From: bones_was_here Date: Thu, 13 May 2021 16:52:12 +0000 (+1000) Subject: Merge branch 'master' into bones_was_here/centreprints X-Git-Tag: xonotic-v0.8.5~405^2~34^2~1 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=095de3c9eda3ade2d68c6274df53db3f3bfcd96a;hp=9aa0ae2585418a0d070eceb2109034b99187c5a2;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into bones_was_here/centreprints --- diff --git a/.tx/merge-base b/.tx/merge-base index 592a083cd..af99f0876 100644 --- a/.tx/merge-base +++ b/.tx/merge-base @@ -1 +1 @@ -Mon May 3 07:23:38 CEST 2021 +Wed May 12 07:23:45 CEST 2021 diff --git a/common.he.po b/common.he.po index 10c390bb7..1ade42566 100644 --- a/common.he.po +++ b/common.he.po @@ -5,8 +5,8 @@ # Translators: # nad le , 2018 # Omer I.S., 2020 -# Omer I.S. , 2020 -# Omer I.S. , 2020 +# Omeritzics Games , 2020 +# Omeritzics Games , 2020 # Roi Asher Gerszkoviez , 2020 # Tal Leibman , 2019 msgid "" diff --git a/hud_luma.cfg b/hud_luma.cfg index 9ad2425a7..7bcbef2b9 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -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" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index c642ac38f..715d57efd 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -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" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index d15dd868a..25f871bf1 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -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" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 11c57ee48..e3e857b0a 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -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" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 42a79015c..fdf1efff3 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -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" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 9200283c3..74132c08a 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -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" diff --git a/notifications.cfg b/notifications.cfg index 0a0934b13..a23eb5539 100644 --- a/notifications.cfg +++ b/notifications.cfg @@ -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 diff --git a/qcsrc/client/hud/panel/centerprint.qh b/qcsrc/client/hud/panel/centerprint.qh index f9e23b726..a143fa0a2 100644 --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@ -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; diff --git a/qcsrc/common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc b/qcsrc/common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc index d91546af5..f8e364fdd 100644 --- a/qcsrc/common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc +++ b/qcsrc/common/mutators/mutator/kick_teamkiller/sv_kick_teamkiller.qc @@ -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); } } diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index f48f5060b..5fe8699c2 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -149,17 +149,6 @@ 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!"), "") diff --git a/qcsrc/common/sounds/all.inc b/qcsrc/common/sounds/all.inc index b7228d454..d8d60c4a1 100644 --- a/qcsrc/common/sounds/all.inc +++ b/qcsrc/common/sounds/all.inc @@ -277,6 +277,7 @@ SOUND(KILL, "misc/kill"); SOUND(SPAWN, "misc/spawn"); SOUND(TALK, "misc/talk"); +SOUND(TALK2, "misc/talk2"); SOUND(TELEPORT, "misc/teleport"); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 8dd6c341b..434c12098 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -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) diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index bf63bbb91..63fd27839 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -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; diff --git a/qcsrc/common/vehicles/cl_vehicles.qh b/qcsrc/common/vehicles/cl_vehicles.qh index 76bdc6731..6b1ce3264 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qh +++ b/qcsrc/common/vehicles/cl_vehicles.qh @@ -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) diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh index c762acfa2..589db7a10 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh @@ -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 diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 08a0b68da..7d3c1faca 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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; } } diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index ed3273be8..31d65f948 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -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; diff --git a/qcsrc/server/main.qc b/qcsrc/server/main.qc index 13574bf0e..73f473ae9 100644 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@ -26,6 +26,40 @@ #include #include +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) diff --git a/qcsrc/server/main.qh b/qcsrc/server/main.qh index 0685ca71f..e189601a7 100644 --- a/qcsrc/server/main.qh +++ b/qcsrc/server/main.qh @@ -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); diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 7abd4e6bc..11509b542 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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; } diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index bffb7dbd5..6628b4236 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -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"); diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 615929807..be57248ac 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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