and more performance tweaks

This commit is contained in:
DarthArgus
2014-10-27 21:28:46 -07:00
parent 7bcd3cb5bc
commit 7254d00e3c
25 changed files with 82 additions and 82 deletions
@@ -1299,7 +1299,7 @@ void ChatServer::destroyRoom(const std::string & roomName)
if (pos != roomName.npos)
{
std::string tmpRoomName = roomName.substr(0, pos);
char lastChar = tmpRoomName[strlen(tmpRoomName.c_str()) - 1];
char lastChar = tmpRoomName[tmpRoomName.length() - 1];
if (lastChar >= '0' && lastChar <= '9')
{
ChatServer::destroyRoom(tmpRoomName);
@@ -146,9 +146,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
// deliver IM to character
ChatInstantMessageToCharacter chat(cri);
ChatAvatarId characterName = chat.getCharacterName();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatAvatarId fromName;
@@ -185,9 +185,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
// deliver IM to character
ChatInstantMessageToCharacter chat(cri);
ChatAvatarId characterName = chat.getCharacterName();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::sendInstantMessage(*i, chat.getSequence(), characterName, chat.getMessage(), chat.getOutOfBand());
@@ -205,9 +205,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatPersistentMessageToServer\n");
ChatPersistentMessageToServer chat(cri);
ChatAvatarId characterName = chat.getToCharacterName();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::sendPersistentMessage((*i), chat.getSequence(), characterName, chat.getSubject(), chat.getMessage(), chat.getOutOfBand());
@@ -283,9 +283,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatREmoveModeratorFromRoom\n");
ChatRemoveModeratorFromRoom chat(cri);
ChatAvatarId characterName = chat.getAvatarId();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::removeModeratorFromRoom(chat.getSequenceId(), (*i), characterName, chat.getRoomName());
}
@@ -316,9 +316,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatInviteAvatarToRoom\n");
ChatInviteAvatarToRoom chat(cri);
ChatAvatarId characterName = chat.getAvatarId();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::invite((*i), characterName, chat.getRoomName());
}
@@ -328,9 +328,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatUninviteAvatarToRoom\n");
ChatUninviteFromRoom chat(cri);
ChatAvatarId characterName = chat.getAvatar();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::uninvite((*i), chat.getSequence(), characterName, chat.getRoomName());
}
@@ -340,9 +340,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatBanAvatarFromRoom\n");
ChatBanAvatarFromRoom chat(cri);
ChatAvatarId characterName = chat.getAvatarId();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::banFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName());
}
@@ -352,9 +352,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
//printf("ConnectionServerConnection -- ChatUnbanAvatarFromRoom\n");
ChatUnbanAvatarFromRoom chat(cri);
ChatAvatarId characterName = chat.getAvatarId();
if(characterName.gameCode == "")
if(characterName.gameCode.empty())
characterName.gameCode = "SWG";
if(characterName.cluster == "")
if(characterName.cluster.empty())
characterName.cluster = ConfigChatServer::getClusterName();
ChatServer::unbanFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName());
}
@@ -905,7 +905,7 @@ std::string VChatInterface::parseWorldName(std::string const & input)
std::string::size_type findIndex = input.find(worldCode);
if(findIndex != std::string::npos)
{
findIndex += strlen(worldCode.c_str());
findIndex += worldCode.length());
output = input.substr(findIndex);
}
else