return FALSE;
}
+.float checkfail;
void SV_ParseClientCommand(string s) {
string cmd;
float tokens;
tokens = tokenize_console(s);
- cmd = argv(0);
+ cmd = strtolower(argv(0));
if(cmd != "reportcvar")
if(cmd != "sentcvar")
if(cmd != "pause")
return;
} else if(GameCommand_MapVote(argv(0))) {
return;
+ } else if(cmd == "checkfail") {
+ print(sprintf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))));
+ self.checkfail = 1;
} else if(cmd == "autoswitch") {
// be backwards compatible with older clients (enabled)
self.autoswitch = ("0" != argv(1));
} else {
self.version = stof(argv(1));
}
- if(self.version != autocvar_gameversion)
+ if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max)
{
- self.classname = "observer";
self.version_mismatch = 1;
- PutClientInServer();
+ ClientKill_TeamChange(-2); // observe
} else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) {
//JoinBestTeam(self, FALSE, TRUE);
} else if(teams_matter && !autocvar_sv_spectate && !(self.team_forced > 0)) {
}
}
if(self.classname == "player" && autocvar_sv_spectate == 1) {
- if(self.flagcarried)
- DropFlag(self.flagcarried, world, world);
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
- WaypointSprite_PlayerDead();
- self.classname = "observer";
- if(g_ca)
- self.caplayer = 0;
- if(blockSpectators)
- sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
- PutClientInServer();
+ ClientKill_TeamChange(-2); // observe
}
} else if(cmd == "join") {
if not(self.flags & FL_CLIENT)
if(!g_arena)
if (self.classname != "player" && !lockteams)
{
- if(isJoinAllowed()) {
+ if(nJoinAllowed(1)) {
self.classname = "player";
if(g_ca)
self.caplayer = 1;
} else if(lockteams) {
sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
} else if( argv(1) == "red" ) {
- DoTeamChange(COLOR_TEAM1);
+ ClientKill_TeamChange(COLOR_TEAM1);
} else if( argv(1) == "blue" ) {
- DoTeamChange(COLOR_TEAM2);
+ ClientKill_TeamChange(COLOR_TEAM2);
} else if( argv(1) == "yellow" ) {
- DoTeamChange(COLOR_TEAM3);
+ ClientKill_TeamChange(COLOR_TEAM3);
} else if( argv(1) == "pink" ) {
- DoTeamChange(COLOR_TEAM4);
+ ClientKill_TeamChange(COLOR_TEAM4);
} else if( argv(1) == "auto" ) {
- DoTeamChange(-1);
+ ClientKill_TeamChange(-1);
} else {
sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
}
if not(self.flags & FL_CLIENT)
return;
- if((inWarmupStage && 0 >= g_warmup_limit) // with unlimited warmup players have to be able to restart
+ if((inWarmupStage)
|| autocvar_sv_ready_restart || g_race_qualifying == 2)
{
if(!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
sprint(self, cvar_purechanges);
} else if(CheatCommand(tokens)) {
} else {
+#if 0
//if(ctf_clientcommand())
// return;
// grep for Cmd_AddCommand_WithClientCommand to find them all
print("WARNING: Invalid clientcommand by ", self.netname, ": ", s, "\n");
return;
}
+#endif
if(self.jointime > 0 && time > self.jointime + 10 && time > self.nickspamtime) // allow any changes in the first 10 seconds since joining
if(cmd == "name" || cmd == "playermodel") // TODO also playerskin and color?