genericize the proto

This commit is contained in:
RickyRister 2026-05-17 02:37:18 -07:00
parent b4da05e75f
commit f4a9748a6d
7 changed files with 39 additions and 20 deletions

View file

@ -76,6 +76,7 @@ set(PROTO_FILES
event_game_closed.proto
event_game_host_changed.proto
event_game_joined.proto
event_game_log_notice.proto
event_game_say.proto
event_game_state_changed.proto
event_game_state_changed.proto
@ -106,7 +107,6 @@ set(PROTO_FILES
event_set_card_counter.proto
event_set_counter.proto
event_shuffle.proto
event_undo_draw_failed.proto
event_user_joined.proto
event_user_left.proto
event_user_message.proto

View file

@ -0,0 +1,20 @@
syntax = "proto2";
import "game_event.proto";
// Notifies clients of an event that happened, and which could safely be dropped without affect the game state.
// This mostly just means events that should cause a message to be logged to chat.
message Event_GameLogNotice {
// The type of the notice.
// Clients who do not recognize the type should drop the event.
enum NoticeType {
// Player's "undo draw" command failed due to losing track of recent draw
UNDO_DRAW_FAILED = 1;
}
extend GameEvent {
optional Event_GameLogNotice ext = 2022;
}
optional NoticeType notice_type = 1;
}

View file

@ -1,9 +0,0 @@
syntax = "proto2";
import "game_event.proto";
message Event_UndoDrawFailed {
extend GameEvent {
optional Event_UndoDrawFailed ext = 2022;
}
optional sint32 phase = 1;
}

View file

@ -33,7 +33,7 @@ message GameEvent {
// STOP_DUMP_ZONE = 2019; // obsolete
CHANGE_ZONE_PROPERTIES = 2020;
REVERSE_TURN = 2021;
UNDO_DRAW_FAILED = 2022;
GAME_LOG_NOTICE = 2022;
}
optional sint32 player_id = 1 [default = -1];
extensions 100 to max;