mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
don't pm people ignoring you
This commit is contained in:
parent
0afdbc7222
commit
1bee788210
9 changed files with 36 additions and 5 deletions
|
|
@ -266,7 +266,7 @@ void ProtocolResponse::initializeHash()
|
|||
responseHash.insert("spectators_not_allowed", RespSpectatorsNotAllowed);
|
||||
responseHash.insert("only_buddies", RespOnlyBuddies);
|
||||
responseHash.insert("user_level_too_low", RespUserLevelTooLow);
|
||||
responseHash.insert("on_ignore_list", RespOnIgnoreList);
|
||||
responseHash.insert("in_ignore_list", RespInIgnoreList);
|
||||
}
|
||||
|
||||
Response_JoinRoom::Response_JoinRoom(int _cmdId, ResponseCode _responseCode, ServerInfo_Room *_roomInfo)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
class DeckList;
|
||||
|
||||
enum ResponseCode { RespNothing, RespOk, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespOnIgnoreList };
|
||||
enum ResponseCode { RespNothing, RespOk, RespInternalError, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespGameNotStarted, RespGameFull, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed, RespOnlyBuddies, RespUserLevelTooLow, RespInIgnoreList };
|
||||
|
||||
// PrivateZone: Contents of the zone are always visible to the owner,
|
||||
// but not to anyone else.
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ ResponseCode Server_Game::checkJoin(ServerInfo_User *user, const QString &_passw
|
|||
if (!static_cast<Server_Room *>(parent())->getServer()->getBuddyList(creatorInfo->getName()).contains(user->getName()))
|
||||
return RespOnlyBuddies;
|
||||
if (static_cast<Server_Room *>(parent())->getServer()->getIgnoreList(creatorInfo->getName()).contains(user->getName()))
|
||||
return RespOnIgnoreList;
|
||||
return RespInIgnoreList;
|
||||
if (spectator) {
|
||||
if (!spectatorsAllowed)
|
||||
return RespSpectatorsNotAllowed;
|
||||
|
|
|
|||
|
|
@ -281,6 +281,8 @@ ResponseCode Server_ProtocolHandler::cmdMessage(Command_Message *cmd, CommandCon
|
|||
Server_ProtocolHandler *userHandler = server->getUsers().value(receiver);
|
||||
if (!userHandler)
|
||||
return RespNameNotFound;
|
||||
if (userHandler->getIgnoreList().contains(userInfo->getName()))
|
||||
return RespInIgnoreList;
|
||||
|
||||
cont->enqueueItem(new Event_Message(userInfo->getName(), receiver, cmd->getText()));
|
||||
userHandler->sendProtocolItem(new Event_Message(userInfo->getName(), receiver, cmd->getText()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue