r4357 - in trunk/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Sep 5 13:34:49 EDT 2008
Author: esteel
Date: 2008-09-05 13:34:49 -0400 (Fri, 05 Sep 2008)
New Revision: 4357
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/server/clientcommands.qc
trunk/data/qcsrc/server/defs.qh
trunk/data/qcsrc/server/g_world.qc
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/sv_main.qc
Log:
renamed g_tourney_warmup_unlimited_time to g_tourney_warmup_limit and default it to 60 (-1 is totally unlimited, 0 is up to timelimit, other values limit it further)
being limited to 60 seconds, next step is to enable g_tourney too by default (i think CSQC needs to show this in a good way first, we try this later)
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/defaultNexuiz.cfg 2008-09-05 17:34:49 UTC (rev 4357)
@@ -138,7 +138,7 @@
//tournament mod
set g_tourney 0 //enables tourney mode which splits the game into a warmup- and match-stage
-set g_tourney_warmup_unlimited_time 1 //if set the warmup-stage is not affected by any timelimit, otherwise the usual timelimit also affects warmup-stage
+set g_tourney_warmup_limit 60 //if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage, otherwise warmup will be limited to this time (useful for public matches)
set g_tourney_warmup_allow_timeout 0 //if set to 0 you cannot use the calltimeout command during the warmup-stage but only during the match stage
set g_tourney_disable_spec_chat 1 //if set the chat sent by spectators or observers while being in match-stage can only seen by other specs/observers
set g_tourney_disable_spec_vote 1 //if set only players can call a vote during the match-stage (thus spectators and observers can't call a vote then)
Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/qcsrc/server/clientcommands.qc 2008-09-05 17:34:49 UTC (rev 4357)
@@ -265,7 +265,8 @@
} else if(argv(0) == "ready") {
if not(self.flags & FL_CLIENT)
return;
- if(cvar("sv_ready_restart"))
+ if((g_tourney && 0 < g_tourney_warmup_limit) // with unlimited warmup players have to be able to restart
+ || cvar("sv_ready_restart"))
{
if(timeoutStatus) {
return sprint(self, "^1You cannot reset the game while a timeout is active!\n");
@@ -401,6 +402,7 @@
if(g_tourney) {
tourneyInMatchStage = 1; //once the game is restarted the game is in match stage
//reset weapons and ammo, health and armor to default:
+ // TODO is this really the right way?!? see miscfunction.qc readlevelcvars()
start_weapons = WEPBIT_LASER | WEPBIT_SHOTGUN;
start_switchweapon = WEP_SHOTGUN;
start_ammo_shells = cvar("g_start_ammo_shells");
@@ -417,7 +419,7 @@
{
e.ready = 0;
}
- if(0<cvar("timelimit") || (g_tourney && cvar("g_tourney_warmup_unlimited_time")) )
+ if(0<cvar("timelimit") || (g_tourney && (-1 == g_tourney_warmup_limit)) )
{
// remember original timelimit on first restart
if(!timelimit_orig)
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/qcsrc/server/defs.qh 2008-09-05 17:34:49 UTC (rev 4357)
@@ -19,6 +19,7 @@
float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_lms, g_runematch, g_race;
float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_laserguided_missile, g_midair, g_minstagib, g_nixnex, g_nixnex_with_laser, g_norecoil, g_rocketarena, g_vampire, g_minstagib_invis_alpha;
float g_tourney;
+float g_tourney_warmup_limit;
float g_ctf_win_mode;
float g_race_qualifying;
float tourneyInMatchStage;
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/qcsrc/server/g_world.qc 2008-09-05 17:34:49 UTC (rev 4357)
@@ -316,7 +316,7 @@
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 1);
//if tourney is used map starts in warmup mode. if this mode shall stay unlimited, reset timelimit, but save the original one
- if(g_tourney && cvar("g_tourney_warmup_unlimited_time")) {
+ if(g_tourney && (-1 == g_tourney_warmup_limit)) {
timelimit_orig = cvar("timelimit");
cvar_set("timelimit", "0");
}
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2008-09-05 17:34:49 UTC (rev 4357)
@@ -733,6 +733,7 @@
g_rocketarena = cvar("g_rocketarena");
g_vampire = cvar("g_vampire");
g_tourney = cvar("g_tourney");
+ g_tourney_warmup_limit = cvar("g_tourney_warmup_limit");
sv_maxidle = cvar("sv_maxidle");
sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
sv_pogostick = cvar("sv_pogostick");
Modified: trunk/data/qcsrc/server/sv_main.qc
===================================================================
--- trunk/data/qcsrc/server/sv_main.qc 2008-09-05 17:29:17 UTC (rev 4356)
+++ trunk/data/qcsrc/server/sv_main.qc 2008-09-05 17:34:49 UTC (rev 4357)
@@ -152,6 +152,15 @@
Spawnqueue_Check();
+ // if in warmup stage and limit for warmup is hit start match
+ if (!tourneyInMatchStage
+ && 0 < g_tourney_warmup_limit
+ && (time + RESTART_COUNTDOWN) >= g_tourney_warmup_limit)
+ {
+ ReadyRestart();
+ return;
+ }
+
CreatureFrame ();
CheckRules_World ();
More information about the nexuiz-commits
mailing list