Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[GUIDE] Create account without php

Initiate Mage
Joined
Nov 3, 2018
Messages
22
Reaction score
20
It's often a pain to have to debug php scripts to create accounts while setting up a server for dev so I offer an easier alternative (tested only in 1.1 but surely transposable to 4.0):

In server_bin/accountServer/cfg/accountserverdb-config-pgsql.properties:
Code:
#PgSQL
connection.master.driver=org.postgresql.Driver
connection.master.url=jdbc:postgresql://127.0.0.1/your-account-db-name
connection.master.user=your-postgres-user
connection.master.password=your-postgres-password

connection.test-sql = select 1

connection.pool-size = 5

dbcommons.jdbc.dao.sqlexecutor.SQLExecutor=accountserver.accountdb.jdbcimpl.dao.sqlexecutor.SQLExecutorPostgreSQLImpl
#dbcommons.jdbc.pool.ConnectionsPool=dbcommons.jdbc.test.pool.clearwrapperimpl.ConnectionsPoolClearWrapperImpl
#ConnectionsPoolClearWrapperImpl.target=dbcommons.jdbc.pool.dbcpimpl.ConnectionsPoolDBCPImpl
#ConnectionsPoolClearWrapperImpl.tables-to-be-cleared="account"

statements=/accountserver/accountdb/jdbcimpl/dao/statements.cfg

#dbcommons.jdbc.schemecreator.SchemeCreator=dbcommons.jdbc.schemecreator.propertyfileimpl.SchemeCreatorHSQLDBImpl
scheme-file = /accountserver/accountdb/jdbcimpl/scheme-pgsql.cfg

dbcommons.jdbc.schemechecker.SchemeChecker=dbcommons.jdbc.schemechecker.SchemeCheckerPostgresImpl
dbcommons.jdbc.schemeupdater.SchemeUpdater=accountserver.accountdb.jdbcimpl.schemeupdater.SchemeUpdaterPersistent
scheme-updater.version=16

In server_bin/accountServer/cfg/accountUtilCfg.xml

Code:
<?xml version="1.0" ?>
<app>
  <accountDB cfgFile="cfg/accountserverdb-config-pgsql.properties"/>
</app>

Then in server_bin/accountServer/ run the following commands:

Code:
java -jar ../jars/accountserver.AccountUtils.jar cfg/accountUtilCfg.xml create <your-username>

Code:
java -jar ../jars/accountserver.AccountUtils.jar cfg/accountUtilCfg.xml setpassword <your-username> <your-password>

You should see:

Code:
DEBUG - Configuration loaded from the base path cfg/accountUtilCfg.xml
INFO - Executing create
DEBUG - Configuration loaded from the base path cfg/accountserverdb-config-pgsql.properties
INFO - Database "jdbc:postgresql://127.0.0.1/your-account-db-name" is used.
INFO - Database structure checked
INFO - Done

DEBUG - Configuration loaded from the base path cfg/accountUtilCfg.xml
INFO - Executing setpassword
DEBUG - Configuration loaded from the base path cfg/accountserverdb-config-pgsql.properties
INFO - Database "jdbc:postgresql://127.0.0.1/your-account-db-name" is used.
INFO - Database structure checked
INFO - Done

You can run this command to display which commands are available and their syntax:
Code:
java -jar ../jars/accountserver.AccountUtils.jar cfg/accountUtilCfg.xml help

That displays:
Code:
DEBUG - Configuration loaded from the base path cfg/accountUtilCfg.xml
INFO - Executing help
INFO - create <account name> [User|Master|Developer]
INFO - modify <account name> <base access level: User|Master|Developer> [current access level: User|Master|Developer]
INFO - setpassword
INFO - list
INFO - help
INFO - Done

I let you discover what each command do :):

I hope it will help people who are struggling with php files or people that want to quickly setup a server to play arround :wink:
 
Back
Top