Fixed Xbox 360 crash

This commit is contained in:
2026-08-07 04:10:27 -07:00
parent 01abe05b18
commit 7135da3f37
32 changed files with 610 additions and 214 deletions
@@ -14,6 +14,9 @@ CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
{
if (getNetworkPlayer(pQNetPlayer) != NULL)
return;
const char * pszDescription;
// 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound
@@ -160,6 +163,8 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa
{
playerChangedCallback[ i ] = NULL;
}
WinsockNetLayer::Initialize();
m_bLeavingGame = false;
m_bLeaveGameOnTick = false;
@@ -348,6 +353,9 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
IQNet::m_player[0].m_isHostPlayer = true;
IQNet::s_playerCount = 1;
if (getNetworkPlayer(&IQNet::m_player[0]) == NULL)
NotifyPlayerJoined(&IQNet::m_player[0]);
_HostGame( localUsersMask, publicSlots, privateSlots );
int port = WIN64_NET_DEFAULT_PORT;
@@ -388,6 +396,7 @@ int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int l
IQNet::m_player[0].m_isRemote = true;
IQNet::m_player[0].m_isHostPlayer = true;
wcsncpy(IQNet::m_player[0].m_gamertag, searchResult->data.hostName, 31);
IQNet::m_player[0].m_gamertag[31] = L'\0';
WinsockNetLayer::StopDiscovery();
@@ -754,7 +763,22 @@ vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPa
{
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();
for (size_t i = 0; i < friendsSessions[0].size(); i++)
filteredList->push_back(friendsSessions[0][i]);
{
FriendSessionInfo *src = friendsSessions[0][i];
FriendSessionInfo *copy = new FriendSessionInfo();
*copy = *src;
if (src->displayLabel != NULL)
{
copy->displayLabel = new wchar_t[(size_t)src->displayLabelLength + 1];
wcsncpy(copy->displayLabel, src->displayLabel, src->displayLabelLength);
copy->displayLabel[src->displayLabelLength] = L'\0';
}
else
{
copy->displayLabel = NULL;
}
filteredList->push_back(copy);
}
return filteredList;
}
@@ -802,9 +826,11 @@ void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
if( *it == pNetworkPlayer )
{
currentNetworkPlayers.erase(it);
return;
break;
}
}
pQNetPlayer->SetCustomDataValue(0);
}
INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer)