aboutsummaryrefslogtreecommitdiff
path: root/src/server/bnetserver/Main.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-10-17 22:48:06 +0200
committerShauren <shauren.trinity@gmail.com>2014-10-17 22:48:06 +0200
commitf773a9e05340d4de7dd16d0e375a12611c3995b6 (patch)
tree37ff1c708f636216d618cd0e7bf51ec140582ac0 /src/server/bnetserver/Main.cpp
parent40cff79b253869ce16f4e6870380a1b63dcbe664 (diff)
Core: Implemented IPC (Inter-process communication) between worldserver and bnetserver using ZeroMQ library.
* Implemented ToonReady and ToonLoggedOut battle.net packets
Diffstat (limited to 'src/server/bnetserver/Main.cpp')
-rw-r--r--src/server/bnetserver/Main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/server/bnetserver/Main.cpp b/src/server/bnetserver/Main.cpp
index ff891304bd3..ce90019c011 100644
--- a/src/server/bnetserver/Main.cpp
+++ b/src/server/bnetserver/Main.cpp
@@ -35,6 +35,7 @@
#include "RealmList.h"
#include "SystemConfig.h"
#include "Util.h"
+#include "ZmqContext.h"
#include <cstdlib>
#include <iostream>
#include <boost/date_time/posix_time/posix_time.hpp>
@@ -94,12 +95,21 @@ int main(int argc, char** argv)
}
}
+ int32 worldListenPort = sConfigMgr->GetIntDefault("WorldserverListenPort", 1118);
+ if (worldListenPort < 0 || worldListenPort > 0xFFFF)
+ {
+ TC_LOG_ERROR("server.bnetserver", "Specified worldserver listen port (%d) out of allowed range (1-65535)", worldListenPort);
+ return 1;
+ }
+
// Initialize the database connection
if (!StartDB())
return 1;
+ sIpcContext->Initialize();
+
// Get the list of realms for the server
- sRealmList->Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 10));
+ sRealmList->Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 10), worldListenPort);
// Start the listening port (acceptor) for auth connections
int32 bnport = sConfigMgr->GetIntDefault("BattlenetPort", 1119);
@@ -135,6 +145,10 @@ int main(int argc, char** argv)
// Start the io service worker loop
_ioService.run();
+ sIpcContext->Close();
+
+ sRealmList->Close();
+
// Close the Database Pool and library
StopDB();