Protocol changes for admin functions. Fixing generic DB implementation.
This commit is contained in:
@@ -931,6 +931,10 @@ ServerLobbyThread::HandlePacket(boost::shared_ptr<SessionData> session, boost::s
|
||||
HandleNetPacketReportGame(session, packet->GetMsg()->reportgamemessage());
|
||||
} else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_LeaveGameRequestMessage) {
|
||||
// Ignore "leave game" in this state.
|
||||
} else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_AdminRemoveGameMessage) {
|
||||
HandleNetPacketAdminRemoveGame(session, packet->GetMsg()->adminremovegamemessage());
|
||||
} else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_AdminBanPlayerMessage) {
|
||||
HandleNetPacketAdminBanPlayer(session, packet->GetMsg()->adminbanplayermessage());
|
||||
} else {
|
||||
SessionError(session, ERR_SOCK_INVALID_STATE);
|
||||
}
|
||||
@@ -1469,6 +1473,21 @@ ServerLobbyThread::HandleNetPacketReportGame(boost::shared_ptr<SessionData> sess
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::HandleNetPacketAdminRemoveGame(boost::shared_ptr<SessionData> session, const AdminRemoveGameMessage &removeGame)
|
||||
{
|
||||
GameMap::iterator pos = m_gameMap.find(removeGame.removegameid());
|
||||
|
||||
if (pos != m_gameMap.end() && session->GetPlayerData() && GetBanManager().IsAdminPlayer(session->GetPlayerData()->GetDBId())) {
|
||||
InternalRemoveGame(pos->second);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::HandleNetPacketAdminBanPlayer(boost::shared_ptr<SessionData> session, const AdminBanPlayerMessage &banPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ServerLobbyThread::AuthChallenge(boost::shared_ptr<SessionData> session, const string &secret)
|
||||
{
|
||||
|
||||
@@ -156,6 +156,8 @@ protected:
|
||||
void HandleNetPacketChatRequest(boost::shared_ptr<SessionData> session, const ChatRequestMessage &chatRequest);
|
||||
void HandleNetPacketRejectGameInvitation(boost::shared_ptr<SessionData> session, const RejectGameInvitationMessage &reject);
|
||||
void HandleNetPacketReportGame(boost::shared_ptr<SessionData> session, const ReportGameMessage &report);
|
||||
void HandleNetPacketAdminRemoveGame(boost::shared_ptr<SessionData> session, const AdminRemoveGameMessage &removeGame);
|
||||
void HandleNetPacketAdminBanPlayer(boost::shared_ptr<SessionData> session, const AdminBanPlayerMessage &banPlayer);
|
||||
// TODO would be better to use state pattern here.
|
||||
void AuthChallenge(boost::shared_ptr<SessionData> session, const std::string &secret);
|
||||
void CheckAvatarBlacklist(boost::shared_ptr<SessionData> session);
|
||||
|
||||
Reference in New Issue
Block a user