Closed anarchuser closed 4 years ago
Are all observers authenticated or can any client issue an observation request? Not authenticated observers should not get the update, because then any client can just also add itself to the game as observer.
I'm not sure because I don't know much about the internal structure of how this works. I noticed that the GameRoom, which acts as listener to the Game, has separate Observers and Clients. I think it does check; after all, the check has to have happened somewhere
I'll look into it
The Lobby checks this upon adding observers to the GameRoom: https://github.com/CAU-Kiel-Tech-Inf/backend/blob/6dab6be66fd10337d47d364fbf29d1cf4511f84f/server/src/sc/server/Lobby.kt#L87-L90
In case the game is paused, only observers should be notified, so the GUI can update accordingly without the clients being able to calculate their moves already
Fixes https://github.com/CAU-Kiel-Tech-Inf/gui/issues/1