InitialStepsWithMarauroa: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
imported>MiguelAngelBlanchLardin No edit summary |
||
| Line 11: | Line 11: | ||
=Configuration= |
=Configuration= |
||
== Create a MySQL database and user == |
|||
Once we have built Arianne the next step is to setup the configuration file. |
|||
Run the sql client (bin/mysql.exe on the windows noinstall package). |
|||
Each game must have a configuration file that will configure the server to run that particular game. Here is an example: |
|||
Replace <user> and <password> with the desired values and paste the following lines to the prompt that opens: |
|||
<pre> |
|||
create database stendhal; |
|||
grant all on stendhal.* to <user>@localhost identified by '<password>'; |
|||
</pre> |
|||
It should produce output similar to this: |
|||
<pre> |
|||
Welcome to the MySQL monitor. Commands end with ; or \g. |
|||
Your MySQL connection id is 1 to server version: 4.1.10 |
|||
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. |
|||
mysql> create database stendhal; |
|||
Query OK, 1 row affected (0.03 sec) |
|||
mysql> grant all on stendhal.* to testuser@localhost identified by 'testpass'; |
|||
Query OK, 0 rows affected (0.00 sec) |
|||
mysql> |
|||
</pre> |
|||
== Create Marauroa.ini file == |
|||
To create the marauroa.ini file you need to can write it by hand, copy from another place or use our application to generate it.<br> |
|||
To launch the application that will generate the marauroa.ini file write: |
|||
<pre> |
<pre> |
||
java -cp marauroa-XXX.jar marauroa.server.generateini |
|||
# Please don't remove. Needed for test cases. |
|||
</pre> |
|||
test_ATestString=ATestString |
|||
It is a text application that will ask you for values. Let's see it. |
|||
# The database type |
|||
<pre> |
|||
# Options are: |
|||
Marauroa - arianne's open source multiplayer online framework for game development - |
|||
# - MemoryPlayerDatabase |
|||
(C) 1999-2005 Miguel Angel Blanch Lardin |
|||
# - JDCBPlayerDatabase |
|||
marauroa_DATABASE=MemoryPlayerDatabase |
|||
This program is free software; you can redistribute it and/or modify |
|||
# JDBC Database configuration |
|||
it under the terms of the GNU General Public License as published by |
|||
jdbc_url=jdbc:mysql://127.0.0.1/marauroa |
|||
the Free Software Foundation; either version 2 of the License, or |
|||
jdbc_class=com.mysql.jdbc.Driver |
|||
(at your option) any later version. |
|||
jdbc_user=marauroa_dbuser |
|||
jdbc_pwd=marauroa_dbpwd |
|||
This program is distributed in the hope that it will be useful, |
|||
# Network configuration of Marauroa |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
marauroa_PORT=3214 |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
You should have received a copy of the GNU General Public License |
|||
# RP Configuration ( This is provisional ) |
|||
along with this program; if not, write to the Free Software |
|||
rp_RPZoneClass=marauroa.game.MarauroaRPZone |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|||
rp_RPRuleProcessorClass=marauroa.game.MarauroaRPRuleProcessor |
|||
rp_RPAIClass=marauroa.game.MarauroaRPAIManager |
|||
rp_turnDuration=1000 |
|||
syncPerception_frecuency=30 |
|||
</pre> |
|||
python_script= |
|||
Now write the name of the file where you will store the configuration.<br> |
|||
python_script_rules_class= |
|||
Usually pressing <b>ENTER</b> will do the work, as marauroa.ini is a fine name. |
|||
python_script_zone_class= |
|||
<pre> |
|||
python_script_ai_class= |
|||
Write name of the .ini file (marauroa.ini): |
|||
Using "marauroa.ini" as .ini file |
|||
</pre> |
|||
We need to give a name for database.<br> |
|||
bannedIPNetworkList= |
|||
Use the one you have written above on database creation. |
|||
# Server related configuration |
|||
<pre> |
|||
# Types of game are: |
|||
Write name of the database (marauroa): stendhal |
|||
Using "stendhal" as database name |
|||
# - simplegame |
|||
# - the1001 |
|||
# Changes should be related to rp_RPZoneClass and rp_RPRuleProcessorClass |
|||
server_typeGame=marauroa |
|||
Write name of the database host (localhost): |
|||
server_name=Marauroa jserver |
|||
Using "localhost" as database host |
|||
server_version=@version@ |
|||
server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse |
|||
Write name of the database user (marauroa_user): stendhal_user |
|||
# Place where Statistics and server activity report are generated. |
|||
Using "stendhal_user" as database user |
|||
server_stats_directory=~/public_html |
|||
server_logs_directory=~/.marauroa |
|||
</pre> |
|||
Write value of the database user password (marauroa_pass): stendhal_passwd |
|||
Let look at each section individually. <br> |
|||
Using "stendhal_passwd" as database user password |
|||
==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. |
|||
In order to make efective these options please run: |
|||
My recomendation is that you should embrace MySQL and choose JDBCPlayerDatabase. |
|||
# mysql |
|||
create database stendhal; |
|||
grant all on stendhal.* to stendhal_user@localhost identified by 'stendhal_passwd'; |
|||
exit |
|||
</pre> |
|||
The next section describes the connection string to the database. |
|||
* jdbc_url=jdbc:mysql://127.0.0.1/marauroa<br>This attribute explains where the database is running _(127.0.0.1)_and the name of the database _(marauroa)_. |
|||
Marauroa acts as a server. So it needs a valid UDP port where it will listen to incoming packets. |
|||
* jdbc_class=com.mysql.jdbc.Driver<br>this is the class that describes the driver used for this JDBC connection |
|||
* jdbc_user=marauroa_dbuser<br>username of the database account for marauroa |
|||
* jdbc_pwd=marauroa_dbpwd<br>password of the database account for marauroa |
|||
Remember that to setup the database you need to log in to MySQL as administrator: |
|||
<pre> |
<pre> |
||
Write UDP port used by Marauroa (>1024): 32160 |
|||
mysql -u root |
|||
Using "32160" as database user password |
|||
</pre> |
</pre> |
||
And after that run: |
|||
This is perhaps the most complex part of Arianne: Choosing the game.<br> |
|||
If you are using one of the Arianne supported games, just write the name and the params will be filled using a template automatically, but if you are using your own game, you must provide the complete class name for RPWorld and RPRuleProcessor of your game. |
|||
<pre> |
<pre> |
||
Marauroa is a server middleware to run multiplayer games. You need toadd a game |
|||
create database marauroa; |
|||
to the system so that server can work. Actually Arianne has implemented several |
|||
grant all on marauroa.* to marauroa_dbuser@<serverip> identified by 'marauroa_dbpwd'; |
|||
games: |
|||
- stendhal |
|||
- mapacman |
|||
- the1001 |
|||
If you write your own game, just write it name here. |
|||
You will be asked for more info. |
|||
Write name of the game server will run: stendhal |
|||
Using "stendhal" as game |
|||
Setting RPWorld and RPRuleProcessor for Stendhal |
|||
Make sure Marauroa can find in CLASSPATH the folder games/stendhal/* |
|||
NOTE: Copy games generated in stendhal inside folder that contains marauroa.jar file |
|||
</pre> |
</pre> |
||
The marauroa_PORT section defines which TCP/IP port it will use. '''All''' the traffic of Marauroa is UDP based. |
|||
You also have to choose the turn time.<br> |
|||
The next section talks about the Role playing engine configuration: |
|||
Any range is valid, but the best value is around mean ping time for players, that is around 200-300 ms. |
|||
* rp_RPZoneClass points to the class that contains our game RPZone logic |
|||
<pre> |
|||
* rp_RPRuleProcessorClass points to the class that contains our game RPRuleProcessor logic |
|||
Write turn time duration in milliseconds (200<time<1000)): 300 |
|||
* rp_turnDuration defines the turn time. The lower the turn time the more bandwidth that will be generated. |
|||
Using turn of 300 milliseconds |
|||
* 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. |
|||
</pre> |
|||
Finally decide where to store logs and statistics.<br> |
|||
The available games currently are: |
|||
Logs will be stored at ''path''/logs. |
|||
* the1001 |
|||
<pre> |
|||
* mapacman |
|||
Write path for logs generation (./)): |
|||
Using path "./" for log generation |
|||
Write path for statistics generation (./)): |
|||
The gane should be set with server_typeGame |
|||
Using path "./" for statistics generation |
|||
COMPLETE--- |
|||
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. |
|||
Generating "marauroa.ini" file |
|||
Generated. |
|||
</pre> |
|||
Congrats!. You configured your Marauroa server. |
|||
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= |
=Running= |
||