summaryrefslogtreecommitdiff
path: root/swiftstory/client.py
AgeCommit message (Collapse)Author
2021-12-23Refactor GameManager and add control over game creationOlivier Gayot
GameManager had a method called join_game ; which was not actually doing any joining. Instead, it was just returning a reference to the game that would match the specified game name and language. In case the game would not exist, it would be created before being returned. The function is now renamed find_by_name. Also a new parameter "create" has been added. It is a boolean that controls whether a game would be created if it does not exist. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Don't store a reference to a client from the playerOlivier Gayot
The only reason why we had a reference was that we were able to send notifications back to the client. Instead, we now store the notifications at the player level. At the client level, we now have a coroutine that waits for notifications from the player and sends them when available. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Make sure our use of websockets package is forwards compatibleOlivier Gayot
It seems that between version 8 and 10 of the websockets package, a redesign of the modules hierarchy was performed. In version 8, when importing "websockets", we would end up with a lot of extra things imported in the websockets namespace. For instance: * websockets.exceptions * websockets.server These extra are no longer imported in recent versions. Therefore, we have to be more explicit when importing features from the websockets package. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Add required annotations to make sure mypy succeedsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Add back not so unused module ...Olivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Use lowercase module namesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>