Backend - Add match logic (#38)

* add method to update server state

* add draft test match unit test class

* add join response message class

* add lobby state message class

* add spectator raw type

* add start match json schema

* add start match message class

* add test client manager class

* change client to return server responses as python classes

* add start match test method

* adapt old unit tests to use python message classes

* shortcut two players join and ready protocol

* fix wrong imports

* add message to assertion

* make broadcast function send message provided as argument

* add match state message class

* add match state json schema

* add match utility class

* add match state message class

* extend test function with match state check

* remove print statement

* add missing match schemas to frontend and add id properties

* make state keys unique

* fix MockSocket

* add basic match history funtionality

* use Prettier formatter

* fix typehint error
This commit is contained in:
Denis authored and GitHub committed 2026-05-04 20:00:44 +02:00
1 parent db3781c11d
commit 72e6cb10ed
21 files changed
+474 -135

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
{
"$id": "http://localhost/match/state.json",
"type": "object",
"properties": {
"messageType": {
"const": "matchState"
},
"messageContent": {
"type": "object",
"properties": {
"history": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "./table.json"
},
{
"$ref": "./action.json"
}
]
}
}
},
"required": [
"history"
],
"additionalProperties": false
}
}
}