Skip to content

Question about Lobby (Game over scenarios) in Chess.cs #6

@LoveraSantiago

Description

@LoveraSantiago

First of all, my thanks for making this repository available as a reference.

In the end-of-match scenario, would it be advisable to remove players from the lobby? With "_gameApiClient.Lobby.RemovePlayerAsync"?
Or close the lobby?

Maybe for cost reasons of deactivating it as soon as possible. But mainly because it helps to avoid a "join" of a match that has already ended.

I ended up using RemovePlayerAsync because I saw something in the documentation that says a lobby without players ends up being closed.

Following this approach where each player removes themselves from the lobby when the match ends, I believe that the removal depends on the "role of Player" for the removal to be possible.

I have experienced errors like "code":53,"detail":"user does not have authority to remove the specified player".

Which leads me to believe that in the "Chess.cs" example, when calling gameApiClient.Lobby.CreateLobbyAsync in the HostGame method, player 1 assumes the "Lobby Host" role and player 2, when calling _gameApiClient.Lobby.JoinLobbyByCodeAsync in the JoinGame method, assumes the "Lobby Member" role.

Does this approach make sense?
Is there any way to close the lobby? Is it necessary?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions