InitialStepsWithMarauroa: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin
imported>Oslsachem
No edit summary
Line 28: Line 28:
Query OK, 1 row affected (0.03 sec)
Query OK, 1 row affected (0.03 sec)
mysql> grant all on marauroa.* to testuser@localhost identified by 'testpass';
mysql> grant all on marauroa.* to stendhal_user@localhost identified by 'stendhal_passwd';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Line 70: Line 70:


We need to give a name for database.<br>
We need to give a name for database.<br>
Use the one you have written above on database creation.
Use the one you have written above on database creation.<br>
We need to give a name for database user and this user password.<br>
Use the ones you have written above on database creation.
<pre>
<pre>
Write name of the database (marauroa): marauroa
Write name of the database (marauroa): marauroa

Revision as of 15:47, 24 March 2006

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

Create a MySQL database and user

Run the sql client (bin/mysql.exe on the windows noinstall package). Replace <user> and <password> with the desired values and paste the following lines to the prompt that opens:

    create database marauroa;
    grant all on marauroa.* to <user>@localhost identified by '<password>';

It should produce output similar to this:

  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 marauroa;
  Query OK, 1 row affected (0.03 sec)
  
  mysql> grant all on marauroa.* to stendhal_user@localhost identified by 'stendhal_passwd';
  Query OK, 0 rows affected (0.00 sec)
  
  mysql>

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.
To launch the application that will generate the marauroa.ini file write:

  java -cp marauroa-XXX.jar marauroa.server.generateini

It is a text application that will ask you for values. Let's see it.

Marauroa - arianne's open source multiplayer online framework for game development -
(C) 1999-2005 Miguel Angel Blanch Lardin

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
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
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Now write the name of the file where you will store the configuration.
Usually pressing ENTER will do the work, as marauroa.ini is a fine name.

Write name of the .ini file (marauroa.ini):
Using "marauroa.ini" as .ini file

We need to give a name for database.
Use the one you have written above on database creation.
We need to give a name for database user and this user password.
Use the ones you have written above on database creation.

Write name of the database (marauroa): marauroa
Using "marauroa" as database name

Write name of the database host (localhost):
Using "localhost" as database host

Write name of the database user (marauroa_user): stendhal_user
Using "stendhal_user" as database user

Write value of the database user password (marauroa_pass): stendhal_passwd
Using "stendhal_passwd" as database user password

In order to make efective these options please run:
# mysql
  create database stendhal;
  grant all on stendhal.* to stendhal_user@localhost identified by 'stendhal_passwd';
  exit

Marauroa acts as a server. So it needs a valid UDP port where it will listen to incoming packets.

Write UDP port used by Marauroa (>1024): 32160
Using "32160" as database user password

This is perhaps the most complex part of Arianne: Choosing the game.
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.

Marauroa is a server middleware to run multiplayer games. You need toadd a game
to the system so that server can work. Actually Arianne has implemented several
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

You also have to choose the turn time.
Any range is valid, but the best value is around mean ping time for players, that is around 200-300 ms.

Write turn time duration in milliseconds (200<time<1000)): 300
Using turn of 300 milliseconds

Finally decide where to store logs and statistics.
Logs will be stored at path/logs.

Write path for logs generation (./)):
Using path "./" for log generation

Write path for statistics generation (./)):
Using path "./" for statistics generation

COMPLETE---
Generating "marauroa.ini" file
Generated.

Congrats!. You configured your Marauroa server.

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.server.marauroad -c <game.ini> -l

NOTE: On Linux use : instead of ; to define the classpath.

NOTE: You may change what it is logged by default, so you need to edit the <game.ini> configuration file and modify the options

  • server_logs_allowed
  • server_logs_rejected

Allowed is a semicolon(;) separated list of strings that defines what is allowed to be logged only if it starts with any of the strings allowed contains. If allows contains a * it will log everything. For example:

  server_logs_allowed=Stendhal

It will log everything whose location begins with Stendhal. In Marauroa every log has a location that generated the logged event and a level of that event, as well as a extra description of the event. For Example:

  2005-04-15 22:20:02.843	(7)	>	StendhalRPZone::populate	
  2005-04-15 22:20:02.859	(7)	D	StendhalRPZone::populate	Adding SIGN: RPObject with Attributes of Class(sign): [text=Talk to Nishiya to buy a sheep!.|He will offer you a nice price.][zoneid=village][type=sign][y=27.0][x=26.0][id=1] and RPSlots 
  2005-04-15 22:20:02.859	(7)	D	StendhalRPZone::populate	Adding NPC seller: RPObject with Attributes of Class(sellernpc): [zoneid=village][dx=0][type=sellernpc][y=28.0][dy=0][name=Nishiya][id=2][x=29.0] and RPSlots 

On a similar way works Rejected that is a semicolon(;) separated list of strings that simply reject for being logged everything that starts by any of the strings rejected contains. For example:

server_logs_rejected=StendhalRPRuleProcessor::endTurn;StendhalRPRuleProcessor::beginTurn


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 -i marauroa.ini -u <user> -p <password> -c <character> -e <email>

For example in mapacman:

  mapacman.mapacmancreateaccount -i marauroa.ini -u root -p pazzw0rd -c MaSSive -e root@localhost.com

For example in Stendhal:

 Initial Steps With Stendhal

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