Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include "GameLogic/VictoryConditions.h"
#include "Common/PlayerList.h"
#include "GameLogic/GameLogic.h"
// Initialize slot pointers first to ensure they're valid
cleanUpSlotPointers();


#include "GameNetwork/FileTransfer.h"
#include "GameClient/MapUtil.h"
#include "GameClient/GameText.h"
Expand Down Expand Up @@ -542,4 +546,4 @@ void NGMPGame::StartCountdown()
{
pWS->SendData_CountdownStarted();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "GameNetwork/GeneralsOnline/NGMPGame.h"
#include "GameLogic/VictoryConditions.h"
#include "Common/PlayerList.h"
#include "GameLogic/GameLogic.h"
#include "GameNetwork/FileTransfer.h"
#include "GameClient/MapUtil.h"
#include "GameClient/GameText.h"
#include "GameNetwork/GameSpyOverlay.h"
#include "Common/RandomValue.h"
#include "GameNetwork/GeneralsOnline/NGMP_interfaces.h"
#include "GameNetwork/NetworkInterface.h"
#include "Common/GlobalData.h"
#include "GameClient/View.h"

NGMPGameSlot::NGMPGameSlot()
{
GameSlot();
m_profileID = 0;
m_wins = 0;
m_losses = 0;
m_rankPoints = 0;
m_favoriteSide = 0;
m_pingInt = 0;
m_profileID = 0;
m_pingStr.clear();
}

// NGMPGame ----------------------------------------

NGMPGame::NGMPGame()
{
// Initialize slot pointers first to ensure they're valid
cleanUpSlotPointers();

NGMP_OnlineServices_LobbyInterface* pLobbyInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_LobbyInterface>();
if (pLobbyInterface == nullptr)
{
// Ensure m_inGame is set to false even if we return early
m_inGame = false;
return;
}

setLocalIP(0);

m_ladderIP.clear();
m_ladderPort = 0;

enterGame(); // this is done on join in the GS impl, and must be called before setMap

// NGMP: Store map
setMap(pLobbyInterface->GetCurrentLobbyMapPath());

// init
//init();

// NGMP: Populate slots
UpdateSlotsFromCurrentLobby();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "GameNetwork/GeneralsOnline/NGMPGame.h"
#include "GameLogic/VictoryConditions.h"
#include "Common/PlayerList.h"
#include "GameLogic/GameLogic.h"
#include "GameNetwork/FileTransfer.h"
#include "GameClient/MapUtil.h"
#include "GameClient/GameText.h"
#include "GameNetwork/GameSpyOverlay.h"
#include "Common/RandomValue.h"
#include "GameNetwork/GeneralsOnline/NGMP_interfaces.h"
#include "GameNetwork/NetworkInterface.h"
#include "Common/GlobalData.h"
#include "GameClient/View.h"

NGMPGameSlot::NGMPGameSlot()
{
GameSlot();
m_profileID = 0;
m_wins = 0;
m_losses = 0;
m_rankPoints = 0;
m_favoriteSide = 0;
m_pingInt = 0;
m_profileID = 0;
m_pingStr.clear();
}

// NGMPGame ----------------------------------------

NGMPGame::NGMPGame()
{
// Initialize slot pointers first to ensure they're valid
cleanUpSlotPointers();

NGMP_OnlineServices_LobbyInterface* pLobbyInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_LobbyInterface>();
if (pLobbyInterface == nullptr)
{
// Ensure m_inGame is set to false even if we return early
m_inGame = false;
return;
}

setLocalIP(0);

m_ladderIP.clear();
m_ladderPort = 0;

enterGame(); // this is done on join in the GS impl, and must be called before setMap

// NGMP: Store map
setMap(pLobbyInterface->GetCurrentLobbyMapPath());

// init
//init();

// NGMP: Populate slots
UpdateSlotsFromCurrentLobby();
}
58 changes: 58 additions & 0 deletions tmp/test_ngmp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "GameNetwork/GeneralsOnline/NGMPGame.h"
#include "GameLogic/VictoryConditions.h"
#include "Common/PlayerList.h"
#include "GameLogic/GameLogic.h"
#include "GameNetwork/FileTransfer.h"
#include "GameClient/MapUtil.h"
#include "GameClient/GameText.h"
#include "GameNetwork/GameSpyOverlay.h"
#include "Common/RandomValue.h"
#include "GameNetwork/GeneralsOnline/NGMP_interfaces.h"
#include "GameNetwork/NetworkInterface.h"
#include "Common/GlobalData.h"
#include "GameClient/View.h"

NGMPGameSlot::NGMPGameSlot()
{
GameSlot();
m_profileID = 0;
m_wins = 0;
m_losses = 0;
m_rankPoints = 0;
m_favoriteSide = 0;
m_pingInt = 0;
m_profileID = 0;
m_pingStr.clear();
}

// NGMPGame ----------------------------------------

NGMPGame::NGMPGame()
{
// Initialize slot pointers first to ensure they're valid
cleanUpSlotPointers();

NGMP_OnlineServices_LobbyInterface* pLobbyInterface = NGMP_OnlineServicesManager::GetInterface<NGMP_OnlineServices_LobbyInterface>();
if (pLobbyInterface == nullptr)
{
// Ensure m_inGame is set to false even if we return early
m_inGame = false;
return;
}

setLocalIP(0);

m_ladderIP.clear();
m_ladderPort = 0;

enterGame(); // this is done on join in the GS impl, and must be called before setMap

// NGMP: Store map
setMap(pLobbyInterface->GetCurrentLobbyMapPath());

// init
//init();

// NGMP: Populate slots
UpdateSlotsFromCurrentLobby();
}
Loading