Xbox 360 fixes (again...) (#29)
Merging main repo undid a lot of my changes so this PR reimplements them. Fixes build and playthrough. Has been tested.Reviewed-on: #29 Co-authored-by: qloak <realminecart@gmail.com>
This commit was merged in pull request #29.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user