From The Mana World

How to develop for dummies


This tutorial assumes you are using Linux. If you are using windows, you need to set up a virtual machine.

Initial Setup

This tutorial assumes you are using the Bash shell. If you are using any other shell bugs may happen.

Installing the dependencies

Debian derivates (including Ubuntu)

  • Open a terminal.
sudo apt-get install g++ python2.7 make realpath git

Fedora derivates

  • Open a terminal.
sudo yum install gcc-c++ make git

Creating a github account

Setting up the global git environment

  • Go to https://github.com/settings/applications and click the button "Generate new token"
  • Choose any name you want for the token.
  • Check those permissions: repo public_repo user:email write:repo_hook repo:status read:public_key user repo_deployment
  • Copy the personal token. It will look something like this: 46cc23de2f02e4t08536803ve705d8241e62e527
  • open a terminal
git config --global credential.helper "cache --timeout=3600"
git config --global user.name "Your Name"
git config --global user.email "<username>@users.noreply.github.com"
touch ~/.netrc
chmod 600 ~/.netrc
  • open the file ~/.netrc in your favorite text editor and put this inside
machine github.com login <username> password <token>
  • save the file and close the text editor

Forking and cloning

echo "export PATH=$PATH:~/bin" >> ~/.bashrc
source ~/.bashrc
mkdir ~/tmwAthena
cd ~/tmwAthena
git clone --recursive https://github.com/<username>/tmwa.git
git clone --recursive https://github.com/<username>/tmwa-server-data.git

Setting up the remotes

  • open a terminal
cd ~/tmwAthena/tmwa
git remote add upstream git://github.com/themanaworld/tmwa.git
git fetch --tags --all
cd ../tmwa-server-data
git remote add upstream git://github.com/themanaworld/tmwa-server-data.git
cd tools
git remote add upstream git://github.com/themanaworld/tmw-tools.git
cd ../client-data
git remote add upstream git://github.com/themanaworld/tmwa-client-data.git

Copying the local config files

  • open a terminal
cd ~/tmwAthena/tmwa-server-data/login/conf
cp ladmin_local.conf.example ladmin_local.conf
cp login_local.conf.example login_local.conf
cd ../../world/conf
cp char_local.conf.example char_local.conf
cd ../map/conf
cp atcommand_local.conf.example atcommand_local.conf
cp battle_local.conf.example battle_local.conf
cp map_local.conf.example map_local.conf
cd ../db
cp const-debugflag.txt.example const-debugflag.txt

Making an admin account

  • open a terminal (and leave it open)
cd ~/tmwAthena/tmwa-server-data
./run-all
  • wait until it says "Map-server 0 loading complete.". If after 2 minutes you do not see this message, ask for support on IRC.
  • while keeping the other terminal open, open a new one
cd ~/tmwAthena/tmwa-server-data/login
tmwa-admin
add <username> M <password>
gm <username> 99
exit
  • close this terminal but keep the one in which you typed run-all

Making a custom manaplus launcher

  • open your favorite text editor and paste this inside:
#!/bin/bash
manaplus --server localhost --port 6901 -u -d ~/tmwAthena/tmwa-server-data/client-data
  • save the file in ~/bin and name it "m+"
  • open a terminal
chmod +x ~/bin/m+

Testing the server

  • While your terminal in which you typed run-all is still open, open a new terminal
m+
  • You will see the login screen. Type the username and password that you have set at the step "Making an admin account"
  • You should now be able to create a character and use the server. If it does not work, seek help on IRC.

Updating from upstream

to-do: explain how to pull from the tmw repo and force-push to the fork

Making new content

to-do: explain how to create branches and why it is important, explain how to push and make a PR