Skip to content

Commit

Permalink
added join lobby json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Petzys committed Feb 22, 2024
1 parent f77e4c6 commit cfc1dbd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions JSON Schema/lobby/join.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "lobby/join",
"profile": {
"id": 1,
"name": "boris",
"color": 123
}
}
36 changes: 36 additions & 0 deletions JSON Schema/lobby/join.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "lobby/join",
"title": "Client joins the lobby",
"description": "Game Client joins the lobby, and sends the player's profile",
"type": "object",
"properties": {
"message_type": {
"description": "The message type",
"type": "string",
"const": "lobby/join"
},
"profile": {
"description": "The profile object of the player",
"type": "object",
"properties": {
"id": {
"description": "The id of the player",
"type": "number"
},
"name": {
"description": "The name of the player",
"type": "string"
},
"color": {
"description": "The color of the player",
"type": "number",
"minimum": 0,
"maximum": 16777215
}
},
"required": [ "id", "name", "color"]
}
},
"required": [ "message_type", "profile"]
}

0 comments on commit cfc1dbd

Please sign in to comment.