Preparing admin functions in PokerTH client.
This commit is contained in:
@@ -146,16 +146,16 @@ public:
|
||||
LOG_MSG("Successfully connected to database.");
|
||||
}
|
||||
|
||||
virtual void ConnectFailed(const string &error) {
|
||||
virtual void ConnectFailed(string error) {
|
||||
LOG_ERROR("DB connect error: " << error);
|
||||
}
|
||||
|
||||
virtual void QueryError(const std::string &error) {
|
||||
virtual void QueryError(string error) {
|
||||
LOG_ERROR("DB query error: " << error);
|
||||
}
|
||||
|
||||
virtual void PlayerLoginSuccess(unsigned requestId, const DBPlayerData &dbPlayerData) {
|
||||
m_server.UserValid(requestId, dbPlayerData);
|
||||
virtual void PlayerLoginSuccess(unsigned requestId, boost::shared_ptr<DBPlayerData> dbPlayerData) {
|
||||
m_server.UserValid(requestId, *dbPlayerData);
|
||||
}
|
||||
|
||||
virtual void PlayerLoginFailed(unsigned requestId) {
|
||||
@@ -199,6 +199,10 @@ public:
|
||||
m_server.SendReportGameResult(requestId, replyId, false);
|
||||
}
|
||||
|
||||
virtual void PlayerAdminList(unsigned requestId, std::list<DB_id> adminList) {
|
||||
m_server.GetBanManager().SetAdminPlayerIds(adminList);
|
||||
}
|
||||
|
||||
private:
|
||||
ServerLobbyThread &m_server;
|
||||
};
|
||||
@@ -242,6 +246,7 @@ ServerLobbyThread::Init(const string &logDir)
|
||||
m_serverConfig.readConfigString("DBServerPassword"),
|
||||
m_serverConfig.readConfigString("DBServerDatabaseName"),
|
||||
m_serverConfig.readConfigString("DBServerEncryptionKey"));
|
||||
m_database->AsyncQueryAdminPlayers(0);
|
||||
|
||||
GetBanManager().InitGameNameBadWordList(m_serverConfig.readConfigStringList("GameNameBadWordList"));
|
||||
}
|
||||
@@ -1074,6 +1079,10 @@ ServerLobbyThread::HandleNetPacketAuthClientResponse(boost::shared_ptr<SessionDa
|
||||
GetSender().Send(session, packet);
|
||||
// The last message is only for server verification.
|
||||
// We are done now, the user has logged in.
|
||||
boost::shared_ptr<PlayerData> tmpPlayerData = session->GetPlayerData();
|
||||
if (GetBanManager().IsAdminPlayer(tmpPlayerData->GetDBId())) {
|
||||
session->GetPlayerData()->SetRights(PLAYER_RIGHTS_ADMIN);
|
||||
}
|
||||
CheckAvatarBlacklist(session);
|
||||
} else
|
||||
SessionError(session, ERR_NET_INVALID_PASSWORD);
|
||||
|
||||
Reference in New Issue
Block a user