-
Notifications
You must be signed in to change notification settings - Fork 3
/
picarto_protocol.proto
311 lines (270 loc) · 6.37 KB
/
picarto_protocol.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
syntax = "proto3";
// Chat message client->server
message NewMessage {
string message = 1;
}
// Sends the userlist
message UserList {
message User {
message UserData {
bool registered = 1;
bool moderator = 2;
bool streamer = 3;
bool ptv_admin = 4;
bool basic = 5;
bool premium = 6;
bool subscriber = 7;
string color = 8;
bool ignoring = 9;
}
message BanData {
bool is_shadow_ban = 1;
}
uint32 user_id = 1;
string display_name = 2;
oneof user_state {
UserData user_data = 3;
BanData ban_data = 4;
}
}
repeated User user = 1;
}
// Chat message
message ChatMessage {
uint32 id = 1;
uint32 user_id = 2;
string display_name = 3;
string message = 4;
bool registered = 5;
bool moderator = 6;
bool streamer = 7;
bool ptv_admin = 8;
bool basic = 9;
bool premium = 10;
bool subscriber = 11;
string color = 12;
int64 time_stamp = 13;
bool is_me_message = 14;
}
// A global admin message
message GlobalMessage {
string message = 1;
}
// Whisper message
message Whisper {
uint32 id = 1;
uint32 user_id = 2;
string display_name = 3;
string message = 4;
bool incomming = 5; // Whether or not we are recieving this whisper (otherwise we sent it)
int64 time_stamp = 6;
}
// Server message
message ServerMessage {
string message = 1;
}
// Command help
message CommandHelp {
message Command {
repeated string triggers = 1;
string description = 2;
}
repeated Command commands = 1;
}
// Signals with no data sent by the server
message Control {
enum MessageType {
END_HISTORY = 0; // No more history to send
KICK = 1; // User was kicked
GAMING = 2; // Enable/disable gaming mode
ADULT = 3; // Enable/disable adult mode
COMMISSIONS = 4; // Enable/disable commissions
COMMISSION_DESCRIPTION = 5; // Commission description update
DESCRIPTION = 6; // Description update
CONTENT_TYPE = 7; // Update content type/category
CAN_TALK = 8; // Can the user talk
SHOW_POLL_CREATOR = 9; // Show the poll creator
SHOW_RAFFLE_CREATOR = 10; // Show the raffle creator
NAME_TAKEN = 11; // The name you have picked has already been taken
}
MessageType message_type = 1;
bool data_bool = 2;
}
// Admin control messages - PTVAdmin-sent signals
message AdminControl {
enum MessageType {
ADULT = 0; // Admins announce channel is unmarked
GAMING = 1; // Admins announce gaming has issues
MOVIE = 2; // Admins announce video is too large
}
MessageType message_type = 1;
}
// Online status of a channel
message OnlineState {
bool is_live = 1;
uint32 viewers = 2;
uint32 channel = 3;
string channel_name = 4;
}
// Update the clients on current multistream status
message Multistream {
message Channel {
uint32 channel = 1;
string channel_name = 2;
}
Channel host = 1;
repeated Channel guests = 2;
}
// Update a color client->server and server->client
message Color {
string color = 1;
}
// When the ignore list is updated
message IgnoresUpdated {
repeated string ignores = 1;
}
// Adding/removing an ignore client->server
message ModifyIgnores {
string ignore_name = 1;
bool is_adding = 2; // If false, removing
}
// When a message is removed
message RemoveMessage {
uint32 id = 1;
uint32 executioner_id = 2;
string executioner_display_name = 3;
}
// When all messages of a user are cleared
message ClearUserMessages {
string username = 1; // May choose to switch to display_name
uint32 executioner_id = 2;
string executioner_display_name = 3;
}
// When all nessage history is cleared
message ClearHistory {
uint32 executioner_id = 1;
string executioner_display_name = 2;
}
// When a user is kicked
message Kick {
uint32 user_id = 1;
string display_name = 2;
uint32 executioner_id = 3;
string executioner_display_name = 4;
}
// When a user is banned
message Ban {
uint32 user_id = 1;
string display_name = 2;
uint32 executioner_id = 3;
string executioner_display_name = 4;
bool is_shadow_ban = 5;
}
// When a user is unbanned
message UnBan {
uint32 user_id = 1;
string display_name = 2;
uint32 executioner_id = 3;
string executioner_display_name = 4;
}
// When a user is modded/unmodded
message Mod {
uint32 user_id = 1;
string display_name = 2;
bool is_now_mod = 3;
}
// A list of all moderators
message ModList {
message Moderator {
uint32 user_id = 1;
string display_name = 2;
}
repeated Moderator moderators = 1;
}
// Start a raffle client->server
message RaffleInit {
repeated string names = 1;
}
// When a raffle is run
message RaffleRun {
string winner = 1;
repeated string names = 2;
uint32 host_id = 3;
string host_display_name = 4;
}
// Start a poll client->server and server->client
message PollInit {
string question = 1;
repeated string options = 2;
uint32 host_id = 3;
string host_display_name = 4;
}
// Send poll updates
message PollUpdate {
repeated int32 votes = 1;
uint32 host_id = 2;
string host_display_name = 3;
}
// When a poll is finished
message PollResult {
string question = 1;
repeated string winners = 2;
int32 votes = 3;
uint32 host_id = 4;
string host_display_name = 5;
}
// Poll vote client->server
message PollVote {
uint32 option = 1;
}
// Poll vote confirmation
message PollVoteResponse {
bool success = 1;
}
// Set a name client->server
message SetName {
string name = 1;
}
// Confirm your name was set (if response is non-empty, something went wrong)
message NameConfirmation {
string response = 1;
}
// When mod tools should change type
message ModTools {
enum ModToolsType {
NONE = 0;
MODERATOR = 1;
STREAMER = 2;
PTV_ADMIN = 3;
}
ModToolsType mod_tools_type = 1;
}
// End a poll client->server
message PollEnd {
}
// A reminder set by the streamer
message Reminder {
string message = 1;
}
// A timer set by the streamer
message Timer {
string message = 1;
}
// A wrapper for messages for the monitor client
message MonitorData {
bytes message_content = 1;
uint32 channel = 2;
string channel_name = 3;
}
// When the chat level has changed (who can talk)
message ChatLevel {
enum ChatLevelType {
EVERYONE = 0; // Everyone can talk
STREAMER = 1; // Only the streamer can talk
STREAMER_MODERATOR = 2; // Only the streamer and moderators can talk
STREAMER_MODERATOR_SUBSCRIBER = 3; // Only the streamer, moderators and subscribers can talk
STREAMER_MODERATOR_FOLLOWER = 4; // Only the streamer, moderators and followers can talk
STREAMER_MODERATOR_SUBSCRIBER_FOLLOWER = 5; // Only the streamer, moderators, subscribers and followers can talk
}
ChatLevelType chat_level = 1;
}