Commit Graph
14 Commits
Author SHA1 Message Date
Denis 0ac5630ae9 Backend - Add parabola calculations (#45)
CI / lint_backend (push) Failing after 1m48s
CI / lint_frontend (push) Failing after 2m52s
* add global constants file

* use only float

* add constants dir

* load constants.json

* add table half width constant

* add pixels per meter conversion to frontend

* fix and clarify conversion between seconds and milliseconds

* add basic working parabola calucations

* add cup offsets

* make parabola end at cup positions

* add cup constants

* add simple match resolvement logic

* fix lint errors

* remove console log

* remove print statement
2026-08-31 20:57:50 +02:00
Denis 72e6cb10ed 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
2026-05-04 20:00:44 +02:00
Denis b163732c24 Backend - Add backend lint job and unit tests (#37)
* add backend lint job

* add python actions

* add linting and unittests to CI

* add missing dependencies

* fix wrong cd cmd

* fix missing config file
2026-04-01 08:01:29 +02:00
Denis b63f2da22c Backend - Add jsonschema module (#32)
* add jsonschema module

* remove unused files

* small refactoring

* remove hardcoded host and port arguments

* remove hardcoded host and server arguments

* add direct response flag and to raw methods

* fix config lookup

* fix is players full method

* use config singleton for server host and port arguments

* add join message schema

* move testclient module

* move client tast module

* add python typehint module

* rename as_dict method to as_raw

* delete message_raw file

* add client state module

* add more type modules

* update json schemas

* add support for json schema validation

* add ready property to client

* add client getter and adder methods

* add repr dunder method

* fix client context not being updated with new client id

* add support for toggle ready message

* only toggle ready if client is player

* add toggle role message

* add rejoin message

* remove old files

* fix import

* remove unused import

* update unit tests to work with new message classes

* make schema dir not user configurable

* add config template

* rename client id getter method

* make client id none-ed
2026-03-24 20:57:41 +01:00
Denis 523d933ffd add more unit tests (#28)
* add test method for toggle role action

* add max player detection in lobby during join

* add test method for max players check

* remove unused player module

* add missing client shutdown statements

* add process rejoin action method

* move client id logic to server class

* add test method for rejoin action

* extend test rejoin action method

* add comment to hacky solution
2026-02-02 20:59:57 +01:00
Denisandlucas 01211f6243 add async multi-client unit tests (#25)
* add class method to create player instance from dict

* update server code to use changes to player interface

* update gitignore

* update requirements

* add join action

* add client class

* add lobby class

* add new server implementation

* backup old server implementation

* test for player names in join action

* remove print statement

* add gamestate to dict method

* complete join action unit test

* move actions to their own file

* check if websocket is none before sending a message

* only toggle ready if client is a player

* remove old code

* move test utiliy wrapper and classes into separate module

* add toggle ready method and return correct gamestate response

* fix async test methods for join and toggle ready

* add script to start the autobeerpong server

* remove old files

* remove print statement

* remove unused imports and print statements

* check broadcast responses using assertEqual

* update README

* Add formatting to frontend (#27)

* update README

---------

Co-authored-by: Lucas Habersaat <lucas@habersaat.ch>
2026-01-11 19:33:54 +01:00
Denis 824ee0687d add unit tests (#18)
* move application files into sub-folder

* rename app folder to autobeerpong

* fix import

* add unittest for join action

* add start server method

* add toggle role action unit test

* add toggle ready action unit test

* add wrapper to start and terminate server

* rename test lobby file

* close websocket after sending all actions

* add test rejoin test method

* fix key error
2025-12-08 19:21:36 +01:00
Denis a8777035f8 fix player disconnect bug (#17)
* fixi fix fix

* make sure players websocket objects are properly destroyed

* broadcast gamestate after disconnect
2025-10-20 21:34:05 +02:00
Denis fb74527e82 fix multiple clients bug (#16)
* switch to relative imports for DIY files

* fix player instance always belonging to last joined client
2025-10-20 20:13:17 +02:00
Denis 465eb5554c add rejoin action (#12)
* answer to join call

* add is_disconnected flag

* add rejoin action

* fix missing json dumps

* fix old websocket object used after rejoin

* add disconnect, reconnect and send message logic

* use player object to send dataw

* (wip) add tests for disconnect

* fix abgelieferte gugus

* turn off readyness and enable spectator in disconnect function
2025-10-13 21:32:06 +02:00
Denis d95641d168 add toggle ready and player ids (#11) 2025-10-09 20:26:05 +02:00
Denis 72e3adc6f9 add broadcast upon join (#10)
* add broadcast upon join

* add max players

* add toggleRole action

* add simple error handling

* add player check when toggling role

* fix backend-breaking bug
2025-10-06 21:56:20 +02:00
Denis abf72c8093 add draft server with join action implemented (#5)
* add draft server with join action implemented

* check if message is None

* add websockets library

* some fixes
2025-09-14 21:06:25 +02:00
Denis ea8d1871e6 add backend folder and draft code (#2)
* add gitignore

* add backend folder

* add python venv to gitignore

* add requirements for backend

* add __pycache__

* add draft code for backend app
2025-08-24 21:03:26 +02:00