From The Mana World
Construction-worker.png
This article is currently under construction.



We're using Git as version control system for our source files and content. Have a look at our Tutorial about how to use Git.

Set Up

This is a how to help content development for official TMW-eA using Ubuntu and the Mana client. Other OS and clients may differ. Following this guide, you should be able to get development testing versions of the client data (tmwdata), server-data (eathena-data) and participate in development by using a localhost server. After getting these, you can both test current development and begin development in the direction you find most fitting.


Install Dependencies

In addition to the basic build tools (GCC, Make, headers, ...), Bison, and Flex are needed.

Debian derivates (including Ubuntu)

  • Open a terminal.
sudo apt-get install g++-multilib flex bison

Set Up Own Server

Here are the steps to use when creating a new local testing server.

  • Open a terminal.
 mkdir ~/tmw-ea
 cd ~/tmw-ea/
 git clone git://github.com/themanaworld/tmwa.git eathena
 git clone --recursive git://github.com/themanaworld/tmwa-server-data.git eathena-data
 cd eathena/
 make
 sudo make install # (you can use prefix=/path to install somewhere other than /usr/local), for example  make install prefix=~ should work in Ubuntu (~/bin is in your PATH by default)
 git config --global url.git@github.com:.pushInsteadOf git://github.com [1] [2]
 cd ../eathena-data
  • Preferably, add the update hooks.
 ln -s ../../git/hooks/post-merge .git/hooks/
 ln -s ../../../../git/hooks/post-merge .git/modules/client-data/hooks/ # (git 1.7.8 or newer)
 ln -s ../../../git/hooks/post-merge client-data/.git/hooks/ # (git 1.7.7 or older)
 make conf
 cd client-data
 git checkout master
 cd music
 git checkout master

Updating the Server

Running and Administrating the Server

The TMWAthena (eAthena) is in fact 3 servers:

  • The char-server which manages characters and connects them to the map server.
  • The login server which manages accounts and connection to char server.
  • The map-server which manages game content (maps, monsters, items, scripts...) and their interaction with characters


  • Start the servers: Open a terminal and run all three local servers.
 cd ~/tmw-ea/eathena-data/
 ./char-server& ./login-server& ./map-server&
  • In the terminal, Launch ladmin the administration tool, add yourself as an user and make yourself a GM:
cd ~/tmw-ea/eathena-data/login
ladmin (not ./ladmin)
add <username> M <password> 
gm <username> 99


Note : Be sure that you are running ladmin from within the "login/" directory. Check that the config files are correct: the connection port should be 6901 for tmwa's configuration, not 6900, which is the hard-coded default.

See also: GM Commands

Network configuration

The configuration files set up your personal server to be used on your computer with a client running on the same computer by default. The hereby information is taken after the original lan_support.conf file which is now located in tmwa-server-data / login / conf / directory.

Note:

  • LAN: Local Area Network
  • WAN: Wide Area Network
Athena TXT version LAN configure file.
Support Client Connect to Local Area Network (LAN) IP Address Server.
put this fle into conf/ directory

HOWTO

The login-server, char-server and map-server must be on the same subnetwork (not necessary on the same computer). You can not use eAthena if you want to install the servers on 2 or more different LAN.

First of all: you must configure your router to forward your WAN IP (one or more) and port (default: 6900, 6121 and 5121) to the right concerned computer(s) (if default port, forward 6900 port to the (LAN IP) login-server, 6121 port to the (LAN IP) char-server, etc.). After, set in char_athena.conf and map_athena.conf files the WAN IP and the right ports that you use. Give to WAN people (client that are not on your LAN) your WAN IP to have an access to your server. At this point, all players outside your LAN can access to your server(s).

Now, you must parameter your LAN for the servers.

  • Set the LAN IP of the char-server and the map-server in this file (lan_char_ip and lan_map_ip).
  • Set the definition of your LAN in this file (subnet and subnetmask).

When you load/start login-server and char-server, read what the server displays, and specially the section ---LAN CONFIGURATION---.

    If you see a warning or something not good, correct it.

Now LAN client can access to your server.

NB: if you want that nobody of your LAN can access to your server, put 127.0.0.1 in IP and 255.255.255.255 for the mask.
      So only the localhost computer would access to your server.
NB2: you can use LAN name if you have some instead of IP and/or mask.
NB3: if you want set your server only for LAN people, set your LAN IP instead of the WAN IP, and set 127.0.0.1/255.255.255.255 for the LAN IP.

HOW THAT WORKS

When someone tries to connect to your server(s), the login-server/char-server checks its IP with the LAN subnet (subnet and subnetmask parameters). If it matches, the login-server sends the LAN IP of the char-server (lan_char_ip); and char-server do same for map-server (lan_map_ip). If not, the login-server sends the WAN IP of the char-server that it have received (char_ip in char_athena.conf) and the char-server sends the WAN IP of the map-server that it have received (map_ip in map_athena.conf).

List of configuration files

caption
configuration file location
lan_support.conf cell
char_athena.conf cell
map_athena.conf cell

Connecting

  1. Open a command line terminal and run your client pointing to your client data and your local server :
 manaplus --server localhost --port 6901 -u -d ~/tmw-ea/eathena-data/client-data

or

 mana --server localhost --port 6901 -u -d ~/tmw-ea/eathena-data/client-data

If all went well, you are now ready to test new content and participate with development.

Server's git repository has been moved to GitHub

the following is a copy of the information post by o11c: tmwAthena switch to github: http://forums.themanaworld.org/viewtopic.php?f=2&t=16241

