]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/clientcommands.qc
new cheat, "make"
[divverent/nexuiz.git] / data / qcsrc / server / clientcommands.qc
1 entity nagger;
2 float readycount;
3 float Nagger_SendEntity(entity to, float sendflags)
4 {
5         float nags, i, f, b;
6         entity e;
7         WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
8
9         nags = 0;
10         if(readycount)
11         {
12                 nags |= 1;
13                 if(to.ready == 0)
14                         nags |= 2;
15         }
16         if(votecalled)
17         {
18                 nags |= 4;
19                 if(to.vote_vote == 0)
20                         nags |= 8;
21         }
22         if(inWarmupStage)
23                 nags |= 16;
24
25         if(sendflags & 128)
26                 nags |= 128;
27
28         WriteByte(MSG_ENTITY, nags);
29
30         if(nags & 128)
31         {
32                 if(votecalled)
33                         WriteString(MSG_ENTITY, votecalledvote_display);
34                 else
35                         WriteString(MSG_ENTITY, "");
36         }
37         
38         if(nags & 1)
39         {
40                 for(i = 1; i <= maxclients; i += 8)
41                 {
42                         for(f = 0, e = edict_num(i), b = 1; b < 256; b *= 2, e = nextent(e))
43                                 if(clienttype(e) != CLIENTTYPE_REAL || e.ready)
44                                         f |= b;
45                         WriteByte(MSG_ENTITY, f);
46                 }
47         }
48
49         return TRUE;
50 }
51 void Nagger_Init()
52 {
53         Net_LinkEntity(nagger = spawn(), FALSE, 0, Nagger_SendEntity);
54 }
55 void Nagger_VoteChanged()
56 {
57         if(nagger)
58                 nagger.SendFlags |= 128;
59 }
60 void Nagger_VoteCountChanged()
61 {
62         if(nagger)
63                 nagger.SendFlags |= 1;
64 }
65 void Nagger_ReadyCounted()
66 {
67         if(nagger)
68                 nagger.SendFlags |= 1;
69 }
70
71 void ReadyCount();
72 string MapVote_Suggest(string m);
73
74 entity GetPlayer(string name)
75 {
76         float num;
77         entity e;
78         string ns;
79
80         if(substring(name, 0, 1) == "#") {
81                 num = stof(substring(name, 1, 999));
82                 if(num >= 1 && num <= maxclients) {
83                         for((e = world); num > 0; --num, (e = nextent(e)))
84                                 ;
85                         //if(clienttype(e) == CLIENTTYPE_REAL)
86                         if(e.classname == "player")
87                                 return e;
88                 }
89         } else {
90                 ns = strdecolorize(name);
91                 FOR_EACH_REALPLAYER(e) {
92                         if(!strcasecmp(strdecolorize(e.netname), ns)) {
93                                 return e;
94                         }
95                 }
96         }
97         return world;
98 }
99
100 //float ctf_clientcommand();
101 float readyrestart_happened;
102 .float lms_spectate_warning;
103 void spawnfunc_func_breakable();
104 void SV_ParseClientCommand(string s) {
105         string cmd;
106         float tokens, f, effectnum;
107         vector start, end;
108         entity e, oldself;
109
110         tokens = tokenize_console(s);
111
112         if(GameCommand_Vote(s, self)) {
113                 return;
114         } else if(GameCommand_MapVote(argv(0))) {
115                 return;
116         } else if(argv(0) == "autoswitch") {
117                 // be backwards compatible with older clients (enabled)
118                 self.autoswitch = ("0" != argv(1));
119                 local string autoswitchmsg;
120                 if (self.autoswitch) {
121                         autoswitchmsg = "on";
122                 } else {
123                         autoswitchmsg = "off";
124                 }
125                 sprint(self, strcat("^1autoswitch turned ", autoswitchmsg, "\n"));
126         } else if(argv(0) == "clientversion") {
127                 if not(self.flags & FL_CLIENT)
128                         return;
129                 if (argv(1) == "$gameversion") {
130                         //versionmsg = "^1client is too old to get versioninfo.\nUPDATE!!! (http://www.nexuiz.com)^8";
131                         // either that or someone wants to be funny
132                         self.version = 1;
133                 } else {
134                         self.version = stof(argv(1));
135                 }
136                 if(self.version != cvar("gameversion"))
137                 {
138                         self.classname = "observer";
139                         self.version_mismatch = 1;
140                         PutClientInServer();
141                 } else if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force")) {
142                         //JoinBestTeam(self, FALSE, TRUE);
143                 } else if(teams_matter && !cvar("sv_spectate")) {
144                         self.classname = "observer";
145                         stuffcmd(self,"menu_showteamselect\n");
146                 }
147         } else if(argv(0) == "reportcvar") { // old system
148                 if(substring(argv(2), 0, 1) == "$") // undefined cvar: use the default value on the server then
149                 {
150                         s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
151                         tokens = tokenize_console(s);
152                 }
153                 GetCvars(1);
154         } else if(argv(0) == "sentcvar") { // new system
155                 if(tokens == 2) // undefined cvar: use the default value on the server then
156                 {
157                         s = strcat(substring(s, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
158                         tokens = tokenize_console(s);
159                 }
160                 GetCvars(1);
161         } else if(argv(0) == "spectate") {
162                 if not(self.flags & FL_CLIENT)
163                         return;
164                 if(g_arena)
165                         return;
166                 if(g_lms)
167                 {
168                         if(self.lms_spectate_warning)
169                         {
170                                 // mark player as spectator
171                                 PlayerScore_Add(self, SP_LMS_RANK, 666 - PlayerScore_Add(self, SP_LMS_RANK, 0));
172                         }
173                         else
174                         {
175                                 self.lms_spectate_warning = 1;
176                                 sprint(self, "WARNING: you won't be able to enter the game again after spectating in LMS. Use the same command again to spectate anyway.\n");
177                                 return;
178                         }
179                 }
180                 if(self.classname == "player" && cvar("sv_spectate") == 1) {
181                         if(self.flagcarried)
182                                 DropFlag(self.flagcarried, world, world);
183                         if(self.ballcarried)
184                                 DropBall(self.ballcarried, self.origin, self.velocity);
185                         kh_Key_DropAll(self, TRUE);
186                         WaypointSprite_PlayerDead();
187                         self.classname = "observer";
188                         if(blockSpectators)
189                                 sprint(self, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
190                         PutClientInServer();
191                 }
192         } else if(argv(0) == "join") {
193                 if not(self.flags & FL_CLIENT)
194                         return;
195                 if(!g_arena)
196                 if (self.classname != "player" && !lockteams)
197                 {
198                         if(isJoinAllowed()) {
199                                 self.classname = "player";
200                                 PlayerScore_Clear(self);
201                                 bprint ("^4", self.netname, "^4 is playing now\n");
202                                 PutClientInServer();
203                         }
204                         else {
205                                 //player may not join because of g_maxplayers is set
206                                 centerprint_atprio(self, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
207                         }
208                 }
209         } else if( argv(0) == "selectteam" ) {
210                 if not(self.flags & FL_CLIENT)
211                         return;
212                 if( !teams_matter ) {
213                         sprint( self, "selecteam can only be used in teamgames\n");
214                 } else if(cvar("g_campaign")) {
215                         //JoinBestTeam(self, 0);
216                 } else if(lockteams) {
217                         sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
218                 } else if( argv(1) == "red" ) {
219                         DoTeamChange(COLOR_TEAM1);
220                 } else if( argv(1) == "blue" ) {
221                         DoTeamChange(COLOR_TEAM2);
222                 } else if( argv(1) == "yellow" ) {
223                         DoTeamChange(COLOR_TEAM3);
224                 } else if( argv(1) == "pink" ) {
225                         DoTeamChange(COLOR_TEAM4);
226                 } else if( argv(1) == "auto" ) {
227                         DoTeamChange(-1);
228                 } else {
229                         sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
230                 }
231         } else if(argv(0) == "ready") {
232                 if not(self.flags & FL_CLIENT)
233                         return;
234
235                 if((inWarmupStage && 0 >= g_warmup_limit) // with unlimited warmup players have to be able to restart
236                    || cvar("sv_ready_restart"))
237                 {
238                         if(!readyrestart_happened || cvar("sv_ready_restart_repeatable"))
239                         {
240                                 if (self.ready) // toggle
241                                 {
242                                         self.ready = FALSE;
243                                         bprint(self.netname, "^2 is ^1NOT^2 ready\n");
244                                 }
245                                 else
246                                 {
247                                         self.ready = TRUE;
248                                         bprint(self.netname, "^2 is ready\n");
249                                 }
250
251                                 // cannot reset the game while a timeout is active!
252                                 if(!timeoutStatus)
253                                         ReadyCount();
254                         } else {
255                                 sprint(self, "^1Game has already been restarted\n");
256                         }
257                 }
258         } else if(argv(0) == "maplist") {
259                 sprint(self, maplist_reply);
260         } else if(argv(0) == "lsmaps") {
261                 sprint(self, lsmaps_reply);
262         } else if(argv(0) == "records") {
263                 sprint(self, records_reply);
264         } else if(argv(0) == "voice") {
265                 if(tokens >= 3)
266                         VoiceMessage(argv(1), substring(s, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)));
267                 else
268                         VoiceMessage(argv(1), "");
269         } else if(argv(0) == "say") {
270                 if(tokens >= 2)
271                         Say(self, FALSE, world, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
272                 //clientcommand(self, formatmessage(s));
273         } else if(argv(0) == "say_team") {
274                 if(tokens >= 2)
275                         Say(self, TRUE, world, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
276                 //clientcommand(self, formatmessage(s));
277         } else if(argv(0) == "tell") {
278                 e = GetCommandPlayerSlotTargetFromTokenizedCommand(tokens, 1);
279                 if(e && tokens > ParseCommandPlayerSlotTarget_firsttoken)
280                         Say(self, FALSE, e, substring(s, argv_start_index(ParseCommandPlayerSlotTarget_firsttoken), argv_end_index(-1) - argv_start_index(ParseCommandPlayerSlotTarget_firsttoken)), 1);
281                 else
282                         sprint(self, "ERROR: usage: tell # playerid text...\n");
283                 //clientcommand(self, formatmessage(s));
284         } else if(argv(0) == "info") {
285                 cmd = cvar_string(strcat("sv_info_", argv(1)));
286                 if(cmd == "")
287                         sprint(self, "ERROR: unsupported info command\n");
288                 else
289                         wordwrap_sprint(cmd, 1111);
290         } else if(argv(0) == "suggestmap") {
291                 sprint(self, strcat(MapVote_Suggest(argv(1)), "\n"));
292         } else if(argv(0) == "timeout") {
293                 if not(self.flags & FL_CLIENT)
294                         return;
295                 if(cvar("sv_timeout")) {
296                         if(self.classname == "player") {
297                                 if(votecalled)
298                                         sprint(self, "^7Error: you can not call a timeout while a vote is active!\n");
299                                 else
300                                         evaluateTimeout();
301                         }
302                         else
303                                 sprint(self, "^7Error: only players can call a timeout!\n");
304                 }
305         } else if(argv(0) == "timein") {
306                 if not(self.flags & FL_CLIENT)
307                         return;
308                 if(cvar("sv_timeout")) {
309                         evaluateTimein();
310                 }
311         } else if(argv(0) == "teamstatus") {
312                 Score_NicePrint(self);
313         } else if(argv(0) == "cvar_changes") {
314                 sprint(self, cvar_changes);
315         } else if(argv(0) == "pointparticles") {
316                 if(sv_cheats && tokens == 5)
317                 {
318                         // arguments:
319                         //   effectname
320                         //   origin (0..1, on crosshair line)
321                         //   velocity
322                         //   howmany
323                         effectnum = particleeffectnum(argv(1));
324                         f = stof(argv(2));
325                         start = (1-f) * self.origin + f * self.cursor_trace_endpos;
326                         end = stov(argv(3));
327                         f = stof(argv(4));
328                         pointparticles(effectnum, start, end, f);
329                 }
330                 else
331                         sprint(self, "Usage: sv_cheats 1; restart; cmd pointparticles effectname position(0..1) velocityvector multiplier\n");
332         } else if(argv(0) == "trailparticles") {
333                 if(sv_cheats && tokens == 2)
334                 {
335                         // arguments:
336                         //   effectname
337                         effectnum = particleeffectnum(argv(1));
338                         W_SetupShot(self, FALSE, FALSE, "");
339                         traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
340                         trailparticles(self, effectnum, w_shotorg, trace_endpos);
341                 }
342                 else
343                         sprint(self, "Usage: sv_cheats 1; restart; cmd trailparticles effectname\n");
344         } else if(argv(0) == "make") {
345                 if(sv_cheats && tokens == 3)
346                 {
347                         // arguments:
348                         //   modelname mode
349                         f = stof(argv(2));
350                         W_SetupShot(self, FALSE, FALSE, "");
351                         traceline(w_shotorg, w_shotorg + w_shotdir * 512, MOVE_NORMAL, self);
352                         if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
353                         {
354                                 sprint(self, "cannot make stuff there (bad surface)\n");
355                         }
356                         else
357                         {
358                                 oldself = self;
359                                 self = spawn();
360                                 self.model = strzone(argv(1));
361                                 self.mdl = "rocket_explode";
362                                 self.health = 1000;
363                                 self.origin = trace_endpos;
364                                 self.effects = EF_NOMODELFLAGS;
365                                 if(f == 1)
366                                 {
367                                         self.angles = fixedvectoangles2(trace_plane_normal, v_forward);
368                                         self.angles = AnglesTransform_Multiply(self.angles, '-90 0 0'); // so unrotated models work
369                                 }
370                                 spawnfunc_func_breakable();
371                                 // now, is it valid?
372                                 if(f == 0)
373                                 {
374                                         tracebox(self.origin, self.mins, self.maxs, self.origin, MOVE_NORMAL, self);
375                                         if(trace_startsolid)
376                                         {
377                                                 sprint(self, "cannot make stuff there (no space)\n");
378                                                 remove(self);
379                                         }
380                                 }
381                                 self = oldself;
382                         }
383                 }
384                 else
385                         sprint(self, "Usage: sv_cheats 1; restart; cmd make models/... 0/1/2\n");
386         } else {
387                 //if(ctf_clientcommand())
388                 //      return;
389                 cmd = argv(0);
390                 // grep for Cmd_AddCommand_WithClientCommand to find them all
391                 if(cmd != "status")
392                 if(cmd != "max")
393                 if(cmd != "monster")
394                 if(cmd != "scrag")
395                 if(cmd != "wraith")
396                 if(cmd != "gimme")
397                 if(cmd != "god")
398                 if(cmd != "notarget")
399                 if(cmd != "fly")
400                 if(cmd != "noclip")
401                 if(cmd != "give")
402                 //if(cmd != "say") // handled above
403                 //if(cmd != "say_team") // handled above
404                 if(cmd != "tell")
405                 if(cmd != "kill")
406                 if(cmd != "pause")
407                 if(cmd != "ping")
408                 if(cmd != "name")
409                 if(cmd != "color")
410                 if(cmd != "rate")
411                 if(cmd != "pmodel")
412                 if(cmd != "playermodel")
413                 if(cmd != "playerskin")
414                 if(cmd != "prespawn")
415                 if(cmd != "spawn")
416                 if(cmd != "begin")
417                 if(cmd != "pings")
418                 if(cmd != "sv_startdownload")
419                 if(cmd != "download")
420                 {
421                         print("WARNING: Invalid clientcommand by ", self.netname, ": ", s, "\n");
422                         return;
423                 }
424
425                 if(self.jointime > 0 && time > self.jointime + 10 && time > self.nickspamtime) // allow any changes in the first 10 seconds since joining
426                 if(cmd == "name" || cmd == "playermodel") // TODO also playerskin and color?
427                 {
428                         if(self.nickspamtime == 0 || time > self.nickspamtime + cvar("g_nick_flood_timeout"))
429                                 // good, no serious flood
430                                 self.nickspamcount = 1;
431                         else
432                                 self.nickspamcount += 1;
433                         self.nickspamtime = time + cvar("g_nick_flood_penalty");
434                         
435                         if (timeoutStatus == 2) //when game is paused, no flood protection
436                                 self.nickspamcount = self.nickspamtime = 0;
437                 }
438
439                 clientcommand(self,s);
440         }
441 }
442
443 void ReadyRestartForce()
444 {
445         local entity e;
446
447         bprint("^1Server is restarting...\n");
448
449         VoteReset();
450
451         // clear overtime
452         if (checkrules_overtimesadded > 0) {
453                 //we have to decrease timelimit to its original value again!!
454                 float newTL;
455                 newTL = cvar("timelimit");
456                 newTL -= checkrules_overtimesadded * cvar("timelimit_overtime");
457                 cvar_set("timelimit", ftos(newTL));
458         }
459         
460         checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
461         
462
463         readyrestart_happened = 1;
464         game_starttime = time + RESTART_COUNTDOWN;
465         restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
466
467         inWarmupStage = 0; //once the game is restarted the game is in match stage
468
469         //reset the .ready status of all players (also spectators)
470         FOR_EACH_CLIENTSLOT(e)
471                 e.ready = 0;
472         readycount = 0;
473         Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
474
475         if(cvar("teamplay_lockonrestart") && teams_matter) {
476                 lockteams = 1;
477                 bprint("^1The teams are now locked.\n");
478         }
479
480         //initiate the restart-countdown-announcer entity
481         if(cvar("sv_ready_restart_after_countdown"))
482         {
483                 restartTimer = spawn();
484                 restartTimer.think = restartTimer_Think;
485                 restartTimer.nextthink = game_starttime;
486         }
487
488         //after a restart every players number of allowed timeouts gets reset, too
489         if(cvar("sv_timeout"))
490         {
491                 FOR_EACH_REALPLAYER(e)
492                         e.allowedTimeouts = cvar("sv_timeout_number");
493         }
494
495         //reset map immediately if this cvar is not set
496         if (!cvar("sv_ready_restart_after_countdown"))
497                 reset_map(TRUE);
498
499         if(cvar("sv_eventlog"))
500                 GameLogEcho(":restart");
501 }
502
503 void ReadyRestart()
504 {
505         // no arena, assault support yet...
506         if(g_arena | g_assault | gameover | intermission_running | race_completing)
507                 localcmd("restart\n");
508
509         // reset ALL scores, but only do that at the beginning 
510         //of the countdown if sv_ready_restart_after_countdown is off!
511         //Otherwise scores could be manipulated during the countdown!
512         if (!cvar("sv_ready_restart_after_countdown"))
513                 Score_ClearAll();
514
515         ReadyRestartForce();
516 }
517
518 /**
519  * Counts how many players are ready. If not enough players are ready, the function
520  * does nothing. If all players are ready, the timelimit will be extended and the
521  * restart_countdown variable is set to allow other functions like PlayerPostThink
522  * to detect that the countdown is now active. If the cvar sv_ready_restart_after_countdown
523  * is not set the map will be resetted.
524  *
525  * Function is called after the server receives a 'ready' sign from a player.
526  */
527 void ReadyCount()
528 {
529         local entity e;
530         local float r, p;
531
532         r = p = 0;
533
534         FOR_EACH_REALPLAYER(e)
535         {
536                 p += 1;
537                 if(e.ready)
538                         r += 1;
539         }
540
541         readycount = r;
542
543         Nagger_ReadyCounted();
544
545         if(r) // at least one is ready
546         if(r == p) // and, everyone is ready
547                 ReadyRestart();
548 }
549
550 /**
551  * Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown
552  * is set)
553  */
554 void restartTimer_Think() {
555         restart_mapalreadyrestarted = 1;
556         Score_ClearAll();
557         reset_map(TRUE);
558         remove(self);
559         return;
560 }
561
562 /**
563  * Checks whether the player who calls the timeout is allowed to do so.
564  * If so, it initializes the timeout countdown. It also checks whether another
565  * timeout was already running at this time and reacts correspondingly.
566  *
567  * affected globals/fields: .allowedTimeouts, remainingTimeoutTime, remainingLeadTime,
568  *                          timeoutInitiator, timeoutStatus, timeoutHandler
569  *
570  * This function is called when a player issues the calltimeout command.
571  */
572 void evaluateTimeout() {
573         if (inWarmupStage && !g_warmup_allow_timeout)
574                 return sprint(self, "^7Error: You can not call a timeout in warmup-stage!\n");
575         if (time < game_starttime )
576                 return sprint(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
577         if (timeoutStatus != 2) {
578                 //if the map uses a timelimit make sure that timeout cannot be called right before the map ends
579                 if (cvar("timelimit")) {
580                         //a timelimit was used
581                         local float myTl;
582                         myTl = cvar("timelimit");
583
584                         local float lastPossibleTimeout;
585                         lastPossibleTimeout = (myTl*60) - cvar("sv_timeout_leadtime") - 1;
586
587                         if (lastPossibleTimeout < time - game_starttime)
588                                 return sprint(self, "^7Error: It is too late to call a timeout now!\n");
589                 }
590         }
591         //player may not call a timeout if he has no calls left
592         if (self.allowedTimeouts < 1)
593                 return sprint(self, "^7Error: You already used all your timeout calls for this map!\n");
594         //now all required checks are passed
595         self.allowedTimeouts -= 1;
596         bprint(self.netname, " ^7called a timeout (", ftos(self.allowedTimeouts), " timeouts left)!\n"); //write a bprint who started the timeout (and how many he has left)
597         remainingTimeoutTime = cvar("sv_timeout_length");
598         remainingLeadTime = cvar("sv_timeout_leadtime");
599         timeoutInitiator = self;
600         if (timeoutStatus == 0) { //if another timeout was already active, don't change its status (which was 1 or 2) to 1, only change it to 1 if no timeout was active yet
601                 timeoutStatus = 1;
602                 //create the timeout indicator which centerprints the information to all players and takes care of pausing/unpausing
603                 timeoutHandler = spawn();
604                 timeoutHandler.think = timeoutHandler_Think;
605         }
606         timeoutHandler.nextthink = time; //always let the entity think asap
607
608         //inform all connected clients about the timeout call
609         play2all("announcer/robotic/timeoutcalled.wav");
610 }
611
612 /**
613  * Checks whether a player is allowed to resume the game. If he is allowed to do it,
614  * and the lead time for the timeout is still active, this countdown just will be aborted (the
615  * game will never be paused). Otherwise the remainingTimeoutTime will be set to the corresponding
616  * value of the cvar sv_timeout_resumetime.
617  *
618  * This function is called when a player issues the resumegame command.
619  */
620 void evaluateTimein() {
621         if (!timeoutStatus)
622                 return sprint(self, "^7Error: There is no active timeout which could be aborted!\n");
623         if (self != timeoutInitiator)
624                 return sprint(self, "^7Error: You may not abort the active timeout. Only the player who called it can do that!\n");
625         if (timeoutStatus == 1) {
626                 remainingTimeoutTime = timeoutStatus = 0;
627                 timeoutHandler.nextthink = time; //timeoutHandler has to take care of it immediately
628                 bprint(strcat("^7The timeout was aborted by ", self.netname, " !\n"));
629         }
630         else if (timeoutStatus == 2) {
631                 //only shorten the remainingTimeoutTime if it makes sense
632                 if( remainingTimeoutTime > (cvar("sv_timeout_resumetime") + 1) ) {
633                         bprint(strcat("^1Attention: ^7", self.netname, " resumed the game! Prepare for battle!\n"));
634                         remainingTimeoutTime = cvar("sv_timeout_resumetime");
635                         timeoutHandler.nextthink = time; //timeoutHandler has to take care of it immediately
636                 }
637                 else
638                         sprint(self, "^7Error: Your resumegame call was discarded!\n");
639
640         }
641 }