-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lobby / Connector: Move game control to lobby #689
Comments
I wanted to fix #664 but since the fix there seems to require a bit of refactoring as well, I am exploring how this longer-term fix would work. As I understand today, the connector is not authed, anyone who knows the ip address and port can connect and issue commands. For a 2 player game with host and peer and the client being the game binary, the current flow:
The proposed new workflow would be:
I'm not sure if this would have to be a breaking change, it might be possible to have the lobby/connector handle both flows simultaneously during the transition. This does essentially add some kind of indirect auth to the connector, as creating/joining now requires a JWT from the lobby, the connector could not validate the JWT, but it would know if it was valid once it tried to interact with the lobby and return auth errors to the clients if it's not valid. Currently the connector only knows the max_players (I believe so it can reserve open ports for those players?). The connector would now have the lobby URL and game name from the JWT. Tasks I can imagine:
|
Yes.
More or less, this is correct.
Exactly. The important thing here is that the game is not created in the lobby server, just the JWT.
Yes. Basically, the authority to create, remove & keep the game updated is moved from players to the connector.
I think this is not necessary. We can add it later if the need arises.
Ditto, I think that the connector does not have to inform the players that lobby was updated. It is AFAIK enough to inform the client that the join was successful (this is already part of the protocol).
The connector should remove players from the lobby game as they leave. When all players leave (the detection mechanism is already implemented), it should delete the game with a request from lobby.
At this stage of development, we do not have to care much about breaking changes (as long as the builds from main work with each other). So I would implement it in a way which is most straightforward.
Exactly. Once this is coupled with encryption (#459), it should be end-to-end secure (in a sence :-)).
It knows max players so that it does not allow more than that number of players to join the game (atomically).
Yes.
Yes. This might need a bit more design. But the ideas is this: you send JWT which encodes user name and game name + send other info like map (not part of the JWT?). This information would be then forwarded by the connector to the lobby (but not necessarily stored by the connector, only the lobby URL, game name and user associated JWT are needed for future requests).
Makes sense. I would put game name to JWT payload (which is free form).
I think that the best way is to require public URL as part of the lobby configuration so it knows each own URL.
Yes.It should validate signature + expiration of the JWT. It would use
I would not consider this as a separate task, but each PR modifying or adding a new endpoint should update the OAS as well. This is so that the docs and implementation always stay in sync.
|
Currently, it is up to the client to create / join / leave games at both DE Lobby and DE Connector. This complicates the clients and it is prone to dis-synchronization & timing issues.
Fix this by moving the Lobby game handling responsibility to DE Lobby:
The text was updated successfully, but these errors were encountered: