diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-08-21 22:28:06 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-08-21 22:28:06 +0200 |
commit | d2361ae056da8caf2c9b42e03a9f17f3fcb10790 (patch) | |
tree | b2df95ed217c6a5efc150fdfd8811bf70e723e5d /src | |
parent | acfbb612045ec4cbddb5c13aa15518b2e9612af0 (diff) |
Core/Battle.net: Made battle.net port configurable
Diffstat (limited to 'src')
-rw-r--r-- | src/server/authserver/Main.cpp | 22 | ||||
-rw-r--r-- | src/server/authserver/authserver.conf.dist | 7 |
2 files changed, 22 insertions, 7 deletions
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 <cstdlib> -#include <boost/date_time/posix_time/posix_time.hpp> -#include <boost/program_options.hpp> -#include <iostream> -#include <openssl/opensslv.h> -#include <openssl/crypto.h> #include "AsyncAcceptor.h" #include "AuthSession.h" @@ -43,6 +37,12 @@ #include "RealmList.h" #include "SystemConfig.h" #include "Util.h" +#include <cstdlib> +#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/program_options.hpp> +#include <iostream> +#include <openssl/opensslv.h> +#include <openssl/crypto.h> 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<AuthSession> authServer(_ioService, bindIp, port); - AsyncAcceptor<Battlenet::Session> bnetServer(_ioService, bindIp, 1119); + AsyncAcceptor<Battlenet::Session> bnetServer(_ioService, bindIp, bnport); // Set signal handlers boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM); diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index b7dee9ac08b..e0ef6982353 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -54,6 +54,13 @@ MaxPingTime = 30 RealmServerPort = 3724 # +# BattlenetPort +# Description: TCP port to reach the auth server for battle.net connections. +# Default: 1119 + +BattlenetPort = 1119 + +# # # BindIP # Description: Bind auth server to IP/hostname |