Installation de Stendhal

Installation de Stendhal.

1) Installation de Apache-Mysql-Php :

Cf. : Installation d’un serveur Linux-Apache-Mysql-Php

2) Installation de Java 7 :

pi@raspberrypi ~ $ sudo apt-get install openjdk-7-jdk openjdk-7-jre
pi@raspberrypi ~ $ sudo apt-get install ant

3) Répertoire de travail :

pi@raspberrypi ~ $ mkdir -p JEUX/STENDHAL
pi@raspberrypi ~ $ cd JEUX/STENDHAL/

4) Installation du connecteur Mysql pour Java :

A télécharger à partir de : http://dev.mysql.com/downloads/connector/j/

pi@raspberrypi ~/JEUX/STENDHAL $ tar xvfz mysql-connector-java-5.1.34.tar.gz 

5) Création de la base de donnée Marauroa :

pi@raspberrypi ~/JEUX/STENDHAL $ sudo mysql -u root -p
mysql> create database marauroa;
Query OK, 1 row affected (0.01 sec)

mysql> grant all on marauroa.* to 'root'@'localhost' identified by 'mot2passe';
Query OK, 0 rows affected (0.04 sec)

mysql> quit;
Bye

6) Téléchargement du code source de Marauroa :

pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/marauroa/3.9.2/marauroa-3.9.2.zip
pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/marauroa/3.9.2/marauroa-3.9.2-src.tar.gz
pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/marauroa/3.9.2/marauroa-3.9.2-docs.zip
pi@raspberrypi ~/JEUX/STENDHAL $ tar xvfz marauroa-3.9.2-src.tar.gz 
pi@raspberrypi ~/JEUX/STENDHAL $ cd marauroa-3.9.2/

7) Compilation de Marauroa :

pi@raspberrypi ~/JEUX/STENDHAL/marauroa-3.9.2 $ ant
pi@raspberrypi ~/JEUX/STENDHAL/marauroa-3.9.2 $ cd ..

8) Téléchargement de Stendhal :

pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/stendhal/1.16/stendhal-server-1.16.zip
pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/stendhal/1.16/stendhal-1.16.zip
pi@raspberrypi ~/JEUX/STENDHAL $ wget http://downloads.sourceforge.net/project/arianne/stendhal/1.16/stendhal-1.16-src.tar.gz
pi@raspberrypi ~/JEUX/STENDHAL $ tar xvfz stendhal-1.16-src.tar.gz 

9) Serveur Stendhal :

– Compilation :

pi@raspberrypi ~/JEUX/STENDHAL $ cd stendhal-1.16/
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ 
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ ant

– Vérification :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ ls -l build/lib/
total 39328
-rw-r--r-- 1 pi pi  1134930 févr. 14 19:34 stendhal-1.16.jar
-rw-r--r-- 1 pi pi 23860101 févr. 14 19:34 stendhal-data-1.16.jar
-rw-r--r-- 1 pi pi  3921728 févr. 14 19:32 stendhal-maps-1.16.jar
-rw-r--r-- 1 pi pi  4952756 févr. 14 19:34 stendhal-music-data-1.16.jar
-rwxr-xr-x 1 pi pi  2266501 févr. 14 19:31 stendhal-server-1.16.jar
-rw-r--r-- 1 pi pi  3809633 févr. 14 19:34 stendhal-sound-data-1.16.jar
-rwxr-xr-x 1 pi pi    39750 févr. 14 19:34 stendhal-starter-1.16.jar
-rw-r--r-- 1 pi pi   262983 févr. 14 19:32 stendhal-xmlconf-1.16.jar

– Copie des librairies :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cp build/lib/stendhal-server-1.16.jar .
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cp ../../STENDHAL/marauroa-3.9.2/build-archive/*.jar .
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cp ../../STENDHAL/marauroa-3.9.2/libs/*.jar .
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cp ../mysql-connector-java-5.1.34/mysql-connector-java-5.1.34-bin.jar mysql-connector.jar
pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cp libs/*.jar .

– Fichier de configuration :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ java -cp stendhal-server-1.16.jar games.stendhal.server.core.engine.GenerateINI
OpenJDK Zero VM warning: .hotspotrc file is present but has been ignored.  Run with -XX:Flags=.hotspotrc to load the file.
Which database system do you want to use? "h2" is an integrated database that 
works out of the box, "mysql" requires a MySQL server. If in doubt, say "h2" [h2]: mysql
Write name of the database [marauroa]: 
Write name of the database host [localhost]: 
Write name of the database user: root
Write value of the database user password: mot2passe
...

– Rendre exécutable le script de lancement du serveur :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ chmod +x runserver.sh 

– Lancement du serveur :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ ./runserver.sh 
...
WARN  [main      ] StendhalRPWorld          (45  ) - Developing mode, loading maps from tiled/ instead of data/maps
WARN  [main      ] WordList                 (231 ) - suspicious plural: lilium -> liliums (lilias?)
WARN  [main      ] WordList                 (231 ) - suspicious plural: captain -> SUB-NAM (captains?)
INFO  [main      ] ZonesXMLLoader           (145 ) - Loading zone: 0_ados_mountain_n2_w2
INFO  [main      ] ZonesXMLLoader           (145 ) - Loading zone: 0_ados_mountain_n2_w
INFO  [main      ] ConfiguratorDescriptor   (103 ) - Configuring zone [0_ados_mountain_n2_w] with: games.stendhal.server.core.config.zone.NoTeleportIn
ERROR [main      ] ConfiguratorDescriptor   (76  ) - Unable to find zone configurator: games.stendhal.server.maps.ados.entwives.EntwifeNPC
...
INFO  [marauroad ] Statistics               (122 ) - Total/Used memory: 96132/69450
INFO  [marauroad ] Statistics               (122 ) - Total/Used memory: 96132/64251
INFO  [marauroad ] Statistics               (122 ) - Total/Used memory: 96132/84422

10) Erreur :

WARN  [verManager] AccountCreator           (104 ) - SQL exception while trying to create a new account
java.sql.SQLException: Field 'email' doesn't have a default value

Solution :

ALTER TABLE `account` CHANGE `email` `email` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'test@framboisepi.fr'

11) Client Stendhal :

– Répertoire de travail :

pi@raspberrypi ~/JEUX/STENDHAL/stendhal-1.16 $ cd ..
pi@raspberrypi ~/JEUX/STENDHAL $ mkdir Client
pi@raspberrypi ~/JEUX/STENDHAL $ cd Client/

– Initialisation du client :

pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16.zip .
pi@raspberrypi ~/JEUX/STENDHAL/Client $ unzip stendhal-1.16.zip 

– Copie des librairies :

pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16/build/lib/stendhal-data-1.16.jar lib/
pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16/build/lib/stendhal-music-data-1.16.jar lib/
pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16/build/lib/stendhal-sound-data-1.16.jar lib/  
pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16/build/lib/stendhal-1.16.jar lib/
pi@raspberrypi ~/JEUX/STENDHAL/Client $ mv lib/stendhal-1.16.jar lib/stendhal.jar 
pi@raspberrypi ~/JEUX/STENDHAL/Client $ cp ../stendhal-1.16/build/lib/stendhal-starter-1.16.jar .

– Lancement du client :

pi@raspberrypi ~/JEUX/STENDHAL/Client $ java -jar stendhal-starter.jar

stendhal

12) Lien :

Site officiel : https://stendhalgame.org/