stuffcmd(this, "_scoreboard_team_selection 1\n");
return true;
}
+
void Join(entity this)
{
if (autocvar_g_campaign && !campaign_bots_may_start && !game_stopped && time >= game_starttime)
if(to_join)
{
Join(to_join);
- CS(this).wants_join = false;
this.team_selected = false; // Don't let this player select team
- LOG_INFOF("Forcing joining of queued player %s!", to_join.netname);
}
if(!this.team_selected)
PutClientInServer(this);
if(IS_PLAYER(this))
- if(teamplay && this.team != -1 && CS(this).wants_join)
- //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_PLAY_TEAM), this.netname);
- {}
+ if(teamplay && this.team != -1)
+ {
+ if(CS(this).wants_join)
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_PLAY_TEAM), this.netname);
+ }
else
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_JOIN_PLAY, this.netname);
this.team_selected = false;
+
+ if(to_join)
+ CS(to_join).wants_join = false;
}
int GetPlayerLimit()
if (teamplay && lockteams) return false;
if (MUTATOR_CALLHOOK(ForbidSpawn, this)) return false;
if (ShowTeamSelection(this)) return false;
- //if (CS(this).wants_join) return false;
- if (teamplay && !SpectatorWantsJoin(this))
- {
- // TODO : Refactor
- LOG_INFOF("Spec %s wants to join. Queueing.", this.netname);
- CS(this).wants_join = true;
- return false;
- }
+ if (CS(this).wants_join) return false;
return true;
}
// Check if there are spectators waiting to join
if(!teamplay) return NULL;
- FOREACH_CLIENT(IS_SPEC(it) || IS_OBSERVER(it), {
+ //FOREACH_CLIENT(IS_SPEC(it) || IS_OBSERVER(it), {
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if(it == this) continue;
if(CS(it).wants_join) {
LOG_INFOF("Player is waiting to join: %s", it.netname);
});
// No players waiting to join
+ LOG_INFO("No players waiting to join.");
return NULL;
}
if (!IS_BOT_CLIENT(player))
TeamBalance_AutoBalanceBots();
- if (team_index != -1 && IS_PLAYER(player))
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_PLAY_TEAM), player.netname);
+ if (team_index != -1)
+ {
+ if (!SpectatorWantsJoin(player))
+ {
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_WANTS_TEAM), player.netname);
+ CS(player).wants_join = true; // TODO : Refactor
+ }
+ else
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_PLAY_TEAM), player.netname);
+ }
}
if (team_index == -1)