Compile ArenaServer from the source code
Hello everyone! I hope this tut will help you easy to compile the ArenaServer from the MainServer source.
I will take this source code: http://forum.ragezone.com/f613/sourc...-4-3-a-1107099
as an example.
1. DB for ArenaServer:
You need copy db atum2_db_1 and restore as atum2_db_arena (2 databases are the same)
http://i77.photobucket.com/albums/j7...psy0qjnjhs.png
2. Build Arena Bin:
Goto folder ProjectsServer\GameServer in the source, copy and rename:
- IMServer -> AIMServer
- LogServer -> ALogServer
- NPCServer -> ANPCServer
- FieldServer -> ArenaServer
Goto AIMServer folder, rename IMServer.vcxproj to AIMServer.vcxproj
in ALogServer folder, rename LogServer.vcxproj to ALogServer.vcxproj
in ANPCServer folder, rename NPCServer.vcxproj to ANPCServer.vcxproj
in ArenaServer folder, rename FieldServer.vcxproj to ArenaServer.vcxproj
Backto GameServer folder, open GameServer.sln with Microsoft Visual C++ 2013, right click on Solution > select Add > Existing Project...
http://i77.photobucket.com/albums/j7...psefafcuib.png
And select AIMServer.vcxproj, do repeat with ALogServer.vcxproj, ANPCServer.vcxproj and ArenaServer.vcxproj
http://i77.photobucket.com/albums/j7...psfofw8jxi.png
- Open Contents.h in ProjectsServer\GameServer\CommonGameServer, add code
- Right click on AIMServer, ALogServer, ANPCServer, ArenaServer > select Build Selection (Solutions Configurations R_WikiGames_Eng)
http://i77.photobucket.com/albums/j7...psd5eowiiq.png
Waiting for build start, after build complete, you can see bin file in BuildResult folder
rename IMServer.exe to IMServer.exe
- LogServer.exe to ALogServer.exe
- NPCServer.exe to ANPCServer.exe
- FieldServer.exe to ArenaServer.exe
Copy its to yourServer/Bin
3. Config:
a, Global config: open GlobalGameServer.h in ProjectsServer\GameServer\CommonGameServer, you can see global config file path:
- Create ArenaGlobal.cfg in yourServer/config (same global.cfg), put IP, server name and set
Code:
$ARENA_SERVER_FLAG=TRUE
like this:
b, Map config: open NPCIOCP.cpp in ProjectsServer\GameServer\ANPCServer\Main to see Arena map config file path:
- Crete ArenaMap.cfg in yourServer/config to load arena map, like this:
Code:
### CAUTION: Refer to "global.cfg"! ###
################################################################################
# User Defined Variables
################################################################################
################################################################################
ServerGroupDefaultMap $SERVER_GROUP_DEFAULT_MAP
######################################################################################################################
2001 1 FALSE $FIELD_SERVER_IP $FIELD_SERVER_PORT 6021 $NPC_SERVER_IP $NPC_SERVER_PORT 6026 256 256 FALSE
2002 1 FALSE $FIELD_SERVER_IP $FIELD_SERVER_PORT 6031 $NPC_SERVER_IP $NPC_SERVER_PORT 6036 256 256 FALSE
9101 30 TRUE $FIELD_SERVER_IP $FIELD_SERVER_PORT 7870 $NPC_SERVER_IP $NPC_SERVER_PORT 7875 256 256 TRUE
9102 30 TRUE $FIELD_SERVER_IP $FIELD_SERVER_PORT 7872 $NPC_SERVER_IP $NPC_SERVER_PORT 7873 256 256 TRUE
9200 30 TRUE $FIELD_SERVER_IP $FIELD_SERVER_PORT 7880 $NPC_SERVER_IP $NPC_SERVER_PORT 7885 256 256 TRUE
9201 30 TRUE $FIELD_SERVER_IP $FIELD_SERVER_PORT 7890 $NPC_SERVER_IP $NPC_SERVER_PORT 7895 256 256 TRUE
9202 30 TRUE $FIELD_SERVER_IP $FIELD_SERVER_PORT 7900 $NPC_SERVER_IP $NPC_SERVER_PORT 7905 256 256 TRUE
- Done, run both MainServer and ArenaServer, check SystemLog to know ArenaServer load ok:
ArenaFieldSystem log:
Code:
08-13 11:14:22| [Notify] Open all UDP Socket for NPCServer!! Count( 7)
08-13 11:14:24|Socket Connect SocketIndex[201] PeerIP[ 192.168.1.100] Port[49740]
08-13 11:14:24| [Notify] ArenaServer, MainFieldServer is registered. MFSID(10061) MFSName( ROFL) MFSIP(192.168.1.100) PeerSocketIP(192.168.1.100)
08-13 11:14:27| [Notify] UDP Socket ready for NPC Server!! MapIndex(2001) SockIdx( 0)
08-13 11:14:27| [Notify] UDP Socket ready for NPC Server!! MapIndex(2002) SockIdx( 1)
08-13 11:14:27| [Notify] UDP Socket ready for NPC Server!! MapIndex(9101) SockIdx( 2)
08-13 11:14:28| [Notify] UDP Socket ready for NPC Server!! MapIndex(9102) SockIdx( 3)
08-13 11:14:28| [Notify] UDP Socket ready for NPC Server!! MapIndex(9200) SockIdx( 4)
08-13 11:14:28| [Notify] UDP Socket ready for NPC Server!! MapIndex(9201) SockIdx( 5)
08-13 11:14:28| [Notify] UDP Socket ready for NPC Server!! MapIndex(9202) SockIdx( 6)
Good luck! ;)
Some files in the tut: https://mega.nz/#!hJhSxD6L!TjL0aezbH...VQq_f7H9Sr_6Sc
Re: Compile ArenaServer from the source code
Nice tutorial, it's good to see that you are back ;)
But you don't need necessarily copy the projects, just add a arena config for them
Re: Compile ArenaServer from the source code
Cute, but seems like an unnecessary hassle.
You're better off just adding a custom build step and just making a copy of the executable under a different name.
At the target location, just move it in it's own folder with configs and the like, shouldn't cause too much of an issue if at all.
(If the server is in \path\server\bin, you can simply move it to \path\arenaserver\bin)
Re: Compile ArenaServer from the source code
Great efforts put into this tutorial!
However I also agree with @DragonLord. Copying the projects just for the definition seem an unnecessary hassle. And it comes with further problems.
What if you change one of the project source files? Like, add new feature functionality to the Sockets? You'd have to do everything twice, as you have the same projects twice but with a different ARENA flag.
I'd suggest making a new configuration for Field, IM, Log, NPC server that defines the preprocessor definition "ARENA" instead.
http://i35.servimg.com/u/f35/14/11/12/87/arenac10.png
Then you can customize your build steps like Dragon mentioned to get the other config built together with the normal one if you need to.
Re: Compile ArenaServer from the source code
That my guide are redundant, thanks for your feedback. :)
Re: Compile ArenaServer from the source code
Not redundant, no.
You've simply learned a better method :)
Learn something new every day.
Re: Compile ArenaServer from the source code
Or rather execute the cl.exe by a post build event, but in that case you'll recompile the arena server each time you compile the main server.
Re: Compile ArenaServer from the source code
Quote:
Originally Posted by
Aesir
Or rather execute the cl.exe by a post build event, but in that case you'll recompile the arena server each time you compile the main server.
... There's no difference between the arena and normal servers executables.
Your reply has been pointless, I'm afraid.
Re: Compile ArenaServer from the source code
in last source what was relase al you ned its to change only the config on build and all wil be ok all god
Re: Compile ArenaServer from the source code
Quote:
Originally Posted by
DragonLord
... There's no difference between the arena and normal servers executables.
Your reply has been pointless, I'm afraid.
As long as ttlove in this tutorial used a preprocessor defined macro for build arena bins, i would say that rather the build process is slightly different.
Thats why i would use a post build event ;)