Closed Askaholic closed 3 weeks ago
@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.
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:
Reproduce
Scenario 1
Scenario 2
Solution
The
social_add
command should check if the current player is hosting a game, and if so immediately send agame_info
message to the added player as follows:If the player was foed and the game was previously visible to the player:
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:game_info
message to the friended player immediately.