mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 23:53:54 -07:00
server code cleanup, changed in-game ping event to not use any bandwidth as long as nothing changes
This commit is contained in:
parent
a64df4a0f5
commit
4895f2b4fd
27 changed files with 232 additions and 268 deletions
|
|
@ -41,15 +41,16 @@ SET(PROTO_FILES
|
|||
command_stop_dump_zone.proto
|
||||
command_undo_draw.proto
|
||||
context_concede.proto
|
||||
context_connection_state_changed.proto
|
||||
context_deck_select.proto
|
||||
context_move_card.proto
|
||||
context_mulligan.proto
|
||||
context_ping_changed.proto
|
||||
context_ready_start.proto
|
||||
context_undo_draw.proto
|
||||
event_add_to_list.proto
|
||||
event_attach_card.proto
|
||||
event_connection_closed.proto
|
||||
event_connection_state_changed.proto
|
||||
event_create_arrow.proto
|
||||
event_create_counter.proto
|
||||
event_create_token.proto
|
||||
|
|
@ -72,7 +73,6 @@ SET(PROTO_FILES
|
|||
event_list_games.proto
|
||||
event_list_rooms.proto
|
||||
event_move_card.proto
|
||||
event_ping.proto
|
||||
event_player_properties_changed.proto
|
||||
event_remove_from_list.proto
|
||||
event_reveal_cards.proto
|
||||
|
|
|
|||
7
common/pb/context_connection_state_changed.proto
Normal file
7
common/pb/context_connection_state_changed.proto
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import "game_event_context.proto";
|
||||
|
||||
message Context_ConnectionStateChanged {
|
||||
extend GameEventContext {
|
||||
optional Context_ConnectionStateChanged ext = 1007;
|
||||
}
|
||||
}
|
||||
7
common/pb/context_ping_changed.proto
Normal file
7
common/pb/context_ping_changed.proto
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import "game_event_context.proto";
|
||||
|
||||
message Context_PingChanged {
|
||||
extend GameEventContext {
|
||||
optional Context_PingChanged ext = 1006;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import "game_event.proto";
|
||||
|
||||
message Event_ConnectionStateChanged {
|
||||
extend GameEvent {
|
||||
optional Event_ConnectionStateChanged ext = 1006;
|
||||
}
|
||||
optional bool connected = 1;
|
||||
}
|
||||
|
|
@ -9,4 +9,5 @@ message Event_GameStateChanged {
|
|||
optional bool game_started = 2;
|
||||
optional sint32 active_player_id = 3;
|
||||
optional sint32 active_phase = 4;
|
||||
optional uint32 seconds_elapsed = 5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
import "game_event.proto";
|
||||
import "serverinfo_playerping.proto";
|
||||
|
||||
message Event_Ping {
|
||||
extend GameEvent {
|
||||
optional Event_Ping ext = 1008;
|
||||
}
|
||||
optional uint32 seconds_elapsed = 1;
|
||||
repeated ServerInfo_PlayerPing ping_list = 2;
|
||||
}
|
||||
|
|
@ -6,9 +6,7 @@ message GameEvent {
|
|||
GAME_HOST_CHANGED = 1003;
|
||||
KICKED = 1004;
|
||||
GAME_STATE_CHANGED = 1005;
|
||||
CONNECTION_STATE_CHANGED = 1006;
|
||||
PLAYER_PROPERTIES_CHANGED = 1007;
|
||||
PING = 1008;
|
||||
GAME_SAY = 1009;
|
||||
CREATE_ARROW = 2000;
|
||||
DELETE_ARROW = 2001;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ message GameEventContext {
|
|||
UNDO_DRAW = 1003;
|
||||
MOVE_CARD = 1004;
|
||||
MULLIGAN = 1005;
|
||||
PING_CHANGED = 1006;
|
||||
CONNECTION_STATE_CHANGED = 1007;
|
||||
}
|
||||
extensions 100 to max;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@ message ServerInfo_PlayerProperties {
|
|||
optional bool conceded = 4;
|
||||
optional bool ready_start = 5;
|
||||
optional string deck_hash = 6;
|
||||
optional sint32 ping_seconds = 7;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue