From 962efd73077fee3f09915c1dda6f16b0eb2afafe Mon Sep 17 00:00:00 2001 From: z411 Date: Sat, 5 Sep 2020 15:00:36 -0400 Subject: [PATCH] Added full hostname --- qcsrc/client/hud/panel/scoreboard.qc | 2 +- qcsrc/client/main.qc | 2 +- qcsrc/client/main.qh | 2 +- qcsrc/server/autocvars.qh | 1 + qcsrc/server/client.qc | 6 +++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index a0c5a337e..023a33d7a 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1635,7 +1635,7 @@ void Scoreboard_Draw() pos.y += sb_gameinfo_type_fontsize.y; // z411 servername - drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(hostname, true, sb_gameinfo_detail_fontsize)), hostname, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(hostname_full, true, sb_gameinfo_detail_fontsize)), hostname_full, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += sb_gameinfo_detail_fontsize.y; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 8ac1a067c..e140fb5ec 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -921,7 +921,7 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew) g_trueaim_minrange = ReadCoord(); - strcpy(hostname, ReadString()); + strcpy(hostname_full, ReadString()); return = true; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 95df48074..70b952d9e 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -4,7 +4,7 @@ #include // z411 -string hostname; +string hostname_full; // Map coordinate base calculations need these vector mi_center; diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index e96c67b47..f2482b9db 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -263,6 +263,7 @@ float autocvar_gameversion; float autocvar_gameversion_min; float autocvar_gameversion_max; string autocvar_hostname; +string autocvar_hostname_full; // z411 bool autocvar_lastlevel; //int autocvar_leadlimit; int autocvar_leadlimit_and_fraglimit; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 33df8ab98..ea18ed479 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -875,8 +875,8 @@ void ClientInit_misc(entity this) WriteByte(channel, serverflags); WriteCoord(channel, autocvar_g_trueaim_minrange); - // z411 send hostname - WriteString(channel, autocvar_hostname); + // z411 send full hostname + WriteString(channel, (autocvar_hostname_full ? autocvar_hostname_full : autocvar_hostname)); } void ClientInit_CheckUpdate(entity this) @@ -1064,7 +1064,7 @@ string getwelcomemessage(entity this) modifications = substring(modifications, 2, strlen(modifications) - 2); string versionmessage = GetClientVersionMessage(this); - string s = strcat(versionmessage, "^8\n^8\nhost is ^9", autocvar_hostname, "^8\n"); + string s = strcat(versionmessage, "^8\n^8\nhost is ^9", (autocvar_hostname_full ? autocvar_hostname_full : autocvar_hostname), "^8\n"); s = strcat(s, "^8\nmatch type is ^1", gamemode_name, "^8\n"); -- 2.39.2