Fixed Xbox 360 AGAIN.

This commit is contained in:
2026-08-08 02:43:05 -07:00
parent bc871dd39b
commit 53c32884b3
6 changed files with 368 additions and 135 deletions
@@ -12,6 +12,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
@@ -164,6 +167,8 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa
playerChangedCallback[ i ] = NULL;
}
NetworkSocketLayer::Initialize();
m_bLeavingGame = false;
m_bLeaveGameOnTick = false;
m_bHostChanged = false;
@@ -373,6 +378,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 = NETWORK_LAN_DEFAULT_PORT;
@@ -413,6 +421,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';
NetworkSocketLayer::StopDiscovery();
@@ -435,8 +444,6 @@ int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int l
NotifyPlayerJoined(&IQNet::m_player[0]);
NotifyPlayerJoined(&IQNet::m_player[localSmallId]);
m_pGameNetworkManager->StateChange_AnyToStarting();
return CGameNetworkManager::JOINGAME_SUCCESS;
}
@@ -495,6 +502,18 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame()
return true;
}
void CPlatformNetworkManagerStub::SetGamePlayState()
{
extern QNET_STATE _iQNetStubState;
_iQNetStubState = QNET_STATE_GAME_PLAY;
if (m_pIQNet->IsHost())
{
NetworkSocketLayer::UpdateAdvertiseJoinable(true);
}
}
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
{
if (this->m_bLeavingGame)
@@ -801,7 +820,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;
}
@@ -861,9 +895,11 @@ void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
if( *it == pNetworkPlayer )
{
currentNetworkPlayers.erase(it);
return;
break;
}
}
pQNetPlayer->SetCustomDataValue(0);
}
INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer)