Core: Implemented IPC (Inter-process communication) between worldserver and bnetserver using ZeroMQ library.

* Implemented ToonReady and ToonLoggedOut battle.net packets
This commit is contained in:
Shauren
2014-10-17 22:48:06 +02:00
parent 40cff79b25
commit f773a9e053
72 changed files with 4922 additions and 68 deletions

View File

@@ -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();