From: Rudolf Polzer Date: Sat, 11 Dec 2010 19:45:49 +0000 (+0100) Subject: route selectteam through the kill delay system X-Git-Tag: xonotic-v0.1.0preview~57 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ed108d0c82c1fa93948eb39f5ded6427dbd99027;p=xonotic%2Fxonotic-data.pk3dir.git route selectteam through the kill delay system --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index bd41d3ffd..3585d26fe 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1538,7 +1538,7 @@ sv_gameplayfix_q2airaccelerate 1 sv_gameplayfix_stepmultipletimes 1 // delay for "kill" to prevent abuse -set g_balance_kill_delay 0 +set g_balance_kill_delay 2 set g_balance_kill_antispam 5 // this feature is currently buggy in the engine (it appears to PREVENT any dropping in lots of maps, leading to weirdly aligned entities, and in some cases even CAUSES them to drop through solid, like in facing worlds nex) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index e5ca67606..a93398b60 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -1029,6 +1029,8 @@ float autocvar_g_weapon_throwable; string autocvar_g_xonoticversion; float autocvar_gamecfg; float autocvar_gameversion; +float autocvar_gameversion_min; +float autocvar_gameversion_max; string autocvar_hostname; float autocvar_lastlevel; float autocvar_leadlimit; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 84e7a310a..1d034a4ec 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1231,7 +1231,13 @@ void ClientKill_Now_TeamChange() JoinBestTeam( self, FALSE, FALSE ); } else if(self.killindicator_teamchange == -2) + { + 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")); PutObserverInServer(); + } else SV_ChangeTeam(self.killindicator_teamchange - 1); } diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index 92e4b8ac1..adaf36f16 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -164,11 +164,10 @@ void SV_ParseClientCommand(string s) { } 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)) { @@ -211,17 +210,7 @@ void SV_ParseClientCommand(string s) { } } 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) @@ -256,15 +245,15 @@ void SV_ParseClientCommand(string s) { } 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" ) ); }