Le shard désigne une instance du serveur de jeu basé sur le système Ryzom Core. Ce tutoriel a été établi à partir des notes issues du wiki de Ryzomcore1).
Il reste à détailler le déploiement d'AMS (Account Management System) mais on va le remplacer par webNel , une interface en Python et Django.
Avant toute chose, assurez-vous d'avoir une base bien configurée : Premières étapes dans la mise en place d'un serveur
L'installation du shard se fait sous Linux (Debian Jessie est conseiller), avec un utilisateur dédié, que nous nommerons ici “compil” :
La première partie se fait en root.
adduser compil
adduser compil sudo
adduser compil www-data
Des essais ont été faits sur:
apt update apt dist-upgrade
À ce point si le kernel est mis à jour , vous devez redémarrer:
reboot
Vous avez besoin d'installer des outils et libs pour compiler et démarrer le serveur. Choisissez apache2 ou nginx
⇒ Installez les paquets de LAMP :
apt install apache2 apache2-utils mariadb-server mariadb-client mcrypt
php:
apt install php libapache2-mod-php php-mysql php-gd php-imagick
Pour le code AMS avant 2019-05-11 php<7.2
apt install php-mcrypt
⇒ Installez les paquets de LEMP :
apt install nginx mysql-server mysql-client mcrypt
apt install php5-fpm php5-mysql php5-gd php5-imagick
Ceci est optionnel
apt install phpmyadmin
php doit être ⇐ à la version 7.1 car mcrypt n'est plus disponible en 7.2 ! source
apt-get install git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-dev rrdtool libmysqlclient18-dev bison libxmu-dev autoconf automake libcpptest-dev libgif-dev cpputest libssl-dev unzip p7zip p7zip-full screen wget
apt-get install git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-dev rrdtool bison libxmu-dev autoconf automake libmysqlclient-dev libgif-dev libgif-dev cpputest libssl-dev unzip p7zip p7zip-full screen wget
apt install git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-turbo-dev rrdtool bison autoconf automake libmysqlclient-dev libgif-dev cpputest libssl-dev liblzma-dev unzip p7zip p7zip-full screen wget
apt install git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng-dev libjpeg62-turbo-dev rrdtool bison libxmu-dev autoconf automake default-libmysqlclient-dev libgif-dev cpputest libssl-dev liblzma-dev unzip p7zip p7zip-full screen wget libsquish-dev
wget https://clients.lirria.khaganat.net/tools/squish-1.11.7z 7z x squish-1.11.7z cd squish-1.11
Puis compiler:
make make install
Installer dans l'ordre DirectX SDK puis Visual
Pour visual 2015, pensez à activer le module c++
A partir d'ici on va dans user compil
su compil
git clone https://git.khaganat.net/khaganat/mmorpg_khanat/khanat-opennel-code.git git clone https://git.khaganat.net/khaganat/mmorpg_khanat/khanat-ressources.git
Pour windows en plus :
Télécharger
+-- code
| |
| +-- nel
| |
| +-- ryzom
| |
| +-- ...
|
+-- external
Pour un script permament:
nano /home/compil/.bashrc
Pour un script à lancer à chaque session:
nano shard.sh
Variable à mettre dans votre script:
#!/bin/bash export RYHOME=/home/compil/khanat-opennel-code/code export RYZOM_PATH=/home/compil/khanat-opennel-code/code/ryzom export PATH=$PATH:/home/compil/khanat-opennel-code/code/ryzom/tools/scripts/linux export RYDATA=/home/compil/khanat-ressources
Pour lancer le script et exporter les variables dans le shell actuel :
./shard.sh
Pour linux :
mkdir $RYHOME/build && cd $RYHOME/build
Pour windows :
Créez un répertoire "build" dans le répertoire "code"
Ligne CMake :
cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF ..
Liste des options de cmake : option
Attention, il faut que le serveur soit compilé, pour avoir les symboles de debug (voir Déboguer le shard) avec l'option: -DWITH_SYMBOLS=ON
Options :
Sans les outils : ( vous en avez besoin pour le shard, pour faire le visual_slot.tab et le patch) -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF
Pour Windows :
Lancer Cmake : *Code source : C:/khanat-opennel-code/code *Build les binaires : C:/khanat-opennel-code/code/build *Configurer pour visual c++ 2015 *Configurer *Changer les options *Générer
Pour linux :
make -jX (X= nombres de coeur +1, si ça plante n'utiliser que "make") sudo make install
Pour Windows :
Lancer C:\khanat-opennel-code\code\build\RyzomCore.sln qui a été généré en choisissant Visual C++ appuyez sur F7 pour compiler
Éditer différents fichiers pour trouver la configuration du serveur :
nano $RYZOM_PATH/server/frontend_service.cfg
La ligne à éditer dans frontend_service.cfg est:
FSListenHost = “your.server.ip.adress”;
Pour nous c'est :
FSListenHost = “lirria.khaganat.net”;
nano $RYZOM_PATH/server/sql.cfg
A éditer selon votre configuration:
DBHost = "127.0.0.1"; DBRingName = "ring_mini01";
Laisser en localhost. Créer un utilisateur “nel” qui a les droits sur sa base de donnée, et un utilisateur “ring”, chacun avec son mot de passe. Remplir $RYZOM_PATH/server/sql.cfg avec ces informations.
Copier les sources du serveur web dans le dossier ryzomweb (le dossier sera crée automatiquement) :
cp -r $RYHOME/web ryzomweb chmod -R a+w ryzomweb
nano /etc/apache2/sites-available/shard.conf
######################
# Khanat AMS #
######################
<VirtualHost *:80>
ServerName lirria.khaganat.net
ServerAdmin webmaster@localhost
DocumentRoot /home/compil/ryzomweb/public_php/
ErrorLog ${APACHE_LOG_DIR}/ams_error.log
CustomLog ${APACHE_LOG_DIR}/ams_access.log combined
<Directory "/home/compil/ryzomweb/">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
DirectoryIndex index.php
AddType text/html .php .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</Directory>
</VirtualHost>
##########################
# Khanat serveur de jeu #
##########################
<VirtualHost *:40916>
<Directory "/home/compil/ryzomweb/">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ServerName lirria.khaganat.net
ServerAdmin admin@localhost
DocumentRoot /home/compil/ryzomweb/public_php
ErrorLog ${APACHE_LOG_DIR}/shard_error.log
CustomLog ${APACHE_LOG_DIR}/shard_access.log combined
</VirtualHost>
Activer shard.conf
a2ensite shard
Ouvrir le port 40916
nano /etc/apache2/ports.conf
Ajouter :
Listen 40916
Redémarrer le service Apache :
service apache2 restart
###################### # Khanat AMS # ###################### server { listen 80; listen [::]:80; server_name lirria.khaganat.net; #Création des accès et des erreurs du logs dans /var/log/nginx access_log /var/log/nginx/lirria.ams_access.log; error_log /var/log/nginx/lirria.ams_error.log info; #Dossier de ryzomweb root /var/www/ryzomweb/web/public_php; index index.php index.html ; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } location ~ /\.ht { deny all; } location ~* .(?:png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /index.php$uri$is_args$args; # Optional: Don't log access to other assets access_log off; } }
##########################
# Khanat serveur de jeu #
##########################
server {
listen 40916;
listen [::]:40916;
server_name lirria.khaganat.net;
#Création des accès et des erreurs du logs dans /var/log/nginx
access_log /var/log/nginx/lirria.shard_access.log;
error_log /var/log/nginx/lirria.shard_error.log info;
#Dossier de ryzomweb
root /var/www/ryzomweb/web/public_php;
index index.php index.html ;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Allez à : http://VOTRE_ADRESSE_IP/setup
Suivez les instructions.
Si vous voulez gérer votre base MySQL, allez à : http://VOTRE_ADRESSE_IP/phpmyadmin
Pour vous aidez à la remplir :
https://khaganat.net/wikhan/fr:shard_database
Notes de travail :
Une page générale sur tous les web services : https://ryzomcore.atlassian.net/wiki/display/RC/Web+Services+Installer+Design+Doc
Pour installer les web services : https://ryzomcore.atlassian.net/wiki/display/RC/Configure+Linux+Web+Services
—
Pour installer AMS : https://ryzomcore.atlassian.net/wiki/display/RC/Setup+the+AMS
Documentation sur AMS : https://ryzomcore.atlassian.net/wiki/display/RC/Account+Management+System
Détails sur AMS : https://ryzomcore.atlassian.net/wiki/display/RC/AMS+Design+Info
Vidéos et explications de l'auteur de AMS : https://plus.google.com/116363537101759977044
—
Installation de l'API pour avoir des app : https://ryzomcore.atlassian.net/wiki/display/RC/Configuring+Ryzom+API
WIki sur l'API : http://dev.ryzom.com/projects/ryzom-api/wiki
Cette partie vous explique comment lancer votre shard avec la nouvelle organisation des data.
ln -s $RYDATA/collisions $RYZOM_PATH/server/ ln -s $RYDATA/leveldesign $RYZOM_PATH/server/ ln -s $RYDATA/primitives $RYZOM_PATH/server/ ln -s $RYDATA/translation $RYZOM_PATH/server/ ln -s $RYDATA/continents $RYZOM_PATH/server/ ln -s $RYDATA/common $RYZOM_PATH/server/ ln -s $RYDATA/shard/su/dev_gm_names.xml $RYZOM_PATH/server/data_shard ln -s $RYDATA/shard/su/invalid_entity_names.txt $RYZOM_PATH/server/data_shard ln -s $RYDATA/shard/su/reserved_names.xml $RYZOM_PATH/server/data_shard ln -s $RYDATA/shard/egs/game_event.txt $RYZOM_PATH/server/data_shard ln -s $RYDATA/shard/egs/mission_queues.txt $RYZOM_PATH/server/data_shard ln -s $RYDATA/shard/egs/named_items.txt $RYZOM_PATH/server/data_shard
Vous pouvez aussi copié le script qui fabrique automatiquement le sheet_id.bin et visual_tab.bin et il place au bon endroit tous les fichiers dont à le client . c'est un script quand le shard et le client est au même endroit.
cd $RYHOME/build/bin ./make_sheet_id -o$RYDATA/leveldesign/game_elem/sheet_id.bin $RYDATA/leveldesign/game_elem $RYDATA/leveldesign/game_element $RYDATA/leveldesign/world $RYDATA/leveldesign/ecosystems $RYDATA/sound
Tout d'abord, vérifier que les chemins vers le répertoire contenant les datasheets (leveldesign), les primitives (primitives) et les fichiers communs au serveur et au client (common) sont bons dans le fichier de configuration :
cd $RYHOME/build/bin cp sheets_packer $RYZOM_PATH/tools/sheets_packer/ cd $RYZOM_PATH/tools/sheets_packer
(Changez sheets_packer.cfg n'est plus utile pour la branche Lirria que vous avez pullé)
nano sheets_packer.cfg
État actuel de notre fichier sheets_packer.cfg :
/////////////////////////////////
/////////////////////////////////
/// SHEETS PACKER CONFIG FILE ///
/////////////////////////////////
/////////////////////////////////
DataPath = { "../../common/data_leveldesign", "../../common/data_common", "../../client/data", "../../../../../khanat-ressources/common", "../../../../../khanat-ressources/leveldesign", "../../../../../khanat-ressources/primitives" };
WorldSheet = "ryzom.world";
PrimitivesPath = "../../../../../khanat-ressources/primitives";
OutputDataPath = "../../client/data";
LigoPrimitiveClass = "world_editor_classes.xml";
Puis on peut lancer le sheets_packer, en restant bien dans le répertoire où on a ce fichier .cfg car les chemins sont relatifs :
$ $RYZOM_PATH/tools/sheets_packer/sheets_packer
Enfin, copier le visual_slot.tab à sa place
cp visual_slot.tab $RYZOM_PATH/common/data_common/visual_slot.tab
Ceci est un bidouillage pour ajouter certains fichiers de traduction étrangement demandés par IOS. Il faudrait trouver comment supprimer ces appels qui sont hardcodés dans : code/ryzom/server/src/input_output_service/string_manager.h lignes 54 à 67:
class CStringManager { public: /// This is a list of available language. enum TLanguages { work, english, german, french, russian, spanish, NB_LANGUAGES };
for var in $RYDATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_de}; done for var in $RYDATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_es}; done for var in $RYDATA/translation/translated/*_wk.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_wk/_ru}; done
Si jamais vous n'avez pas non plus les traductions en français, il faut ajouter :
(Changez le français n'est plus utile pour la branche Lirria que vous avez pullé)
for var in $RYDATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_fr}; done
Pour allumer le shard:
shard start
Pour naviguer et sortir de screen:
ctrl+a+n ( ou ctrl+a+ le chiffre du service) permets de naviguer entre les services Ctrl+a+d permets de sortir de screen Ctrl+a+echap permets de remonter le log Shard join permets de rejoindre un shard allumé shard share permets de rejoindre un shard allumé à plusieurs
Pour éteindre le shard:
shard stop
L'installation du Serveur de Patchs est expliquée en détail sur une page dédiée : Installation d'un serveur de patchs
http://votre.ip:40916/login/r2_login.php?cmd=login&login=sonlogin&password=mdp&clientApplication=Lirria sonlogin= votre user mdp= votre mots de passe
Des librairies ne sont pas présente dans l'édition de lien (création du binaire avec toutes le dépendances)
Erreur : /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libxml2.a(encoding.o): In function `openIcuConverter': (.text+0xff7): undefined reference to `ucnv_open_57'
patch :
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 4e5d4bfb5..7f773d4ab 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -152,6 +152,20 @@ IF(WITH_STATIC)
IF(LIBLZMA_LIBRARIES)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
ENDIF()
+ # under Linux, recent libxml2 versions are linked against libicuuc & libicudata
+ IF(WITH_STATIC_EXTERNAL)
+ find_library (LIBICUUC_LIBRARY NAMES icuuc)
+ IF(LIBICUUC_LIBRARY)
+ SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBICUUC_LIBRARY})
+ ENDIF()
+ find_library (LIBICUDATA_LIBRARY NAMES icudata)
+ IF(LIBICUDATA_LIBRARY)
+ SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBICUDATA_LIBRARY})
+ ENDIF()
+ ENDIF()
ENDIF()
ENDIF()
Erreur: /usr/local/lib/libcurl.a(md5.c.o):(.data.rel.ro+0x0): undefined reference to `MD5_Init' patch :
--- CMakeLists.txt-ref 2018-03-11 15:14:14.921459798 +0100
+++ CMakeLists.txt 2018-03-14 22:52:57.604317241 +0100
@@ -440,6 +451,14 @@
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY})
ENDIF()
+ # libcrypto
+ FIND_LIBRARY(LIBCRYPTO_LIBRARY NAMES libcryto crypto PATHS /usr/lib/x86_64-linux-gnu)
+ IF(LIBCRYPTO_LIBRARY)
+ MESSAGE("-- Found crypto: ${LIBCRYPTO_LIBRARY}")
+
+ SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${LIBCRYPTO_LIBRARY})
+ ENDIF()
+
# CURL Macports version depends on libidn, libintl and libiconv too
IF(APPLE)
FIND_LIBRARY(INTL_LIBRARY intl)
@@ -457,6 +476,14 @@
ADD_SUBDIRECTORY(nel)
ENDIF()
+# libcrypto
+FIND_LIBRARY(LIBCRYPTO_LIBRARY NAMES libcryto crypto PATHS /usr/lib/x86_64-linux-gnu)
+IF(LIBCRYPTO_LIBRARY)
+ MESSAGE("-- Found crypto: ${LIBCRYPTO_LIBRARY}")
+ SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${LIBCRYPTO_LIBRARY})
+ENDIF()
+
IF(WITH_RYZOM)
ADD_SUBDIRECTORY(ryzom)
ENDIF()
Certaine librairie on était compilé sans l'option '-fPIC', cela implique que ces librairie ne peuvent pas être intégré en static dans les binaires opennel. [Static a intérêt pour le client, qui évite de forte contrainte sur l'installation sur différent Linux]
Erreur : /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/libluabind.a(class.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
Il faut compiler libluabind (et ne pas installer le package debian)
mkdir -p /opt/src/luabind wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O /opt/src/RUN luabind.tar.gz wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O /opt/src/luabind-debian.tar.xz tar xvf /opt/src/luabind.tar.gz -C /opt/src/luabind --strip 1 || exit 2 tar xvf /opt/src/luabind-debian.tar.xz -C /opt/src/luabind || exit 2 cd /opt/src/luabind; for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done cd /opt/src/luabind;export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS)" linkflags=" $(dpkg-buildflags --get LDFLAGS)" cd /opt/src/luabind;export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS)" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
Erreur : /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libogg.a(framing.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Il faut compiler libogg & libvorbis(et ne pas installer le package debian)
# Build libogg mkdir -p /opt/src/libogg wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O /opt/src/libogg.tar.gz wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O /opt/src/libogg.diff.gz tar xvf /opt/src/libogg.tar.gz -C /opt/src/libogg --strip 1 || exit 2 gunzip /opt/src/libogg.diff.gz cd /opt/src/libogg ; patch -p1 < /opt/src/libogg.diff mkdir -p /opt/src/libogg/build cd /opt/src/libogg/build && ../configure --disable-maintainer-mode \ --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) \ --enable-static \ --prefix=/usr \ CPPFLAGS="-D_FORTIFY_SOURCE=2" \ CFLAGS="-Wformat=2 -g -fPIC" \ CXXFLAGS="-Wformat=2 -g -fPIC" \ LDFLAGS="-Wl,-z,now" cd /opt/src/libogg/build && make cd /opt/src/libogg/build && make install # Build libvorbis mkdir -p /opt/src/libvorbis wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O /opt/src/libvorbis.tar.gz tar xvf /opt/src/libvorbis.tar.gz -C /opt/src/libvorbis --strip 1 || exit 2 wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5-4+deb9u1.debian.tar.xz -O /opt/src/libvorbis.debian.tar.xz tar xvf /opt/src/libvorbis.debian.tar.xz -C /opt/src/libvorbis || exit 2 cd /opt/src/libvorbis; for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done cd /opt/src/libvorbis; ./configure --enable-static --with-pic cd /opt/src/libvorbis; make cd /opt/src/libvorbis; make install