···11+# @rachel-mp4/lrcproto
22+33+This repository defines the LRC protocol message schema using Protocol Buffers and provides generated code for both **TypeScript** and **Go**.
44+55+## Installation
66+77+### TypeScript
88+99+```bash
1010+npm install @rachel-mp4/lrcproto
1111+```
1212+1313+### Go
1414+1515+```go
1616+import "github.com/rachel.mp4/lrcproto/gen/go"
1717+```
1818+1919+## Schema
2020+2121+When implemented in a websocket, LRC communication occurs by sending **Events**, which in LRC 1.0 can be of 14 types. Their semantics may differ slightly if they are sent from client -> server or server -> client
2222+2323+```
2424+Ping #Requests a Pong
2525+2626+Pong #Response to a Ping
2727+2828+Init #Initializes my message (client -> server)
2929+ #or declares that a message was initialized (server -> client)
3030+Pub #Publishes my message (client -> server)
3131+ #or declares that a message was published (server -> client)
3232+Insert #Inserts a string at a given byte offset
3333+3434+Delete #Deletes the bytes between two offsets
3535+3636+Mute #Requests the server stop relaying events from a user
3737+3838+Unmute #Requests the server start relaying events from a user
3939+4040+Set #Sets my metadata
4141+4242+Get #Requests the included fields from the server (client -> server)
4343+ #or provides it to the client (server -> client)
4444+Kick #Requests to kick a user
4545+4646+Hug #Hugs a user
4747+4848+Ban #Requests to ban a user
4949+5050+Unban #Requests to unban a user
5151+```
5252+5353+The LRC protocol does not inherently determine how Mute, Unmute, Kick, Ban and Unban should be implemented. ExternalID and Secret fields allow for some form of verification of identity, which can occur outside of the protocol.
5454+5555+## License
5656+MIT
+1278
gen/ts/lrc.ts
···11+// @generated by protobuf-ts 2.10.0
22+// @generated from protobuf file "lrc.proto" (syntax proto3)
33+// tslint:disable
44+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
55+import type { IBinaryWriter } from "@protobuf-ts/runtime";
66+import { WireType } from "@protobuf-ts/runtime";
77+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
88+import type { IBinaryReader } from "@protobuf-ts/runtime";
99+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
1010+import type { PartialMessage } from "@protobuf-ts/runtime";
1111+import { reflectionMergePartial } from "@protobuf-ts/runtime";
1212+import { MessageType } from "@protobuf-ts/runtime";
1313+/**
1414+ * @generated from protobuf message Event
1515+ */
1616+export interface Event {
1717+ /**
1818+ * @generated from protobuf oneof: msg
1919+ */
2020+ msg: {
2121+ oneofKind: "ping";
2222+ /**
2323+ * @generated from protobuf field: Ping ping = 1;
2424+ */
2525+ ping: Ping;
2626+ } | {
2727+ oneofKind: "pong";
2828+ /**
2929+ * @generated from protobuf field: Pong pong = 2;
3030+ */
3131+ pong: Pong;
3232+ } | {
3333+ oneofKind: "init";
3434+ /**
3535+ * @generated from protobuf field: Init init = 3;
3636+ */
3737+ init: Init;
3838+ } | {
3939+ oneofKind: "pub";
4040+ /**
4141+ * @generated from protobuf field: Pub pub = 4;
4242+ */
4343+ pub: Pub;
4444+ } | {
4545+ oneofKind: "insert";
4646+ /**
4747+ * @generated from protobuf field: Insert insert = 5;
4848+ */
4949+ insert: Insert;
5050+ } | {
5151+ oneofKind: "delete";
5252+ /**
5353+ * @generated from protobuf field: Delete delete = 6;
5454+ */
5555+ delete: Delete;
5656+ } | {
5757+ oneofKind: "mute";
5858+ /**
5959+ * @generated from protobuf field: Mute mute = 7;
6060+ */
6161+ mute: Mute;
6262+ } | {
6363+ oneofKind: "unmute";
6464+ /**
6565+ * @generated from protobuf field: Unmute unmute = 8;
6666+ */
6767+ unmute: Unmute;
6868+ } | {
6969+ oneofKind: "set";
7070+ /**
7171+ * @generated from protobuf field: Set set = 9;
7272+ */
7373+ set: Set;
7474+ } | {
7575+ oneofKind: "get";
7676+ /**
7777+ * @generated from protobuf field: Get get = 10;
7878+ */
7979+ get: Get;
8080+ } | {
8181+ oneofKind: "kick";
8282+ /**
8383+ * @generated from protobuf field: Kick kick = 11;
8484+ */
8585+ kick: Kick;
8686+ } | {
8787+ oneofKind: "hug";
8888+ /**
8989+ * @generated from protobuf field: Hug hug = 12;
9090+ */
9191+ hug: Hug;
9292+ } | {
9393+ oneofKind: "ban";
9494+ /**
9595+ * @generated from protobuf field: Ban ban = 13;
9696+ */
9797+ ban: Ban;
9898+ } | {
9999+ oneofKind: "unban";
100100+ /**
101101+ * @generated from protobuf field: Unban unban = 14;
102102+ */
103103+ unban: Unban;
104104+ } | {
105105+ oneofKind: undefined;
106106+ };
107107+}
108108+/**
109109+ * @generated from protobuf message Ping
110110+ */
111111+export interface Ping {
112112+}
113113+/**
114114+ * @generated from protobuf message Pong
115115+ */
116116+export interface Pong {
117117+}
118118+/**
119119+ * @generated from protobuf message Init
120120+ */
121121+export interface Init {
122122+ /**
123123+ * @generated from protobuf field: uint32 id = 1;
124124+ */
125125+ id: number;
126126+ /**
127127+ * @generated from protobuf field: string nick = 2;
128128+ */
129129+ nick: string;
130130+ /**
131131+ * @generated from protobuf field: string externalID = 3;
132132+ */
133133+ externalID: string;
134134+ /**
135135+ * @generated from protobuf field: uint32 color = 4;
136136+ */
137137+ color: number;
138138+ /**
139139+ * @generated from protobuf field: bool echoed = 5;
140140+ */
141141+ echoed: boolean;
142142+}
143143+/**
144144+ * @generated from protobuf message Pub
145145+ */
146146+export interface Pub {
147147+ /**
148148+ * @generated from protobuf field: uint32 id = 1;
149149+ */
150150+ id: number;
151151+}
152152+/**
153153+ * @generated from protobuf message Insert
154154+ */
155155+export interface Insert {
156156+ /**
157157+ * @generated from protobuf field: uint32 id = 1;
158158+ */
159159+ id: number;
160160+ /**
161161+ * @generated from protobuf field: string body = 2;
162162+ */
163163+ body: string;
164164+ /**
165165+ * @generated from protobuf field: uint32 byteIndex = 3;
166166+ */
167167+ byteIndex: number;
168168+}
169169+/**
170170+ * @generated from protobuf message Delete
171171+ */
172172+export interface Delete {
173173+ /**
174174+ * @generated from protobuf field: uint32 id = 1;
175175+ */
176176+ id: number;
177177+ /**
178178+ * @generated from protobuf field: uint32 byteStart = 2;
179179+ */
180180+ byteStart: number;
181181+ /**
182182+ * @generated from protobuf field: uint32 byteEnd = 3;
183183+ */
184184+ byteEnd: number;
185185+}
186186+/**
187187+ * @generated from protobuf message Mute
188188+ */
189189+export interface Mute {
190190+ /**
191191+ * @generated from protobuf field: uint32 id = 1;
192192+ */
193193+ id: number;
194194+}
195195+/**
196196+ * @generated from protobuf message Unmute
197197+ */
198198+export interface Unmute {
199199+ /**
200200+ * @generated from protobuf field: uint32 id = 1;
201201+ */
202202+ id: number;
203203+}
204204+/**
205205+ * @generated from protobuf message Set
206206+ */
207207+export interface Set {
208208+ /**
209209+ * @generated from protobuf field: string nick = 1;
210210+ */
211211+ nick: string;
212212+ /**
213213+ * @generated from protobuf field: string externalID = 2;
214214+ */
215215+ externalID: string;
216216+ /**
217217+ * @generated from protobuf field: uint32 color = 3;
218218+ */
219219+ color: number;
220220+}
221221+/**
222222+ * @generated from protobuf message Get
223223+ */
224224+export interface Get {
225225+ /**
226226+ * @generated from protobuf field: string topic = 1;
227227+ */
228228+ topic: string;
229229+ /**
230230+ * @generated from protobuf field: uint32 connected = 2;
231231+ */
232232+ connected: number;
233233+}
234234+/**
235235+ * @generated from protobuf message Sudo
236236+ */
237237+export interface Sudo {
238238+ /**
239239+ * @generated from protobuf field: string externalID = 1;
240240+ */
241241+ externalID: string;
242242+ /**
243243+ * @generated from protobuf field: string secret = 2;
244244+ */
245245+ secret: string;
246246+}
247247+/**
248248+ * @generated from protobuf message Kick
249249+ */
250250+export interface Kick {
251251+ /**
252252+ * @generated from protobuf field: Sudo privileges = 1;
253253+ */
254254+ privileges?: Sudo;
255255+ /**
256256+ * @generated from protobuf field: uint32 id = 2;
257257+ */
258258+ id: number;
259259+}
260260+/**
261261+ * @generated from protobuf message Hug
262262+ */
263263+export interface Hug {
264264+ /**
265265+ * @generated from protobuf field: uint32 id = 1;
266266+ */
267267+ id: number;
268268+}
269269+/**
270270+ * @generated from protobuf message Ban
271271+ */
272272+export interface Ban {
273273+ /**
274274+ * @generated from protobuf field: Sudo privileges = 1;
275275+ */
276276+ privileges?: Sudo;
277277+ /**
278278+ * @generated from protobuf field: uint32 id = 2;
279279+ */
280280+ id: number;
281281+}
282282+/**
283283+ * @generated from protobuf message Unban
284284+ */
285285+export interface Unban {
286286+ /**
287287+ * @generated from protobuf field: Sudo privileges = 1;
288288+ */
289289+ privileges?: Sudo;
290290+ /**
291291+ * @generated from protobuf field: uint32 id = 2;
292292+ */
293293+ id: number;
294294+}
295295+// @generated message type with reflection information, may provide speed optimized methods
296296+class Event$Type extends MessageType<Event> {
297297+ constructor() {
298298+ super("Event", [
299299+ { no: 1, name: "ping", kind: "message", oneof: "msg", T: () => Ping },
300300+ { no: 2, name: "pong", kind: "message", oneof: "msg", T: () => Pong },
301301+ { no: 3, name: "init", kind: "message", oneof: "msg", T: () => Init },
302302+ { no: 4, name: "pub", kind: "message", oneof: "msg", T: () => Pub },
303303+ { no: 5, name: "insert", kind: "message", oneof: "msg", T: () => Insert },
304304+ { no: 6, name: "delete", kind: "message", oneof: "msg", T: () => Delete },
305305+ { no: 7, name: "mute", kind: "message", oneof: "msg", T: () => Mute },
306306+ { no: 8, name: "unmute", kind: "message", oneof: "msg", T: () => Unmute },
307307+ { no: 9, name: "set", kind: "message", oneof: "msg", T: () => Set },
308308+ { no: 10, name: "get", kind: "message", oneof: "msg", T: () => Get },
309309+ { no: 11, name: "kick", kind: "message", oneof: "msg", T: () => Kick },
310310+ { no: 12, name: "hug", kind: "message", oneof: "msg", T: () => Hug },
311311+ { no: 13, name: "ban", kind: "message", oneof: "msg", T: () => Ban },
312312+ { no: 14, name: "unban", kind: "message", oneof: "msg", T: () => Unban }
313313+ ]);
314314+ }
315315+ create(value?: PartialMessage<Event>): Event {
316316+ const message = globalThis.Object.create((this.messagePrototype!));
317317+ message.msg = { oneofKind: undefined };
318318+ if (value !== undefined)
319319+ reflectionMergePartial<Event>(this, message, value);
320320+ return message;
321321+ }
322322+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Event): Event {
323323+ let message = target ?? this.create(), end = reader.pos + length;
324324+ while (reader.pos < end) {
325325+ let [fieldNo, wireType] = reader.tag();
326326+ switch (fieldNo) {
327327+ case /* Ping ping */ 1:
328328+ message.msg = {
329329+ oneofKind: "ping",
330330+ ping: Ping.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).ping)
331331+ };
332332+ break;
333333+ case /* Pong pong */ 2:
334334+ message.msg = {
335335+ oneofKind: "pong",
336336+ pong: Pong.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).pong)
337337+ };
338338+ break;
339339+ case /* Init init */ 3:
340340+ message.msg = {
341341+ oneofKind: "init",
342342+ init: Init.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).init)
343343+ };
344344+ break;
345345+ case /* Pub pub */ 4:
346346+ message.msg = {
347347+ oneofKind: "pub",
348348+ pub: Pub.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).pub)
349349+ };
350350+ break;
351351+ case /* Insert insert */ 5:
352352+ message.msg = {
353353+ oneofKind: "insert",
354354+ insert: Insert.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).insert)
355355+ };
356356+ break;
357357+ case /* Delete delete */ 6:
358358+ message.msg = {
359359+ oneofKind: "delete",
360360+ delete: Delete.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).delete)
361361+ };
362362+ break;
363363+ case /* Mute mute */ 7:
364364+ message.msg = {
365365+ oneofKind: "mute",
366366+ mute: Mute.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).mute)
367367+ };
368368+ break;
369369+ case /* Unmute unmute */ 8:
370370+ message.msg = {
371371+ oneofKind: "unmute",
372372+ unmute: Unmute.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).unmute)
373373+ };
374374+ break;
375375+ case /* Set set */ 9:
376376+ message.msg = {
377377+ oneofKind: "set",
378378+ set: Set.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).set)
379379+ };
380380+ break;
381381+ case /* Get get */ 10:
382382+ message.msg = {
383383+ oneofKind: "get",
384384+ get: Get.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).get)
385385+ };
386386+ break;
387387+ case /* Kick kick */ 11:
388388+ message.msg = {
389389+ oneofKind: "kick",
390390+ kick: Kick.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).kick)
391391+ };
392392+ break;
393393+ case /* Hug hug */ 12:
394394+ message.msg = {
395395+ oneofKind: "hug",
396396+ hug: Hug.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).hug)
397397+ };
398398+ break;
399399+ case /* Ban ban */ 13:
400400+ message.msg = {
401401+ oneofKind: "ban",
402402+ ban: Ban.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).ban)
403403+ };
404404+ break;
405405+ case /* Unban unban */ 14:
406406+ message.msg = {
407407+ oneofKind: "unban",
408408+ unban: Unban.internalBinaryRead(reader, reader.uint32(), options, (message.msg as any).unban)
409409+ };
410410+ break;
411411+ default:
412412+ let u = options.readUnknownField;
413413+ if (u === "throw")
414414+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
415415+ let d = reader.skip(wireType);
416416+ if (u !== false)
417417+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
418418+ }
419419+ }
420420+ return message;
421421+ }
422422+ internalBinaryWrite(message: Event, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
423423+ /* Ping ping = 1; */
424424+ if (message.msg.oneofKind === "ping")
425425+ Ping.internalBinaryWrite(message.msg.ping, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
426426+ /* Pong pong = 2; */
427427+ if (message.msg.oneofKind === "pong")
428428+ Pong.internalBinaryWrite(message.msg.pong, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
429429+ /* Init init = 3; */
430430+ if (message.msg.oneofKind === "init")
431431+ Init.internalBinaryWrite(message.msg.init, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
432432+ /* Pub pub = 4; */
433433+ if (message.msg.oneofKind === "pub")
434434+ Pub.internalBinaryWrite(message.msg.pub, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
435435+ /* Insert insert = 5; */
436436+ if (message.msg.oneofKind === "insert")
437437+ Insert.internalBinaryWrite(message.msg.insert, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
438438+ /* Delete delete = 6; */
439439+ if (message.msg.oneofKind === "delete")
440440+ Delete.internalBinaryWrite(message.msg.delete, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
441441+ /* Mute mute = 7; */
442442+ if (message.msg.oneofKind === "mute")
443443+ Mute.internalBinaryWrite(message.msg.mute, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
444444+ /* Unmute unmute = 8; */
445445+ if (message.msg.oneofKind === "unmute")
446446+ Unmute.internalBinaryWrite(message.msg.unmute, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
447447+ /* Set set = 9; */
448448+ if (message.msg.oneofKind === "set")
449449+ Set.internalBinaryWrite(message.msg.set, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
450450+ /* Get get = 10; */
451451+ if (message.msg.oneofKind === "get")
452452+ Get.internalBinaryWrite(message.msg.get, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
453453+ /* Kick kick = 11; */
454454+ if (message.msg.oneofKind === "kick")
455455+ Kick.internalBinaryWrite(message.msg.kick, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
456456+ /* Hug hug = 12; */
457457+ if (message.msg.oneofKind === "hug")
458458+ Hug.internalBinaryWrite(message.msg.hug, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
459459+ /* Ban ban = 13; */
460460+ if (message.msg.oneofKind === "ban")
461461+ Ban.internalBinaryWrite(message.msg.ban, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
462462+ /* Unban unban = 14; */
463463+ if (message.msg.oneofKind === "unban")
464464+ Unban.internalBinaryWrite(message.msg.unban, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
465465+ let u = options.writeUnknownFields;
466466+ if (u !== false)
467467+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
468468+ return writer;
469469+ }
470470+}
471471+/**
472472+ * @generated MessageType for protobuf message Event
473473+ */
474474+export const Event = new Event$Type();
475475+// @generated message type with reflection information, may provide speed optimized methods
476476+class Ping$Type extends MessageType<Ping> {
477477+ constructor() {
478478+ super("Ping", []);
479479+ }
480480+ create(value?: PartialMessage<Ping>): Ping {
481481+ const message = globalThis.Object.create((this.messagePrototype!));
482482+ if (value !== undefined)
483483+ reflectionMergePartial<Ping>(this, message, value);
484484+ return message;
485485+ }
486486+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Ping): Ping {
487487+ let message = target ?? this.create(), end = reader.pos + length;
488488+ while (reader.pos < end) {
489489+ let [fieldNo, wireType] = reader.tag();
490490+ switch (fieldNo) {
491491+ default:
492492+ let u = options.readUnknownField;
493493+ if (u === "throw")
494494+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
495495+ let d = reader.skip(wireType);
496496+ if (u !== false)
497497+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
498498+ }
499499+ }
500500+ return message;
501501+ }
502502+ internalBinaryWrite(message: Ping, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
503503+ let u = options.writeUnknownFields;
504504+ if (u !== false)
505505+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
506506+ return writer;
507507+ }
508508+}
509509+/**
510510+ * @generated MessageType for protobuf message Ping
511511+ */
512512+export const Ping = new Ping$Type();
513513+// @generated message type with reflection information, may provide speed optimized methods
514514+class Pong$Type extends MessageType<Pong> {
515515+ constructor() {
516516+ super("Pong", []);
517517+ }
518518+ create(value?: PartialMessage<Pong>): Pong {
519519+ const message = globalThis.Object.create((this.messagePrototype!));
520520+ if (value !== undefined)
521521+ reflectionMergePartial<Pong>(this, message, value);
522522+ return message;
523523+ }
524524+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Pong): Pong {
525525+ let message = target ?? this.create(), end = reader.pos + length;
526526+ while (reader.pos < end) {
527527+ let [fieldNo, wireType] = reader.tag();
528528+ switch (fieldNo) {
529529+ default:
530530+ let u = options.readUnknownField;
531531+ if (u === "throw")
532532+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
533533+ let d = reader.skip(wireType);
534534+ if (u !== false)
535535+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
536536+ }
537537+ }
538538+ return message;
539539+ }
540540+ internalBinaryWrite(message: Pong, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
541541+ let u = options.writeUnknownFields;
542542+ if (u !== false)
543543+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
544544+ return writer;
545545+ }
546546+}
547547+/**
548548+ * @generated MessageType for protobuf message Pong
549549+ */
550550+export const Pong = new Pong$Type();
551551+// @generated message type with reflection information, may provide speed optimized methods
552552+class Init$Type extends MessageType<Init> {
553553+ constructor() {
554554+ super("Init", [
555555+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
556556+ { no: 2, name: "nick", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
557557+ { no: 3, name: "externalID", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
558558+ { no: 4, name: "color", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
559559+ { no: 5, name: "echoed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
560560+ ]);
561561+ }
562562+ create(value?: PartialMessage<Init>): Init {
563563+ const message = globalThis.Object.create((this.messagePrototype!));
564564+ message.id = 0;
565565+ message.nick = "";
566566+ message.externalID = "";
567567+ message.color = 0;
568568+ message.echoed = false;
569569+ if (value !== undefined)
570570+ reflectionMergePartial<Init>(this, message, value);
571571+ return message;
572572+ }
573573+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Init): Init {
574574+ let message = target ?? this.create(), end = reader.pos + length;
575575+ while (reader.pos < end) {
576576+ let [fieldNo, wireType] = reader.tag();
577577+ switch (fieldNo) {
578578+ case /* uint32 id */ 1:
579579+ message.id = reader.uint32();
580580+ break;
581581+ case /* string nick */ 2:
582582+ message.nick = reader.string();
583583+ break;
584584+ case /* string externalID */ 3:
585585+ message.externalID = reader.string();
586586+ break;
587587+ case /* uint32 color */ 4:
588588+ message.color = reader.uint32();
589589+ break;
590590+ case /* bool echoed */ 5:
591591+ message.echoed = reader.bool();
592592+ break;
593593+ default:
594594+ let u = options.readUnknownField;
595595+ if (u === "throw")
596596+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
597597+ let d = reader.skip(wireType);
598598+ if (u !== false)
599599+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
600600+ }
601601+ }
602602+ return message;
603603+ }
604604+ internalBinaryWrite(message: Init, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
605605+ /* uint32 id = 1; */
606606+ if (message.id !== 0)
607607+ writer.tag(1, WireType.Varint).uint32(message.id);
608608+ /* string nick = 2; */
609609+ if (message.nick !== "")
610610+ writer.tag(2, WireType.LengthDelimited).string(message.nick);
611611+ /* string externalID = 3; */
612612+ if (message.externalID !== "")
613613+ writer.tag(3, WireType.LengthDelimited).string(message.externalID);
614614+ /* uint32 color = 4; */
615615+ if (message.color !== 0)
616616+ writer.tag(4, WireType.Varint).uint32(message.color);
617617+ /* bool echoed = 5; */
618618+ if (message.echoed !== false)
619619+ writer.tag(5, WireType.Varint).bool(message.echoed);
620620+ let u = options.writeUnknownFields;
621621+ if (u !== false)
622622+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
623623+ return writer;
624624+ }
625625+}
626626+/**
627627+ * @generated MessageType for protobuf message Init
628628+ */
629629+export const Init = new Init$Type();
630630+// @generated message type with reflection information, may provide speed optimized methods
631631+class Pub$Type extends MessageType<Pub> {
632632+ constructor() {
633633+ super("Pub", [
634634+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
635635+ ]);
636636+ }
637637+ create(value?: PartialMessage<Pub>): Pub {
638638+ const message = globalThis.Object.create((this.messagePrototype!));
639639+ message.id = 0;
640640+ if (value !== undefined)
641641+ reflectionMergePartial<Pub>(this, message, value);
642642+ return message;
643643+ }
644644+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Pub): Pub {
645645+ let message = target ?? this.create(), end = reader.pos + length;
646646+ while (reader.pos < end) {
647647+ let [fieldNo, wireType] = reader.tag();
648648+ switch (fieldNo) {
649649+ case /* uint32 id */ 1:
650650+ message.id = reader.uint32();
651651+ break;
652652+ default:
653653+ let u = options.readUnknownField;
654654+ if (u === "throw")
655655+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
656656+ let d = reader.skip(wireType);
657657+ if (u !== false)
658658+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
659659+ }
660660+ }
661661+ return message;
662662+ }
663663+ internalBinaryWrite(message: Pub, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
664664+ /* uint32 id = 1; */
665665+ if (message.id !== 0)
666666+ writer.tag(1, WireType.Varint).uint32(message.id);
667667+ let u = options.writeUnknownFields;
668668+ if (u !== false)
669669+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
670670+ return writer;
671671+ }
672672+}
673673+/**
674674+ * @generated MessageType for protobuf message Pub
675675+ */
676676+export const Pub = new Pub$Type();
677677+// @generated message type with reflection information, may provide speed optimized methods
678678+class Insert$Type extends MessageType<Insert> {
679679+ constructor() {
680680+ super("Insert", [
681681+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
682682+ { no: 2, name: "body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
683683+ { no: 3, name: "byteIndex", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
684684+ ]);
685685+ }
686686+ create(value?: PartialMessage<Insert>): Insert {
687687+ const message = globalThis.Object.create((this.messagePrototype!));
688688+ message.id = 0;
689689+ message.body = "";
690690+ message.byteIndex = 0;
691691+ if (value !== undefined)
692692+ reflectionMergePartial<Insert>(this, message, value);
693693+ return message;
694694+ }
695695+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Insert): Insert {
696696+ let message = target ?? this.create(), end = reader.pos + length;
697697+ while (reader.pos < end) {
698698+ let [fieldNo, wireType] = reader.tag();
699699+ switch (fieldNo) {
700700+ case /* uint32 id */ 1:
701701+ message.id = reader.uint32();
702702+ break;
703703+ case /* string body */ 2:
704704+ message.body = reader.string();
705705+ break;
706706+ case /* uint32 byteIndex */ 3:
707707+ message.byteIndex = reader.uint32();
708708+ break;
709709+ default:
710710+ let u = options.readUnknownField;
711711+ if (u === "throw")
712712+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
713713+ let d = reader.skip(wireType);
714714+ if (u !== false)
715715+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
716716+ }
717717+ }
718718+ return message;
719719+ }
720720+ internalBinaryWrite(message: Insert, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
721721+ /* uint32 id = 1; */
722722+ if (message.id !== 0)
723723+ writer.tag(1, WireType.Varint).uint32(message.id);
724724+ /* string body = 2; */
725725+ if (message.body !== "")
726726+ writer.tag(2, WireType.LengthDelimited).string(message.body);
727727+ /* uint32 byteIndex = 3; */
728728+ if (message.byteIndex !== 0)
729729+ writer.tag(3, WireType.Varint).uint32(message.byteIndex);
730730+ let u = options.writeUnknownFields;
731731+ if (u !== false)
732732+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
733733+ return writer;
734734+ }
735735+}
736736+/**
737737+ * @generated MessageType for protobuf message Insert
738738+ */
739739+export const Insert = new Insert$Type();
740740+// @generated message type with reflection information, may provide speed optimized methods
741741+class Delete$Type extends MessageType<Delete> {
742742+ constructor() {
743743+ super("Delete", [
744744+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
745745+ { no: 2, name: "byteStart", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
746746+ { no: 3, name: "byteEnd", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
747747+ ]);
748748+ }
749749+ create(value?: PartialMessage<Delete>): Delete {
750750+ const message = globalThis.Object.create((this.messagePrototype!));
751751+ message.id = 0;
752752+ message.byteStart = 0;
753753+ message.byteEnd = 0;
754754+ if (value !== undefined)
755755+ reflectionMergePartial<Delete>(this, message, value);
756756+ return message;
757757+ }
758758+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Delete): Delete {
759759+ let message = target ?? this.create(), end = reader.pos + length;
760760+ while (reader.pos < end) {
761761+ let [fieldNo, wireType] = reader.tag();
762762+ switch (fieldNo) {
763763+ case /* uint32 id */ 1:
764764+ message.id = reader.uint32();
765765+ break;
766766+ case /* uint32 byteStart */ 2:
767767+ message.byteStart = reader.uint32();
768768+ break;
769769+ case /* uint32 byteEnd */ 3:
770770+ message.byteEnd = reader.uint32();
771771+ break;
772772+ default:
773773+ let u = options.readUnknownField;
774774+ if (u === "throw")
775775+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
776776+ let d = reader.skip(wireType);
777777+ if (u !== false)
778778+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
779779+ }
780780+ }
781781+ return message;
782782+ }
783783+ internalBinaryWrite(message: Delete, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
784784+ /* uint32 id = 1; */
785785+ if (message.id !== 0)
786786+ writer.tag(1, WireType.Varint).uint32(message.id);
787787+ /* uint32 byteStart = 2; */
788788+ if (message.byteStart !== 0)
789789+ writer.tag(2, WireType.Varint).uint32(message.byteStart);
790790+ /* uint32 byteEnd = 3; */
791791+ if (message.byteEnd !== 0)
792792+ writer.tag(3, WireType.Varint).uint32(message.byteEnd);
793793+ let u = options.writeUnknownFields;
794794+ if (u !== false)
795795+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
796796+ return writer;
797797+ }
798798+}
799799+/**
800800+ * @generated MessageType for protobuf message Delete
801801+ */
802802+export const Delete = new Delete$Type();
803803+// @generated message type with reflection information, may provide speed optimized methods
804804+class Mute$Type extends MessageType<Mute> {
805805+ constructor() {
806806+ super("Mute", [
807807+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
808808+ ]);
809809+ }
810810+ create(value?: PartialMessage<Mute>): Mute {
811811+ const message = globalThis.Object.create((this.messagePrototype!));
812812+ message.id = 0;
813813+ if (value !== undefined)
814814+ reflectionMergePartial<Mute>(this, message, value);
815815+ return message;
816816+ }
817817+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mute): Mute {
818818+ let message = target ?? this.create(), end = reader.pos + length;
819819+ while (reader.pos < end) {
820820+ let [fieldNo, wireType] = reader.tag();
821821+ switch (fieldNo) {
822822+ case /* uint32 id */ 1:
823823+ message.id = reader.uint32();
824824+ break;
825825+ default:
826826+ let u = options.readUnknownField;
827827+ if (u === "throw")
828828+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
829829+ let d = reader.skip(wireType);
830830+ if (u !== false)
831831+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
832832+ }
833833+ }
834834+ return message;
835835+ }
836836+ internalBinaryWrite(message: Mute, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
837837+ /* uint32 id = 1; */
838838+ if (message.id !== 0)
839839+ writer.tag(1, WireType.Varint).uint32(message.id);
840840+ let u = options.writeUnknownFields;
841841+ if (u !== false)
842842+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
843843+ return writer;
844844+ }
845845+}
846846+/**
847847+ * @generated MessageType for protobuf message Mute
848848+ */
849849+export const Mute = new Mute$Type();
850850+// @generated message type with reflection information, may provide speed optimized methods
851851+class Unmute$Type extends MessageType<Unmute> {
852852+ constructor() {
853853+ super("Unmute", [
854854+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
855855+ ]);
856856+ }
857857+ create(value?: PartialMessage<Unmute>): Unmute {
858858+ const message = globalThis.Object.create((this.messagePrototype!));
859859+ message.id = 0;
860860+ if (value !== undefined)
861861+ reflectionMergePartial<Unmute>(this, message, value);
862862+ return message;
863863+ }
864864+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Unmute): Unmute {
865865+ let message = target ?? this.create(), end = reader.pos + length;
866866+ while (reader.pos < end) {
867867+ let [fieldNo, wireType] = reader.tag();
868868+ switch (fieldNo) {
869869+ case /* uint32 id */ 1:
870870+ message.id = reader.uint32();
871871+ break;
872872+ default:
873873+ let u = options.readUnknownField;
874874+ if (u === "throw")
875875+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
876876+ let d = reader.skip(wireType);
877877+ if (u !== false)
878878+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
879879+ }
880880+ }
881881+ return message;
882882+ }
883883+ internalBinaryWrite(message: Unmute, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
884884+ /* uint32 id = 1; */
885885+ if (message.id !== 0)
886886+ writer.tag(1, WireType.Varint).uint32(message.id);
887887+ let u = options.writeUnknownFields;
888888+ if (u !== false)
889889+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
890890+ return writer;
891891+ }
892892+}
893893+/**
894894+ * @generated MessageType for protobuf message Unmute
895895+ */
896896+export const Unmute = new Unmute$Type();
897897+// @generated message type with reflection information, may provide speed optimized methods
898898+class Set$Type extends MessageType<Set> {
899899+ constructor() {
900900+ super("Set", [
901901+ { no: 1, name: "nick", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
902902+ { no: 2, name: "externalID", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
903903+ { no: 3, name: "color", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
904904+ ]);
905905+ }
906906+ create(value?: PartialMessage<Set>): Set {
907907+ const message = globalThis.Object.create((this.messagePrototype!));
908908+ message.nick = "";
909909+ message.externalID = "";
910910+ message.color = 0;
911911+ if (value !== undefined)
912912+ reflectionMergePartial<Set>(this, message, value);
913913+ return message;
914914+ }
915915+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Set): Set {
916916+ let message = target ?? this.create(), end = reader.pos + length;
917917+ while (reader.pos < end) {
918918+ let [fieldNo, wireType] = reader.tag();
919919+ switch (fieldNo) {
920920+ case /* string nick */ 1:
921921+ message.nick = reader.string();
922922+ break;
923923+ case /* string externalID */ 2:
924924+ message.externalID = reader.string();
925925+ break;
926926+ case /* uint32 color */ 3:
927927+ message.color = reader.uint32();
928928+ break;
929929+ default:
930930+ let u = options.readUnknownField;
931931+ if (u === "throw")
932932+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
933933+ let d = reader.skip(wireType);
934934+ if (u !== false)
935935+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
936936+ }
937937+ }
938938+ return message;
939939+ }
940940+ internalBinaryWrite(message: Set, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
941941+ /* string nick = 1; */
942942+ if (message.nick !== "")
943943+ writer.tag(1, WireType.LengthDelimited).string(message.nick);
944944+ /* string externalID = 2; */
945945+ if (message.externalID !== "")
946946+ writer.tag(2, WireType.LengthDelimited).string(message.externalID);
947947+ /* uint32 color = 3; */
948948+ if (message.color !== 0)
949949+ writer.tag(3, WireType.Varint).uint32(message.color);
950950+ let u = options.writeUnknownFields;
951951+ if (u !== false)
952952+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
953953+ return writer;
954954+ }
955955+}
956956+/**
957957+ * @generated MessageType for protobuf message Set
958958+ */
959959+export const Set = new Set$Type();
960960+// @generated message type with reflection information, may provide speed optimized methods
961961+class Get$Type extends MessageType<Get> {
962962+ constructor() {
963963+ super("Get", [
964964+ { no: 1, name: "topic", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
965965+ { no: 2, name: "connected", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
966966+ ]);
967967+ }
968968+ create(value?: PartialMessage<Get>): Get {
969969+ const message = globalThis.Object.create((this.messagePrototype!));
970970+ message.topic = "";
971971+ message.connected = 0;
972972+ if (value !== undefined)
973973+ reflectionMergePartial<Get>(this, message, value);
974974+ return message;
975975+ }
976976+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Get): Get {
977977+ let message = target ?? this.create(), end = reader.pos + length;
978978+ while (reader.pos < end) {
979979+ let [fieldNo, wireType] = reader.tag();
980980+ switch (fieldNo) {
981981+ case /* string topic */ 1:
982982+ message.topic = reader.string();
983983+ break;
984984+ case /* uint32 connected */ 2:
985985+ message.connected = reader.uint32();
986986+ break;
987987+ default:
988988+ let u = options.readUnknownField;
989989+ if (u === "throw")
990990+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
991991+ let d = reader.skip(wireType);
992992+ if (u !== false)
993993+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
994994+ }
995995+ }
996996+ return message;
997997+ }
998998+ internalBinaryWrite(message: Get, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
999999+ /* string topic = 1; */
10001000+ if (message.topic !== "")
10011001+ writer.tag(1, WireType.LengthDelimited).string(message.topic);
10021002+ /* uint32 connected = 2; */
10031003+ if (message.connected !== 0)
10041004+ writer.tag(2, WireType.Varint).uint32(message.connected);
10051005+ let u = options.writeUnknownFields;
10061006+ if (u !== false)
10071007+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10081008+ return writer;
10091009+ }
10101010+}
10111011+/**
10121012+ * @generated MessageType for protobuf message Get
10131013+ */
10141014+export const Get = new Get$Type();
10151015+// @generated message type with reflection information, may provide speed optimized methods
10161016+class Sudo$Type extends MessageType<Sudo> {
10171017+ constructor() {
10181018+ super("Sudo", [
10191019+ { no: 1, name: "externalID", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
10201020+ { no: 2, name: "secret", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
10211021+ ]);
10221022+ }
10231023+ create(value?: PartialMessage<Sudo>): Sudo {
10241024+ const message = globalThis.Object.create((this.messagePrototype!));
10251025+ message.externalID = "";
10261026+ message.secret = "";
10271027+ if (value !== undefined)
10281028+ reflectionMergePartial<Sudo>(this, message, value);
10291029+ return message;
10301030+ }
10311031+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Sudo): Sudo {
10321032+ let message = target ?? this.create(), end = reader.pos + length;
10331033+ while (reader.pos < end) {
10341034+ let [fieldNo, wireType] = reader.tag();
10351035+ switch (fieldNo) {
10361036+ case /* string externalID */ 1:
10371037+ message.externalID = reader.string();
10381038+ break;
10391039+ case /* string secret */ 2:
10401040+ message.secret = reader.string();
10411041+ break;
10421042+ default:
10431043+ let u = options.readUnknownField;
10441044+ if (u === "throw")
10451045+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10461046+ let d = reader.skip(wireType);
10471047+ if (u !== false)
10481048+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10491049+ }
10501050+ }
10511051+ return message;
10521052+ }
10531053+ internalBinaryWrite(message: Sudo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
10541054+ /* string externalID = 1; */
10551055+ if (message.externalID !== "")
10561056+ writer.tag(1, WireType.LengthDelimited).string(message.externalID);
10571057+ /* string secret = 2; */
10581058+ if (message.secret !== "")
10591059+ writer.tag(2, WireType.LengthDelimited).string(message.secret);
10601060+ let u = options.writeUnknownFields;
10611061+ if (u !== false)
10621062+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10631063+ return writer;
10641064+ }
10651065+}
10661066+/**
10671067+ * @generated MessageType for protobuf message Sudo
10681068+ */
10691069+export const Sudo = new Sudo$Type();
10701070+// @generated message type with reflection information, may provide speed optimized methods
10711071+class Kick$Type extends MessageType<Kick> {
10721072+ constructor() {
10731073+ super("Kick", [
10741074+ { no: 1, name: "privileges", kind: "message", T: () => Sudo },
10751075+ { no: 2, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
10761076+ ]);
10771077+ }
10781078+ create(value?: PartialMessage<Kick>): Kick {
10791079+ const message = globalThis.Object.create((this.messagePrototype!));
10801080+ message.id = 0;
10811081+ if (value !== undefined)
10821082+ reflectionMergePartial<Kick>(this, message, value);
10831083+ return message;
10841084+ }
10851085+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Kick): Kick {
10861086+ let message = target ?? this.create(), end = reader.pos + length;
10871087+ while (reader.pos < end) {
10881088+ let [fieldNo, wireType] = reader.tag();
10891089+ switch (fieldNo) {
10901090+ case /* Sudo privileges */ 1:
10911091+ message.privileges = Sudo.internalBinaryRead(reader, reader.uint32(), options, message.privileges);
10921092+ break;
10931093+ case /* uint32 id */ 2:
10941094+ message.id = reader.uint32();
10951095+ break;
10961096+ default:
10971097+ let u = options.readUnknownField;
10981098+ if (u === "throw")
10991099+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11001100+ let d = reader.skip(wireType);
11011101+ if (u !== false)
11021102+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11031103+ }
11041104+ }
11051105+ return message;
11061106+ }
11071107+ internalBinaryWrite(message: Kick, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
11081108+ /* Sudo privileges = 1; */
11091109+ if (message.privileges)
11101110+ Sudo.internalBinaryWrite(message.privileges, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
11111111+ /* uint32 id = 2; */
11121112+ if (message.id !== 0)
11131113+ writer.tag(2, WireType.Varint).uint32(message.id);
11141114+ let u = options.writeUnknownFields;
11151115+ if (u !== false)
11161116+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11171117+ return writer;
11181118+ }
11191119+}
11201120+/**
11211121+ * @generated MessageType for protobuf message Kick
11221122+ */
11231123+export const Kick = new Kick$Type();
11241124+// @generated message type with reflection information, may provide speed optimized methods
11251125+class Hug$Type extends MessageType<Hug> {
11261126+ constructor() {
11271127+ super("Hug", [
11281128+ { no: 1, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
11291129+ ]);
11301130+ }
11311131+ create(value?: PartialMessage<Hug>): Hug {
11321132+ const message = globalThis.Object.create((this.messagePrototype!));
11331133+ message.id = 0;
11341134+ if (value !== undefined)
11351135+ reflectionMergePartial<Hug>(this, message, value);
11361136+ return message;
11371137+ }
11381138+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Hug): Hug {
11391139+ let message = target ?? this.create(), end = reader.pos + length;
11401140+ while (reader.pos < end) {
11411141+ let [fieldNo, wireType] = reader.tag();
11421142+ switch (fieldNo) {
11431143+ case /* uint32 id */ 1:
11441144+ message.id = reader.uint32();
11451145+ break;
11461146+ default:
11471147+ let u = options.readUnknownField;
11481148+ if (u === "throw")
11491149+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11501150+ let d = reader.skip(wireType);
11511151+ if (u !== false)
11521152+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11531153+ }
11541154+ }
11551155+ return message;
11561156+ }
11571157+ internalBinaryWrite(message: Hug, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
11581158+ /* uint32 id = 1; */
11591159+ if (message.id !== 0)
11601160+ writer.tag(1, WireType.Varint).uint32(message.id);
11611161+ let u = options.writeUnknownFields;
11621162+ if (u !== false)
11631163+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11641164+ return writer;
11651165+ }
11661166+}
11671167+/**
11681168+ * @generated MessageType for protobuf message Hug
11691169+ */
11701170+export const Hug = new Hug$Type();
11711171+// @generated message type with reflection information, may provide speed optimized methods
11721172+class Ban$Type extends MessageType<Ban> {
11731173+ constructor() {
11741174+ super("Ban", [
11751175+ { no: 1, name: "privileges", kind: "message", T: () => Sudo },
11761176+ { no: 2, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
11771177+ ]);
11781178+ }
11791179+ create(value?: PartialMessage<Ban>): Ban {
11801180+ const message = globalThis.Object.create((this.messagePrototype!));
11811181+ message.id = 0;
11821182+ if (value !== undefined)
11831183+ reflectionMergePartial<Ban>(this, message, value);
11841184+ return message;
11851185+ }
11861186+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Ban): Ban {
11871187+ let message = target ?? this.create(), end = reader.pos + length;
11881188+ while (reader.pos < end) {
11891189+ let [fieldNo, wireType] = reader.tag();
11901190+ switch (fieldNo) {
11911191+ case /* Sudo privileges */ 1:
11921192+ message.privileges = Sudo.internalBinaryRead(reader, reader.uint32(), options, message.privileges);
11931193+ break;
11941194+ case /* uint32 id */ 2:
11951195+ message.id = reader.uint32();
11961196+ break;
11971197+ default:
11981198+ let u = options.readUnknownField;
11991199+ if (u === "throw")
12001200+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12011201+ let d = reader.skip(wireType);
12021202+ if (u !== false)
12031203+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12041204+ }
12051205+ }
12061206+ return message;
12071207+ }
12081208+ internalBinaryWrite(message: Ban, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
12091209+ /* Sudo privileges = 1; */
12101210+ if (message.privileges)
12111211+ Sudo.internalBinaryWrite(message.privileges, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
12121212+ /* uint32 id = 2; */
12131213+ if (message.id !== 0)
12141214+ writer.tag(2, WireType.Varint).uint32(message.id);
12151215+ let u = options.writeUnknownFields;
12161216+ if (u !== false)
12171217+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12181218+ return writer;
12191219+ }
12201220+}
12211221+/**
12221222+ * @generated MessageType for protobuf message Ban
12231223+ */
12241224+export const Ban = new Ban$Type();
12251225+// @generated message type with reflection information, may provide speed optimized methods
12261226+class Unban$Type extends MessageType<Unban> {
12271227+ constructor() {
12281228+ super("Unban", [
12291229+ { no: 1, name: "privileges", kind: "message", T: () => Sudo },
12301230+ { no: 2, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
12311231+ ]);
12321232+ }
12331233+ create(value?: PartialMessage<Unban>): Unban {
12341234+ const message = globalThis.Object.create((this.messagePrototype!));
12351235+ message.id = 0;
12361236+ if (value !== undefined)
12371237+ reflectionMergePartial<Unban>(this, message, value);
12381238+ return message;
12391239+ }
12401240+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Unban): Unban {
12411241+ let message = target ?? this.create(), end = reader.pos + length;
12421242+ while (reader.pos < end) {
12431243+ let [fieldNo, wireType] = reader.tag();
12441244+ switch (fieldNo) {
12451245+ case /* Sudo privileges */ 1:
12461246+ message.privileges = Sudo.internalBinaryRead(reader, reader.uint32(), options, message.privileges);
12471247+ break;
12481248+ case /* uint32 id */ 2:
12491249+ message.id = reader.uint32();
12501250+ break;
12511251+ default:
12521252+ let u = options.readUnknownField;
12531253+ if (u === "throw")
12541254+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12551255+ let d = reader.skip(wireType);
12561256+ if (u !== false)
12571257+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12581258+ }
12591259+ }
12601260+ return message;
12611261+ }
12621262+ internalBinaryWrite(message: Unban, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
12631263+ /* Sudo privileges = 1; */
12641264+ if (message.privileges)
12651265+ Sudo.internalBinaryWrite(message.privileges, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
12661266+ /* uint32 id = 2; */
12671267+ if (message.id !== 0)
12681268+ writer.tag(2, WireType.Varint).uint32(message.id);
12691269+ let u = options.writeUnknownFields;
12701270+ if (u !== false)
12711271+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12721272+ return writer;
12731273+ }
12741274+}
12751275+/**
12761276+ * @generated MessageType for protobuf message Unban
12771277+ */
12781278+export const Unban = new Unban$Type();