InitialStepsWithMarauroa: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin |
imported>Kymara m →Create server.ini file: can't remember how to do wiki links, blah |
||
| (164 intermediate revisions by 12 users not shown) | |||
| Line 1: | Line 1: | ||
{{Navigation for Marauroa Top|Using}} |
|||
{{Navigation for Marauroa Users}} |
|||
OK, you have successfully compiled Marauroa and are wondering what to do next? |
OK, you have successfully compiled Marauroa and are wondering what to do next? |
||
<pre> |
<pre> |
||
| Line 6: | Line 10: | ||
Nice, isn't it? |
Nice, isn't it? |
||
Basically, 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 want to run a [[Stendhal]] Server then this is not the guide for you. You do not need to run marauroa separately of the Stendhal Server, please see [[Host a Stendhal Server]] instead. |
|||
If you are none of the above it is possible you are looking for http://arianne.sourceforge.net instead. |
|||
If none of the above apply it is possible you are looking for http://arianne.sourceforge.net instead. |
|||
=Configuration= |
=Configuration= |
||
| Line 28: | Line 34: | ||
Query OK, 1 row affected (0.03 sec) |
Query OK, 1 row affected (0.03 sec) |
||
mysql> grant all on marauroa.* to |
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 34: | Line 40: | ||
</pre> |
</pre> |
||
== Create |
== Create server.ini file == |
||
If you don't have a game yet, see [[ClientServerChatExample|Marauroa Tutorial]] for how to generate a minimum server.ini and how to write the two required classes. |
|||
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> |
|||
java -cp marauroa-XXX.jar marauroa.server.generateini |
|||
</pre> |
|||
To create the marauroa.ini file you need to can write it by hand, copy from another place or use your game application to generate it.<br> |
|||
It is a text application that will ask you for values. Let's see it. |
|||
Please refer to your game documentation about how to write it. |
|||
<pre> |
|||
Marauroa - arianne's open source multiplayer online framework for game development - |
|||
(C) 1999-2005 Miguel Angel Blanch Lardin |
|||
Stendhal Documentation: [[VisualGuideToInstallingStendhalStep5]] |
|||
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. |
|||
=Running= |
|||
This program is distributed in the hope that it will be useful, |
|||
Once you have it configured, just run the server by executing: |
|||
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 |
|||
</pre> |
|||
Now write the name of the file where you will store the configuration.<br> |
|||
Usually pressing <b>ENTER</b> will do the work, as marauroa.ini is a fine name. |
|||
<pre> |
<pre> |
||
java -classpath .;mysql-connector-java-3.0.7-stable-bin.jar;log4j.jar;marauroa.jar marauroa.server.marauroad -c <server.ini> |
|||
Write name of the .ini file (marauroa.ini): |
|||
Using "marauroa.ini" as .ini file |
|||
</pre> |
</pre> |
||
''NOTE'': On Unix use : instead of ; to define the classpath. |
|||
We need to give a name for database.<br> |
|||
Use the one you have written above on database creation. |
|||
<pre> |
|||
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 |
|||
</pre> |
|||
Marauroa acts as a server. So it needs a valid UDP port where it will listen to incoming packets. |
|||
''NOTE'': You may change what it is logged by default, so you need to edit the log4j.properties file. |
|||
For example: |
|||
<pre> |
<pre> |
||
# Set root logger level to DEBUG and its only appender to A1. |
|||
Write UDP port used by Marauroa (>1024): 32160 |
|||
log4j.rootLogger=INFO, Console, File |
|||
Using "32160" as database user password |
|||
</pre> |
|||
# Paste all logger entries with a threshold of WARN to the console |
|||
This is perhaps the most complex part of Arianne: Choosing the game.<br> |
|||
log4j.appender.Console=org.apache.log4j.ConsoleAppender |
|||
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. |
|||
log4j.appender.Console.layout=org.apache.log4j.PatternLayout |
|||
<pre> |
|||
log4j.appender.Console.layout.ConversionPattern=%-4r %-5p %c %x - %m%n |
|||
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. |
|||
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender |
|||
Write name of the game server will run: stendhal |
|||
log4j.appender.File.File=server.log |
|||
Using "stendhal" as game |
|||
log4j.appender.File.layout=org.apache.log4j.PatternLayout |
|||
log4j.appender.File.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n |
|||
# Disabled debug messages for stendhal...some 10 thousand logs each minute is |
|||
Setting RPWorld and RPRuleProcessor for Stendhal |
|||
# way too much |
|||
Make sure Marauroa can find in CLASSPATH the folder games/stendhal/* |
|||
log4j.logger.marauroa.server.game.RPServerManager=WARN |
|||
NOTE: Copy games generated in stendhal inside folder that contains marauroa.jar file |
|||
</pre> |
</pre> |
||
Make sure that you have the MySQL server running too. Marauroa will build all the needed table structure for itself. |
|||
You also have to choose the turn time.<br> |
|||
Any range is valid, but the best value is around mean ping time for players, that is around 200-300 ms. |
|||
<pre> |
|||
Write turn time duration in milliseconds (200<time<1000)): 300 |
|||
Using turn of 300 milliseconds |
|||
</pre> |
|||
This will start Marauroa. |
|||
Finally decide where to store logs and statistics.<br> |
|||
Logs will be stored at ''path''/logs. |
|||
<pre> |
|||
Write path for logs generation (./)): |
|||
Using path "./" for log generation |
|||
Now refer to game documentation about how to start the game server and how to create accounts and so on. |
|||
Write path for statistics generation (./)): |
|||
Using path "./" for statistics generation |
|||
COMPLETE--- |
|||
Generating "marauroa.ini" file |
|||
Generated. |
|||
</pre> |
|||
Congrats!. You configured your Marauroa server. |
|||
=Running= |
|||
Once you have it configured, just run the server by executing: |
|||
<pre> |
|||
java -classpath marauroa.jar;mysql-connector-java-3.0.7-stable-bin.jar marauroa.server.marauroad -c <game.ini> -l |
|||
</pre> |
|||
''NOTE'': On Linux use : instead of ; to define the classpath. |
|||
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 |
|||
<pre> |
|||
<game>.<game>createaccount -i marauroa.ini -u <user> -p <password> -c <character> -e <email> |
|||
</pre> |
|||
For example in mapacman: |
|||
<pre> |
|||
mapacman.mapacmancreateaccount -i marauroa.ini -u root -p pazzw0rd -c MaSSive -e root@localhost.com |
|||
</pre> |
|||
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. |
|||
<pre> |
|||
java -classpath marauroa.jar marauroa.nullClient root pazzw0rd MaSSive |
|||
</pre> |
|||
[[Category:Marauroa]] |
|||
=Playing with clients= |
|||
{{#breadcrumbs: [[Marauroa]] | [[Navigation for Marauroa Users|Using]] | [[InitialStepsWithMarauroa|Initial Steps]]}} |
|||
Please read the client pages at http://arianne.sourceforge.net |
|||