Move ready outside client into player and fix frontend schema validation (#39)
This commit is contained in:
1 parent
d88fb1d6f9
commit
1ea5786ecd
24 files changed
+205
-93
No files matched your search
@@ -2,7 +2,7 @@ import json
|
||||
|
||||
from websockets.asyncio.server import ServerConnection
|
||||
|
||||
from autobeerpong.types.raw import MessageRaw_T, ClientRaw_T
|
||||
from autobeerpong.types.raw import MessageRaw_T, ClientRaw_T, PlayerRaw_T
|
||||
from autobeerpong.states.client import ClientState
|
||||
|
||||
|
||||
@@ -21,6 +21,16 @@ class Client:
|
||||
return {
|
||||
"id": self.id,
|
||||
"name": self.name,
|
||||
}
|
||||
|
||||
def as_raw_player(self) -> PlayerRaw_T:
|
||||
assert self.state is ClientState.PLAYER
|
||||
|
||||
return {
|
||||
"client": {
|
||||
"id": self.id,
|
||||
"name": self.name,
|
||||
},
|
||||
"ready": self.ready,
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class AutobeerpongServer:
|
||||
lobby_state_raw: MessageRaw_T = {
|
||||
"messageType": "lobbyState",
|
||||
"messageContent": {
|
||||
"players": [player.as_raw() for player in players],
|
||||
"players": [player.as_raw_player() for player in players],
|
||||
"spectators": [spectator.as_raw() for spectator in spectators],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3,3 +3,4 @@ from typing import Any
|
||||
_Raw_T = dict[str, Any]
|
||||
MessageRaw_T = _Raw_T
|
||||
ClientRaw_T = _Raw_T
|
||||
PlayerRaw_T = _Raw_T
|
||||
@@ -46,7 +46,7 @@ class TestLobby(IsolatedAsyncioTestCase):
|
||||
self.assertEqual(response["messageType"], "lobbyState")
|
||||
self.assertEqual(len(response["messageContent"]["players"]), 2)
|
||||
|
||||
player_names = [p["name"] for p in response["messageContent"]["players"]]
|
||||
player_names = [p["client"]["name"] for p in response["messageContent"]["players"]]
|
||||
|
||||
self.assertIn("Ruedi", player_names)
|
||||
self.assertIn("Hansi", player_names)
|
||||
@@ -92,9 +92,9 @@ class TestLobby(IsolatedAsyncioTestCase):
|
||||
players = response["messageContent"]["players"]
|
||||
|
||||
for player in players:
|
||||
if player["name"] == "Ruedi":
|
||||
if player["client"]["name"] == "Ruedi":
|
||||
self.assertEqual(player["ready"], True)
|
||||
elif player["name"] == "Hansi":
|
||||
elif player["client"]["name"] == "Hansi":
|
||||
self.assertEqual(player["ready"], False)
|
||||
|
||||
self.assertEqual(client_a_responses[3], client_b_responses[2])
|
||||
@@ -104,9 +104,9 @@ class TestLobby(IsolatedAsyncioTestCase):
|
||||
players = response["messageContent"]["players"]
|
||||
|
||||
for player in players:
|
||||
if player["name"] == "Ruedi":
|
||||
if player["client"]["name"] == "Ruedi":
|
||||
self.assertEqual(player["ready"], True)
|
||||
elif player["name"] == "Hansi":
|
||||
elif player["client"]["name"] == "Hansi":
|
||||
self.assertEqual(player["ready"], True)
|
||||
|
||||
self.assertEqual(client_a_responses[4], client_b_responses[3])
|
||||
|
||||
@@ -11,28 +11,32 @@ import { BaseSocket, MessageEvent } from "./sockets/BaseSocket";
|
||||
import { MockSocket } from "./sockets/MockSocket";
|
||||
import { Socket } from "./sockets/Socket";
|
||||
|
||||
type Action = "join" | "rejoin" | "toggleRole" | "toggleReady";
|
||||
type MessageType = "join" | "rejoin" | "toggleRole" | "toggleReady";
|
||||
|
||||
interface Request {
|
||||
action: Action;
|
||||
messageType: MessageType;
|
||||
}
|
||||
|
||||
interface JoinRequest {
|
||||
action: "join";
|
||||
messageType: "join";
|
||||
messageContent: {
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface RejoinRequest {
|
||||
action: "rejoin";
|
||||
messageType: "rejoin";
|
||||
messageContent: {
|
||||
id: Id;
|
||||
};
|
||||
}
|
||||
|
||||
interface ToggleRoleRequest {
|
||||
action: "toggleRole";
|
||||
messageType: "toggleRole";
|
||||
}
|
||||
|
||||
interface ToggleReadyRequest {
|
||||
action: "toggleReady";
|
||||
messageType: "toggleReady";
|
||||
}
|
||||
|
||||
export class LobbyMessageEvent extends Event {
|
||||
@@ -92,7 +96,7 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
const messageObject = JSON.parse(message.json);
|
||||
|
||||
if (this._waitForJoin) {
|
||||
this._client = messageObject.player as Client;
|
||||
this._client = messageObject.messageContent.client as Client;
|
||||
storeClient(this._client);
|
||||
this._waitForJoin = false;
|
||||
this.emit("joined", new JoinedEvent());
|
||||
@@ -106,21 +110,17 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (messageObject.state.stateType) {
|
||||
case "lobby":
|
||||
switch (messageObject.messageType) {
|
||||
case "lobbyState":
|
||||
this.emit(
|
||||
"lobby-message",
|
||||
new LobbyMessageEvent(
|
||||
new LobbyState(messageObject.state, this._client),
|
||||
),
|
||||
new LobbyMessageEvent(new LobbyState(messageObject, this._client)),
|
||||
);
|
||||
break;
|
||||
case "match":
|
||||
case "matchState":
|
||||
this.emit(
|
||||
"match-message",
|
||||
new MatchMessageEvent(
|
||||
new MatchState(messageObject.state, this._client),
|
||||
),
|
||||
new MatchMessageEvent(new MatchState(messageObject, this._client)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -165,8 +165,10 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
|
||||
join(name: string): void {
|
||||
const joinRequest = {
|
||||
action: "join",
|
||||
messageType: "join",
|
||||
messageContent: {
|
||||
name,
|
||||
},
|
||||
} as JoinRequest;
|
||||
|
||||
this._waitForJoin = true;
|
||||
@@ -175,8 +177,8 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
|
||||
rejoin(id: Id): void {
|
||||
const rejoinRequest = {
|
||||
action: "rejoin",
|
||||
id,
|
||||
messageType: "rejoin",
|
||||
messageContent: { id },
|
||||
} as RejoinRequest;
|
||||
|
||||
this._waitForJoin = true;
|
||||
@@ -185,7 +187,7 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
|
||||
toggleRole(): void {
|
||||
const toggleRoleRequest = {
|
||||
action: "toggleRole",
|
||||
messageType: "toggleRole",
|
||||
} as ToggleRoleRequest;
|
||||
|
||||
this._send(toggleRoleRequest);
|
||||
@@ -193,7 +195,7 @@ export class Connection extends Evented<typeof ConnectionEvents> {
|
||||
|
||||
toggleReady(): void {
|
||||
const toggleReadyRequest = {
|
||||
action: "toggleReady",
|
||||
messageType: "toggleReady",
|
||||
} as ToggleReadyRequest;
|
||||
|
||||
this._send(toggleReadyRequest);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
Id,
|
||||
Player,
|
||||
Spectator,
|
||||
getClient,
|
||||
} from "./jsonTypes";
|
||||
import { maxPlayers } from "./main";
|
||||
import { log } from "./utils/debugUtils";
|
||||
@@ -33,11 +34,11 @@ export class LobbyState {
|
||||
}
|
||||
|
||||
get players(): Player[] {
|
||||
return this.lobbyStateRaw.players;
|
||||
return this.lobbyStateRaw.messageContent.players;
|
||||
}
|
||||
|
||||
get spectators(): Spectator[] {
|
||||
return this.lobbyStateRaw.spectators;
|
||||
return this.lobbyStateRaw.messageContent.spectators;
|
||||
}
|
||||
|
||||
get isFull(): boolean {
|
||||
@@ -53,7 +54,7 @@ export class LobbyState {
|
||||
}
|
||||
|
||||
get isSpectator(): boolean {
|
||||
return this.spectators.map((p) => p.client.id).includes(this.client.id);
|
||||
return this.spectators.map((p) => getClient(p).id).includes(this.client.id);
|
||||
}
|
||||
|
||||
getPlayerById(id: Id): Player | undefined {
|
||||
@@ -61,6 +62,6 @@ export class LobbyState {
|
||||
}
|
||||
|
||||
getSpectatorById(id: Id): Spectator | undefined {
|
||||
return this.spectators.find((p) => p.client.id === id);
|
||||
return this.spectators.find((p) => getClient(p).id === id);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import * as ex from "excalibur";
|
||||
import { spacingS } from "../utils/formattingUtils";
|
||||
import { headingFont, paragraphFont } from "../utils/fontUtil";
|
||||
import { Text } from "./Text";
|
||||
import { Client, Player, Spectator } from "../jsonTypes";
|
||||
import { Client, getClient, Player, Spectator } from "../jsonTypes";
|
||||
|
||||
const clientColor = ex.Color.fromHex("40E0D0");
|
||||
|
||||
@@ -51,7 +51,7 @@ export class ClientListScreenElement extends ex.ScreenElement {
|
||||
let y = headingFont.size + spacingS;
|
||||
|
||||
for (const currentClient of this._clients) {
|
||||
const isClient = currentClient.client.id === this._client?.id;
|
||||
const isClient = getClient(currentClient).id === this._client?.id;
|
||||
const label = this.createLabel(currentClient, y, isClient);
|
||||
|
||||
y += label.font.size + spacingS;
|
||||
@@ -77,7 +77,7 @@ export class ClientListScreenElement extends ex.ScreenElement {
|
||||
isClient: boolean,
|
||||
): Text {
|
||||
const color = isClient ? clientColor : undefined;
|
||||
const { name } = client.client;
|
||||
const { name } = getClient(client);
|
||||
const label = new Text({
|
||||
text: name,
|
||||
font: paragraphFont,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
export type Id = number;
|
||||
|
||||
export interface MessageRaw {
|
||||
state: LobbyStateRaw | MatchStateRaw;
|
||||
}
|
||||
export type MessageRaw = LobbyStateRaw | MatchStateRaw;
|
||||
|
||||
export interface LobbyStateRaw {
|
||||
stateType: "lobby";
|
||||
messageType: "lobbyState";
|
||||
messageContent: {
|
||||
players: Player[];
|
||||
spectators: Spectator[];
|
||||
};
|
||||
}
|
||||
|
||||
export type LobbyStateRawReadonly = Readonly<LobbyStateRaw>;
|
||||
@@ -17,9 +17,7 @@ export interface Player {
|
||||
ready: boolean;
|
||||
}
|
||||
|
||||
export interface Spectator {
|
||||
client: Client;
|
||||
}
|
||||
export type Spectator = Client;
|
||||
|
||||
export interface Client {
|
||||
id: Id;
|
||||
@@ -27,8 +25,10 @@ export interface Client {
|
||||
}
|
||||
|
||||
export interface MatchStateRaw {
|
||||
stateType: "match";
|
||||
messageType: "matchState";
|
||||
messageContent: {
|
||||
history: (Table | Action)[];
|
||||
};
|
||||
}
|
||||
|
||||
export type MatchStateRawReadonly = Readonly<MatchStateRaw>;
|
||||
@@ -52,3 +52,9 @@ export interface Parabola {
|
||||
}
|
||||
|
||||
export type Vector2 = [number, number];
|
||||
|
||||
export function getClient(playerOrSpectator: Player | Spectator): Client {
|
||||
return "client" in playerOrSpectator
|
||||
? playerOrSpectator.client
|
||||
: playerOrSpectator;
|
||||
}
|
||||
@@ -1,25 +1,36 @@
|
||||
import Ajv, { ValidateFunction } from "ajv";
|
||||
import Ajv, { ValidateFunction } from "ajv/dist/2020";
|
||||
|
||||
import { log } from "./utils/debugUtils";
|
||||
import { Client, MessageRaw } from "./jsonTypes";
|
||||
import messageSchemaFile from "../../schema/message_schema.json";
|
||||
import clientSchemaFile from "../../schema/client_schema.json";
|
||||
import lobbyStateSchemaFile from "../../schema/lobby_state_schema.json";
|
||||
import matchStateSchemaFile from "../../schema/match_state_schema.json";
|
||||
import actionSchemaFile from "../../schema/action_schema.json";
|
||||
import playerSchemaFile from "../../schema/player_schema.json";
|
||||
import spectatorSchemaFile from "../../schema/spectator_schema.json";
|
||||
import tableSchemaFile from "../../schema/table_schema.json";
|
||||
import messageSchemaFile from "../../schema/message.json";
|
||||
|
||||
import clientSchemaFile from "../../schema/common/client.json";
|
||||
import playerSchemaFile from "../../schema/common/player.json";
|
||||
|
||||
import joinSchemaFile from "../../schema/lobby/join.json";
|
||||
import joinResponseSchemaFile from "../../schema/lobby/join_response.json";
|
||||
import rejoinSchemaFile from "../../schema/lobby/rejoin.json";
|
||||
import lobbyStateSchemaFile from "../../schema/lobby/state.json";
|
||||
import toggleReadySchemaFile from "../../schema/lobby/toggle_ready.json";
|
||||
import toggleRoleSchemaFile from "../../schema/lobby/toggle_role.json";
|
||||
|
||||
// import matchStateSchemaFile from "../../schema//match/state.json";
|
||||
// import actionSchemaFile from "../../schema/match/action.json";
|
||||
// import tableSchemaFile from "../../schema/match/table_schema.json";
|
||||
|
||||
const ajv = new Ajv({ strict: true });
|
||||
|
||||
ajv.addSchema(lobbyStateSchemaFile, "lobby_state_schema.json");
|
||||
ajv.addSchema(matchStateSchemaFile, "match_state_schema.json");
|
||||
ajv.addSchema(actionSchemaFile, "action_schema.json");
|
||||
ajv.addSchema(clientSchemaFile, "client_schema.json");
|
||||
ajv.addSchema(playerSchemaFile, "player_schema.json");
|
||||
ajv.addSchema(spectatorSchemaFile, "spectator_schema.json");
|
||||
ajv.addSchema(tableSchemaFile, "table_schema.json");
|
||||
ajv.addSchema(clientSchemaFile, "client.json");
|
||||
ajv.addSchema(playerSchemaFile, "player.json");
|
||||
|
||||
ajv.addSchema(joinSchemaFile, "join.json");
|
||||
ajv.addSchema(joinResponseSchemaFile, "join_response.json");
|
||||
ajv.addSchema(rejoinSchemaFile, "rejoin.json");
|
||||
ajv.addSchema(lobbyStateSchemaFile, "state.json");
|
||||
ajv.addSchema(toggleReadySchemaFile, "toggle_ready.json");
|
||||
ajv.addSchema(toggleRoleSchemaFile, "toggle_role.json");
|
||||
|
||||
// TODO: Match schemas
|
||||
|
||||
const validateMessage = ajv.compile(messageSchemaFile);
|
||||
const validateClient = ajv.compile(clientSchemaFile);
|
||||
|
||||
@@ -29,16 +29,16 @@ export class MockSocket
|
||||
|
||||
export function mockLobbyMessage(): string {
|
||||
const lobbyUpdate = {
|
||||
state: {
|
||||
stateType: "lobby",
|
||||
messageType: "lobbyState",
|
||||
messageContent: {
|
||||
players: [
|
||||
{ client: { name: "Dubbel", id: 0 }, ready: true },
|
||||
{ client: { name: "Yeah", id: 1 }, ready: false },
|
||||
],
|
||||
spectators: [
|
||||
{ client: { name: "Dubbel", id: 2 } },
|
||||
{ client: { name: "Cocksucker", id: 3 } },
|
||||
{ client: { name: "Cocksucker 2", id: 4 } },
|
||||
{ name: "Dubbel", id: 2 },
|
||||
{ name: "Cocksucker", id: 3 },
|
||||
{ name: "Cocksucker 2", id: 4 },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,26 +2,44 @@
|
||||
"title": "Action",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"parabola": { "$ref": "#/$defs/parabola" },
|
||||
"turn": { "$ref": "#/$defs/turn" }
|
||||
"parabola": {
|
||||
"$ref": "#/$defs/parabola"
|
||||
},
|
||||
"required": ["parabola", "turn"],
|
||||
"turn": {
|
||||
"$ref": "#/$defs/turn"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"parabola",
|
||||
"turn"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"$defs": {
|
||||
"turn": {
|
||||
"enum": ["a", "b"]
|
||||
"enum": [
|
||||
"a",
|
||||
"b"
|
||||
]
|
||||
},
|
||||
"parabola": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"startPosition": { "$ref": "#/$defs/vector2" },
|
||||
"startVelocity": { "$ref": "#/$defs/vector2" },
|
||||
"stopTime": { "type": "number" }
|
||||
"startPosition": {
|
||||
"$ref": "#/$defs/vector2"
|
||||
},
|
||||
"startVelocity": {
|
||||
"$ref": "#/$defs/vector2"
|
||||
},
|
||||
"stopTime": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"vector2": {
|
||||
"type": "array",
|
||||
"items": { "type": "number" },
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
}
|
||||
|
||||
@@ -2,17 +2,28 @@
|
||||
"title": "MatchState",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"stateType": { "enum": ["match"]},
|
||||
"stateType": {
|
||||
"enum": [
|
||||
"match"
|
||||
]
|
||||
},
|
||||
"history": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{ "$ref": "./table_schema.json" },
|
||||
{ "$ref": "./action_schema.json" }
|
||||
{
|
||||
"$ref": "./table_schema.json"
|
||||
},
|
||||
{
|
||||
"$ref": "./action_schema.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["stateType", "history"],
|
||||
"required": [
|
||||
"stateType",
|
||||
"history"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -9,6 +9,9 @@
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["client", "ready"],
|
||||
"required": [
|
||||
"client",
|
||||
"ready"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
"$ref": "./client_schema.json"
|
||||
}
|
||||
},
|
||||
"required": ["client"],
|
||||
"required": [
|
||||
"client"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -2,23 +2,40 @@
|
||||
"title": "Table",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cupsA": { "$ref": "#/$defs/cups" },
|
||||
"cupsB": { "$ref": "#/$defs/cups" },
|
||||
"teamA": { "$ref": "#/$defs/team" },
|
||||
"teamB": { "$ref": "#/$defs/team" }
|
||||
"cupsA": {
|
||||
"$ref": "#/$defs/cups"
|
||||
},
|
||||
"required": ["cupsA", "cupsB", "teamA", "teamB"],
|
||||
"cupsB": {
|
||||
"$ref": "#/$defs/cups"
|
||||
},
|
||||
"teamA": {
|
||||
"$ref": "#/$defs/team"
|
||||
},
|
||||
"teamB": {
|
||||
"$ref": "#/$defs/team"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cupsA",
|
||||
"cupsB",
|
||||
"teamA",
|
||||
"teamB"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"$defs": {
|
||||
"cups": {
|
||||
"type": "array",
|
||||
"items": { "type": "boolean" },
|
||||
"items": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3
|
||||
},
|
||||
"team": {
|
||||
"type": "array",
|
||||
"items": { "type": "number" },
|
||||
"items": {
|
||||
"type": "number"
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "schema:client",
|
||||
"$id": "http://localhost/common/client.json",
|
||||
"title": "Client",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -10,15 +10,11 @@
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"ready": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"ready"
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "http://localhost/common/player.json",
|
||||
"title": "Player",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"client": {
|
||||
"$ref": "./client.json"
|
||||
},
|
||||
"ready": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"client",
|
||||
"ready"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/join.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "join"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/join_response.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "joinResponse"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/rejoin.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "rejoin"
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/state.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "lobbyState"
|
||||
},
|
||||
"messageContent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"players": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "../common/client.json"
|
||||
"$ref": "../common/player.json"
|
||||
}
|
||||
},
|
||||
"spectators": {
|
||||
@@ -19,3 +23,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/toggle_ready.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "toggleReady"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"$id": "http://localhost/lobby/toggle_role.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messageType": {
|
||||
"const": "toggleRole"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "schema:message",
|
||||
"$id": "http://localhost/message.json",
|
||||
"title": "Message",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in new issue
Block a user