Outils pour utilisateurs

Outils du site


issue57:labolinux

Traditionally our family has two periods of the year that we do a big cleanup - spring cleaning and at the start of a new year. This year, instead of tossing out our old Athlon64, I decided to reuse it as a development server for our existing MMORPG server. I first became aware of The Mana World (TMW) in late 2007 when the client software, tmw, appeared in the universe repositories of Ubuntu 7.10, Gutsy Gibbon. At the time, the TMW client was primitive but quite functional. Over the past several years, the game has advanced both on the client and server side. The great thing about running a TMW server is that it doesn’t require a lot of horsepower if you plan on running a small server for friends and family. We originally set up our server on a Pentium III 1.1 GHz CPU with 256 MB of RAM (mind you the hard drives were lightning fast 15,000 RPM SCSI drives). This setup was enough to host 5 simultaneous players over the Internet on our ADSL connection. Currently, we host the Auldsbel server on a hyperthreaded Pentium 4 2.8 GHz system with 2 GB of RAM, and that also runs the front facing web server. Hosting a web server is helpful for getting the client software to show who else is online, but it’s not necessary to get the server running.

Habituellement, notre famille fait un grand nettoyage deux fois par an, au printemps et au début d'une nouvelle année. Cette année, au lieu de mettre notre vieux Athlon64 au rebut, j'ai décidé de l'utiliser comme serveur de développement pour notre serveur MMORPG existant. J'ai eu connaissance de The Mana World (TMW) fin 2007, quand le logiciel client est apparu dans les dépôts universe d'Ubuntu 7.10 Gutsy Gibbon. Le client TMW était alors élémentaire, mais tout à fait fonctionnel. Depuis plusieurs années, des avancées ont été faites du côté serveur aussi bien que du côté client.

La beauté d'un serveur TMW se trouve dans ses exigences qui sont minimes si vous avez l'intention de faire tourner un petit serveur pour les amis et la famille. Au départ, nous avons mis notre serveur sur un processeur Pentium III à 1,1 GHz avec 256 Mo de RAM (il faut savoir que les disques durs furent rapides comme l'éclair, des disques SCSI à 15.000 RPM). C'était suffisant pour accueillir cinq joueurs en ligne simultanés sur notre connexion ADSL. Actuellement nous hébergeons un serveur Auldsbel sur un Pentium 4 multi-cœur à 2,8 GHz avec 2 Go de RAM et il fait tourner aussi un serveur web à interface utilisateur. Héberger un serveur web est utile pour pouvoir demander au logiciel client d'afficher les autres personnes en ligne, mais ce n'est pas obligatoire pour faire tourner le serveur.

We used a server install of Ubuntu 10.04 LTS as the base for our server, and used a notebook running the client software to test the configuration. You may want to install the server on a desktop version of Ubuntu if you plan on using a single machine for the server and client. The TMW server is based on the eAthena (newer TMW server software exists that’s written from scratch, but the main server still uses modified eAthena code) project. eAthena was originally developed as an open-source server Ragnarok, but TMW developers have done a great job modifying it for the Mana World client. To begin, you need to install git-core, build-essential, flex, and bison: sudo apt-get install git-core build-essential flex bison Next you create a directory to hold the server software, and download and build the tmw-ea server software:

Comme base de notre serveur, nous avons utilisé une installation serveur d'Ubuntu 10.04 LTS et nous nous sommes servis d'un portable avec le logiciel client pour tester la configuration. Vous voudriez peut-être installer le serveur sur Ubuntu Desktop si vous projetez d'utiliser une seule machine comme serveur et client. Le serveur TMW est basé sur le projet eAthena (des logiciels serveurs TMW plus récents existent, écrits à partir de zéro, mais le serveur principal utilise encore du code eAthena modifié).

Au départ, eAthena fut développé comme un serveur Ragnarok open-source, mais les développeurs TMW l'ont modifié pour être le client Mana world et ils ont fait du bon boulot. Pour commencer, il faut installer git-core, build-essential, flex et bison :

sudo apt-get install git-core build-essential flex bison

Vous devez ensuite créer un répertoire pour les logiciels serveurs, puis télécharger et compiler les logiciels serveurs tmw-ea :

mkdir ~/tmw-ea cd ~/tmw-ea git clone git:gitorious.org/tmw-eathena/mainline.git eathena git clone –recursive git:gitorious.org/+tmw-admins/tmw/tmwa-server-test.git eathena-data cd eathena Be patient while git clones the repositories. Depending on which version of Ubuntu you’re running, you may run into problems with Make being older than version 3.82 (the version developers recommend you use to make the project). If you run into problems making the project, run the next step: mkdir -p obj/{common,login,char,map,ladmin,tool} make Multiple servers can be run from the same point, but the tmw-ea main server binaries should be copied to a standard folder: sudo cp login-server char-server map-server ladmin /usr/local/bin/ The next step is to add git hooks to allow updating of the client data. Without this step, you’ll still be able to run the server software, you just won’t be able to pull updates from the git repositories.

mkdir ~/tmw-ea

cd ~/tmw-ea

git clone git:gitorious.org/tmw-eathena/mainline.git eathena git clone –recursive git:gitorious.org/+tmw-admins/tmw/tmwa-server-test.git eathena-data

cd eathena

Soyez patient pendant que git clone les dépôts. Selon la version d'Ubuntu que vous exécutez, vous pourriez rencontrer des problèmes avec make parce qu'il est plus vieux que la version 3.8.2. (celle que les développeurs recommandent que vous utilisez pour « make » le projet). Si, effectivement, vous avez des problèmes, exécutez la prochaine étape :

mkdir -p obj/{common,login,char,map,ladmin,tool}

make

Plusieurs serveurs peuvent être lancés à partir du même point, mais vous devrez copier les binaires du serveur principal tmw-ea vers un dossier standard :

sudo cp login-server char-server map-server ladmin /usr/local/bin/

La prochaine étape est de rajouter des « git hooks » pour permettre la mise à jour des données des clients. Sans cette étape vous pouvez toujours exécuter les logiciels du serveur, mais vous ne pourrez pas récupérer des mises à jour des dépôts git.

cd ../eathena-data ln -s ../../git/hooks/post-merge .git/hooks/ ln -s ../../../git/hooks/post-merge client-data/.git/hooks/ The last little bit of setup is to make the config files, and checkout client data and funky music: cd client-data git checkout master cd music git checkout master At this point, our server is set for us to log-in locally. I set up a static IP for the development server in our Tomato-MLPPP Linksys WRT54L router, and assigned it the same hostname I assigned the production system. Before we can test the server, we have to load 3 server processes: the character server, the login server, and the map server (the configuration files for these three servers are what we’ll modify later for an Internet facing server). For now we’ll load the server executables to test the server: cd ~/tmw-ea/eathena-data ./char-server & ./login-server & ./map-server &

cd ../eathena-data

ln -s ../../git/hooks/post-merge .git/hooks/

ln -s ../../../git/hooks/post-merge client-data/.git/hooks/

Enfin, il faut faire les fichiers de configuration et « checkout » les donnée clients et de la musique funky :

cd client-data

git checkout master

cd music

git checkout master

À ce stade, notre serveur est prêt pour que nous nous connections localement. J'ai paramétré une IP statique pour le serveur de développement dans notre routeur Tomato-MLPPP Linksys WRT54L et lui ai assigné le même « hostname » que j'avais donné au système de production. Avant de pouvoir tester le serveur, il faut charger 3 serveurs procéduraux : le serveur de personnages (character server), le serveur de connection (login) et le serveur de carte (map) (les fichiers de configuration pour ces trois serveurs sont ce que nous allons modifier plus tard pour un serveur vers l'Internet). Pour le moment, nous allons charger les exécutables du serveur pour le tester :

cd ~/tmw-ea/eathena-data

./char-server & ./login-server & ./map-server &

When you log in to the server for the first time, you’ll see the character log-in on the terminal you launch the server from. From my notebook I loaded the TMW client: sudo apt-get install tmw There are a number of TMW clients. The one in the Ubuntu 10.04 repository is a bit dated and freezes for GM’s when they entered a room where clients were logged in. Better to use the manaplus client available from http://manaplus.evolonline.org/ if you intend to expose your server to the rest of the world. When the TMW client is loaded, click the Custom Server button, and enter the hostname you gave your server (or domain-name/dynamic DNS name). At this point, we’re just confirming the server is working locally and setting ourselves up to be GM - before exposing it to the rest of the world.

Lorsque vous vous connectez au serveur pour la première fois, vous verrez le login du personnage sur le terminal à partir duquel vous lancez le serveur.

J'ai chargé le client TMW à partir de mon portable :

sudo apt-get install tmw

Il y a de nombreux clients TMW. Celui dans le dépôt d'Ubuntu 10.04 est un peu vieux et se plante pour des GM (Game Masters ou Maîtres des jeux) quand ils entrent dans une salle où des clients étaient connectés. Il vaut mieux utiliser le client manaplus disponible sur http://manaplus.evolonline.org/ si vous avez l'intention d'exposer votre serveur au reste du monde.

Quand le client TMW a été chargé, cliquez sur le bouton « Custom Server » et rentrez le « hostname » (ou nom de domaine/ ou nom DNS) que vous avez attribué à votre serveur. À ce stade, nous ne faisons que confirmer que le serveur fonctionne localement et nous faisons le nécessaire à fin d'être « GM » (Maître du jeu) - avant de le montrer au reste du monde.

When the client connects, click the register button. Note: you cannot register through the client if you intend to play on the official Mana World server. On the main server, you have to register through the web site, and wait for approval. On your own server you just register a username. The next screen is the character management screen where you choose a character. Since this is the first time you’ve logged on, all the character slots will be blank. Create a character and assign statistics on the next screen. You can also change hair color and hair style. As you might have guessed, one user login can have multiple characters. You want to make sure you create a character before inviting anyone else to the server so you can set the first character to be the game master (GM). The TMW variation of eathena stores character data in ~/tmw-ea/eathena-data/login/save. The file account.txt stores character information. The file gm_accounts.txt is where you set up who will be GM on your server. GM’s and developers normally are assigned special levels. You can find these levels in the file ~/tmw-ea/eathena-data/world/map/conf/atcommand_local.conf. What’s important is that you set yourself up as a level 99 GM. If you assign other GMs set their level to 60 so they have limited GM power. The gm_accounts.txt file is formatted in the following fashion: account_number gm_level

Quand le client se connecte, cliquez sur le bouton « register ». N.B. : Il n'est pas possible de vous inscrire à partir du client si vous avez l'intention de jouer sur le serveur officiel Mana World. À partir de votre serveur principal, il faut vous inscrire au moyen du site web, puis attendre l'approbation. Sur votre propre serveur, vous n'inscrivez qu'un nom d'utilisateur (username).

L'écran suivant est l'écran de gestion des personnages où vous choisissez un personnage. Puisque c'est la première fois que vous vous êtes connectés, tous les cases personnages seront vierges. Créez un personnage et assignez les statistiques sur l'écran suivant. Vous pouvez également changer la couleur et le style des cheveux. Comme vous aurez peut-être deviné, un nom d'utilisateur peut avoir de multiple personnages.

Vous devez vous assurer de créer un personnage avant d'inviter d'autres personnes à utiliser le serveur, afin de pouvoir configurer le premier personnage comme Maître du jeu (GM). Le dérivé TMW d'eathena sauvegarde les données du personnage dans ~/tmw-ea/eathena-data/login/save. L'information concernant le personnage est sauvegardée dans le fichier account.txt. C'est dans le fichier gm_accounts.txt, que vous configurerez le GM sur votre serveur. Généralement, les GM et les développeurs se voient assignés des niveaux particuliers. Vous trouverez ces niveaux dans le fichier ~/tmw-ea/eathena-data/world/map/conf/atcommand_local.conf. Ce qui importe c'est que vous soyez paramétré comme un GM de niveau 99. Si vous assignez d'autres GM, configurez leur niveau à 60, afin de limiter leurs pouvoirs en tant que GM. Le fichier gm_accounts.txt est formaté de la façon suivante :

numéro_de_compte niveau_gm (account_number gm_level).

The first user account is normally assigned a number of 2000000. Subsequent accounts increment the user account number by 1, so the next user account created would be 2000001. So to make the first user account GM we would give the gm_account.txt the following information: 20000000 99 The ~/tmw-ea/eathena-data/login/save/gm_accounts.txt file can be modified while you’re logged in to your server. Once you’ve given yourself GM level, you can try some of the GM commands. All GM commands begin with an @ symbol. @help will give you a list of GM commands in the debug tab. The keen-eyed will notice that many of the @gm commands scroll right off the screen. To correct this problem we need to adjust the amount of lines available in the chat window of the client software. In the top right corner of the tmw client software, click the Setup button, then click the chat tab, and adjust Limit max lines in chat to 120. GM’s have the power to create items, spawn monsters, warp to players, warp players to other places, even launch an all-out player versus player war, so choose your GMs carefully. GM actions are logged in a plain text file tmw-ea/eathena-data/world/map/gm.log.year.month (for example tmw-ea/eathena-data/world/map/gm.log.2012.01). We found that looking at the gm log files from the main server gave us a better understanding of the @gm commands and how they’re used. Luckily the main server is transparent with their log files, and they can be viewed online at http://server.themanaworld.org/gm.

Normalement, le premier compte d'utilisateur se voit assigner le numéro 2000000. Les comptes suivants incrémentent le numéro de compte utilisateur de 1 et, par conséquent, le numéro du compte utilisateur suivant serait 2000001. Ainsi, pour rendre le premier compte utilisateur GM on inscrirait les informations suivantes dans le fichier gm_account.txt :

2000000 99

Le fichier ~/tmw-ea/eathena-data/login/save/gm_accounts.txt peut être modifié pendant que vous êtes connecté à votre serveur. Une fois que vous vous êtes attribué le niveau GM, vous pouvez essayer quelques commandes GM. Toutes les commandes GM commencent par le symbole @. @help affichera une liste de commandes GM sous l'onglet « debug ». Ceux aux yeux de lynx remarqueront que de nombreuses commandes @gm sortent de l'écran en défilant. Pour corriger ceci, nous devons ajuster la quantité de lignes disponible dans la fenêtre de chat du logiciel client. Dans le coin droit en haut du logiciel client tmw, cliquez sur le bouton « Setup » puis sur l'onglet chat et ajustez « Limit max lines » (limiter le maximum nombre de lignes) à 120.

Les GM peuvent créer des objets, faire apparaître des monstres, se téléporter jusqu'aux joueurs, téléporter des joueurs ailleurs et même lancer une guerre à outrance entre les joueurs ; vous devez donc choisir vos GM avec grand soin. Les actions des GM sont enregistrées dans un fichier texte simple tmw-ea/eathena-data/world/map/gm.log.year.month (par exemple tmw-ea/eathena-data/world/map/gm.log.2012.01). Nous avons constaté que regarder les fichiers gm log sur le serveur principal nous a fait mieux comprendre les commandes @gm et comment s'en servir. Le serveur principal n'essaie heureusement pas de cacher les fichiers journal et vous pouvez les consulter à http://server.themanaworld.org/gm.

Putting your server online In order to make your server available to everyone on the Internet, you’ll need to punch some holes in the firewall of your router. In particular, TCP and UDP for ports 5122, 6122, and 6901. You’ll also need to modify the configuration files for the server executables. There are a lot of configuration files, in a few places. The configuration files we want are all suffixed with _local.conf. In particular we want to modify the following files: ~/tmw-ea/eathena-data/world/conf/char_local.conf ~/tmw-ea/eathena-data/world/map/conf/map_local.conf ~/tmw-ea/eathena-data/login/conf/ladmin_local.conf There are 3 variables we want to set, the IP addresses for the login server, the character server, and the map server. If you’re using a dynamic DNS service, the dynamic DNS name can be used in the place of the character and map server, but you should use your local address for the login server (on our test server we used 127.0.0.1 and it worked fine for the login server). Note that if your DNS changes while the server is online the server may be unavailable. Our ISP offers a very inexpensive static IP address, which is what we use in place of the character and map server variables. Our char_local.conf looks something like this: Comment : Login server IP login_ip: 127.0.0.1 Comment : Character server IP char_ip: auldsbel.dyndns.org

La mise en ligne de votre serveur

Afin de rendre votre serveur disponible en ligne pour tous, vous aurez besoin de percer quelques trous dans le pare-feu de votre routeur. En particulier, TCP et UDP pour les ports 5122, 6122 et 6901. Vous devrez également modifier les fichiers de configuration pour les exécutables du serveur. Il y a beaucoup de fichiers de configuration qui se trouvent dans quelques emplacements. Les fichiers de configuration que nous voulons ont tous le suffixe _local.conf. Nous voulons modifier surtout les fichiers suivants :

~/tmw-ea/eathena-data/world/conf/char_local.conf ~/tmw-ea/eathena-data/world/map/conf/map_local.conf ~/tmw-ea/eathena-data/login/conf/ladmin_local.conf

Il y a 3 variables que nous devons régler : l'adresse IP pour le serveur login, celle pour le serveur des personnages et celle pour le serveur carte. Si vous utilisez un service DNS dynamique, le nom DNS dynamique peut être utilisé à la place des serveurs personnage et carte, mais il faudrait utiliser votre adresse locale pour le serveur login (sur notre serveur de test, nous avons utilisé 127.0.0.1 et cela a très bien fonctionné pour le serveur login). Remarquez que si votre DNS change pendant que le serveur est en ligne, il peut ne plus être disponible. Notre FAI propose une adresse IP statique pour pas grand-chose et c'est ce que nous utilisons à la place des variables des serveurs personnage et carte. Notre char_local.conf ressemble à ceci :

Comment : Login server IP login_ip: 127.0.0.1 Comment : Character server IP char_ip: auldsbel.dyndns.org

Similarly our map_local.conf looks like this: Character Server IP char_ip: auldsbel.dyndns.org Map server IP map_ip: auldsbel.dyndns.org The ladmin_local.conf file is an important configuration file used by the ladmin tool. Using ladmin, the administrator can execute a variety of administrative tasks without using the client to log in to the server. You can find a number of other configuration files in the ~/tmw-ea/eathena-data/world/map/conf directory. If you want to have magic in your world, you’ll want to look at the magic.conf.template file and the build-magic.sh shell script. The help.txt file in this directory is the same help file that gets displayed to GMs who issue the @help command. You will also likely want to customize the motd.txt (message of the day) file. Like a lot of Linux software, the Mana World eAthena server is highly customizable. While you can run a server identical to the main server, you’ll probably want to customize your server more extensively. Good sources for information on further customization can be found on the Mana World forums, wiki, and in the How to Develop sections of the Mana World web site. URLs of Interest: The Mana World - http://www.themanaworld.org/ TMW Forums - http://forums.themanaworld.org/ TMW Wiki - http://wiki.themanaworld.org/ How to Develop (& server set-up) - http://wiki.themanaworld.org/index.php/How_to_Develop Auldsbel TMW server: http://auldsbel.org/

De façon similaire, notre map_local.conf ressemble à ceci :

Character Server IP char_ip: auldsbel.dyndns.org Map server IP map_ip: auldsbel.dyndns.org

Le fichier ladmin_local.conf est un important fichier de configuration utilisé par l'outil ladmin. Avec ladmin, l'administrateur peut exécuter diverses tâches d'administration sans devoir utiliser le client pour se connecter au serveur.

Vous trouverez de nombreux autres fichiers de configuration dans le répertoire ~/tmw-ea/eathena-data/world/map/conf. Si vous voulez que votre monde possède la magie, vous devrez regarder le fichier magic.conf.template et le script shell build-magic.sh. Le fichier help.txt dans ce répertoire est le même fichier help qui s'affiche pour les GM qui font la commande @help. Vous voudrez sans doute aussi personnaliser le fichier motd.txt (message du jour).

Comme pas mal de logiciels sous Linux, le serveur Mana World eAthena peut être personnalisé à volonté. Alors que vous faites tourner un serveur identique au serveur principal, vous voudrez sans doute personnaliser le vôtre davantage. Des renseignements sur une personnalisation plus poussée se trouvent sur les forums et le wiki de Mana World, ainsi que dans les sections du site Web Mana World « How to Develop » (comment développer).

Des URL intéressantes :

The Mana World - http://www.themanaworld.org/ TMW Forums - http://forums.themanaworld.org/ TMW Wiki - http://wiki.themanaworld.org/ How to Develop (& server set-up) - http://wiki.themanaworld.org/index.php/How_to_Develop Auldsbel TMW server: http://auldsbel.org/

issue57/labolinux.txt · Dernière modification : 2012/03/14 22:46 de andre_domenech