From: z411 Date: Sat, 17 Apr 2021 23:11:53 +0000 (-0400) Subject: Added permanent MOTD X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8684b5a2ff72cb130099d8c2278e02d314921462;p=xonotic%2Fxonotic-data.pk3dir.git Added permanent MOTD --- diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 56b6869c6..3e0d46379 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -11,7 +11,7 @@ void HUD_InfoMessages_Export(int fh) HUD_Write_Cvar("hud_panel_infomessages_flip"); } -float autocvar_hud_panel_infomessages_group0 = 1; +//float autocvar_hud_panel_infomessages_group0 = 1; float autocvar_hud_panel_infomessages_group_fadetime = 0.4; float autocvar_hud_panel_infomessages_group_time = 6; const int IMG_COUNT = 1; // number of InfoMessage Groups @@ -94,7 +94,7 @@ void HUD_InfoMessages() s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player)); InfoMessage(s);*/ - if(autocvar_hud_panel_infomessages_group0) + /*if(autocvar_hud_panel_infomessages_group0) { img_curr_group = 0; switch(img_select(img_curr_group) % 3) @@ -117,7 +117,7 @@ void HUD_InfoMessages() break; } InfoMessage(s); - } + }*/ //bool mutator_returnvalue = MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize, img_curr_group); //pos = M_ARGV(0, vector); @@ -219,6 +219,9 @@ void HUD_InfoMessages() } // z411 + if (motd_permanent != "") + InfoMessage(motd_permanent); + MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize, img_curr_group); } else diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 668d0d27d..06fc1dede 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1062,6 +1062,7 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew) g_trueaim_minrange = ReadCoord(); strcpy(hostname_full, ReadString()); + strcpy(motd_permanent, ReadString()); return = true; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 90fc6b636..1820fe369 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -6,6 +6,7 @@ // z411 string hostname_full; +string motd_permanent; bool autocvar_cl_db_saveasdump; bool autocvar_cl_spawn_event_particles; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 288193e6e..468c03c98 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -889,7 +889,8 @@ void ClientInit_misc(entity this) WriteCoord(channel, autocvar_g_trueaim_minrange); // z411 send full hostname - WriteString(channel, (autocvar_hostname_full ? autocvar_hostname_full : autocvar_hostname)); + WriteString(channel, autocvar_hostname_full); + WriteString(channel, autocvar_sv_motd_permanent); } void ClientInit_CheckUpdate(entity this) diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index bf9dbf9ec..29b3029c4 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -46,6 +46,7 @@ float autocvar_gameversion_max; string autocvar_hostname; int autocvar_spawn_debug; string autocvar_sv_motd; +string autocvar_sv_motd_permanent; int autocvar_sv_name_maxlength = 64; bool autocvar_sv_servermodelsonly; int autocvar_sv_spectate; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 53f61aeb4..18dd29a8b 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -320,6 +320,7 @@ void cvar_changes_init() BADCVAR("g_maplist"); BADCVAR("g_maplist_mostrecent"); BADCVAR("sv_motd"); + BADCVAR("sv_motd_permanent"); BADPREFIX("g_teamnames_");