software-challenge / backend

Server, Client und Spiel-Plugins der Software-Challenge Germany
https://www.software-challenge.de
11 stars 10 forks source link

fix(server): if paused, send new state to observers only #293

Closed anarchuser closed 4 years ago

anarchuser commented 4 years ago

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

SKoschnicke commented 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.

anarchuser commented 4 years ago

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

anarchuser commented 4 years ago

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