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