From: bones_was_here Date: Thu, 21 Apr 2022 16:06:43 +0000 (+1000) Subject: Remove legacy MOTD centreprint (retaining support for old servers) X-Git-Tag: xonotic-v0.8.6~418^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1c0f9f28bc81d721b00abc7f6a9f00950456ec04;p=xonotic%2Fxonotic-data.pk3dir.git Remove legacy MOTD centreprint (retaining support for old servers) --- diff --git a/notifications.cfg b/notifications.cfg index 732ed5fae..1919601d5 100644 --- a/notifications.cfg +++ b/notifications.cfg @@ -343,7 +343,7 @@ seta notification_INFO_WEAPON_TUBA_SUICIDE "1" "0 = off, 1 = print to console, 2 seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)" -// MSG_CENTER notifications (count = 243): +// MSG_CENTER notifications (count = 242): seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint" seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint" seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint" @@ -485,7 +485,6 @@ seta notification_CENTER_LMS_VISIBLE_LEADER "1" "0 = off, 1 = centerprint" seta notification_CENTER_LMS_VISIBLE_OTHER "1" "0 = off, 1 = centerprint" seta notification_CENTER_MISSING_PLAYERS "1" "0 = off, 1 = centerprint" seta notification_CENTER_MISSING_TEAMS "1" "0 = off, 1 = centerprint" -seta notification_CENTER_MOTD "1" "0 = off, 1 = centerprint" seta notification_CENTER_MOVETOSPEC_IDLING "1" "0 = off, 1 = centerprint" seta notification_CENTER_NADE_BONUS "1" "0 = off, 1 = centerprint" seta notification_CENTER_NADE_THROW "1" "0 = off, 1 = centerprint" @@ -750,4 +749,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 = 843): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 243, MSG_MULTI = 157, MSG_CHOICE = 28 +// Notification counts (total = 842): MSG_ANNCE = 80, MSG_INFO = 335, MSG_CENTER = 242, MSG_MULTI = 157, MSG_CHOICE = 28 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index ea7e1dda8..0a643da4a 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1394,7 +1394,6 @@ bool net_handle_ServerWelcome() return true; } - welcome_msg_force_centerprint = ReadByte(); strcpy(hostname, ReadString()); string hostversion = ReadString(); @@ -1435,7 +1434,7 @@ void Welcome_Message_Show_Try() if (!welcome_msg_menu_check_maxtime) return; - bool want_dialog = (!welcome_msg_force_centerprint && !isdemo() && autocvar_cl_welcome_in_menu_dialog); + bool want_dialog = !isdemo(); // if want dialog check if menu is initialized but for a short time if (!want_dialog || cvar("_menu_initialized") == 2 || time > welcome_msg_menu_check_maxtime) { @@ -1448,8 +1447,6 @@ void Welcome_Message_Show_Try() if (intermission) // close it after it's been initialized so it can still be opened manually localcmd("\ntogglemenu 0\n"); } - else - centerprint_Add(ORDINAL(CPID_MOTD), strcat(hostname, "\n\n\n", welcome_msg), 15, 0); strfree(welcome_msg); welcome_msg_menu_check_maxtime = 0; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index a2b0fe31c..bc16a8643 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -19,7 +19,6 @@ bool autocvar__hud_showbinds_reload; bool autocvar_developer_csqcentities; bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode bool autocvar_cl_race_cptimes_showself = false; -bool autocvar_cl_welcome_in_menu_dialog = true; // Map coordinate base calculations need these vector mi_center; @@ -106,7 +105,6 @@ bool warmup_stage; string hostname; string welcome_msg; float welcome_msg_menu_check_maxtime; -bool welcome_msg_force_centerprint; void Welcome_Message_Show_Try(); void Fog_Force(); diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 69483bfc3..73c858fcf 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -716,8 +716,6 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(INSTAGIB_FINDAMMO_FIRST, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) MSG_CENTER_NOTIF(INSTAGIB_LIVES_REMAINING, N_ENABLE, 0, 1, "f1", CPID_Null, "0 0", _("^F2Extra lives remaining: ^K1%s"), "") - MSG_CENTER_NOTIF(MOTD, N_ENABLE, 1, 0, "s1", CPID_MOTD, "-1 0", "^BG%s", "") - MSG_CENTER_NOTIF(NIX_COUNTDOWN, N_ENABLE, 0, 2, "item_wepname", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") MSG_CENTER_NOTIF(NIX_NEWWEAPON, N_ENABLE, 0, 1, "item_wepname", CPID_NIX, "0 0", _("^F2Active weapon: ^F1%s"), "") diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index fb06d264a..74e313dce 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -62,7 +62,6 @@ ENUMCLASS(CPID) CASE(CPID, MISSING_TEAMS) CASE(CPID, MISSING_PLAYERS) CASE(CPID, INSTAGIB_FINDAMMO) - CASE(CPID, MOTD) CASE(CPID, NIX) CASE(CPID, ONSLAUGHT) CASE(CPID, ONS_CAPSHIELD) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 08f9ff664..32c265e9c 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1019,17 +1019,10 @@ void ClientPreConnect(entity this) } #endif -void SendWelcomemessage(entity this, bool force_centerprint) -{ - msg_entity = this; - WriteHeader(MSG_ONE, TE_CSQC_SERVERWELCOME); - SendWelcomemessage_msg_type(this, force_centerprint, MSG_ONE); -} - // NOTE csqc uses the active mutators list sent by this function // to understand which mutators are enabled // also note that they aren't all registered mutators, e.g. jetpack, low gravity -void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type) +void SendWelcomemessage_msg_type(entity this, int msg_type) { WriteByte(msg_type, boolean(autocvar_g_campaign)); if (boolean(autocvar_g_campaign)) @@ -1039,7 +1032,6 @@ void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_ty WriteString(msg_type, Campaign_GetMessage()); return; } - WriteByte(msg_type, force_centerprint); WriteString(msg_type, autocvar_hostname); WriteString(msg_type, autocvar_g_xonoticversion); WriteByte(msg_type, CS(this).version_mismatch); diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 996a68f62..8436aa6b3 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -318,7 +318,7 @@ bool independent_players; .float nickspamtime; // time of last nick change .float nickspamcount; -void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type); +void SendWelcomemessage_msg_type(entity this, int msg_type); // respawning .int respawn_flags; diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index b6244ee24..da3fddd60 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -214,7 +214,7 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf) WriteByte(MSG_ENTITY, welcome_msg_too); // welcome message is sent here because it needs to know the gametype if (welcome_msg_too) - SendWelcomemessage_msg_type(to, false, MSG_ENTITY); + SendWelcomemessage_msg_type(to, MSG_ENTITY); return true; } diff --git a/xonotic-client.cfg b/xonotic-client.cfg index 7a0dec689..2e40bc277 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -24,14 +24,13 @@ cl_particles_forcetraileffects 1 alias dropweapon "impulse 17" +// support for servers still using the old centreprint MOTD alias +show_info0 "+button7" alias -show_info0 "-button7" alias +show_info1 "menu_showwelcomedialog" alias -show_info1 "" - -seta cl_welcome_in_menu_dialog 1 "1: show the welcome message in a dedicated menu dialog; 0: show it as a centerprint message" -alias +show_info +show_info$cl_welcome_in_menu_dialog -alias -show_info -show_info$cl_welcome_in_menu_dialog +alias +show_info +show_info$_menu_welcome_dialog_available +alias -show_info -show_info$_menu_welcome_dialog_available // merge lightmaps up to 2048x2048 textures mod_q3bsp_lightmapmergepower 4