From The Mana World
(colors)
Line 22: Line 22:
* Go to https://github.com/settings/profile and under "Public email" choose the address that ends with @users.noreply.github.com
* Go to https://github.com/settings/profile and under "Public email" choose the address that ends with @users.noreply.github.com


== Setting up the global git environment ==
== Setting up the global gi t environment ==
* Go to https://github.com/settings/applications and click the button "Generate new token"
* Go to https://github.com/settings/applications and click the button "Generate new token"
* Choose any name you want for the token.
* Choose any name you want for the token.
Line 28: Line 28:
* Copy the personal token. It will look something like this: 46cc23de2f02e4t08536803ve705d8241e62e527
* Copy the personal token. It will look something like this: 46cc23de2f02e4t08536803ve705d8241e62e527
* open a terminal
* open a terminal
  git config --global credential.helper "cache --timeout=3600"
  <span style="color:#999900">git</span> config --global credential.helper "cache --timeout=3600"
  git config --global user.name "Your Name"
  <span style="color:#999900">git</span> config --global user.name "Your Name"
  git config --global user.email "<username>@users.noreply.github.com"
  <span style="color:#999900">git</span> config --global user.email "<username>@users.noreply.github.com"
  touch ~/.netrc
  touch ~/.netrc
  chmod 600 ~/.netrc
  chmod 600 ~/.netrc
Line 47: Line 47:
  source ~/.bashrc
  source ~/.bashrc
  mkdir ~/tmwAthena
  mkdir ~/tmwAthena
  cd ~/tmwAthena
  <span style="color:#990099">cd</span> ~/tmwAthena
  <nowiki>git clone --recursive https://github.com/<username>/tmwa.git</nowiki>
  <span style="color:#999900">git</span> clone --recursive <nowiki>https://github.com/<username>/tmwa.git</nowiki>
  <nowiki>git clone --recursive https://github.com/<username>/tmwa-server-data.git</nowiki>
  <span style="color:#999900">git</span> clone --recursive <nowiki>https://github.com/<username>/tmwa-server-data.git</nowiki>


== Setting up the remotes ==
== Setting up the remotes ==
* open a terminal
* open a terminal
  cd ~/tmwAthena/tmwa
  <span style="color:#990099">cd</span> ~/tmwAthena/tmwa
  git remote add upstream <nowiki>git://github.com/themanaworld/tmwa.git</nowiki>
  <span style="color:#999900">git</span> remote add upstream <nowiki>git://github.com/themanaworld/tmwa.git</nowiki>
  git fetch --tags --all
  <span style="color:#999900">git</span> fetch --tags --all
  cd ../tmwa-server-data
  <span style="color:#990099">cd</span> ../tmwa-server-data
  git remote add upstream <nowiki>git://github.com/themanaworld/tmwa-server-data.git</nowiki>
  <span style="color:#999900">git</span> remote add upstream <nowiki>git://github.com/themanaworld/tmwa-server-data.git</nowiki>
  cd tools
  <span style="color:#990099">cd</span> tools
  git remote add upstream <nowiki>git://github.com/themanaworld/tmw-tools.git</nowiki>
  <span style="color:#999900">git</span> remote add upstream <nowiki>git://github.com/themanaworld/tmw-tools.git</nowiki>
  cd ../client-data
  <span style="color:#990099">cd</span> ../client-data
  git remote add upstream <nowiki>git://github.com/themanaworld/tmwa-client-data.git</nowiki>
  <span style="color:#999900">git</span> remote add upstream <nowiki>git://github.com/themanaworld/tmwa-client-data.git</nowiki>


== Copying the local config files ==
== Copying the local config files ==
* open a terminal
* open a terminal
  cd ~/tmwAthena/tmwa-server-data/login/conf
  <span style="color:#990099">cd</span> ~/tmwAthena/tmwa-server-data/login/conf
  cp ladmin_local.conf.example ladmin_local.conf
  <span style="color:#000099">cp</span> ladmin_local.conf.example ladmin_local.conf
  cp login_local.conf.example login_local.conf
  <span style="color:#000099">cp</span> login_local.conf.example login_local.conf
  cd ../../world/conf
  <span style="color:#990099">cd</span> ../../world/conf
  cp char_local.conf.example char_local.conf
  <span style="color:#000099">cp</span> char_local.conf.example char_local.conf
  cd ../map/conf
  <span style="color:#990099">cd</span> ../map/conf
  cp atcommand_local.conf.example atcommand_local.conf
  <span style="color:#000099">cp</span> atcommand_local.conf.example atcommand_local.conf
  cp battle_local.conf.example battle_local.conf
  <span style="color:#000099">cp</span> battle_local.conf.example battle_local.conf
  cp map_local.conf.example map_local.conf
  <span style="color:#000099">cp</span> map_local.conf.example map_local.conf
  cd ../db
  <span style="color:#990099">cd</span> ../db
  cp const-debugflag.txt.example const-debugflag.txt
  <span style="color:#000099">cp</span> const-debugflag.txt.example const-debugflag.txt


== Making an admin account ==
== Making an admin account ==
* open a terminal (and leave it open)
* open a terminal (and leave it open)
  cd ~/tmwAthena/tmwa-server-data
  <span style="color:#990099">cd</span> ~/tmwAthena/tmwa-server-data
  ./run-all
  ./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.
* 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
* while keeping the other terminal open, open a new one
  cd ~/tmwAthena/tmwa-server-data/login
  <span style="color:#990099">cd</span> ~/tmwAthena/tmwa-server-data/login
  tmwa-admin
  tmwa-admin
  add <username> M <password>
  add <username> M <password>

Revision as of 17:39, 22 April 2015

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 gi t 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