fix more warnings

This commit is contained in:
DarthArgus
2014-10-27 18:59:37 -07:00
parent 9e6f200300
commit 7b6271b48d
26 changed files with 71 additions and 170 deletions
@@ -1177,7 +1177,6 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons
else if(message.isType("DatabaseConsoleReplyMessage"))
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
GenericValueTypeMessage<std::pair<std::string, std::string> > msg(ri);
IGNORE_RETURN(sendToRandomGameServer(msg));
@@ -2657,7 +2656,6 @@ void CentralServer::run(void)
setup.port = ConfigCentralServer::getConnectionServicePort();
setup.bindInterface = ConfigCentralServer::getConnectionServiceBindInterface();
Service * cons = new Service(ConnectionAllocator<ConnectionServerConnection>(), setup);
NOT_NULL(cons);
cserver.m_connService = cons;
setup.port = ConfigCentralServer::getConsoleServicePort();
@@ -2743,7 +2741,7 @@ void CentralServer::run(void)
Os::sleep(1);
}
} while (!barrierReached && !cserver.m_done);
} while (!cserver.m_done);
//@todo Central needs to run a clock so we can schedule re-tries with the login server.
{
@@ -2881,7 +2881,7 @@ void ChatInterface::OnReceivePersistentMessage(const ChatAvatar *destAvatar, con
DEBUG_WARNING(true, ("We received an OnREceivePersistentMessage with a success result code but NULL data. This is an error that the API should never give."));
return;
}
if (!destAvatar || !header)
if (!header)
{
return;
}
@@ -3020,10 +3020,6 @@ void ChatInterface::OnReceiveInstantMessage(const ChatAvatar *srcAvatar, const C
DEBUG_WARNING(true, ("We received an OnReceiveInstantMessage with a success result code but NULL data. This is an error that the API should never give."));
return;
}
if (!srcAvatar || !destAvatar)
{
return;
}
ChatAvatarId fromId;
makeAvatarId(*srcAvatar, fromId);
ChatAvatarId toId;
@@ -477,24 +477,17 @@ void ChatServer::onEnumerateServers(const EnumerateServers & e)
ConnectionServerConnection * c = new ConnectionServerConnection(e.getAddress(), e.getPort());
if (c != NULL)
if ( !e.getAddress().empty()
&& (e.getPort() != 0))
{
if ( !e.getAddress().empty()
&& (e.getPort() != 0))
{
ChatServer::fileLog(true, "ChatServer", "onEnumerateServers() count(%d) address(%s)", count, getConnectionAddress(c).c_str());
ChatServer::fileLog(true, "ChatServer", "onEnumerateServers() count(%d) address(%s)", count, getConnectionAddress(c).c_str());
IGNORE_RETURN(connectionServerConnections.insert(c));
s_chatServerMetricsData->setConnectionServerConnectionCount(instance().connectionServerConnections.size());
}
else
{
ChatServer::fileLog(true, "ChatServer", "onEnumerateServers() count(%d) Empty server address", count);
}
IGNORE_RETURN(connectionServerConnections.insert(c));
s_chatServerMetricsData->setConnectionServerConnectionCount(instance().connectionServerConnections.size());
}
else
{
ChatServer::fileLog(true, "ChatServer", "onEnumerateServers() count(%d) NULL connection", count);
ChatServer::fileLog(true, "ChatServer", "onEnumerateServers() count(%d) Empty server address", count);
}
}//lint !e429 Custodial pointer 'c' (line 232) has not been freed or returned //jrandall tracked by connectionServerConnections
break;
@@ -1006,7 +1006,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
else
{
//Forward on to Game Server
DEBUG_REPORT_LOG((!m_client || !m_client->getGameConnection()), ("Warn, received game message with no game connection. This may happen for a short time after a GameServer crashes. If it continues to happen, it indicates a bug.\n"));
DEBUG_REPORT_LOG(!m_client || !m_client->getGameConnection()), ("Warn, received game message with no game connection. This may happen for a short time after a GameServer crashes. If it continues to happen, it indicates a bug.\n");
if (m_client && m_client->getGameConnection())
{
@@ -198,7 +198,6 @@ bool ConnectionServer::decryptToken(const KeyShare::Token & token, uint32 & stat
uint32 len = sizeof(uint32) + sizeof(bool) + MAX_ACCOUNT_NAME_LENGTH + 1;
unsigned char * keyBuffer = new unsigned char[len];
unsigned char * keyBufferPointer = keyBuffer;
NOT_NULL(keyBuffer);
memset(keyBuffer, 0, len);
@@ -228,7 +227,6 @@ bool ConnectionServer::decryptToken(const KeyShare::Token & token, char* session
uint32 len = apiSessionIdWidth + sizeof(StationId);
unsigned char * keyBuffer = new unsigned char[len + 1];
unsigned char * keyBufferPointer = keyBuffer;
NOT_NULL(keyBuffer);
memset(keyBuffer, 0, sizeof(*keyBuffer));
@@ -237,7 +235,7 @@ bool ConnectionServer::decryptToken(const KeyShare::Token & token, char* session
if (! retval)
return retval;
memcpy(sessionKey, keyBufferPointer, apiSessionIdWidth);
memcpy(sessionKey, keyBufferPointer, sizeof(*keyBuffer));
keyBufferPointer += apiSessionIdWidth;
memcpy(&stationId, keyBufferPointer, sizeof(StationId));
delete [] keyBuffer;
@@ -912,7 +910,6 @@ void ConnectionServer::receiveMessage(const MessageDispatch::Emitter & source, c
else if (message.isType("ExcommunicateGameServerMessage"))
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ExcommunicateGameServerMessage msg(ri);
LOG("GameGameConnect",("Told to drop connection to %lu by Central",msg.getServerId()));
@@ -1040,7 +1037,7 @@ void ConnectionServer::run(void)
Os::sleep(1);
}
} while (!barrierReached && !cserver.done);
} while (!cserver.done);
NetworkHandler::clearBytesThisFrame();
@@ -1418,7 +1415,6 @@ void ConnectionServer::installSessionValidation()
void ConnectionServer::addToClientMap(const NetworkId &oid, ClientConnection* cconn)
{
Client * newClient = new Client(cconn, oid);
NOT_NULL(newClient);
clientMap[oid] = newClient;
@@ -1171,19 +1171,17 @@ void LoginServer::run(void)
}
NetworkHandler::clearBytesThisFrame();
if(mon)
mon->set(WORLD_COUNT_CHANNEL, static_cast<int>(getInstance().m_clientMap.size()));
int count = 0;
ClusterListType::const_iterator i;
for(i = getInstance().m_clusterList.begin(); i != getInstance().m_clusterList.end(); ++i)
{
mon->set(WORLD_COUNT_CHANNEL, static_cast<int>(getInstance().m_clientMap.size()));
int count = 0;
ClusterListType::const_iterator i;
for(i = getInstance().m_clusterList.begin(); i != getInstance().m_clusterList.end(); ++i)
{
if((*i)->m_connected)
++count;
}
mon->set(CLUSTER_COUNT_CHANNEL, count);
mon->Update();
if((*i)->m_connected)
++count;
}
mon->set(CLUSTER_COUNT_CHANNEL, count);
mon->Update();
}
NetworkHandler::update();
@@ -1373,7 +1371,6 @@ void LoginServer::onValidateClient(StationId suid, const std::string & username,
size_t len = sizeof(uint32) + sizeof(bool) + MAX_ACCOUNT_NAME_LENGTH + 1;
unsigned char * keyBuffer = new unsigned char[len];
unsigned char * keyBufferPointer = keyBuffer;
NOT_NULL(keyBuffer);
IGNORE_RETURN(memset(keyBuffer, 0, len));
@@ -703,7 +703,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
else if (message.isType("ExcommunicateGameServerMessage"))
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ExcommunicateGameServerMessage msg(ri);
LOG("GameGameConnect",("Planet Server %s was told to drop connection to %lu by Central",Scene::getInstance().getSceneId().c_str(),msg.getServerId()));
@@ -715,7 +714,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
else if (message.isType("FactionalSystemMessage"))
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
FactionalSystemMessage msg(ri);
// forward message to all game servers on this planet for processing
@@ -725,7 +723,6 @@ void PlanetServer::receiveMessage(const MessageDispatch::Emitter & source, const
else if (message.isType("MessageToPlayersOnPlanet"))
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
GenericValueTypeMessage<std::pair<std::pair<std::pair<std::string, std::vector<int8> >, std::pair<float, bool> >, std::pair<Vector, float> > > const msg(ri);
// forward message to all game servers on this planet for processing