InitialStepsWithMarauroa: Difference between revisions
No edit summary |
No edit summary |
(No difference)
| |
Revision as of 13:50, 31 January 2005
OK, you have successfully compiled Marauroa and are wondering what to do next?
BUILD SUCCESSFUL Total time: 3 seconds
Nice, isn't it? Basicly, if you have built a Marauroa server it must be because you either want to play with the server a bit yourself or because you want to run your own game server or because you are a developer who wishes to develop your own game.
If you are none of the above it is possible you are looking for http://arianne.sourceforge.net instead.
Configuration
Once we have built Arianne the next step is to setup the configuration file. Each game must have a configuration file that will configure the server to run that particular game. Here is an example:
# Please don't remove. Needed for test cases. test_ATestString=ATestString # The database type # Options are: # - MemoryPlayerDatabase # - JDCBPlayerDatabase marauroa_DATABASE=MemoryPlayerDatabase # JDBC Database configuration jdbc_url=jdbc:mysql://127.0.0.1/marauroa jdbc_class=com.mysql.jdbc.Driver jdbc_user=marauroa_dbuser jdbc_pwd=marauroa_dbpwd # Network configuration of Marauroa marauroa_PORT=3214 # RP Configuration ( This is provisional ) rp_RPZoneClass=marauroa.game.MarauroaRPZone rp_RPRuleProcessorClass=marauroa.game.MarauroaRPRuleProcessor rp_RPAIClass=marauroa.game.MarauroaRPAIManager rp_turnDuration=1000 syncPerception_frecuency=30 python_script= python_script_rules_class= python_script_zone_class= python_script_ai_class= bannedIPNetworkList= # Server related configuration # Types of game are: # - marauroa # - simplegame # - the1001 # Changes should be related to rp_RPZoneClass and rp_RPRuleProcessorClass server_typeGame=marauroa server_name=Marauroa jserver server_version=@version@ server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse # Place where Statistics and server activity report are generated. server_stats_directory=~/public_html server_logs_directory=~/.marauroa
Let look at each section individually.
Database
Our first item is *marauroa_DATABASE*, this attribute sets the type of database that you will use:
- MemoryPlayerDatabase, this type of database is prebuilt in memory and so to modify it you need to recompile the server and manually edit sources to add new accounts. Obviously when application is shut down everything that has been modified is discarded.
- JDBCPlayerDatabase, this is mainly a MySQL database. It won't run as-is on other SQL compliant databases because it uses MySQL features as special tables types to get transactions and auto_increment column types to generate pk.
My recomendation is that you should embrace MySQL and choose JDBCPlayerDatabase.
The next section describes the connection string to the database.
- jdbc_url=jdbc:mysql://127.0.0.1/marauroa
This attribute explains where the database is running _(127.0.0.1)_and the name of the database _(marauroa)_. - jdbc_class=com.mysql.jdbc.Driver
this is the class that describes the driver used for this JDBC connection - jdbc_user=marauroa_dbuser
username of the database account for marauroa - jdbc_pwd=marauroa_dbpwd
password of the database account for marauroa
Remember that to setup the database you need to log in to MySQL as administrator:
mysql -u root
And after that run:
create database marauroa; grant all on marauroa.* to marauroa_dbuser@<serverip> identified by 'marauroa_dbpwd';
The marauroa_PORT section defines which TCP/IP port it will use. All the traffic of Marauroa is UDP based.
The next section talks about the Role playing engine configuration:
- rp_RPZoneClass points to the class that contains our game RPZone logic
- rp_RPRuleProcessorClass points to the class that contains our game RPRuleProcessor logic
- rp_turnDuration defines the turn time. The lower the turn time the more bandwidth that will be generated.
- syncPerception_frecuency defines the time frame that a player have to wait before a sync perception comes and he/she so can login into the system.
The available games currently are:
- the1001
- mapacman
The gane should be set with server_typeGame
The server section contains information that will be sent to the clients using the Server info message. Whatever begins with server_ is sent on this message to the clients.
Finally you should define where the output of statistics and logs messages should be done:
- server_stats_directory defines the folder where the statistics files are generated, usually a public HTML folder.
- server_logs_directory defines where to store the logs. Please keep this one safe and private.
Running
Once you have it configured, just run the server by executing:
java -classpath marauroa.jar;mysql-connector-java-3.0.7-stable-bin.jar marauroa.marauroad -c <game.ini> -l
Make sure that you have the MySQL running too. Marauroa will build all the needed table structure for itself.
This will start Marauroa
Creating accounts
Before anything else, you MUST create accounts for your players. The idea is simple enough, you can even wrap it in to a webpage interface, much like we did with http://gladiators.game-server.cc
<game>.<game>createaccount -u <user> -p <password> -c <character> -e <email>
For example in mapacman:
mapacman.mapacmancreateaccount -u root -p pazzw0rd -c MaSSive -e root@localhost.com
Each game has a different number of parameters, check them out with the -h parameter.
Testing
To test that your connection is working use nullClient. It is a simple client that connects to the server, chooses a character and receives perceptions. If it works it means that everything else is also working.
java -classpath marauroa.jar marauroa.nullClient root pazzw0rd MaSSive
Playing with clients
Please read the client pages at http://arianne.sourceforge.net