mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
remove the stop dump zone command from the protocol (#4326)
the stop dump zone command was implemented as a courtesy to other players in order to take into account when they would stop looking at unknown information however, this can be abused, a malicious client can send this command whenever they would like cockatrice is not a physical tabletop nor does it aim to be, if you can take a screenshot of your deck and then close the view, you are not cheating as you have been given this information in order to prevent anyone from abusing this we should remove the command from the protocol, this means servers will ignore this message and clients will get a little invalid command reply in their debug log the extension id will remain reserved shuffling your deck will always invalidate any card view looking at those cards if players wish to signal that they stopped looking at their deck for whatever reason they should just use the chat instead, optionally using one of the chat macros
This commit is contained in:
parent
fac7bfaa92
commit
ebe2c494aa
13 changed files with 3 additions and 100 deletions
|
|
@ -48,7 +48,6 @@ SET(PROTO_FILES
|
|||
command_set_sideboard_lock.proto
|
||||
command_shuffle.proto
|
||||
commands.proto
|
||||
command_stop_dump_zone.proto
|
||||
command_undo_draw.proto
|
||||
context_concede.proto
|
||||
context_connection_state_changed.proto
|
||||
|
|
@ -102,7 +101,6 @@ SET(PROTO_FILES
|
|||
event_set_card_counter.proto
|
||||
event_set_counter.proto
|
||||
event_shuffle.proto
|
||||
event_stop_dump_zone.proto
|
||||
event_user_joined.proto
|
||||
event_user_left.proto
|
||||
event_user_message.proto
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
syntax = "proto2";
|
||||
import "game_commands.proto";
|
||||
message Command_StopDumpZone {
|
||||
extend GameCommand {
|
||||
optional Command_StopDumpZone ext = 1025;
|
||||
}
|
||||
optional sint32 player_id = 1;
|
||||
optional string zone_name = 2;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
syntax = "proto2";
|
||||
import "game_event.proto";
|
||||
|
||||
message Event_StopDumpZone {
|
||||
extend GameEvent {
|
||||
optional Event_StopDumpZone ext = 2019;
|
||||
}
|
||||
optional sint32 zone_owner_id = 1;
|
||||
optional string zone_name = 2;
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ message GameCommand {
|
|||
NEXT_TURN = 1022;
|
||||
SET_ACTIVE_PHASE = 1023;
|
||||
DUMP_ZONE = 1024;
|
||||
STOP_DUMP_ZONE = 1025;
|
||||
STOP_DUMP_ZONE = 1025; // deprecated
|
||||
REVEAL_CARDS = 1026;
|
||||
MOVE_CARD = 1027;
|
||||
SET_SIDEBOARD_PLAN = 1028;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ message GameEvent {
|
|||
SET_ACTIVE_PLAYER = 2016;
|
||||
SET_ACTIVE_PHASE = 2017;
|
||||
DUMP_ZONE = 2018;
|
||||
STOP_DUMP_ZONE = 2019;
|
||||
STOP_DUMP_ZONE = 2019; // deprecated
|
||||
CHANGE_ZONE_PROPERTIES = 2020;
|
||||
REVERSE_TURN = 2021;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "pb/command_set_sideboard_lock.pb.h"
|
||||
#include "pb/command_set_sideboard_plan.pb.h"
|
||||
#include "pb/command_shuffle.pb.h"
|
||||
#include "pb/command_stop_dump_zone.pb.h"
|
||||
#include "pb/command_undo_draw.pb.h"
|
||||
#include "pb/context_concede.pb.h"
|
||||
#include "pb/context_connection_state_changed.pb.h"
|
||||
|
|
@ -65,7 +64,6 @@
|
|||
#include "pb/event_set_card_counter.pb.h"
|
||||
#include "pb/event_set_counter.pb.h"
|
||||
#include "pb/event_shuffle.pb.h"
|
||||
#include "pb/event_stop_dump_zone.pb.h"
|
||||
#include "pb/response.pb.h"
|
||||
#include "pb/response_deck_download.pb.h"
|
||||
#include "pb/response_dump_zone.pb.h"
|
||||
|
|
@ -1830,36 +1828,6 @@ Server_Player::cmdDumpZone(const Command_DumpZone &cmd, ResponseContainer &rc, G
|
|||
return Response::RespOk;
|
||||
}
|
||||
|
||||
Response::ResponseCode
|
||||
Server_Player::cmdStopDumpZone(const Command_StopDumpZone &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges)
|
||||
{
|
||||
if (!game->getGameStarted()) {
|
||||
return Response::RespGameNotStarted;
|
||||
}
|
||||
if (conceded) {
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
Server_Player *otherPlayer = game->getPlayers().value(cmd.player_id());
|
||||
if (!otherPlayer) {
|
||||
return Response::RespNameNotFound;
|
||||
}
|
||||
Server_CardZone *zone = otherPlayer->getZones().value(QString::fromStdString(cmd.zone_name()));
|
||||
if (!zone) {
|
||||
return Response::RespNameNotFound;
|
||||
}
|
||||
|
||||
if (zone->getType() == ServerInfo_Zone::HiddenZone) {
|
||||
zone->setCardsBeingLookedAt(0);
|
||||
|
||||
Event_StopDumpZone event;
|
||||
event.set_zone_owner_id(cmd.player_id());
|
||||
event.set_zone_name(zone->getName().toStdString());
|
||||
ges.enqueueGameEvent(event, playerId);
|
||||
}
|
||||
return Response::RespOk;
|
||||
}
|
||||
|
||||
Response::ResponseCode
|
||||
Server_Player::cmdRevealCards(const Command_RevealCards &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges)
|
||||
{
|
||||
|
|
@ -2115,9 +2083,6 @@ Server_Player::processGameCommand(const GameCommand &command, ResponseContainer
|
|||
case GameCommand::DUMP_ZONE:
|
||||
return cmdDumpZone(command.GetExtension(Command_DumpZone::ext), rc, ges);
|
||||
break;
|
||||
case GameCommand::STOP_DUMP_ZONE:
|
||||
return cmdStopDumpZone(command.GetExtension(Command_StopDumpZone::ext), rc, ges);
|
||||
break;
|
||||
case GameCommand::REVEAL_CARDS:
|
||||
return cmdRevealCards(command.GetExtension(Command_RevealCards::ext), rc, ges);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ class Command_DelCounter;
|
|||
class Command_NextTurn;
|
||||
class Command_SetActivePhase;
|
||||
class Command_DumpZone;
|
||||
class Command_StopDumpZone;
|
||||
class Command_RevealCards;
|
||||
class Command_ReverseTurn;
|
||||
class Command_MoveCard;
|
||||
|
|
@ -226,8 +225,6 @@ public:
|
|||
Response::ResponseCode
|
||||
cmdSetActivePhase(const Command_SetActivePhase &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||
Response::ResponseCode cmdDumpZone(const Command_DumpZone &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||
Response::ResponseCode
|
||||
cmdStopDumpZone(const Command_StopDumpZone &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||
Response::ResponseCode cmdRevealCards(const Command_RevealCards &cmd, ResponseContainer &rc, GameEventStorage &ges);
|
||||
Response::ResponseCode
|
||||
cmdReverseTurn(const Command_ReverseTurn & /*cmd*/, ResponseContainer & /*rc*/, GameEventStorage &ges);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue