]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into bones_was_here/centreprints
authorbones_was_here <bones_was_here@xa.org.au>
Thu, 13 May 2021 16:52:12 +0000 (02:52 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Thu, 13 May 2021 16:52:12 +0000 (02:52 +1000)
24 files changed:
.tx/merge-base
common.he.po
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
notifications.cfg
qcsrc/client/hud/panel/centerprint.qh
qcsrc/common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc
qcsrc/common/notifications/all.inc
qcsrc/common/sounds/all.inc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/vehicles/cl_vehicles.qh
qcsrc/common/vehicles/vehicle/raptor_weapons.qh
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/main.qc
qcsrc/server/main.qh
qcsrc/server/teamplay.qc
qcsrc/server/world.qc
xonotic-server.cfg

index 592a083cd3f5f830901d3626ab12b610237723ac..af99f08768c2a8bfb38431a0707297420738b096 100644 (file)
@@ -1 +1 @@
-Mon May  3 07:23:38 CEST 2021
+Wed May 12 07:23:45 CEST 2021
index 10c390bb7e8a0b37a56ee2623d41349dae01ede2..1ade42566c64a331d85fe512aa66730240704886 100644 (file)
@@ -5,8 +5,8 @@
 # Translators:
 # nad le <nadavlevi726@gmail.com>, 2018
 # Omer I.S., 2020
-# Omer I.S. <omeritzicschwartz@gmail.com>, 2020
-# Omer I.S. <omeritzicschwartz@gmail.com>, 2020
+# Omeritzics Games <omeritzicschwartz@gmail.com>, 2020
+# Omeritzics Games <omeritzicschwartz@gmail.com>, 2020
 # Roi Asher Gerszkoviez <gerszkoviez@gmail.com>, 2020
 # Tal Leibman <leibman2@gmail.com>, 2019
 msgid ""
index 9ad2425a7c498bf97171eff9bea3acbb18ca03a3..7bcbef2b937fa8afb4af63737e06203c809eab90 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index c642ac38f46121727ce1487c6a78b6cc8a8d2462..715d57efdcff1b8da2a2a9acfb537277446b097c 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index d15dd868ac2c37c074f2a17da73137ebb99774a6..25f871bf12b7165008527e3d25b4d25300a9a238 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index 11c57ee484bdc0344e34c507f5408a9d35d41a1a..e3e857b0a0f5a9fdf7a9f7ee47e9440709793071 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index 42a79015cdc43267e21a93505aa7a287987c133a..fdf1efff39a046b5aea8571c6a01b8672736c1d1 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index 9200283c3d3c1aeaed050a7933f4f9e675039ca7..74132c08a90604924cc5d2546398467ab50f1197 100644 (file)
@@ -276,8 +276,8 @@ seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_fontscale_bold "1.4"
 seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
 seta hud_panel_centerprint_fade_subsequent "1"
 seta hud_panel_centerprint_fade_subsequent_passone "3"
 seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
index 0a0934b1363ad1ac23f1be6849c55f64c006341f..a23eb5539ae13833fdf6b94ee50762af6b30498e 100644 (file)
@@ -11,7 +11,7 @@
 // **                                          ** //
 // ********************************************** //
 
-// MSG_ANNCE notifications (count = 90):
+// MSG_ANNCE notifications (count = 80):
 seta notification_ANNCE_ACHIEVEMENT_AIRSHOT "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_ACHIEVEMENT_AMAZING "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_ACHIEVEMENT_AWESOME "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
@@ -52,16 +52,6 @@ seta notification_ANNCE_NUM_GAMESTART_6 "0" "0 = disabled, 1 = enabled if gentle
 seta notification_ANNCE_NUM_GAMESTART_7 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_NUM_GAMESTART_8 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_NUM_GAMESTART_9 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_1 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_10 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_2 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_3 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_4 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_5 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_6 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_7 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_8 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
-seta notification_ANNCE_NUM_IDLE_9 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_NUM_KILL_1 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_NUM_KILL_10 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_NUM_KILL_2 "0" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
@@ -745,7 +735,7 @@ seta notification_debug "0" "Print extra debug information on all notification f
 seta notification_errors_are_fatal "1" "If a notification fails upon initialization, cause a Host_Error to stop the program"
 seta notification_item_centerprinttime "1.5" "How long to show item information centerprint messages (like 'You got the Electro' or such)"
 seta notification_lifetime_mapload "10" "Amount of time that notification entities last immediately at mapload (in seconds) to help prevent notifications from being lost on early init (like gamestart countdown)"
-seta notification_lifetime_runtime "0.5" "Amount of time that notification entities last on the server during runtime (in seconds)"
+seta notification_lifetime_runtime "0.5" "Amount of time that notification entities last on the server during runtime (In seconds)"
 seta notification_server_allows_location "1" "Server side cvar for allowing death messages to show location information too"
 seta notification_show_location "0" "Append location information to MSG_INFO death/kill messages"
 seta notification_show_location_string "" "Replacement string piped into sprintf, so you can do different messages like this: ' at the %s' or ' (near %s)'"
@@ -756,4 +746,4 @@ seta notification_show_sprees_info "3" "Show spree information in MSG_INFO messa
 seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
 seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
 
-// Notification counts (total = 849): MSG_ANNCE = 90, MSG_INFO = 334, MSG_CENTER = 241, MSG_MULTI = 156, MSG_CHOICE = 28
+// Notification counts (total = 839): MSG_ANNCE = 80, MSG_INFO = 334, MSG_CENTER = 241, MSG_MULTI = 156, MSG_CHOICE = 28
index f9e23b726fb61c0188ec948defd293530b3f81a7..a143fa0a2a830ede880ae4fbfb414ee73c8d4892 100644 (file)
@@ -3,8 +3,8 @@
 
 bool autocvar_hud_panel_centerprint;
 float autocvar_hud_panel_centerprint_align;
-float autocvar_hud_panel_centerprint_fade_in = 0.2;
-float autocvar_hud_panel_centerprint_fade_out = 0.5;
+float autocvar_hud_panel_centerprint_fade_in = 0.15;
+float autocvar_hud_panel_centerprint_fade_out = 0.15;
 float autocvar_hud_panel_centerprint_fade_subsequent = 1;
 float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3;
 float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5;
index d91546af5711fcfa9b9848202cc7c775c3aca151..f8e364fddca307cab249b853f72c8ec3ac6921a5 100644 (file)
@@ -28,7 +28,7 @@ MUTATOR_HOOKFUNCTION(kick_teamkiller, PlayerDies)
        if (teamkills >= autocvar_g_kick_teamkiller_lower_limit &&
            teamkills >= autocvar_g_kick_teamkiller_rate*playtime/60.0)
        {
-               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_TEAMKILL, attacker.netname);
-               dropclient(attacker);
+               if (dropclient_schedule(attacker))
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_TEAMKILL, attacker.netname);
        }
 }
index f48f5060b1f79220e41a35cd192801bc50f81b1d..5fe8699c2500699f61c9fa4b593468c0756e17a1 100644 (file)
     MSG_ANNCE_NOTIF(NUM_GAMESTART_9,            N___NEVER, "9",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
     MSG_ANNCE_NOTIF(NUM_GAMESTART_10,           N___NEVER, "10",                CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
 
-    MSG_ANNCE_NOTIF(NUM_IDLE_1,                 N___NEVER, "1",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_2,                 N___NEVER, "2",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_3,                 N___NEVER, "3",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_4,                 N___NEVER, "4",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_5,                 N___NEVER, "5",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_6,                 N___NEVER, "6",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_7,                 N___NEVER, "7",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_8,                 N___NEVER, "8",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_9,                 N___NEVER, "9",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-    MSG_ANNCE_NOTIF(NUM_IDLE_10,                N___NEVER, "10",                CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-
     MSG_ANNCE_NOTIF(NUM_KILL_1,                 N___NEVER, "1",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
     MSG_ANNCE_NOTIF(NUM_KILL_2,                 N___NEVER, "2",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
     MSG_ANNCE_NOTIF(NUM_KILL_3,                 N___NEVER, "3",                 CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
@@ -414,11 +403,11 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_INFO_NOTIF(POWERUP_STRENGTH,                        N_CONSOLE,  1, 0, "s1", "s1",       "strength",     _("^BG%s^K1 picked up Strength"), "")
 
     MSG_INFO_NOTIF(QUIT_DISCONNECT,                         N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 disconnected"), "")
-    MSG_INFO_NOTIF(QUIT_KICK_IDLING,                        N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for idling"), "")
-    MSG_INFO_NOTIF(MOVETOSPEC_IDLING,                       N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was moved to spectator for idling"), "")
+    MSG_INFO_NOTIF(QUIT_KICK_IDLING,                        N_CHATCON,  1, 1, "s1 f1", "",      "",             _("^BG%s^F3 was kicked after idling for %s seconds"), "")
+    MSG_INFO_NOTIF(MOVETOSPEC_IDLING,                       N_CHATCON,  1, 1, "s1 f1", "",      "",             _("^BG%s^F3 was moved to^BG spectators^F3 after idling for %s seconds"), "")
     MSG_INFO_NOTIF(QUIT_KICK_SPECTATING,                    N_CONSOLE,  0, 0, "", "",           "",             _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
     MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL,                      N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for excessive teamkilling"), "")
-    MSG_INFO_NOTIF(QUIT_SPECTATE,                           N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 is now spectating"), "")
+    MSG_INFO_NOTIF(QUIT_SPECTATE,                           N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 is now^BG spectating"), "")
 
     MSG_INFO_NOTIF(RACE_ABANDONED,                          N_CONSOLE,  1, 0, "s1", "",                                                                     "",                         _("^BG%s^BG has abandoned the race"), "")
     MSG_INFO_NOTIF(RACE_FAIL_RANKED,                        N_CONSOLE,  1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time",         "race_newfail",             _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "")
@@ -658,7 +647,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_CENTER_NOTIF(DEATH_TEAMKILL_FRAGGED,            N_ENABLE,    1, 0, "s1",             CPID_Null,              "0 0",  strcat(BOLD_OPERATOR, _("^K1You were team killed by ^BG%s")), strcat(BOLD_OPERATOR, _("^K1You were betrayed by team mate ^BG%s")))
 
     MSG_CENTER_NOTIF(DISCONNECT_IDLING,                 N_ENABLE,    0, 1, "",               CPID_IDLING,            "1 f1", strcat(BOLD_OPERATOR, _("^K1Stop idling!\n^BGDisconnecting in ^COUNT...")), "")
-    MSG_CENTER_NOTIF(MOVETOSPEC_IDLING,                 N_ENABLE,    0, 1, "",               CPID_IDLING,            "1 f1", strcat(BOLD_OPERATOR, _("^K1Stop idling!\n^BGMoving to spectator in ^COUNT...")), "")
+    MSG_CENTER_NOTIF(MOVETOSPEC_IDLING,                 N_ENABLE,    0, 1, "",               CPID_IDLING,            "1 f1", strcat(BOLD_OPERATOR, _("^K1Stop idling!\n^BGMoving to spectators in ^COUNT...")), "")
 
     MSG_CENTER_NOTIF(DOOR_LOCKED_NEED,                  N_ENABLE,    1, 0, "s1",             CPID_Null,              "0 0",  _("^BGYou need %s^BG!"), "")
     MSG_CENTER_NOTIF(DOOR_LOCKED_ALSONEED,              N_ENABLE,    1, 0, "s1",             CPID_Null,              "0 0",  _("^BGYou also need %s^BG!"), "")
index b7228d454caf822f1ee50be47441fd34f8818f51..d8d60c4a129a987cd297caaa549dab804318d1ec 100644 (file)
@@ -277,6 +277,7 @@ SOUND(KILL, "misc/kill");
 SOUND(SPAWN, "misc/spawn");
 
 SOUND(TALK, "misc/talk");
+SOUND(TALK2, "misc/talk2");
 
 SOUND(TELEPORT, "misc/teleport");
 
index 8dd6c341b3208d61e2c2275da60c0fea53a908f7..434c12098b091cf9e38adbf0aa3654778df613ac 100644 (file)
@@ -1710,23 +1710,6 @@ Notification Announcer_PickNumber(int type, int num)
                        }
                        break;
                }
-               case CNT_IDLE:
-               {
-                       switch(num)
-                       {
-                               case 10: return ANNCE_NUM_IDLE_10;
-                               case 9:  return ANNCE_NUM_IDLE_9;
-                               case 8:  return ANNCE_NUM_IDLE_8;
-                               case 7:  return ANNCE_NUM_IDLE_7;
-                               case 6:  return ANNCE_NUM_IDLE_6;
-                               case 5:  return ANNCE_NUM_IDLE_5;
-                               case 4:  return ANNCE_NUM_IDLE_4;
-                               case 3:  return ANNCE_NUM_IDLE_3;
-                               case 2:  return ANNCE_NUM_IDLE_2;
-                               case 1:  return ANNCE_NUM_IDLE_1;
-                       }
-                       break;
-               }
                case CNT_KILL:
                {
                        switch(num)
index bf63bbb914982311e664363f98e8cf31ccbb2f01..63fd27839d15ee0617d873c3f55f6758408173f1 100644 (file)
@@ -210,7 +210,7 @@ vector animfixfps(entity e, vector a, vector b);
 #ifdef GAMEQC
 const int CNT_NORMAL = 1;
 const int CNT_GAMESTART = 2;
-const int CNT_IDLE = 3;
+//const int CNT_IDLE = 3;
 const int CNT_KILL = 4;
 const int CNT_RESPAWN = 5;
 const int CNT_ROUNDSTART = 6;
index 76bdc67313d230d4d1a4e25b2c162826a77e5029..6b1ce326414440daf8c181237929d43c3c24296e 100644 (file)
@@ -33,7 +33,4 @@ float alarm2time;
 vector vehicleHud_Size;
 vector vehicleHud_Pos;
 
-void RaptorCBShellfragDraw(entity this);
-void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
-
 #define weapon2mode STAT(VEHICLESTAT_W2MODE)
index c762acfa2309386816c7445dbd79e75a53b3565d..589db7a101e836eb5ab9aa401077835d82af7e47 100644 (file)
@@ -52,3 +52,8 @@ float autocvar_g_vehicle_raptor_flare_lifetime = 10;
 float autocvar_g_vehicle_raptor_flare_chase = 0.9;
 float autocvar_g_vehicle_raptor_flare_range = 2000;
 #endif
+
+#ifdef CSQC
+void RaptorCBShellfragDraw(entity this);
+void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang);
+#endif
index 08a0b68da2fb55fceddcba709ed6bc669ddaca8c..7d3c1faca69520d5faa995bcfa443259d4ba668a 100644 (file)
@@ -241,13 +241,6 @@ void PutObserverInServer(entity this)
 
        if (IS_PLAYER(this))
        {
-               if (autocvar_sv_maxidle_playertospectator > 0 && CS(this).idlekick_lasttimeleft)
-               {
-                       Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_IDLING);
-                       CS(this).idlekick_lasttimeleft = 0;
-                       CS(this).parm_idlesince = time;
-               }
-
                if(GetResource(this, RES_HEALTH) >= 1)
                {
                        // despawn effect
@@ -2465,9 +2458,8 @@ void PlayerPreThink (entity this)
                        && (IS_SPEC(this) || IS_OBSERVER(this)) && !this.caplayer
                        && time > (CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime))
                {
-                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
-                       dropclient(this);
-                       return;
+                       if (dropclient_schedule(this))
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
                }
        }
 
@@ -2708,7 +2700,8 @@ void PlayerPostThink (entity this)
        if (autocvar_sv_maxidle > 0 || (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0))
        if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
        if (IS_REAL_CLIENT(this))
-       if (IS_PLAYER(this) || autocvar_sv_maxidle_spectatorsareidle)
+       if (IS_PLAYER(this) || autocvar_sv_maxidle_alsokickspectators)
+       if (!intermission_running) // NextLevel() kills all centerprints after setting this true
        {
                int totalClients = 0;
                if(autocvar_sv_maxidle > 0 && autocvar_sv_maxidle_slots > 0)
@@ -2735,34 +2728,32 @@ void PlayerPostThink (entity this)
                        if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
                                maxidle_time = autocvar_sv_maxidle_playertospectator;
                        float timeleft = ceil(maxidle_time - (time - CS(this).parm_idlesince));
-                       if (timeleft == min(10, maxidle_time - 1)) { // - 1 to support maxidle_time <= 10
-                               if (!CS(this).idlekick_lasttimeleft)
-                               {
-                                       if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
-                                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
-                                       else
-                                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
-                               }
+                       float countdown_time = max(min(10, maxidle_time - 1), ceil(maxidle_time * 0.33)); // - 1 to support maxidle_time <= 10
+                       if (timeleft == countdown_time && !CS(this).idlekick_lasttimeleft)
+                       {
+                               if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
+                                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
+                               else
+                                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
                        }
                        if (timeleft <= 0) {
                                if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
                                {
-                                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname);
+                                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
                                        if (this.caplayer)
                                                this.caplayer = 0;
                                        PutObserverInServer(this);
-                                       CS(this).parm_idlesince = time;
                                }
                                else
                                {
-                                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname);
-                                       dropclient(this);
+                                       if (dropclient_schedule(this))
+                                               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time);
                                }
                                return;
                        }
-                       else if (timeleft <= 10) {
+                       else if (timeleft <= countdown_time) {
                                if (timeleft != CS(this).idlekick_lasttimeleft)
-                                       Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
+                                       play2(this, SND(TALK2));
                                CS(this).idlekick_lasttimeleft = timeleft;
                        }
                }
index ed3273be84e8f7125256f4d23d73bfd065b07341..31d65f948608c1ba8e394b11970f73bd3c4f1412 100644 (file)
@@ -33,8 +33,8 @@ bool autocvar_g_nodepthtestplayers;
 string autocvar_g_mutatormsg;
 float autocvar_sv_foginterval;
 float autocvar_sv_maxidle;
-float autocvar_sv_maxidle_playertospectator;
-bool autocvar_sv_maxidle_spectatorsareidle;
+float autocvar_sv_maxidle_playertospectator = 60;
+bool autocvar_sv_maxidle_alsokickspectators;
 int autocvar_sv_maxidle_slots;
 bool autocvar_sv_maxidle_slots_countbots;
 bool autocvar_g_forced_respawn;
index 13574bf0edcf2347f87610da627a7f6c8ff40e6b..73f473ae979752c412265e06e3bf596daf66dee8 100644 (file)
 #include <server/weapons/csqcprojectile.qh>
 #include <server/world.qh>
 
+void dropclient_do(entity this)
+{
+       if (this.owner)
+               dropclient(this.owner);
+       delete(this);
+}
+/**
+ * Schedules dropclient for a player and returns true;
+ * if dropclient is already scheduled (for that player) it does nothing and returns false.
+ *
+ * NOTE: this function exists only to allow sending a message to the kicked player with
+ * Send_Notification, which doesn't work if called together with dropclient
+ */
+bool dropclient_schedule(entity this)
+{
+       bool scheduled = false;
+       FOREACH_ENTITY_CLASS("dropclient_handler", true,
+       {
+               if(it.owner == this)
+               {
+                       scheduled = true;
+                       break; // can't use return here, compiler shows a warning
+               }
+       });
+       if (scheduled)
+               return false;
+
+       entity e = new_pure(dropclient_handler);
+       setthink(e, dropclient_do);
+       e.owner = this;
+       e.nextthink = time + 0.1;
+       return true;
+}
+
 void CreatureFrame_hotliquids(entity this)
 {
        if (this.contents_damagetime >= time)
index 0685ca71f37d6a6bff68b5b11ddbe4402d816f99..e189601a7c467cf9f757616fbc9ada286c9d62ae 100644 (file)
@@ -16,6 +16,8 @@ bool autocvar_g_balance_falldamage_onlyvertical;
 #define autocvar_slowmo cvar("slowmo")
 float autocvar_sys_ticrate;
 
+bool dropclient_schedule(entity this);
+
 /** print(), but only print if the server is not local */
 void dedicated_print(string input);
 
index 7abd4e6bc47f100d307a8d4fb63e4cff05e2e7e5..11509b5428a74f26d96fdc29c21bdfb7019317e5 100644 (file)
@@ -209,38 +209,39 @@ bool Player_SetTeamIndex(entity player, int index)
 bool SetPlayerTeam(entity player, int team_index, int type)
 {
        int old_team_index = Entity_GetTeamIndex(player);
+
        if (!Player_SetTeamIndex(player, team_index))
-       {
                return false;
-       }
+
        LogTeamChange(player.playerid, player.team, type);
+
        if (team_index != old_team_index)
        {
-               PlayerScore_Clear(player);
-               if (team_index != -1)
-               {
-                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(
-                               player.team, INFO_JOIN_PLAY_TEAM), player.netname);
-               }
-               else
-               {
-                       if (!CS(player).just_joined)
-                       {
-                               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE,
-                                       player.netname);
-                       }
-               }
                KillPlayerForTeamChange(player);
+               PlayerScore_Clear(player);
+               CS(player).parm_idlesince = time;
+
                if (!IS_BOT_CLIENT(player))
-               {
                        TeamBalance_AutoBalanceBots();
-               }
+
+               if (team_index != -1)
+                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_PLAY_TEAM), player.netname);
        }
-       else if (team_index == -1)
+
+       if (team_index == -1)
        {
-               if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
+               if (autocvar_sv_maxidle_playertospectator > 0 && CS(player).idlekick_lasttimeleft)
+               {
+                       // this done here so it happens even when manually speccing during the countdown
+                       Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_IDLING);
+                       CS(player).idlekick_lasttimeleft = 0;
+               }
+               else if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
+               {
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, player.netname);
+               }
        }
+
        return true;
 }
 
index bffb7dbd59f40d30cb682dcbd811ac543a709646..6628b4236c39ab3ed7d1592af909b50e9b4c1356 100644 (file)
@@ -408,7 +408,7 @@ void cvar_changes_init()
                BADPREFIX("skill_");
                BADPREFIX("sv_allow_");
                BADPREFIX("sv_cullentities_");
-               BADPREFIX("sv_maxidle_");
+               BADPREFIX("sv_maxidle");
                BADPREFIX("sv_minigames_");
                BADPREFIX("sv_radio_");
                BADPREFIX("sv_timeout_");
@@ -487,7 +487,6 @@ void cvar_changes_init()
                BADCVAR("sv_defaultplayercolors");
                BADCVAR("sv_defaultplayermodel");
                BADCVAR("sv_defaultplayerskin");
-               BADCVAR("sv_maxidle");
                BADCVAR("sv_maxrate");
                BADCVAR("sv_motd");
                BADCVAR("sv_public");
index 61592980721f18c7c5ddd86301ffd61c14efe88b..be57248acc8b3304fcefd6bbc96c005d779ca50d 100644 (file)
@@ -412,11 +412,11 @@ sv_gameplayfix_droptofloorstartsolid 0
 set sv_foginterval 1 "force enable fog in regular intervals"
 
 set sv_maxidle 0 "kick players idle for more than this amount of time in seconds"
-set sv_maxidle_spectatorsareidle 0 "when sv_maxidle is not 0, assume spectators are idle too"
+set sv_maxidle_alsokickspectators 1 "when sv_maxidle is > 0, kick idle spectators as well as players"
 set sv_maxidle_slots 0 "when not 0, only kick idlers when this many or less player slots are available"
 set sv_maxidle_slots_countbots 1 "count bots as player slots"
 
-set sv_maxidle_playertospectator 0 "move players idle for more than this amount of time in seconds to spectators (sv_maxidle timer starts again after sv_maxidle_playertospectator has moved a player to spectators)"
+set sv_maxidle_playertospectator 60 "move players idle for more than this amount of time in seconds to spectators (sv_maxidle timer starts again after sv_maxidle_playertospectator has moved a player to spectators)"
 
 sv_allowdownloads_inarchive 1 // for csprogs.dat
 sv_allowdownloads 0 // download protocol is evil