mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[Protocol] Add room chat channel extensions and catalog payload (#7475)
* [Protocol] Add room chat channel extensions and catalog payload * [Protocol] Add per-channel write level and banner to room channel catalog Adds two optional fields to ServerInfo_RoomChannel: - write_access_level: minimum privilege level required to send to the channel. When unset, writing requires the same level as reading (access_level), preserving the previous single-level behavior. This allows read-mostly channels such as a developer news feed: readable by everyone, writable only by developers. - banner_message: static notice shown at the top of the channel, analogous to the room join message on Main. Empty means none. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
6c660d6b21
commit
be38e8d429
6 changed files with 41 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ set(PROTO_FILES
|
||||||
event_reveal_cards.proto
|
event_reveal_cards.proto
|
||||||
event_reverse_turn.proto
|
event_reverse_turn.proto
|
||||||
event_roll_die.proto
|
event_roll_die.proto
|
||||||
|
event_room_channel_say.proto
|
||||||
event_room_say.proto
|
event_room_say.proto
|
||||||
event_server_complete_list.proto
|
event_server_complete_list.proto
|
||||||
event_server_identification.proto
|
event_server_identification.proto
|
||||||
|
|
@ -201,6 +202,7 @@ set(PROTO_FILES
|
||||||
serverinfo_replay_match.proto
|
serverinfo_replay_match.proto
|
||||||
serverinfo_report.proto
|
serverinfo_report.proto
|
||||||
serverinfo_room.proto
|
serverinfo_room.proto
|
||||||
|
serverinfo_room_channel.proto
|
||||||
serverinfo_user.proto
|
serverinfo_user.proto
|
||||||
serverinfo_user_alt.proto
|
serverinfo_user_alt.proto
|
||||||
serverinfo_user_session.proto
|
serverinfo_user_session.proto
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
syntax = "proto2";
|
||||||
|
import "room_event.proto";
|
||||||
|
|
||||||
|
message Event_RoomChannelSay {
|
||||||
|
extend RoomEvent {
|
||||||
|
optional Event_RoomChannelSay ext = 1005; // next free RoomEvent extension
|
||||||
|
}
|
||||||
|
optional string channel_id = 1;
|
||||||
|
optional string name = 2;
|
||||||
|
optional string message = 3;
|
||||||
|
optional uint64 time_of = 4;
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ message RoomEvent {
|
||||||
ROOM_SAY = 1002;
|
ROOM_SAY = 1002;
|
||||||
LIST_GAMES = 1003;
|
LIST_GAMES = 1003;
|
||||||
REMOVE_MESSAGES = 1004;
|
REMOVE_MESSAGES = 1004;
|
||||||
|
ROOM_CHANNEL_SAY = 1005;
|
||||||
}
|
}
|
||||||
optional sint32 room_id = 1;
|
optional sint32 room_id = 1;
|
||||||
extensions 100 to max;
|
extensions 100 to max;
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,5 @@ message ServerInfo_ChatMessage {
|
||||||
optional string target_type = 6; // target type (room,game,chat)
|
optional string target_type = 6; // target type (room,game,chat)
|
||||||
optional string target_id = 7; // id of target
|
optional string target_id = 7; // id of target
|
||||||
optional string target_name = 8; // name of target
|
optional string target_name = 8; // name of target
|
||||||
|
optional string channel = 9; // channel id, for room_channel targets
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ syntax = "proto2";
|
||||||
import "serverinfo_game.proto";
|
import "serverinfo_game.proto";
|
||||||
import "serverinfo_user.proto";
|
import "serverinfo_user.proto";
|
||||||
import "serverinfo_gametype.proto";
|
import "serverinfo_gametype.proto";
|
||||||
|
import "serverinfo_room_channel.proto";
|
||||||
|
|
||||||
message ServerInfo_Room {
|
message ServerInfo_Room {
|
||||||
optional sint32 room_id = 1;
|
optional sint32 room_id = 1;
|
||||||
|
|
@ -15,4 +16,5 @@ message ServerInfo_Room {
|
||||||
repeated ServerInfo_GameType gametype_list = 9;
|
repeated ServerInfo_GameType gametype_list = 9;
|
||||||
optional string permissionlevel = 10;
|
optional string permissionlevel = 10;
|
||||||
optional string privilegelevel = 11;
|
optional string privilegelevel = 11;
|
||||||
|
repeated ServerInfo_RoomChannel channel_list = 12;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
message ServerInfo_RoomChannel {
|
||||||
|
enum AccessLevel {
|
||||||
|
// Minimum privilege level, evaluated against the privilege ladder
|
||||||
|
// Public < Registered < Judge < Moderator < Admin < Developer.
|
||||||
|
Public = 0;
|
||||||
|
Registered = 1;
|
||||||
|
Judge = 2;
|
||||||
|
Moderator = 3;
|
||||||
|
Admin = 4;
|
||||||
|
Developer = 5;
|
||||||
|
}
|
||||||
|
optional string id = 1; // stable ASCII id, e.g. "deck-discussion"
|
||||||
|
optional string display_name = 2; // server-provided, localizable only server-side
|
||||||
|
optional AccessLevel access_level = 3 [default = Public]; // minimum privilege level required to read the channel
|
||||||
|
// Minimum privilege level required to write to the channel. When unset, writing requires the same level as
|
||||||
|
// reading. This allows read-mostly channels such as a developer news feed: readable by everyone, writable
|
||||||
|
// only by developers.
|
||||||
|
optional AccessLevel write_access_level = 4;
|
||||||
|
// Static banner shown at the top of the channel, analogous to the room join message on Main. Empty = none.
|
||||||
|
optional string banner_message = 5;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue