2013年9月3日 星期二

Server and clients MultiPlayer ManaWorld Source code

Ref:
https://github.com/mana/manaserv
https://github.com/themanaworld/tmwa
https://github.com/tales/sourceoftales/wiki/How-to-setup-a-local-server

1. Preinstall codeblocks
https://sourceforge.net/projects/codeblocks/files/Binaries/13.12

2. codeblocks->Settings->Environment->General Settings,
uncheck "Allow only one running instance",
uncheck "Use an already running instance", and restart.
For debug 3 projects simultaniously.

3. codeblocks->Settings->->Compiler and Debugger->Debugger Settings,
add "handle SIGTRAP noprint" in [Debugger Initialization Commands].
For reducing a lot of SIGTRAP by ntdll.dll of system.

4. open client mana.cbp in new CodeB. and select target is windows to build

5. open account accountserver.cbp in new CodeB. and select target is windows to build

6. open gameserver.cbp in new CodeB. and select target is windows to build

7. modify manaserv.xml, find "localhost" and change to your ip(my server and client in the same PC)

8. Need create new database then execute sqlite3.exe
download site: https://sourceforge.net/projects/cyqlite/files/3.8.11
extract sqlite3.exe and sqlite3.dll to c:\manasdk\server\src\sql\sqlite
cd c:\manasdk\server\src\sql\sqlite
sqlite3 mana.db < createTables.sql
copy mana.db to c:\manasdk\server

9. execute accountserver.exe gameserver.exe mana.exe

10. when add custom server select server type manaserv then run

///////////////////////////////////Mac Osx port////////////////////////////////////
macport for Xcode 4.6 of Mountain Lion 10.8.2

http://wiki.themanaworld.org/index.php/ ... acOSX_port
http://www.libsdl.org/download-1.2.php
http://www.libsdl.org/projects/SDL_mixe ... e-1.2.html
http://www.libsdl.org/projects/SDL_imag ... e-1.2.html

after install to /Library/Frameworks
then xcode->Preferences -> Downloads and install Command Line Tools

install MacPorts
https://distfiles.macports.org/MacPorts/

then open mac Terminal app, execute follows

sudo port selfupdate
sudo port install libxml2
sudo port install libguichan
sudo port install libsdl_gfx
sudo port install libsdl_net
sudo port install libsdl_ttf
sudo port install physfs
sudo port install libpng
sudo port install freetype
sudo port install libiconv
sudo port install gettext

cmake /Users/[yourname]/[sourcecode]/
make

cp /Users/[yourname]/[clientproject]/src/mana /Users/[yourname]/[clientproject]/
./mana

///////////////////////How to run under Xcode 4 IDE
1. xcode->file->project settings->advanced->custom >> [relative to workspace]

2. add SDL all framework need check copy items into destination

3. preprocessor macros add HAS_SOCKLEN_T MANASERV_SUPPORT=1

4. #include "SDL_mixer.h" change to #include "SDL_mixer/SDL_mixer.h"

5. in main.cpp modify this
#ifndef __MACH__ //add this
if (options.printHelp)
{
printHelp();
return 0;
}
else if (options.printVersion)
{
printVersion();
return 0;
}
#endif //add this

6. c:\mana\client\src\resources\music.cpp
SDL_MIXER_PATCHLEVEL >= 9
to
SDL_MIXER_PATCHLEVEL >= 7

7. press Run button to execute mana successfully

8. or copy mana.app to /Users/[yourname]/[clientproject]/ to run

///////////////////////////////Build on Ubuntu 14.04////////////////////
1.
sudo apt-get install build-essential libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl1.2-dev libsdl-gfx1.2-dev
sudo apt-get install libphysfs-dev zlib1g-dev libxml2-dev libcurl4-gnutls-dev libguichan-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev

2.
sudo cd $home/manasouce
sudo mkdir build
sudo cd $home/manasouce/build
sudo cmake $home/manasouce

3.
sudo cmake-gui CMakeCache.txt
CMAKE_INSTALL_PREFIX -> /opt/manaworld    //I prefer this directory
EBANLE_MANASERV           -> checked                  //(enable it)

click [Configure] button
click [Generte] button
exit cmake-gui

4.
sudo make
sudo make install

5.
Demo photo:
https://drive.google.com/open?id=0B1vVsmc52ncoRGd5Y2pfR25OVEk
/////////////build on Ubuntu 14.04 end///////////

Source download:
a. manaworld source:
http://www.mediafire.com/file/5b4au37045yod3j/manasdk2010.tar.gz
b. [Source of Tales] on mana sdk
http://www.mediafire.com/download/ug9zc01716k46un/SourceofTalessdk2014.zip
http://www.mediafire.com/file/2t1kga2a4kkzb5x/sourcetales2017.rar

沒有留言:

張貼留言