diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp index ec59cdf1..7e0ea1cd 100644 --- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp +++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp @@ -979,39 +979,37 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons GameServerConnection *g = const_cast(safe_cast(&source)); - FATAL(ConfigCentralServer::getValidateBuildVersionNumber() && strcmp(ApplicationVersion::getInternalVersion(), c.getBuildVersionNumber().c_str()), - ("Build version number mismatch: central server (%s), remote server %s (%s)", ApplicationVersion::getInternalVersion(), g->getRemoteAddress().c_str(), c.getBuildVersionNumber().c_str()) - ); + if (g != nullptr) { - // a game server (or db process) has connected... - addGameServer(g); + FATAL(ConfigCentralServer::getValidateBuildVersionNumber() && strcmp(ApplicationVersion::getInternalVersion(), c.getBuildVersionNumber().c_str()), + ("Build version number mismatch: central server (%s), remote server %s (%s)", + ApplicationVersion::getInternalVersion(), g->getRemoteAddress().c_str(), c.getBuildVersionNumber().c_str())); - //Send connection server data - ConnectionServerConnectionList::iterator i = m_connectionServerConnections.begin(); - for(; i != m_connectionServerConnections.end(); ++i) - { - if ((*i)->getGameServicePort() != 0) + // a game server (or db process) has connected... + addGameServer(g); + + //Send connection server data + ConnectionServerConnectionList::iterator i = m_connectionServerConnections.begin(); + for (; i != m_connectionServerConnections.end(); ++i) { - ConnectionServerAddress csa((*i)->getGameServiceAddress(), (*i)->getGameServicePort()); - g->send(csa, true); + if ((*i)->getGameServicePort() != 0) + { + ConnectionServerAddress csa((*i)->getGameServiceAddress(), (*i)->getGameServicePort()); + g->send(csa, true); + } } - } - std::set::const_iterator chatIter; - for(chatIter = m_chatServerConnections.begin(); chatIter != m_chatServerConnections.end(); ++chatIter) - { - if((*chatIter)->getGameServicePort()) + std::set::const_iterator chatIter; + for (chatIter = m_chatServerConnections.begin(); chatIter != m_chatServerConnections.end(); ++chatIter) { - ChatServerOnline cso((*chatIter)->getRemoteAddress(), (*chatIter)->getGameServicePort()); - g->send(cso, true); + if ((*chatIter)->getGameServicePort()) + { + ChatServerOnline cso((*chatIter)->getRemoteAddress(), (*chatIter)->getGameServicePort()); + g->send(cso, true); + } } - } - if (g != NULL) - { - //DEBUG_REPORT_LOG(true, ("CentralServer: Sending CustomerServiceServerGameServerServiceAddress to game server (%s:%d) pid(%i)\n", g->getRemoteAddress().c_str(), g->getRemotePort(), g->getProcessId())); const GenericValueTypeMessage > address("CustomerServiceServerGameServerServiceAddress", std::make_pair(s_customerServiceServerGameServerServiceAddress.first, s_customerServiceServerGameServerServiceAddress.second)); - g->send(address, true); } } diff --git a/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp b/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp index 6d486c33..3ba14e6b 100644 --- a/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp +++ b/external/3rd/library/soePlatform/CSAssist/projects/CSAssist/CSAssistgameapi/CSAssistgameapicore.cpp @@ -113,7 +113,12 @@ CSAssistGameAPIcore::CSAssistGameAPIcore(CSAssistGameAPI *api, const char *serve /////////////////////////////////////////// // populate server list - int size = ::strlen(serverList); + int size = 0; + + if (serverList != nullptr) { + size = ::strlen(serverList); + } + if (!serverList || (size <= 0)) { fprintf(stderr, "CSASsistGameAPIcore()::serverList==NULL! aborting...\n"); @@ -151,10 +156,10 @@ CSAssistGameAPIcore::CSAssistGameAPIcore(CSAssistGameAPI *api, const char *serve m_serverList.push_back(sid); } //fprintf(stderr, "res=%d, p=%s, host=%s, port=%d, size=%d\n", res, p, host, port, m_serverList.size()); - delete p; + delete [] p; } delete host; - delete buf; + delete [] buf; m_curServer = m_serverList.begin(); GetLBHost(); // diff --git a/external/3rd/library/soePlatform/CTServiceGameAPI/CTGenericAPI/GenericApiCore.cpp b/external/3rd/library/soePlatform/CTServiceGameAPI/CTGenericAPI/GenericApiCore.cpp index 6c412225..1756235a 100644 --- a/external/3rd/library/soePlatform/CTServiceGameAPI/CTGenericAPI/GenericApiCore.cpp +++ b/external/3rd/library/soePlatform/CTServiceGameAPI/CTGenericAPI/GenericApiCore.cpp @@ -97,8 +97,6 @@ GenericAPICore::~GenericAPICore() delete (*iter).second; } - m_pending.empty(); - while(m_outCount > 0) { delete m_outboundQueue.front().second;