File tree Expand file tree Collapse file tree 5 files changed +36
-4
lines changed
Core/GameEngine/Include/Common
GeneralsMD/Code/GameEngine/Source
Generals/Code/GameEngine/Source Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 8686#define ENABLE_GUI_HACKS (1)
8787#endif
8888
89+ // Tell our computer identity in the LAN lobby. Disable for privacy.
90+ // Was enabled in the retail game and exposed the computer login and host names.
91+ #ifdef RTS_DEBUG
92+ #ifndef TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY
93+ #define TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY (1)
94+ #endif
95+ #endif
96+
8997#define MIN_DISPLAY_BIT_DEPTH 16
9098#define DEFAULT_DISPLAY_BIT_DEPTH 32
9199#define DEFAULT_DISPLAY_WIDTH 800 // The standard resolution this game was designed for
Original file line number Diff line number Diff line change @@ -901,14 +901,22 @@ void updateGameOptions( void )
901901void setLANPlayerTooltip (LANPlayer* player)
902902{
903903 UnicodeString tooltip;
904- tooltip.format (TheGameText->fetch (" TOOLTIP:LANPlayer" ), player->getLogin ().str (), player->getHost ().str ());
904+
905+ if (!player->getLogin ().isEmpty () || !player->getHost ().isEmpty ())
906+ {
907+ tooltip.format (TheGameText->fetch (" TOOLTIP:LANPlayer" ), player->getLogin ().str (), player->getHost ().str ());
908+ }
909+
905910#if defined(RTS_DEBUG)
906911 UnicodeString ip;
907912 ip.format (L" - %d.%d.%d.%d" , PRINTF_IP_AS_4_INTS (player->getIP ()));
908913 tooltip.concat (ip);
909914#endif
910- TheMouse->setCursorTooltip ( tooltip );
911915
916+ if (!tooltip.isEmpty ())
917+ {
918+ TheMouse->setCursorTooltip ( tooltip );
919+ }
912920}
913921
914922
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ void LANAPI::init( void )
112112
113113 m_lastGameopt = " " ;
114114
115+ #if TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY
115116 char userName[UNLEN + 1 ];
116117 DWORD bufSize = ARRAY_SIZE (userName);
117118 if (GetUserNameA (userName, &bufSize))
@@ -133,6 +134,7 @@ void LANAPI::init( void )
133134 {
134135 m_hostName = " unknown" ;
135136 }
137+ #endif
136138}
137139
138140void LANAPI::reset ( void )
@@ -451,11 +453,13 @@ void LANAPI::update( void )
451453 }
452454 else
453455 {
456+ #if TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY
454457 AsciiString text;
455458 text.format (" User=%s" , m_userName.str ());
456459 RequestGameOptions ( text, true );
457460 text.format (" Host=%s" , m_hostName.str ());
458461 RequestGameOptions ( text, true );
462+ #endif
459463 RequestGameOptions ( " HELLO" , false );
460464 }
461465 }
Original file line number Diff line number Diff line change @@ -996,14 +996,22 @@ void updateGameOptions( void )
996996void setLANPlayerTooltip (LANPlayer* player)
997997{
998998 UnicodeString tooltip;
999- tooltip.format (TheGameText->fetch (" TOOLTIP:LANPlayer" ), player->getLogin ().str (), player->getHost ().str ());
999+
1000+ if (!player->getLogin ().isEmpty () || !player->getHost ().isEmpty ())
1001+ {
1002+ tooltip.format (TheGameText->fetch (" TOOLTIP:LANPlayer" ), player->getLogin ().str (), player->getHost ().str ());
1003+ }
1004+
10001005#if defined(RTS_DEBUG)
10011006 UnicodeString ip;
10021007 ip.format (L" - %d.%d.%d.%d" , PRINTF_IP_AS_4_INTS (player->getIP ()));
10031008 tooltip.concat (ip);
10041009#endif
1005- TheMouse->setCursorTooltip ( tooltip );
10061010
1011+ if (!tooltip.isEmpty ())
1012+ {
1013+ TheMouse->setCursorTooltip ( tooltip );
1014+ }
10071015}
10081016
10091017
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ void LANAPI::init( void )
112112
113113 m_lastGameopt = " " ;
114114
115+ #if TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY
115116 char userName[UNLEN + 1 ];
116117 DWORD bufSize = ARRAY_SIZE (userName);
117118 if (GetUserNameA (userName, &bufSize))
@@ -133,6 +134,7 @@ void LANAPI::init( void )
133134 {
134135 m_hostName = " unknown" ;
135136 }
137+ #endif
136138}
137139
138140void LANAPI::reset ( void )
@@ -451,11 +453,13 @@ void LANAPI::update( void )
451453 }
452454 else
453455 {
456+ #if TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY
454457 AsciiString text;
455458 text.format (" User=%s" , m_userName.str ());
456459 RequestGameOptions ( text, true );
457460 text.format (" Host=%s" , m_hostName.str ());
458461 RequestGameOptions ( text, true );
462+ #endif
459463 RequestGameOptions ( " HELLO" , false );
460464 }
461465 }
You can’t perform that action at this time.
0 commit comments