Block bad game names on server.

This commit is contained in:
lotodore
2010-09-05 00:15:25 +00:00
parent 03be7c2f16
commit 7a1a10abf5
8 changed files with 60 additions and 13 deletions
+6
View File
@@ -202,6 +202,8 @@ ServerLobbyThread::Init(const string &logDir)
m_serverConfig->readConfigString("DBServerPassword"),
m_serverConfig->readConfigString("DBServerDatabaseName"),
m_serverConfig->readConfigString("DBServerEncryptionKey"));
GetBanManager().InitGameNameBadWordList(m_serverConfig->readConfigStringList("GameNameBadWordList"));
}
void
@@ -1335,6 +1337,10 @@ ServerLobbyThread::HandleNetPacketCreateGame(SessionWrapper session, const std::
{
SendJoinGameFailed(session.sessionData, gameId, NTF_NET_JOIN_GAME_NAME_IN_USE);
}
else if (GetBanManager().IsBadGameName(gameName))
{
SendJoinGameFailed(session.sessionData, gameId, NTF_NET_JOIN_GAME_BAD_NAME);
}
else if (session.playerData->GetRights() == PLAYER_RIGHTS_GUEST
&& tmpData.gameType != GAME_TYPE_NORMAL)
{