diff --git a/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.cpp b/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.cpp index f98eee21..3166c33a 100755 --- a/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.cpp +++ b/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.cpp @@ -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; +} + // ====================================================================== diff --git a/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.h b/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.h index 46f67d1e..a2ed16c5 100755 --- a/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.h +++ b/engine/server/application/ConnectionServer/src/shared/ConfigConnectionServer.h @@ -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; }; diff --git a/engine/server/application/ConnectionServer/src/shared/ConnectionServer.cpp b/engine/server/application/ConnectionServer/src/shared/ConnectionServer.cpp index 2fabbf21..a4f9b5c0 100755 --- a/engine/server/application/ConnectionServer/src/shared/ConnectionServer.cpp +++ b/engine/server/application/ConnectionServer/src/shared/ConnectionServer.cpp @@ -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, ...) } } -// ====================================================================== \ No newline at end of file +// ====================================================================== diff --git a/engine/server/application/LoginServer/src/shared/TaskGetClusterList.cpp b/engine/server/application/LoginServer/src/shared/TaskGetClusterList.cpp index 23919142..76c98469 100755 --- a/engine/server/application/LoginServer/src/shared/TaskGetClusterList.cpp +++ b/engine/server/application/LoginServer/src/shared/TaskGetClusterList.cpp @@ -38,13 +38,26 @@ bool TaskGetClusterList::process(DB::Session *session) while ((rowsFetched = qry.fetch()) > 0) { + qry.altAddress.getValue(temp.m_address); + + if (temp.m_address.empty()) + { + qry.address.getValue(temp.m_address); + } + + DEBUG_WARNING(true, ("Customer facing cluster address is %s", temp.m_address.c_str())); + + if (qry.port.isNull()) + { + temp.m_port = ConfigLoginServer::getCentralServicePort(); + } + else + { + temp.m_port = static_cast(qry.port.getValue()); + } + qry.cluster_id.getValue(temp.m_clusterId); qry.cluster_name.getValue(temp.m_clusterName); - qry.address.getValue(temp.m_address); - if (qry.port.isNull()) - temp.m_port = ConfigLoginServer::getCentralServicePort(); - else - temp.m_port = static_cast(qry.port.getValue()); qry.secret.getValue(temp.m_secret); qry.locked.getValue(temp.m_locked); qry.not_recommended.getValue(temp.m_notRecommended); @@ -75,7 +88,7 @@ void TaskGetClusterList::onComplete() void TaskGetClusterList::GetClustersQuery::getSQL(std::string &sql) { sql=std::string("begin :result := ")+DatabaseConnection::getInstance().getSchemaQualifier()+"login.get_cluster_list(:group_id); end;"; - // DEBUG_REPORT_LOG(true, ("TaskGetClusterList SQL: %s\n", sql.c_str())); + DEBUG_REPORT_LOG(true, ("TaskGetClusterList SQL: %s\n", sql.c_str())); } @@ -94,6 +107,7 @@ bool TaskGetClusterList::GetClustersQuery::bindColumns() if (!bindCol(cluster_id)) return false; if (!bindCol(cluster_name)) return false; if (!bindCol(address)) return false; + if (!bindCol(altAddress)) return false; if (!bindCol(port)) return false; if (!bindCol(secret)) return false; if (!bindCol(locked)) return false; @@ -122,6 +136,7 @@ TaskGetClusterList::GetClustersQuery::GetClustersQuery() : cluster_id(), cluster_name(), address(), + altAddress(), port(), secret(), locked(), diff --git a/engine/server/application/LoginServer/src/shared/TaskGetClusterList.h b/engine/server/application/LoginServer/src/shared/TaskGetClusterList.h index 534c95f1..e57d223c 100755 --- a/engine/server/application/LoginServer/src/shared/TaskGetClusterList.h +++ b/engine/server/application/LoginServer/src/shared/TaskGetClusterList.h @@ -36,6 +36,7 @@ class TaskGetClusterList : public DB::TaskRequest DB::BindableLong cluster_id; //lint !e1925 // public data member DB::BindableString<255> cluster_name; //lint !e1925 // public data member DB::BindableString<255> address; //lint !e1925 // public data member + DB::BindableString<255> altAddress; //lint !e1925 // public data member DB::BindableLong port; //lint !e1925 // public data member DB::BindableBool secret; //lint !e1925 // public data member DB::BindableBool locked; //lint !e1925 // public data member @@ -63,6 +64,7 @@ class TaskGetClusterList : public DB::TaskRequest uint32 m_clusterId; std::string m_clusterName; std::string m_address; + std::string m_altAddress; uint16 m_port; bool m_secret; bool m_locked; diff --git a/game/server/database/login_packages/login.plsql b/game/server/database/login_packages/login.plsql index 02695492..e74f1b64 100644 --- a/game/server/database/login_packages/login.plsql +++ b/game/server/database/login_packages/login.plsql @@ -32,7 +32,7 @@ as from default_char_limits; open result_cursor for - select id, name, address, port, secret, locked, not_recommended, maxCharacterPerAccount, + select id, name, address, altAddress, port, secret, locked, not_recommended, maxCharacterPerAccount, online_player_limit,online_free_trial_limit,free_trial_can_create_char,online_tutorial_limit from cluster_list where group_id = p_group; diff --git a/game/server/database/login_schema/cluster_list.tab b/game/server/database/login_schema/cluster_list.tab index 121bcdb8..cabf6c10 100644 --- a/game/server/database/login_schema/cluster_list.tab +++ b/game/server/database/login_schema/cluster_list.tab @@ -4,6 +4,7 @@ create table cluster_list --NO_IMPORT name varchar2(255), num_characters number, address varchar2(255), + altAddress varchar2(255), port number default 44463, secret char(1), locked char(1), diff --git a/game/server/database/updates/79.sql b/game/server/database/updates/79.sql index 68c16670..1868f13b 100644 --- a/game/server/database/updates/79.sql +++ b/game/server/database/updates/79.sql @@ -1,4 +1,5 @@ alter table cluster_list add address varchar2(255); +alter table cluster_list add altAddress varchar2(255); alter table cluster_list add port number; alter table cluster_list add secret char(1); update cluster_list set secret='N';