# HG changeset patch # User Adam Kaminski # Date 1638422001 18000 # Thu Dec 02 00:13:21 2021 -0500 # Node ID 5a1e00db8cf089877ef8246da14c58997b1c6d4b # Parent 27485e8c5c665aec19dfb919236d0a857073530b Fixed color codes appearing in the hostname when the server was minimized in the systray. diff -r 27485e8c5c66 -r 5a1e00db8cf0 src/win32/serverconsole/serverconsole.cpp --- a/src/win32/serverconsole/serverconsole.cpp Wed Dec 01 23:58:15 2021 -0500 +++ b/src/win32/serverconsole/serverconsole.cpp Thu Dec 02 00:13:21 2021 -0500 @@ -512,8 +512,7 @@ RECT ThisWindowRect; ANIMATIONINFO AnimationInfo; NOTIFYICONDATA NotifyIconData; - UCVarValue Val; - char szString[64]; + FString uncolorizedHostname; AnimationInfo.cbSize = sizeof( AnimationInfo ); SystemParametersInfo( SPI_GETANIMATION, sizeof( AnimationInfo ), &AnimationInfo, 0 ); @@ -547,10 +546,12 @@ NotifyIconData.uCallbackMessage = UWM_TRAY_TRAYID; NotifyIconData.hIcon = g_hSmallIcon; - Val = sv_hostname.GetGenericRep( CVAR_String ); - strncpy( szString, Val.String, 63 ); - szString[63] = 0; - lstrcpy( NotifyIconData.szTip, szString ); + // [AK] Remove any color codes in the server name before sending it off. + uncolorizedHostname = sv_hostname.GetGenericRep( CVAR_String ).String; + V_ColorizeString( uncolorizedHostname ); + V_RemoveColorCodes( uncolorizedHostname ); + + lstrcpy( NotifyIconData.szTip, uncolorizedHostname.GetChars( )); Shell_NotifyIcon( NIM_ADD, &NotifyIconData ); break;