Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Compile ArenaServer from the source code

Junior Spellweaver
Joined
Dec 3, 2012
Messages
162
Reaction score
130
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/source-code-ao-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)

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums


2. Build Arena Bin:
Goto folder ProjectsServer\GameServer in the source, copy and rename:
- IMServer -> AIMServer
- LogServer -> ALogServer
- NPCServer -> ANPCServer
- FieldServer -> ArenaServer

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

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

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

Backto GameServer folder, open GameServer.sln with Microsoft Visual C++ 2013, right click on Solution > select Add > Existing Project...

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums


And select AIMServer.vcxproj, do repeat with ALogServer.vcxproj, ANPCServer.vcxproj and ArenaServer.vcxproj

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums


- Open Contents.h in ProjectsServer\GameServer\CommonGameServer, add code
Code:
#define ARENA

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

- Right click on AIMServer, ALogServer, ANPCServer, ArenaServer > select Build Selection (Solutions Configurations R_WikiGames_Eng)

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums


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

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

3. Config:
a, Global config: open GlobalGameServer.h in ProjectsServer\GameServer\CommonGameServer, you can see global config file path:

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

- Create ArenaGlobal.cfg in yourServer/config (same global.cfg), put IP, server name and set
Code:
$ARENA_SERVER_FLAG=TRUE

like this:

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

b, Map config: open NPCIOCP.cpp in ProjectsServer\GameServer\ANPCServer\Main to see Arena map config file path:

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

- 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:

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums

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]
[COLOR="#FF0000"]08-13 11:14:24|  [Notify] ArenaServer, MainFieldServer is registered. MFSID(10061) MFSName(                ROFL) MFSIP(192.168.1.100) PeerSocketIP(192.168.1.100) [/COLOR]
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:
 
Last edited:
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
483
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)
 
[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
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.

ttlove9 - Compile ArenaServer from the source code - RaGEZONE Forums


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.
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
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.
 
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
483
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.
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
... 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 ;)
 
Back
Top