I've switched the tmwAthena repository to github. I was originally intending to wait for me to finish my rewrite, but figured it wasn't worth the wait.

I've updated the wiki page and the test server. you can switch your local clone like this:

$ git remote set-url origin git://github.com/themanaworld/tmwa.git

although you should probably first confirm that you are, indeed, in the correct repository:

$ git remote -v
origin  git://gitorious.org/tmw-eathena/mainline.git (fetch)
<other lines may follow>


(I also enabled automatic builds through travis-CI, so I don't have to worry as much about breaking other systems. Of course, I still need to see what config needs to be done so it will test with other gcc versions) -o11c


You can also pull the data which has been modified.

  • Open a terminal.
cd ~/tmw-ea/eathena-data
git pull
  • If you haven't installed the hook,
git submodule update --merge  at toplevel (for client-data) and in client-data (for music)
  • Close the terminal.

See Also: README.mv.txt - Documentation on using git submodules, like client-data and tmw-music.


Generating client updates

  • Shutdown all your servers.
  • First we are going to change the config files to be sure the paths are correct.
cd ~/tmw-ea/eathena-data/client-data/tools/client-updates/src
ls
Ouptut:
client-updates-gen      client-updates-push 
adler32.c                    client-updates-inspect  makefile 
client-updates.conf.example  client-updates-news
End of output 
  • Copy the example file and make a conf file of it.
cp client-updates.conf.example client-updates.conf
ls
Output:
client-updates.conf.example  client-updates-news 
adler32.c            client-updates-gen           client-updates-push 
client-updates.conf  client-updates-inspect       makefile 

(as you can see now there is a client-updates.conf file made)

End of output
  • Edit the client-updates.conf file with gedit or nano or vi.

Search for the folowing lines:

CLIENT_DATA_DIR="$HOME/tmwa-client-data"
UPDATES_DIR="$HOME/client-updates" 
UPDATES_PUBLISH_DIR="$HOME/www/tmwupdate"

And change them to:

CLIENT_DATA_DIR="~/tmw-ea/eathena-data/client-data"
UPDATES_DIR="~/tmw-ea/eathena-data/client-data/tools/client-updates" 
UPDATES_PUBLISH_DIR="/var/www/tmwupdates" (your public www folder /tmwupdates)
  • Save the file and get back in the terminal.
cd ~/tmw-ea/eathena-data/login/conf
ls
Output:
ladmin_athena.conf         lan_support.conf   login_local.conf.example 
ladmin_local.conf          login_athena.conf 
ladmin_local.conf.example  login_local.conf 
End of output
  • Edit the login_local.conf with an editor and look for the following line:
update_host: http://updates.themanaworld.org/
  • Change that line to:
update_host: http://127.0.0.1/tmwupdates/ (or use your external ip)
  • Save the file and get back in the terminal.

For this part you realy need to change something inside of the client-data folder. If you do not change a file, the updates are generated but nothing will be updated. You are now free to do some changes, first close the client and your servers. Make your modifications (e.g. Change a map) and save them.

  • Open a terminal.

First we compile the adler32 tool to generate a hash.

cd ~/tmw-ea/eathena-data/client-data/tools/client-updates/src 
make
Output must be: 
gcc -lz -o adler32 adler32.c
  • Now that we compiled the adler tool we can make us a update.
cd ~/tmw-ea/eathena-data/client-data
make maps (if you changed a map. the output will be converting all the maps by tmx_converter.py tool.)
  • Then we check the latest commitment on git.
git log --oneline | tail -n 1
The output of this will be: 
840c732 *** empty log message ***
End of output

We only so this once, after we made an update with client-updates-gen 840c732 the client-updates-gen can exec without the commit value.

git status
Output example:
On branch master 
Changed but not updated: 
(use "git add <file>..." to update what will be committed) 
(use "git checkout -- <file>..." to discard changes in working directory)  
modified:   maps/001-1.tmx 
no changes added to commit (use "git add" and/or "git commit -a")
End of output 
  • Now we add the modified files with git add.
git add [modified files] (example git add maps/001-1.tmx)
git add client-data (or add the file that changed see example above).
git commit

If we do git commit it will open up vi or nano and you must fill in something to commit something. If you just save the file without filling in something its not working, so if you dont know what to fill in just put … in it and save. Above, we changed the 001-1.tmx map so i will fill in the commit file like this: changed map 001-1. Then save the file.

./tools/client-updates/src/client-updates-gen 840c732

This will make a zip file that has to be pushed to your webserver so that the manaplus or tmw client can download the updates and install them. If we dont do “client-updates-push” there will be no data on the webserver and the client keeps saying us that the update is not complete. Or the client will crash.

./tools/client-updates/src/client-updates-push

You will see that the files are copied to the location you specified in the config file (/var/www/tmwupdates) earlier

  • Now you can start your servers and start the client to see if the updates are working.

All content can now be displayed without starting a client with the -u -d arguments.

If you make another change at the maps or data and want to make more updates, just repeat the last steps:

Repeat steps:

cd ~/tmw-ea/eathena-data/client-data
make maps (if you changed a map)
git status
git add [modified files] (example git add maps/001-1.tmx)
git add client-data (or add the file that changed see example above).
git commit
./tools/client-updates/src/client-updates-gen

The first time we did this command with client-updates-gen 840c732. We dont do that anymore. Just client-updates-gen is ok to do the job.

./tools/client-updates/src/client-updates-push