RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
Loading...
Searching...
No Matches
Message.h
Go to the documentation of this file.
1// message.h
2#pragma once
3#include <string>
4#include <string_view>
5#include <cstdint>
6#include "nlohmann/json.hpp"
7#include "Components.h"
8
9// If you use nlohmann::json in this TU, include it once anywhere before using helpers.
10// #include <nlohmann/json.hpp>
11
12enum class Role
13{
14 NONE,
16 PLAYER
17};
18
20{
22 LOCAL,
24 CUSTOM
25};
26
27namespace msg
28{
29
30 enum class DCType : uint8_t
31 {
32 // Snapshots and Composite Operations
34 Snapshot_Board = 101,
35 CommitMarker = 102,
36 CommitBoard = 103,
37 ImageChunk = 104,
38
39 //Operations
40 MarkerMove = 150,
41 MarkerMoveState = 151,
42 MarkerCreate = 1,
43 MarkerUpdate = 2, //Position and/or Visibility
44 MarkerDelete = 3,
45 FogCreate = 4,
46 FogUpdate = 5, //Size and/or Visibility
47 FogDelete = 6,
48 GridUpdate = 7, //Position, Size and/or Visibility
49 NoteCreate = 8,
50 NoteUpdate = 9, //Metadata and/or Content
51 NoteDelete = 10,
52
53 UserNameUpdate = 105, // Game channel: broadcast username changes
54
55 // chat ops (binary)
56 ChatGroupCreate = 200,
57 ChatGroupUpdate = 201,
58 ChatGroupDelete = 202,
59 ChatMessage = 203
60 };
61 inline std::string DCtypeString(DCType type)
62 {
63 std::string type_str;
64 switch (type)
65 {
67 type_str = "Snapshot_GameTable";
68 break;
70 type_str = "Snapshot_Board";
71 break;
73 type_str = "CommitMarker";
74 break;
76 type_str = "CommitBoard";
77 break;
79 type_str = "ImageChunk";
80 break;
82 type_str = "MarkerCreate";
83 break;
85 type_str = "MarkerUpdate";
86 break;
88 type_str = "MarkerDelete";
89 break;
91 type_str = "FogCreate";
92 break;
94 type_str = "FogUpdate";
95 break;
97 type_str = "FogDelete";
98 break;
100 type_str = "GridUpdate";
101 break;
103 type_str = "NoteCreate";
104 break;
106 type_str = "NoteUpdate";
107 break;
109 type_str = "NoteDelete";
110 break;
112 type_str = "ChatThreadCreate";
113 break;
115 type_str = "ChatThreadUpdate";
116 break;
118 type_str = "ChatThreadDelete";
119 break;
121 type_str = "ChatMessage";
122 break;
124 type_str = "MarkerMove";
125 break;
127 type_str = "MarkerMoveState";
128 break;
130 type_str = "UserNameUpdate";
131 break;
132 default:
133 type_str = "UnkownType";
134 break;
135 }
136 return type_str;
137 }
138
139 enum class ImageOwnerKind : uint8_t
140 {
141 Board = 0,
142 Marker = 1
143 };
144
146 {
147 uint64_t markerId = 0;
148 uint64_t boardId = 0;
149 std::string name; // filename/hint if you want
154 };
155
157 {
158 uint64_t boardId = 0;
159 std::string boardName;
163 };
164
165 // Single ready container with tag + optionals (only 1 engaged)
167 {
169 std::string fromPeerId; // optional: who sent it (fill in DC callback if you have it)
170
171 std::optional<uint64_t> tableId;
172 std::optional<uint64_t> boardId;
173 std::optional<uint64_t> markerId;
174 std::optional<uint64_t> fogId;
175
176 std::optional<Position> pos;
177 std::optional<Size> size;
178 std::optional<Visibility> vis;
179
180 std::optional<std::string> name;
181 std::optional<std::vector<uint8_t>> bytes;
182 std::optional<BoardMeta> boardMeta;
183 std::optional<MarkerMeta> markerMeta;
184
185 std::optional<uint64_t> threadId;
186 std::optional<uint64_t> ts;
187 std::optional<std::string> text; // chat text
188 std::optional<std::set<std::string>> participants; // thread participants
189
190 std::optional<Moving> mov;
191 std::optional<MarkerComponent> markerComp;
192
193 std::optional<Grid> grid;
194
195 std::optional<uint32_t> dragEpoch;
196 std::optional<uint32_t> seq;
197 std::optional<Role> senderRole;
198
199 std::optional<std::string> userUniqueId;
200 std::optional<uint8_t> rebound;
201 };
202
203 struct NetEvent
204 {
205 enum class Type
206 {
207 DcOpen,
208 DcClosed,
209 PcOpen,
210 PcClosed,
213 };
215 std::string peerId;
216 std::string label;
217 };
218
220 {
221 std::string fromPeer;
222 std::string label;
223 std::vector<uint8_t> bytes;
224 };
225
226 // ---------- Common JSON keys (shared) ----------
227 namespace key
228 {
229 inline constexpr std::string_view Type = "type";
230 inline constexpr std::string_view From = "from";
231 inline constexpr std::string_view To = "to";
232 inline constexpr std::string_view Broadcast = "broadcast";
233 inline constexpr std::string_view Timestamp = "ts";
234 inline constexpr std::string_view Text = "text";
235 inline constexpr std::string_view Clients = "clients";
236 inline constexpr std::string_view Event = "event";
237 inline constexpr std::string_view Username = "username";
238 inline constexpr std::string_view ClientId = "clientId";
239 inline constexpr std::string_view Target = "target";
240 inline constexpr std::string_view GmId = "gmId";
241 // Signaling-specific
242 inline constexpr std::string_view Sdp = "sdp";
243 inline constexpr std::string_view Candidate = "candidate";
244 inline constexpr std::string_view SdpMid = "sdpMid";
245 //inline constexpr std::string_view SdpMLineIndex = "sdpMLineIndex";
246
247 // Auth / control
248 inline constexpr std::string_view UniqueId = "uniqueId";
249 inline constexpr std::string_view AuthOk = "ok";
250 inline constexpr std::string_view AuthMsg = "msg";
251 inline constexpr std::string_view AuthToken = "token";
252 inline constexpr std::string_view Password = "password";
253
254 // DataChannel (game) generic keys (if you serialize as JSON)
255 inline constexpr std::string_view Label = "label"; // DC label if needed
256 inline constexpr std::string_view Payload = "payload"; // generic payload
257 inline constexpr std::string_view EntityId = "entityId";
258 inline constexpr std::string_view X = "x";
259 inline constexpr std::string_view Y = "y";
260 inline constexpr std::string_view Z = "z";
261 inline constexpr std::string_view Visible = "visible";
262 inline constexpr std::string_view ImageId = "imageId";
263 inline constexpr std::string_view BytesOffset = "offset";
264 inline constexpr std::string_view BytesTotal = "total";
265 inline constexpr std::string_view Chunk = "chunk";
266 } // namespace key
267
268 // ---------- Signaling message types (WebSocket) ----------
269 namespace signaling
270 {
271 inline constexpr std::string_view Join = "join";
272 inline constexpr std::string_view Offer = "offer";
273 inline constexpr std::string_view Answer = "answer";
274 inline constexpr std::string_view Presence = "presence";
275 inline constexpr std::string_view Candidate = "candidate";
276 inline constexpr std::string_view Ping = "ping";
277 inline constexpr std::string_view Pong = "pong"; // if you choose to send explicit pongs
278 inline constexpr std::string_view Auth = "auth";
279 inline constexpr std::string_view AuthResponse = "auth_response";
280 inline constexpr std::string_view Text = "text";
281 inline constexpr std::string_view ServerDisconnect = "server_disconnect";
282 inline constexpr std::string_view PeerDisconnect = "peer_disconnect";
283 } // namespace signaling
284
285 namespace value
286 {
287 inline constexpr std::string False = "false";
288 inline constexpr std::string True = "true";
289 } // namespace value
290
291 // ---------- DataChannel message types (game logic) ----------
292 // Prefer binary with a tiny header for performance, but define string labels too
293 namespace dc
294 {
295 namespace name
296 {
297 inline constexpr std::string Game = "game";
298 inline constexpr std::string Chat = "chat";
299 inline constexpr std::string Notes = "notes";
300 inline constexpr std::string MarkerMove = "marker_move";
301 } // namespace name
302
303 } // namespace dc
304
305 // --- DCType <-> string (chat only) ---
306 inline const char* DCTypeToJson(DCType t)
307 {
308 switch (t)
309 {
311 return "ChatGroupCreate";
313 return "ChatGroupUpdate";
315 return "ChatGroupDelete";
317 return "ChatMessage";
318 default:
319 return "";
320 }
321 }
322 inline bool DCTypeFromJson(std::string_view s, DCType& out)
323 {
324 if (s == "ChatGroupCreate")
325 {
327 return true;
328 }
329 if (s == "ChatGroupUpdate")
330 {
332 return true;
333 }
334 if (s == "ChatGroupDelete")
335 {
337 return true;
338 }
339 if (s == "ChatMessage")
340 {
342 return true;
343 }
344 return false;
345 }
346
347 // Common payload keys for chat JSON
348 namespace chatkey
349 {
350 inline constexpr std::string_view Type = "type"; // string (ChatMessage, ChatGroupCreate, ...)
351 inline constexpr std::string_view TableId = "tableId"; // u64
352 inline constexpr std::string_view GroupId = "groupId"; // u64
353 inline constexpr std::string_view Name = "name"; // string (group name)
354 inline constexpr std::string_view Parts = "participants"; // array<string> (peer ids)
355 inline constexpr std::string_view Ts = "ts"; // u64
356 inline constexpr std::string_view Username = "username"; // string
357 inline constexpr std::string_view Text = "text"; // string
358 } // namespace chatkey
359
360 // ========== JSON helpers (nlohmann::json) ==========
361 // Enable by including <nlohmann/json.hpp> before using these.
362
363 using Json = nlohmann::json;
364
365 // --- builders (chat JSON) ---
366 inline Json makeChatGroupCreate(uint64_t tableId, uint64_t groupId,
367 const std::string& name,
368 const std::set<std::string>& participants)
369 {
370 Json j = {
372 {std::string(chatkey::TableId), tableId},
373 {std::string(chatkey::GroupId), groupId},
374 {std::string(chatkey::Name), name},
375 {std::string(chatkey::Parts), Json::array()}};
376 for (auto& p : participants)
377 j[std::string(chatkey::Parts)].push_back(p);
378 return j;
379 }
380
381 inline Json makeChatGroupUpdate(uint64_t tableId, uint64_t groupId,
382 const std::string& name,
383 const std::set<std::string>& participants)
384 {
385 Json j = {
387 {std::string(chatkey::TableId), tableId},
388 {std::string(chatkey::GroupId), groupId},
389 {std::string(chatkey::Name), name},
390 {std::string(chatkey::Parts), Json::array()}};
391 for (auto& p : participants)
392 j[std::string(chatkey::Parts)].push_back(p);
393 return j;
394 }
395
396 inline Json makeChatGroupDelete(uint64_t tableId, uint64_t groupId)
397 {
398 return Json{
400 {std::string(chatkey::TableId), tableId},
401 {std::string(chatkey::GroupId), groupId}};
402 }
403
404 inline Json makeChatMessage(uint64_t tableId, uint64_t groupId,
405 uint64_t ts, const std::string& username,
406 const std::string& text)
407 {
408 return Json{
410 {std::string(chatkey::TableId), tableId},
411 {std::string(chatkey::GroupId), groupId},
412 {std::string(chatkey::Ts), ts},
413 {std::string(chatkey::Username), username},
414 {std::string(chatkey::Text), text}};
415 }
416
417 inline Json makeOffer(const std::string& from, const std::string& to,
418 const std::string& sdp, const std::string& username,
419 const std::string& uniqueId,
420 const std::string& broadcast = msg::value::False)
421 {
422 return Json{
423 {std::string(key::Type), std::string(signaling::Offer)},
424 {std::string(key::From), from},
425 {std::string(key::To), to},
426 {std::string(key::Broadcast), broadcast},
427 {std::string(key::Sdp), sdp},
428 {std::string(key::Username), username},
429 {std::string(key::UniqueId), uniqueId},
430 };
431 }
432
433 inline Json makeAnswer(const std::string& from, const std::string& to,
434 const std::string& sdp, const std::string& username,
435 const std::string& uniqueId,
436 const std::string& broadcast = msg::value::False)
437 {
438 return Json{
439 {std::string(key::Type), std::string(signaling::Answer)},
440 {std::string(key::From), from},
441 {std::string(key::To), to},
442 {std::string(key::Broadcast), broadcast},
443 {std::string(key::Sdp), sdp},
444 {std::string(key::Username), username},
445 {std::string(key::UniqueId), uniqueId},
446 };
447 }
448 inline Json makeCandidate(const std::string& from, const std::string& to, const std::string& cand, const std::string& broadcast = msg::value::False)
449 {
450 return Json{
451 {std::string(key::Type), std::string(signaling::Candidate)},
452 {std::string(key::From), from},
453 {std::string(key::To), to},
454 {std::string(key::Broadcast), broadcast},
455 {std::string(key::Candidate), cand}};
456 }
457
458 inline Json makePresence(const std::string& event, const std::string& clientId)
459 {
460 return Json{
461 {std::string(key::Type), std::string(signaling::Presence)},
462 {std::string(key::Event), event},
463 {std::string(key::ClientId), clientId}};
464 }
465
466 inline nlohmann::json makePeerDisconnect(const std::string& targetPeerId, bool broadcast = true)
467 {
468 return nlohmann::json{
469 {std::string(key::Type), std::string(signaling::PeerDisconnect)},
470 {std::string(key::Broadcast), broadcast ? std::string(msg::value::True) : std::string(msg::value::False)},
471 {std::string(key::Target), targetPeerId}};
472 }
473
475 {
476 return Json{
478 {std::string(msg::key::Broadcast), std::string(msg::value::True)}};
479 }
480
481 inline Json makePing(const std::string& from)
482 {
483 return Json{
484 {std::string(key::Type), std::string(signaling::Ping)},
485 {std::string(key::From), from}};
486 }
487 /* inline Json makeAuth(const std::string& token, const std::string& username)
488 {
489 return Json{
490 {std::string(key::Type), std::string(signaling::Auth)},
491 {std::string(key::AuthToken), token},
492 {std::string(key::Username), username},
493 };
494 }*/
495 inline Json makeAuth(const std::string& token,
496 const std::string& username,
497 const std::string& uniqueId)
498 {
499 return Json{
500 {std::string(key::Type), std::string(signaling::Auth)},
501 {std::string(key::AuthToken), token},
502 {std::string(key::Username), username},
503 {std::string(key::UniqueId), uniqueId},
504 };
505 }
506 inline nlohmann::json makeAuthResponse(const std::string ok, const std::string& msg,
507 const std::string& clientId, const std::string& username,
508 const std::vector<std::string>& clients = {},
509 const std::string& gmPeerId = "",
510 const std::string& uniqueId = "")
511 {
512 auto j = nlohmann::json{
513 {std::string(key::Type), std::string(signaling::AuthResponse)},
514 {std::string(key::AuthOk), ok},
515 {std::string(key::AuthMsg), msg},
516 {std::string(key::ClientId), clientId},
517 {std::string(key::Username), username}};
518 if (!clients.empty())
519 j[std::string(msg::key::Clients)] = clients;
520 if (!gmPeerId.empty())
521 j[key::GmId] = gmPeerId;
522 if (!uniqueId.empty())
523 j[std::string(key::UniqueId)] = uniqueId;
524 return j;
525 }
526 /* inline Json makeAuthResponse(const std::string ok, const std::string& msg, const std::string& clientId, const std::string& username, const std::vector<std::string>& clients = {})
527 {
528
529 auto j = Json{
530 {std::string(key::Type), std::string(signaling::AuthResponse)},
531 {std::string(key::AuthOk), ok},
532 {std::string(key::AuthMsg), msg},
533 {std::string(key::ClientId), clientId},
534 {std::string(key::Username), username}};
535
536 if (!clients.empty())
537 {
538 j[std::string(msg::key::Clients)] = clients; // array of peerId strings
539 };
540
541 return j;
542 }*/
543 //inline nlohmann::json makeAuthResponse(const std::string ok, const std::string& msg, const std::string& clientId, const std::string& username, const std::vector<std::string>& clients = {}, const std::string& gmPeerId = "")
544 //{
545 // auto j = nlohmann::json{
546 // {std::string(key::Type), std::string(signaling::AuthResponse)},
547 // {std::string(key::AuthOk), ok},
548 // {std::string(key::AuthMsg), msg},
549 // {std::string(key::ClientId), clientId},
550 // {std::string(key::Username), username}};
551 // if (!clients.empty())
552 // {
553 // j[std::string(msg::key::Clients)] = clients;
554 // }
555 // if (!gmPeerId.empty())
556 // {
557 // j[key::GmId] = gmPeerId; // NEW
558 // }
559 // return j;
560 //}
561 inline Json makeText(const std::string& from, const std::string& to, const std::string& text, bool broadcast = false)
562 {
563 return Json{
564 {std::string(key::Type), std::string(signaling::Text)},
565 {std::string(key::From), from},
566 {std::string(key::To), to},
567 {std::string(key::Broadcast), broadcast},
568 {std::string(key::Text), text}};
569 }
570
571 // ---- predicates ----
572 inline bool isType(const Json& j, std::string t)
573 {
574 auto it = j.find(std::string(key::Type));
575 return it != j.end() && it->is_string() && it->get_ref<const std::string&>() == t;
576 }
577
578 // ---- accessors (safe-ish) ----
579 inline std::string getString(const Json& j, std::string k, std::string def = {})
580 {
581 auto it = j.find(std::string(k));
582 return (it != j.end() && it->is_string()) ? it->get<std::string>() : std::move(def);
583 }
584 inline int getInt(const Json& j, std::string k, int def = 0)
585 {
586 auto it = j.find(std::string(k));
587 return (it != j.end() && it->is_number_integer()) ? it->get<int>() : def;
588 }
589 inline bool getBool(const Json& j, std::string k, bool def = false)
590 {
591 auto it = j.find(std::string(k));
592 return (it != j.end() && it->is_boolean()) ? it->get<bool>() : def;
593 }
594
595} // namespace msg
ConnectionType
Definition Message.h:20
Role
Definition Message.h:13
@ PLAYER
@ GAMEMASTER
constexpr std::string_view Ts
Definition Message.h:355
constexpr std::string_view Username
Definition Message.h:356
constexpr std::string_view Name
Definition Message.h:353
constexpr std::string_view Text
Definition Message.h:357
constexpr std::string_view Type
Definition Message.h:350
constexpr std::string_view Parts
Definition Message.h:354
constexpr std::string_view TableId
Definition Message.h:351
constexpr std::string_view GroupId
Definition Message.h:352
constexpr std::string Chat
Definition Message.h:298
constexpr std::string Game
Definition Message.h:297
constexpr std::string MarkerMove
Definition Message.h:300
constexpr std::string_view AuthToken
Definition Message.h:251
constexpr std::string_view Payload
Definition Message.h:256
constexpr std::string_view ImageId
Definition Message.h:262
constexpr std::string_view BytesTotal
Definition Message.h:264
constexpr std::string_view Type
Definition Message.h:229
constexpr std::string_view Y
Definition Message.h:259
constexpr std::string_view Event
Definition Message.h:236
constexpr std::string_view Target
Definition Message.h:239
constexpr std::string_view GmId
Definition Message.h:240
constexpr std::string_view To
Definition Message.h:231
constexpr std::string_view X
Definition Message.h:258
constexpr std::string_view EntityId
Definition Message.h:257
constexpr std::string_view UniqueId
Definition Message.h:248
constexpr std::string_view AuthOk
Definition Message.h:249
constexpr std::string_view From
Definition Message.h:230
constexpr std::string_view Sdp
Definition Message.h:242
constexpr std::string_view Chunk
Definition Message.h:265
constexpr std::string_view BytesOffset
Definition Message.h:263
constexpr std::string_view SdpMid
Definition Message.h:244
constexpr std::string_view Timestamp
Definition Message.h:233
constexpr std::string_view AuthMsg
Definition Message.h:250
constexpr std::string_view Z
Definition Message.h:260
constexpr std::string_view Visible
Definition Message.h:261
constexpr std::string_view Password
Definition Message.h:252
constexpr std::string_view Candidate
Definition Message.h:243
constexpr std::string_view Clients
Definition Message.h:235
constexpr std::string_view Username
Definition Message.h:237
constexpr std::string_view Text
Definition Message.h:234
constexpr std::string_view ClientId
Definition Message.h:238
constexpr std::string_view Broadcast
Definition Message.h:232
constexpr std::string_view Label
Definition Message.h:255
constexpr std::string_view ServerDisconnect
Definition Message.h:281
constexpr std::string_view PeerDisconnect
Definition Message.h:282
constexpr std::string_view Text
Definition Message.h:280
constexpr std::string_view Join
Definition Message.h:271
constexpr std::string_view Answer
Definition Message.h:273
constexpr std::string_view AuthResponse
Definition Message.h:279
constexpr std::string_view Ping
Definition Message.h:276
constexpr std::string_view Offer
Definition Message.h:272
constexpr std::string_view Pong
Definition Message.h:277
constexpr std::string_view Auth
Definition Message.h:278
constexpr std::string_view Presence
Definition Message.h:274
constexpr std::string_view Candidate
Definition Message.h:275
constexpr std::string False
Definition Message.h:287
constexpr std::string True
Definition Message.h:288
Definition Message.h:28
bool DCTypeFromJson(std::string_view s, DCType &out)
Definition Message.h:322
Json makeChatMessage(uint64_t tableId, uint64_t groupId, uint64_t ts, const std::string &username, const std::string &text)
Definition Message.h:404
Json makePing(const std::string &from)
Definition Message.h:481
Json makeOffer(const std::string &from, const std::string &to, const std::string &sdp, const std::string &username, const std::string &uniqueId, const std::string &broadcast=msg::value::False)
Definition Message.h:417
Json makeChatGroupUpdate(uint64_t tableId, uint64_t groupId, const std::string &name, const std::set< std::string > &participants)
Definition Message.h:381
Json makeBroadcastShutdown()
Definition Message.h:474
bool getBool(const Json &j, std::string k, bool def=false)
Definition Message.h:589
ImageOwnerKind
Definition Message.h:140
std::string getString(const Json &j, std::string k, std::string def={})
Definition Message.h:579
DCType
Definition Message.h:31
Json makePresence(const std::string &event, const std::string &clientId)
Definition Message.h:458
Json makeText(const std::string &from, const std::string &to, const std::string &text, bool broadcast=false)
Definition Message.h:561
nlohmann::json Json
Definition Message.h:363
nlohmann::json makePeerDisconnect(const std::string &targetPeerId, bool broadcast=true)
Definition Message.h:466
nlohmann::json makeAuthResponse(const std::string ok, const std::string &msg, const std::string &clientId, const std::string &username, const std::vector< std::string > &clients={}, const std::string &gmPeerId="", const std::string &uniqueId="")
Definition Message.h:506
Json makeCandidate(const std::string &from, const std::string &to, const std::string &cand, const std::string &broadcast=msg::value::False)
Definition Message.h:448
Json makeChatGroupCreate(uint64_t tableId, uint64_t groupId, const std::string &name, const std::set< std::string > &participants)
Definition Message.h:366
int getInt(const Json &j, std::string k, int def=0)
Definition Message.h:584
Json makeAnswer(const std::string &from, const std::string &to, const std::string &sdp, const std::string &username, const std::string &uniqueId, const std::string &broadcast=msg::value::False)
Definition Message.h:433
std::string DCtypeString(DCType type)
Definition Message.h:61
const char * DCTypeToJson(DCType t)
Definition Message.h:306
Json makeAuth(const std::string &token, const std::string &username, const std::string &uniqueId)
Definition Message.h:495
bool isType(const Json &j, std::string t)
Definition Message.h:572
Json makeChatGroupDelete(uint64_t tableId, uint64_t groupId)
Definition Message.h:396
Panning pan
Definition Message.h:160
uint64_t boardId
Definition Message.h:158
std::string boardName
Definition Message.h:159
std::string label
Definition Message.h:222
std::vector< uint8_t > bytes
Definition Message.h:223
std::string fromPeer
Definition Message.h:221
Visibility vis
Definition Message.h:152
uint64_t boardId
Definition Message.h:148
uint64_t markerId
Definition Message.h:147
std::string name
Definition Message.h:149
Position pos
Definition Message.h:150
std::string label
Definition Message.h:216
std::string peerId
Definition Message.h:215
std::optional< uint8_t > rebound
Definition Message.h:200
std::optional< MarkerMeta > markerMeta
Definition Message.h:183
std::optional< uint64_t > fogId
Definition Message.h:174
std::optional< Visibility > vis
Definition Message.h:178
std::optional< std::vector< uint8_t > > bytes
Definition Message.h:181
std::optional< uint64_t > markerId
Definition Message.h:173
std::optional< Role > senderRole
Definition Message.h:197
std::optional< MarkerComponent > markerComp
Definition Message.h:191
std::optional< Moving > mov
Definition Message.h:190
std::optional< Position > pos
Definition Message.h:176
std::optional< std::string > text
Definition Message.h:187
std::optional< Grid > grid
Definition Message.h:193
std::optional< std::string > userUniqueId
Definition Message.h:199
std::string fromPeerId
Definition Message.h:169
std::optional< uint32_t > dragEpoch
Definition Message.h:195
std::optional< uint32_t > seq
Definition Message.h:196
std::optional< BoardMeta > boardMeta
Definition Message.h:182
std::optional< uint64_t > ts
Definition Message.h:186
std::optional< uint64_t > boardId
Definition Message.h:172
std::optional< Size > size
Definition Message.h:177
std::optional< uint64_t > threadId
Definition Message.h:185
std::optional< std::string > name
Definition Message.h:180
std::optional< std::set< std::string > > participants
Definition Message.h:188
std::optional< uint64_t > tableId
Definition Message.h:171