mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-30 00:15:47 -04:00
ConnectionServer: add altPublicBindAddress config option
This commit is contained in:
@@ -113,6 +113,8 @@ void ConfigConnectionServer::install(void)
|
||||
KEY_INT (connectionServerNumber, 0);
|
||||
KEY_INT (fakeBuddyPoints, 0);
|
||||
|
||||
KEY_STRING (altPublicBindAddress, "");
|
||||
|
||||
int index = 0;
|
||||
char const * result = 0;
|
||||
do
|
||||
@@ -163,4 +165,11 @@ int ConfigConnectionServer::getFakeBuddyPoints()
|
||||
return data->fakeBuddyPoints;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
const char * ConfigConnectionServer::getPublicBindAddress()
|
||||
{
|
||||
return data->altPublicBindAddress;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
|
||||
int connectionServerNumber;
|
||||
int fakeBuddyPoints;
|
||||
|
||||
const char * altPublicBindAddress;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,6 +135,7 @@ public:
|
||||
static int getConnectionServerNumber();
|
||||
static int getFakeBuddyPoints();
|
||||
|
||||
static const char * getPublicBindAddress();
|
||||
private:
|
||||
static Data * data;
|
||||
};
|
||||
|
||||
@@ -484,7 +484,9 @@ void ConnectionServer::handleConnectionServerIdMessage(const ConnectionServerId
|
||||
uint16 chatPort = 0;
|
||||
uint16 csPort = 0;
|
||||
if (c)
|
||||
{
|
||||
chatPort = c->getBindPort();
|
||||
}
|
||||
|
||||
if (cs)
|
||||
{
|
||||
@@ -493,12 +495,21 @@ void ConnectionServer::handleConnectionServerIdMessage(const ConnectionServerId
|
||||
|
||||
uint16 publicPort = 0;
|
||||
if (servicePublic)
|
||||
{
|
||||
publicPort = servicePublic->getBindPort();
|
||||
}
|
||||
|
||||
uint16 privatePort = 0;
|
||||
if (servicePrivate)
|
||||
{
|
||||
privatePort = servicePrivate->getBindPort();
|
||||
}
|
||||
|
||||
std::string clientServicePublicBindAddress = NetworkHandler::getHostName();
|
||||
std::string clientServicePublicBindAddress = ConfigConnectionServer::getPublicBindAddress();
|
||||
if (clientServicePublicBindAddress.empty())
|
||||
{
|
||||
clientServicePublicBindAddress = NetworkHandler::getHostName();
|
||||
}
|
||||
|
||||
NOT_NULL(gameService);
|
||||
NOT_NULL(chatService);
|
||||
@@ -508,7 +519,9 @@ void ConnectionServer::handleConnectionServerIdMessage(const ConnectionServerId
|
||||
sendToCentralProcess(ncs);
|
||||
}
|
||||
else
|
||||
{
|
||||
FATAL(true, ("Error in connection server startup"));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1566,4 +1579,4 @@ void ConnectionServer::setDone(char const *reasonfmt, ...)
|
||||
}
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
// ======================================================================
|
||||
|
||||
Reference in New Issue
Block a user