-
Notifications
You must be signed in to change notification settings - Fork 117
Description
When a game host announces their game to the lobby, the message is supposed to set GameInfo.isDirectConnect like so:
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPI.cpp
Lines 717 to 718 in e2385c5
| reply.GameInfo.inProgress = m_currentGame->isGameInProgress(); | |
| reply.GameInfo.isDirectConnect = m_currentGame->getIsDirectConnect(); |
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp
Lines 197 to 198 in e2385c5
| reply.GameInfo.inProgress = m_currentGame->isGameInProgress(); | |
| reply.GameInfo.isDirectConnect = m_currentGame->getIsDirectConnect(); |
The same should be done below, otherwise the game may read uninitialized memory when parsing this message:
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANAPIhandlers.cpp
Lines 67 to 68 in e2385c5
| reply.GameInfo.inProgress = m_currentGame->isGameInProgress(); | |
Additionally, m_isDirectConnect should probably be initialized in the constructor here:
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameNetwork/LANGameInfo.cpp
Lines 89 to 100 in e2385c5
| LANGameInfo::LANGameInfo() | |
| { | |
| //Added By Sadullah Nader | |
| //Initializtions missing and needed | |
| m_lastHeard = 0; | |
| m_next = NULL; | |
| // | |
| for (Int i = 0; i< MAX_SLOTS; ++i) | |
| setSlotPointer(i, &m_LANSlot[i]); | |
| setLocalIP(TheLAN->GetLocalIP()); | |
| } |