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