[Room][UserList] Introduce style delegate for user list

- Allow users to set a card name and parameters as their background banner
- Allow mods to white/blacklist cards
- Allow toggling back to the old display style

Took 7 minutes

Took 28 seconds

Took 2 minutes

Took 2 minutes
This commit is contained in:
Lukas Brübach 2026-06-07 10:13:07 +02:00
parent bdb0f12f66
commit aff93a4435
35 changed files with 1977 additions and 26 deletions

View file

@ -122,6 +122,7 @@ set(PROTO_FILES
response_activate.proto
response_adjust_mod.proto
response_ban_history.proto
response_card_art_rule_entry.proto
response_deck_download.proto
response_deck_list.proto
response_deck_upload.proto

View file

@ -11,6 +11,9 @@ message ModeratorCommand {
FORCE_ACTIVATE_USER = 1007;
GET_ADMIN_NOTES = 1008;
UPDATE_ADMIN_NOTES = 1009;
ADD_CARD_ART_RULE = 1010;
REMOVE_CARD_ART_RULE = 1011;
LIST_CARD_ART_RULES = 1012;
}
extensions 100 to max;
}
@ -106,3 +109,27 @@ message Command_UpdateAdminNotes {
optional string user_name = 1;
optional string notes = 2;
}
message Command_AddCardArtRule {
extend ModeratorCommand {
optional Command_AddCardArtRule ext = 1010;
}
optional string card_name = 1;
optional string mode = 2; // "ALLOW" or "DENY"
optional string reason = 3;
}
message Command_RemoveCardArtRule {
extend ModeratorCommand {
optional Command_RemoveCardArtRule ext = 1011;
}
optional string card_name = 1;
}
message Command_ListCardArtRules {
extend ModeratorCommand {
optional Command_ListCardArtRules ext = 1012;
}
}

View file

@ -68,6 +68,7 @@ message Response {
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_GET_CODE = 1102;
CARD_ART_RULE_LIST = 1200;
}
required uint64 cmd_id = 1;
optional ResponseCode response_code = 2;

View file

@ -0,0 +1,15 @@
syntax = "proto2";
import "response.proto";
message Response_CardArtRuleEntry {
optional string card_name = 1;
optional string mode = 2;
optional string reason = 3;
}
message Response_ListCardArtRules {
extend Response {
optional Response_ListCardArtRules ext = 1200;
}
repeated Response_CardArtRuleEntry entries = 1;
}

View file

@ -1,4 +1,5 @@
syntax = "proto2";
message ServerInfo_User {
enum UserLevelFlag {
IsNothing = 0;
@ -12,6 +13,13 @@ message ServerInfo_User {
optional string left_side = 1;
optional string right_side = 2;
};
message CardArtParams {
optional string card_name = 1;
optional double margin_pct_l = 2 [default = 0.33];
optional double margin_pct_r = 3 [default = 0.02];
optional double vertical_offset = 4 [default = 0.35];
optional double zoom = 5 [default = 1.0];
};
optional string name = 1;
optional uint32 user_level = 2;
@ -28,4 +36,5 @@ message ServerInfo_User {
optional string clientid = 13;
optional string privlevel = 14;
optional PawnColorsOverride pawn_colors = 15;
}
optional CardArtParams card_art_params = 16;
}

View file

@ -27,6 +27,7 @@ message SessionCommand {
FORGOT_PASSWORD_RESET = 1022;
FORGOT_PASSWORD_CHALLENGE = 1023;
REQUEST_PASSWORD_SALT = 1024;
SET_CARD_ART_PARAMS = 1025;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_MODIFY_MATCH = 1102;
@ -205,3 +206,14 @@ message Command_RequestPasswordSalt {
}
required string user_name = 1;
}
message Command_SetCardArtParams {
extend SessionCommand {
optional Command_SetCardArtParams ext = 1025;
}
optional string card_name = 1;
optional double margin_pct_l = 2;
optional double margin_pct_r = 3;
optional double vertical_offset = 4;
optional double zoom = 5;
}