Skip to content
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

Newly foed/friended players don't receive necessary game_info messages #1002

Open
Askaholic opened this issue Jan 10, 2024 · 1 comment · May be fixed by #1026
Open

Newly foed/friended players don't receive necessary game_info messages #1002

Askaholic opened this issue Jan 10, 2024 · 1 comment · May be fixed by #1026

Comments

@Askaholic
Copy link
Collaborator

Askaholic commented Jan 10, 2024

Scenario 1 - Adding a foe

Imagine you are hosting a game, a player joins the lobby who is just trolling and you don't want them in the game so you kick them. But they keep joining back into the lobby, so you add them as a foe to keep them out of the lobby. The server will now consider the game to be 'invisible' to that player and will prevent them from joining. But because the game is 'invisible' to them, they will stop receiving updates about the game including the updates that say the game has launched or ended and should be removed from the games view. The lobby will stick around on their client until they re-log.

Scenario 2 - Adding a friend

Similarly, imagine you hosted a game for 'friends only'. Now you want to let someone join who wasn't on your friends list yet, so you add them as a friend. The server now considers the game to be visible to them, however it will not actually send them the game_info message needed to display the game in their client until an update is naturally triggered via another player joining/leaving or the game settings being changed.

Log messages

This can cause the following log message to appear:

Client error: You cannot join games hosted by this player.

Reproduce

Scenario 1

  1. Player 1 host a game
  2. Player 1 add player 2 as a foe

Scenario 2

  1. Player 1 host a game with visibility set to 'friends'
  2. Player 1 add player 2 as a friend

Solution

The social_add command should check if the current player is hosting a game, and if so immediately send a game_info message to the added player as follows:

If the player was foed and the game was previously visible to the player:

  • Send a 'fake' game_info message with "state": "closed" to the foed player immediately.
    Otherwise, if the player was friended and the game was previously not visible to the player:
  • Send a game_info message to the friended player immediately.
@benjamin-lawson
Copy link
Contributor

@Askaholic I think I am close to a solution on this. I have made the change to send the subject of the social add or remove a game list update. However, I'll need to check that the client can handle that additional information since it appears it is only sent on login at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants