Skip to content

Only show players if they've managed to connect#551

Merged
Askaholic merged 3 commits into
FAForever:developfrom
Askaholic:lobby-sync-improvements
Mar 28, 2020
Merged

Only show players if they've managed to connect#551
Askaholic merged 3 commits into
FAForever:developfrom
Askaholic:lobby-sync-improvements

Conversation

@Askaholic
Copy link
Copy Markdown
Collaborator

Might fix #225.

When doing testing of the game result issue and struggling with getting the ICE adapter to connect two machines on the same network I noticed what might be causing the display of extra players in lobby.

The server would count a player as "in-lobby" as soon as they sent GameState: Lobby meaning as soon as their game made it to the connecting to host screen. This means if someone was trying to join a lobby, but could not connect to the host, it would still falsely bump the num_players which might cause the lobby to appear full when it was actually one player short.

It seems like the only way to detect if a player has successfully connected to the host is by the host sending PlayerOption commands for them. So we can use the presence of player options as an indicator for successful connection.

I'm not sure if this is the only reason why this bug occurs so I'll leave the issue open for now.

@Askaholic Askaholic requested review from cleborys and norraxx March 23, 2020 23:22
@Askaholic Askaholic force-pushed the lobby-sync-improvements branch from ae19e55 to 5ca3b19 Compare March 23, 2020 23:28
Comment thread server/games/game.py Outdated
Comment thread server/games/game.py
Comment thread server/games/game.py Outdated
player = game_connection.player
del self._connections[player]

if player:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not player - when that situation will happen?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it can actually.

Comment thread server/games/game.py Outdated
Comment thread tests/unit_tests/test_game.py
Comment thread tests/unit_tests/test_game.py
@Askaholic Askaholic force-pushed the lobby-sync-improvements branch 2 times, most recently from 52a92fc to 55afc2c Compare March 28, 2020 05:20
@Askaholic Askaholic force-pushed the lobby-sync-improvements branch from 55afc2c to 761f0c3 Compare March 28, 2020 19:59
@Askaholic Askaholic merged commit 0b09c95 into FAForever:develop Mar 28, 2020
@Askaholic Askaholic deleted the lobby-sync-improvements branch March 28, 2020 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Players in lobby are not always detected properly

3 participants