Fixes duplicate and redundant chatcon notifications.
Displays relevant centreprint each time the team selection GUI or +jump
are used to try to join (even if the player is already queued) for
better noob friendliness.
Always notifies the player when their team selection conflicts with that
of a queued player.
Notifies queued players to get their attention when they join as it may
take some time before another player triggers the join.
Includes the team the player actually got assigned to in the relevant
centreprint (for the cases where they had no preference, or someone else
chose their preferred team first).
Prevents SetPlayerTeam() and queuePlayer() when the player definitely
can't play (version mismatch, locked teams), fixing misleading
notifications.
Allows players to join the queue even when g_maxplayers blocks them from
joining the match, so they can tag in if someone leaves.
Fixes bug with > 2 teams where if a player with a lower entity number
queues for any available team, a player with a higher entity number
and a specific team preference could be assigned to the same team (by
adding a second pass in Join() ).
Fixes lack of "now playing" notification when a bot joins a gametype
without teams.
This required some refactoring:
Calls joinAllowed() from ClientCommand_selectteam(), passing the
team_index through to queuePlayer(). This means calling queuePlayer
from SetPlayerTeam() is no longer needed.
Uses a different logic order in joinAllowed() when the queue is enabled.
Moves the ForbidSpawn MUTATOR hook from joinAllowed() to
PutPlayerInServer(). It seemed to be in the wrong place anyway: the
player is only blocked from spawning, not from joining the match.
No longer sets the .team field when adding a player to the queue
(they're not actually on the team yet), instead calls SetPlayerTeam()
from Join() when actually spawning the queued player.
Uses the .team_selected field to pass selection conflicts to Join(), it
can't be done with a parameter because `join` and `selectteam` are
separate commands.
Moves the queue conflict detection from Player_SetTeamIndexChecked() to
queuePlayer().
Reduces TeamBalance_JoinBestTeam() callsites.
Fixes some uses of NOTIF_ONE where it should have been NOTIF_ONE_ONLY.