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