From d2361ae056da8caf2c9b42e03a9f17f3fcb10790 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 21 Aug 2014 22:28:06 +0200 Subject: Core/Battle.net: Made battle.net port configurable --- src/server/authserver/Main.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/server/authserver/Main.cpp') diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 5b7ad73a0d0..50205d1d585 100644 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -24,12 +24,6 @@ * authentication server */ -#include -#include -#include -#include -#include -#include #include "AsyncAcceptor.h" #include "AuthSession.h" @@ -43,6 +37,12 @@ #include "RealmList.h" #include "SystemConfig.h" #include "Util.h" +#include +#include +#include +#include +#include +#include using boost::asio::ip::tcp; using namespace boost::program_options; @@ -119,9 +119,17 @@ int main(int argc, char** argv) return 1; } + int32 bnport = sConfigMgr->GetIntDefault("BattlenetPort", 1119); + if (bnport < 0 || bnport > 0xFFFF) + { + TC_LOG_ERROR("server.authserver", "Specified battle.net port (%d) out of allowed range (1-65535)", bnport); + StopDB(); + return 1; + } + std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0"); AsyncAcceptor authServer(_ioService, bindIp, port); - AsyncAcceptor bnetServer(_ioService, bindIp, 1119); + AsyncAcceptor bnetServer(_ioService, bindIp, bnport); // Set signal handlers boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM); -- cgit v1.2.3