Make undo draw failure visible in chat (#6889)

* [Server][Game] Make undo draw failure visible in chat

* genericize the proto
This commit is contained in:
RickyRister 2026-05-20 02:23:02 -07:00 committed by ebbit1q
parent 762f36335e
commit cb2ca152b7
8 changed files with 54 additions and 0 deletions

View file

@ -36,6 +36,7 @@
#include <libcockatrice/protocol/pb/event_create_counter.pb.h>
#include <libcockatrice/protocol/pb/event_del_counter.pb.h>
#include <libcockatrice/protocol/pb/event_draw_cards.pb.h>
#include <libcockatrice/protocol/pb/event_game_log_notice.pb.h>
#include <libcockatrice/protocol/pb/event_player_properties_changed.pb.h>
#include <libcockatrice/protocol/pb/event_set_counter.pb.h>
#include <libcockatrice/protocol/pb/event_shuffle.pb.h>
@ -409,6 +410,9 @@ Server_Player::cmdUndoDraw(const Command_UndoDraw & /*cmd*/, ResponseContainer &
}
if (lastDrawList.isEmpty()) {
Event_GameLogNotice event;
event.set_notice_type(Event_GameLogNotice::UNDO_DRAW_FAILED);
ges.enqueueGameEvent(event, playerId);
return Response::RespContextError;
}