mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
WebClient: refactor protobuf method structure (#5014)
This commit is contained in:
parent
f174614496
commit
be5d42baba
53 changed files with 1014 additions and 1263 deletions
19
webclient/src/websocket/commands/room/roomSay.ts
Normal file
19
webclient/src/websocket/commands/room/roomSay.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import webClient from '../../WebClient';
|
||||
|
||||
export function roomSay(roomId: number, message: string): void {
|
||||
const trimmed = message.trim();
|
||||
|
||||
if (!trimmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const CmdRoomSay = webClient.protobuf.controller.Command_RoomSay.create({
|
||||
'message': trimmed
|
||||
});
|
||||
|
||||
const rc = webClient.protobuf.controller.RoomCommand.create({
|
||||
'.Command_RoomSay.ext': CmdRoomSay
|
||||
});
|
||||
|
||||
webClient.protobuf.sendRoomCommand(roomId, rc);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue