InstallingStendhal: Difference between revisions
imported>MiguelAngelBlanchLardin |
imported>Hendrik Brummermann added navigation menu |
||
| (139 intermediate revisions by 11 users not shown) | |||
| Line 1: | Line 1: | ||
{{Navigation for Stendhal Top|Building & Hosting}} |
|||
== Install MySQL == |
|||
This is a generic guide. You may prefer a specific installation guide for [[Easy_Stendhal_Server Installation_On_Windows|Windows]] or [[StendhalLocalhostServerOnLinux|Linux]] |
|||
Download the appropriate MySQL install package from http://dev.mysql.com/downloads/ |
|||
__toc__ |
|||
== Download Stendhal server == |
|||
The server files are available as a .zip. |
|||
Also download the java connector library from the [http://dev.mysql.com/downloads/ same place] (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. |
|||
* Go to [http://arianne.sourceforge.net/?arianne_url=games/game_stendhal#downloadsection download files] and download stendhal-server-{{version}}.zip |
|||
* Save |
|||
* Extract |
|||
== |
== Configure server == |
||
From where you extracted the files to, type command: |
|||
java -cp stendhal-server-{{version}}.jar games.stendhal.server.core.engine.GenerateINI |
|||
Download Maraurora from http://arianne.sourceforge.net/ |
|||
or check out the cvs version and build it. |
|||
For easy H2 database configuration just hit enter to accept each default and skip straight to [[InstallingStendhal#Start_the_server|Start the server]]. |
|||
== Start MySql == |
|||
For MySQL configuration (advanced): |
|||
Refer to the MySql installation documentation for details. |
|||
<small> |
|||
*Which database system do you want to use? write mysql (mysql) |
|||
*database name, hit enter to use the default (marauroa) |
|||
*host, hit enter to use the default (localhost) |
|||
*user, write the username you used in giving MySQL permissions (FOO) |
|||
*password, write the password you used giving MySQL permissions (BAR) |
|||
*port, anything above 1024. 32160 is the default for stendhal, but it can be anything above 1024 |
|||
*game, type "stendhal" (or a number for that, if a multiple-choice menu appears) |
|||
*turn time, or how long the server takes to process each event, choose anything above 200, but below 1000. This is in milliseconds. default is 300 |
|||
*log and stats generation logs, use the default ("./") - it's in the same directory as everything else |
|||
*RSA key size, choose anything smaller than 1024 bits, but greater than 512 (or equal to). This is to make sure that the login information is valid and secure. Like the prompt says, anything greater than 1024 can take a LONG time. But, if you have ~30 minutes to spare (more or less, depending on your comp), you could use the extra security.</small> |
|||
If you used the noinstall package, you can run bin/mysqld.exe. |
|||
=== Install MySQL (optional) === |
|||
Make sure to edit the configuration files to disallow external access if you are just going to use it for local testing, or simply use a firewall to block external access to the database. |
|||
'''You only need to do this if you chose the advanced MySQL option, not H2''' |
|||
Download the appropriate MySQL install package from http://dev.mysql.com/downloads/ |
|||
Also download the java connector library from the [http://dev.mysql.com/downloads/ same place] (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. You can save this download if you get compiled version of Marauroa. |
|||
=== Start MySQL (optional) === |
|||
== Create a MySql user and database for the game == |
|||
'''You only need to do this if you chose the advanced MySQL option, not H2''' |
|||
Refer to the MySQL installation documentation for details. |
|||
If you used the noinstall package, you can run bin/mysqld.exe. |
|||
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: |
|||
<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> |
|||
Make sure to edit the configuration files to disallow external access if you are just going to use it for local testing, or simply use a firewall to block external access to the database. |
|||
== Create Marauroa.ini file == |
|||
=== Configure MySQL (optional) === |
|||
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> |
|||
Read at [[InitialStepsWithMarauroa#Configuration|Marauroa configuration]] how to create a database which matches the options given in the configuration file server.ini which you made above. |
|||
To launch the application that will generate the marauroa.ini file write: |
|||
The mysql command is: |
|||
<pre> |
|||
create database marauroa; |
|||
java -cp marauroa-XXX.jar marauroa.server.generateini |
|||
grant all on marauroa.* to 'FOO'@'localhost' identified by 'BAR'; |
|||
</pre> |
|||
== Start the server == |
|||
It is a text application that will ask you for values. Let's see it. |
|||
Now start marauroa server by running runserver.bat, or runserver.sh, or |
|||
<pre> |
|||
Marauroa - arianne's open source multiplayer online framework for game development - |
|||
(C) 1999-2005 Miguel Angel Blanch Lardin |
|||
java -jar stendhal-server-{{version}}.jar |
|||
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. |
|||
== See also == |
|||
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 |
|||
</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> |
|||
Write name of the .ini file (marauroa.ini): |
|||
Using "marauroa.ini" as .ini file |
|||
</pre> |
|||
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): stendhal |
|||
Using "stendhal" 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. |
|||
<pre> |
|||
Write UDP port used by Marauroa (>1024): 32160 |
|||
Using "32160" as database user password |
|||
</pre> |
|||
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> |
|||
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 |
|||
</pre> |
|||
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> |
|||
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 |
|||
Write path for statistics generation (./)): |
|||
Using path "./" for statistics generation |
|||
COMPLETE--- |
|||
Generating "marauroa.ini" file |
|||
Generated. |
|||
</pre> |
|||
Congrats!. You configured your Marauroa server. |
|||
== Copy Stendhal to the Maraurora classpath == |
|||
Marauroa is just the middleware to make everything run.<br> |
|||
But you need to feed it with games. To make Marauroa run Stendhal, just copy the result of compiling stendhal to marauroa folder. |
|||
If you download Marauroa, and unzip it you will see this: |
|||
<pre> |
|||
C:\...\marauroa-0.90>dir |
|||
19/02/2005 19:51 <DIR> . |
|||
19/02/2005 19:51 <DIR> .. |
|||
19/02/2005 13:28 133 AUTHORS |
|||
19/02/2005 13:28 141 BUGS |
|||
19/02/2005 13:28 18.332 COPYING |
|||
19/02/2005 13:28 719.950 jython.jar |
|||
19/02/2005 13:28 18.332 LICENSE |
|||
19/02/2005 13:28 149.364 marauroa-0.90.jar |
|||
19/02/2005 13:28 1.294 marauroa.ini |
|||
19/02/2005 13:28 162 marauroad.bat |
|||
19/02/2005 13:28 235.712 mysql-connector-java-3.0.15-ga-bin.jar |
|||
19/02/2005 13:28 13.930 README |
|||
10 files 1.157.350 bytes |
|||
2 dirs 19.775.102.976 bytes free |
|||
</pre> |
|||
Now simply go to Stendhal folder and type |
|||
<pre> |
|||
C:\...\stendhal>ant jar |
|||
<pre> |
|||
Buildfile: build.xml |
|||
init: |
|||
[mkdir] Created dir: C:\....\stendhal\build |
|||
[mkdir] Created dir: C:\....\stendhal\lib |
|||
[mkdir] Created dir: C:\....\javadocs |
|||
client_compile: |
|||
[delete] Deleting directory C:\....\stendhal\build |
|||
[mkdir] Created dir: C:\....\stendhal\build |
|||
[copy] Copying 3 files to C:\....\stendhal\build\sprites |
|||
[javac] Compiling 18 source files to C:\....\stendhal\build |
|||
client_jar: |
|||
[jar] Building jar: C:\....\stendhal\lib\stendhal-0.00.jar |
|||
server_compile: |
|||
[delete] Deleting directory C:\....\stendhal\build |
|||
[mkdir] Created dir: C:\....\stendhal\build |
|||
[copy] Copying 3 files to C:\....\stendhal\build\games\stendhal\server\maps |
|||
[javac] Compiling 6 source files to C:\....\stendhal\build |
|||
server_jar: |
|||
[jar] Building jar: C:\....\stendhal\lib\stendhal-server-0.00.jar |
|||
jar: |
|||
BUILD SUCCESSFUL |
|||
Total time: 3 seconds |
|||
</pre> |
|||
Now in lib folder you have two jar files: |
|||
<pre> |
|||
C:\....\stendhal\lib>dir |
|||
19/02/2005 22:02 <DIR> . |
|||
19/02/2005 22:02 <DIR> .. |
|||
19/02/2005 22:02 109.104 stendhal-0.00.jar |
|||
19/02/2005 22:02 11.851 stendhal-server-0.00.jar |
|||
2 files 120.955 bytes |
|||
2 dirs 19.775.070.208 bytes free |
|||
</pre> |
|||
Copy stendhal-server-0.00.jar into Marauroa folder: |
|||
<pre> |
|||
copy stendhal-server-0.00.jar D:\.....\marauroa |
|||
</pre> |
|||
Go to Marauroa folder and edit marauroad.bat file, that should looks like: |
|||
<pre> |
|||
set LOCALCLASSPATH=.;stendhal-server-0.00.jar;marauroa-0.90.jar;jython.jar;mysql-connector-java-3.0.15-ga-bin.jar |
|||
java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c marauroa.ini -l |
|||
</pre> |
|||
Did you noticed the added stendhal-server-0.00.jar file? |
|||
Congrats! You have successfully installed Stendhal in a Marauroa server.<br> |
|||
Now start marauroa server by running marauroad.bat |
|||
== Start the server == |
|||
* [[StendhalServerTroubleShooting|Trouble shooting]] |
|||
Run the maraurora.bat file (or create an equivalent shell script if in unix). |
|||
* [[StendhalPublicServer|Host an online Stendhal server]] |
|||
<br> |
|||
<br> |
|||
<br> |
|||
---- |
|||
[[Stendhal | Back to stendhal main wiki page]] |
|||
== Start the Stendhal client == |
|||
[[Category:Stendhal]] |
|||
TODO: We need a bat file or such for starting the client. |
|||
Latest revision as of 17:03, 16 February 2012
This is a generic guide. You may prefer a specific installation guide for Windows or Linux
Download Stendhal server
The server files are available as a .zip.
- Go to download files and download stendhal-server-1.48.zip
- Save
- Extract
Configure server
From where you extracted the files to, type command:
java -cp stendhal-server-1.48.jar games.stendhal.server.core.engine.GenerateINI
For easy H2 database configuration just hit enter to accept each default and skip straight to Start the server.
For MySQL configuration (advanced):
- Which database system do you want to use? write mysql (mysql)
- database name, hit enter to use the default (marauroa)
- host, hit enter to use the default (localhost)
- user, write the username you used in giving MySQL permissions (FOO)
- password, write the password you used giving MySQL permissions (BAR)
- port, anything above 1024. 32160 is the default for stendhal, but it can be anything above 1024
- game, type "stendhal" (or a number for that, if a multiple-choice menu appears)
- turn time, or how long the server takes to process each event, choose anything above 200, but below 1000. This is in milliseconds. default is 300
- log and stats generation logs, use the default ("./") - it's in the same directory as everything else
- RSA key size, choose anything smaller than 1024 bits, but greater than 512 (or equal to). This is to make sure that the login information is valid and secure. Like the prompt says, anything greater than 1024 can take a LONG time. But, if you have ~30 minutes to spare (more or less, depending on your comp), you could use the extra security.
Install MySQL (optional)
You only need to do this if you chose the advanced MySQL option, not H2 Download the appropriate MySQL install package from http://dev.mysql.com/downloads/
Also download the java connector library from the same place (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. You can save this download if you get compiled version of Marauroa.
Start MySQL (optional)
You only need to do this if you chose the advanced MySQL option, not H2 Refer to the MySQL installation documentation for details.
If you used the noinstall package, you can run bin/mysqld.exe.
Make sure to edit the configuration files to disallow external access if you are just going to use it for local testing, or simply use a firewall to block external access to the database.
Configure MySQL (optional)
Read at Marauroa configuration how to create a database which matches the options given in the configuration file server.ini which you made above. The mysql command is:
create database marauroa; grant all on marauroa.* to 'FOO'@'localhost' identified by 'BAR';
Start the server
Now start marauroa server by running runserver.bat, or runserver.sh, or
java -jar stendhal-server-1.48.jar
See also