[Server/Client/Protocol] Add developer staff role

Introduce a Developer staff level (proto flag 32, DB admin bit 8) that
sits between admin and moderator: no kick/ban/warn/report/admin powers,
but gets server log access via a new developer command container family
(GET_SERVER_STATS, VIEWLOG_HISTORY) and an idle-timeout exemption.

- Protocol: IsDeveloper flag, developer_commands.proto envelope,
  Command_GetServerStats/Command_GetLogHistory, Response_GetServerStats,
  Command_AdjustMod.should_be_developer
- Servatrice: fail-closed developer dispatcher, uptime snapshot handler,
  shared log history handler reuse, bit-8 DB mapping
- Client: burgundy pawn/badge/labels/sort order, prepareDeveloperCommand,
  minimal Developer stats tab, log tab access, promote/demote actions

Took 24 minutes

Took 18 seconds
This commit is contained in:
Lukas Brübach 2026-08-23 19:40:16 +02:00
parent 7d867b9745
commit 1ff7ffcaa4
31 changed files with 515 additions and 23 deletions

View file

@ -22,6 +22,8 @@ set(PROTO_FILES
command_del_counter.proto
command_delete_arrow.proto
command_draw_cards.proto
command_get_log_history.proto
command_get_server_stats.proto
command_dump_zone.proto
command_flip_card.proto
command_game_say.proto
@ -71,6 +73,7 @@ set(PROTO_FILES
context_ready_start.proto
context_set_sideboard_lock.proto
context_undo_draw.proto
developer_commands.proto
event_add_to_list.proto
event_attach_card.proto
event_change_zone_properties.proto
@ -140,6 +143,7 @@ set(PROTO_FILES
response_forgotpasswordrequest.proto
response_get_admin_notes.proto
response_get_games_of_user.proto
response_get_server_stats.proto
response_get_user_info.proto
response_join_room.proto
response_list_users.proto

View file

@ -37,6 +37,7 @@ message Command_AdjustMod {
required string user_name = 1;
optional bool should_be_mod = 2;
optional bool should_be_judge = 3;
optional bool should_be_developer = 4;
}
message Command_ResetUserPassword {

View file

@ -0,0 +1,19 @@
syntax = "proto2";
import "developer_commands.proto";
// Developer counterpart of Command_ViewLogHistory: identical query fields, but
// routed through the developer command family so developers never need the
// moderator command container.
message Command_GetLogHistory {
extend DeveloperCommand {
optional Command_GetLogHistory ext = 1001;
}
optional string user_name = 1; // user that created message
optional string ip_address = 2; // ip address of user that created message
optional string game_name = 3; // client id of user that created the message
optional string game_id = 4; // game number the message was sent to
optional string message = 5; // raw message that was sent
repeated string log_location = 6; // destination of message (ex: main room, game room, private chat)
required uint32 date_range = 7; // the length of time (in minutes) to look back for
optional uint32 maximum_results = 8; // the maximum number of query results
}

View file

@ -0,0 +1,8 @@
syntax = "proto2";
import "developer_commands.proto";
message Command_GetServerStats {
extend DeveloperCommand {
optional Command_GetServerStats ext = 1000;
}
}

View file

@ -4,6 +4,7 @@ import "game_commands.proto";
import "room_commands.proto";
import "moderator_commands.proto";
import "admin_commands.proto";
import "developer_commands.proto";
message CommandContainer {
optional uint64 cmd_id = 1;
@ -16,4 +17,5 @@ message CommandContainer {
repeated RoomCommand room_command = 102;
repeated ModeratorCommand moderator_command = 103;
repeated AdminCommand admin_command = 104;
repeated DeveloperCommand developer_command = 105;
}

View file

@ -0,0 +1,8 @@
syntax = "proto2";
message DeveloperCommand {
enum DeveloperCommandType {
GET_SERVER_STATS = 1000;
VIEWLOG_HISTORY = 1001;
}
extensions 100 to max;
}

View file

@ -77,6 +77,7 @@ message Response {
FORGOT_PASSWORD_REQUEST = 1016; // Response to password reset request
PASSWORD_SALT = 1017; // Response containing password salt
GET_ADMIN_NOTES = 1018; // Response with admin notes
GET_SERVER_STATS = 1019; // Response with server status statistics
REPLAY_LIST = 1100; // Response listing replays
REPLAY_DOWNLOAD = 1101; // Response for replay download
REPLAY_GET_CODE = 1102; // Response containing replay code

View file

@ -0,0 +1,19 @@
syntax = "proto2";
import "response.proto";
message Response_GetServerStats {
extend Response {
optional Response_GetServerStats ext = 1220;
}
optional uint64 users_count = 1;
optional uint64 mods_count = 2;
optional uint64 games_count = 3;
// Traffic recorded during the last status update tick
optional uint64 tx_bytes = 4;
optional uint64 rx_bytes = 5;
optional uint64 uptime_secs = 6;
optional uint64 timest = 7; // unix timestamp of the snapshot
}

View file

@ -8,6 +8,7 @@ message ServerInfo_User {
IsModerator = 4;
IsAdmin = 8;
IsJudge = 16;
IsDeveloper = 32;
};
message PawnColorsOverride {
optional string left_side = 1;