Skip to content

[TF2] Players stuck in unassigned team when multiple players attempt to join #3651

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

Open
nosoop opened this issue Sep 1, 2021 · 0 comments · May be fixed by ValveSoftware/source-sdk-2013#1296

Comments

@nosoop
Copy link

nosoop commented Sep 1, 2021

Long-standing bug (I'm able to see similar code in the disassembly going as far back as when the game was first converted to SteamPipe; don't have any older binaries).

When multiple players join a team at the same time, some players may be stuck in unassigned.

My guess on why this happens (since reproducing this is tricky) is that the general command handler rejects jointeam commands on a cooldown of 2 seconds as spam prevention but does not redisplay the team selection panel (which is handled by CTFPlayer::HandleCommand_JoinTeam()). So what happens is:

  1. Player connects to the server and attempts to join team, dispatching the jointeam command.
  2. Spam prevention (in CTFPlayer::ClientCommand) sets the next allowed team change command to 2 seconds in the future.
  3. The jointeam-specific handler rejects the team change because the team is now at capacity, and tells the client to redisplay the team selection panel.
  4. Player selects a team from the panel, dispatching a new jointeam command within the 2 second cooldown interval.
  5. Spam prevention swallows the command without doing anything; the jointeam-specific handler isn't called.

As the player is restricted from opening the team menu while unassigned (the callback for changeteam in client code), the player is effectively softlocked unless they reconnect or are aware that spectate allows them to open the panel.

I've written up a targeted fix for this particular case here.

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