StendhalLocalhostServerOnLinux: Difference between revisions
Content deleted Content added
imported>Neoneurone No edit summary |
imported>Immibis MAJOR CHANGES AND BROUGHT UP-TO-DATE |
||
Line 1:
This guide applies to:
*Marauroa 2.1
*Stendhal 0.64
*Stendhal server 0.64
= Setting up a localhost server =
This guide will teach you how to set up a server on your
*Marauroa version 2.1
*A compiled version of the Stendhal Server, version 0.64
*MySQL
*GNU/Linux (This may be others, the directions should apply almost exactly to any *nix system)
*A text editor (doesn't matter)
*Command-line access
<!-- This is
== Getting the materials ==
Download a current version of Stendhal. If you want to use the current release of the
If you want to compile it yourself from CVS or the source code provided at the downloads link, then see [[HowToBuildStendhal|How to build Stendhal]] for more info. If you run a Linux System, then you have the necessary tools to get everything else. I recommend ViM for those command-line lovers, and GEdit/Kate for those GUI people. Command line access shouldn't be a problem, ask your system administrator if you do and how to get to it.
= Setting up MySQL =
After you've installed MySQL, make sure you have a database ready for it
At a command line, type
mysql -u NAME -p
if you need a password for your server (by default, you don't).
If you don't need a password, omit the "-u NAME -p" part.
At the prompt that appears, type
create database marauroa;
= Makin' the cake =
Line 28 ⟶ 33:
#Create a server directory, to hold everything in a nice, organized way
#Unzip your Stendhal Server zip in this server directory
#Run the
#Have fun
Now, the first and last shouldn't be to hard. Let's create that directory!
Line 35 ⟶ 39:
== Creating the server directory ==
I'm an organized person when it comes to my computer. Now, sometimes that means I have to go about 3-4 levels deeper into the folder hierarchy to get where I want, but at least I know where my files are for whatever project directory I'm in. Now, you don't have to do this, but I like to keep my computer not so cluttered up with files that I don't know where they belong. Let's create it in your home directory. NOTE: The commands given are for use in the command-line, but you can take the GUI route as well. For some commands, you must run them from the command-line, and I will tell you
cd
mkdir stendhal_server▼
▲mkdir stendhal_server
This will create a directory called "stendhal_server" in your home directory. See how easy that was? And how easy to tell what will be in that directory? That's the beauty of organization.
Line 45 ⟶ 47:
*marauroa.jar
*log4j.properties
*stendhal-server-
*stendhal-xmlconf-
*stendhal-maps-
*log4j.jar
*groovy.jar
Line 58 ⟶ 60:
== MySQL & Marauroa: Let the 2 be one ==
Time to configure Marauroa to point to the database you made earlier. In the command-line (not in GUI!), run:
When it asks you for...
*database name,
*host, using 'localhost' is fine
*user, use the username you used in giving permissions (FOO)
*password, use the password you used giving permissions (BAR)
*port, anything above 1024. 32160 is the deafult for stendhal, but it can be anything above 1024
*game, type "stendhal" (or a number for that, if a
*turn time, or how long the server takes to process each event, choose anything above 200, but below 1000. This is in milliseconds
*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
Well, thats everything! When it's finished, you'll have a new file, "
To start Marauroa, simply open the marauroad file in the directory with Marauroa - you may need to make it executable first.
To make it executable, in a command prompt type
▲java -cp marauroa.jar:stendhal-server-0.63.jar games.stendhal.server.GenerateINI
chmod +x /path/to/marauroad
To start it from a command prompt, type
cd /path/to/
▲== Bash it up! Starting marauroa ==
./marauroad
where /path/to/ is the path to the directory in which Marauroa is installed.
== Have fun ==
Well, that's it! Just follow the
= Extras =
This is the extras section! Here you have trouble shooting, and hints & tips
== Troubleshooting ==
=== Can't login! ===
You try logging in with the account you made when you first got Stendhal. It doesn't work in your server! You see, the MySQL database we created is the user and some other info database, meaning that we have a list of users, while the main server has it's own list. Until access is publicly granted to the MySQL database over there, we must click on Create An Account and choose localhost as the server to join. 2 different accounts. That, well, sucks.
== Server bonuses ==
=== You are the man! ===
Want to be an admin? Now you can! It's easy! First create a file called "admins.list" This is a plain text file, with each name on a seperate line. The name must be EXACT, or it will not work. Then
=== Be my wife? And other server extensions ===
Server extensions. They add much (or little) functionality to a server, that another may not have. If you want to add the Spouse extension, which adds marriage (uh-oh!) to your server, just add these to your marauroa.ini file we created earlier (note that marriage is not built in to the server and doesn't require an extension, but you can use this template for all extensions):
# load StendhalServerExtension(s)▼
groovy=games.stendhal.server.scripting.StendhalGroovyRunner
▲# load StendhalServerExtension(s)
server_extension=groovy,http,spouse▼
▲server_extension=groovy,http,spouse
http.port = 8080▼
▲http.port = 8080
The first 3 lines (not including the comment) point to specfic classes in your code. Ther server_extension line tells marauroa to load those extensions at start time. After adding these, restart your server. Don't worry - the RSA keys won't break because you added these lines. I personally have 3 server extensions that I wrote as well, 2 of which are broken (help!). To add those, just add this:
And add "
▲my_extention=java.class.path.to.my_extension
▲And add "my_extention" to the end of server_extention (don't forget the comma seperating everything!)
= Finished =
| |||