Remove AUTO_VAR macro and _toString function (#592)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "..\..\..\Minecraft.World\Socket.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
@@ -64,9 +64,8 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
{
|
||||
// Do we already have a primary player for this system?
|
||||
bool systemHasPrimaryPlayer = false;
|
||||
for(AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin()); it < m_machineQNetPrimaryPlayers.end(); ++it)
|
||||
{
|
||||
IQNetPlayer *pQNetPrimaryPlayer = *it;
|
||||
for (auto& pQNetPrimaryPlayer : m_machineQNetPrimaryPlayers)
|
||||
{
|
||||
if( pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer) )
|
||||
{
|
||||
systemHasPrimaryPlayer = true;
|
||||
@@ -78,7 +77,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
}
|
||||
}
|
||||
g_NetworkManager.PlayerJoining( networkPlayer );
|
||||
|
||||
|
||||
if( createFakeSocket == true && !m_bHostChanged )
|
||||
{
|
||||
g_NetworkManager.CreateSocket( networkPlayer, localPlayer );
|
||||
@@ -98,7 +97,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
// g_NetworkManager.UpdateAndSetGameSessionData();
|
||||
SystemFlagAddPlayer( networkPlayer );
|
||||
}
|
||||
|
||||
|
||||
for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(playerChangedCallback[idx] != NULL)
|
||||
@@ -162,7 +161,7 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa
|
||||
{
|
||||
playerChangedCallback[ i ] = NULL;
|
||||
}
|
||||
|
||||
|
||||
m_bLeavingGame = false;
|
||||
m_bLeaveGameOnTick = false;
|
||||
m_bHostChanged = false;
|
||||
@@ -318,8 +317,8 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
|
||||
m_pIQNet->EndGame();
|
||||
}
|
||||
|
||||
for (AUTO_VAR(it, currentNetworkPlayers.begin()); it != currentNetworkPlayers.end(); it++)
|
||||
delete* it;
|
||||
for (auto & it : currentNetworkPlayers)
|
||||
delete it;
|
||||
currentNetworkPlayers.clear();
|
||||
m_machineQNetPrimaryPlayers.clear();
|
||||
SystemFlagReset();
|
||||
@@ -473,7 +472,7 @@ void CPlatformNetworkManagerStub::UnRegisterPlayerChangedCallback(int iPad, void
|
||||
|
||||
void CPlatformNetworkManagerStub::HandleSignInChange()
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
@@ -500,24 +499,24 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
|
||||
{
|
||||
// DWORD playerCount = m_pIQNet->GetPlayerCount();
|
||||
//
|
||||
//
|
||||
// if( this->m_bLeavingGame )
|
||||
// return;
|
||||
//
|
||||
//
|
||||
// if( GetHostPlayer() == NULL )
|
||||
// return;
|
||||
//
|
||||
//
|
||||
// for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
// {
|
||||
// if( i < playerCount )
|
||||
// {
|
||||
// INetworkPlayer *pNetworkPlayer = GetPlayerByIndex(i);
|
||||
//
|
||||
//
|
||||
// // We can call this from NotifyPlayerLeaving but at that point the player is still considered in the session
|
||||
// if( pNetworkPlayer != pNetworkPlayerLeaving )
|
||||
// {
|
||||
// m_hostGameSessionData.players[i] = ((NetworkPlayerXbox *)pNetworkPlayer)->GetUID();
|
||||
//
|
||||
//
|
||||
// char *temp;
|
||||
// temp = (char *)wstringtofilename( pNetworkPlayer->GetOnlineName() );
|
||||
// memcpy(m_hostGameSessionData.szPlayers[i],temp,XUSER_NAME_SIZE);
|
||||
@@ -534,7 +533,7 @@ void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pN
|
||||
// memset(m_hostGameSessionData.szPlayers[i],0,XUSER_NAME_SIZE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// m_hostGameSessionData.hostPlayerUID = ((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetXuid();
|
||||
// m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
}
|
||||
@@ -823,7 +822,7 @@ void CPlatformNetworkManagerStub::GetFullFriendSessionInfo( FriendSessionInfo *f
|
||||
void CPlatformNetworkManagerStub::ForceFriendsSessionRefresh()
|
||||
{
|
||||
app.DebugPrintf("Resetting friends session search data\n");
|
||||
|
||||
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
m_searchResultsCount[i] = 0;
|
||||
@@ -844,8 +843,8 @@ INetworkPlayer *CPlatformNetworkManagerStub::addNetworkPlayer(IQNetPlayer *pQNet
|
||||
void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
|
||||
for( AUTO_VAR(it, currentNetworkPlayers.begin()); it != currentNetworkPlayers.end(); it++ )
|
||||
{
|
||||
for (auto it = currentNetworkPlayers.begin(); it != currentNetworkPlayers.end(); it++)
|
||||
{
|
||||
if( *it == pNetworkPlayer )
|
||||
{
|
||||
currentNetworkPlayers.erase(it);
|
||||
@@ -862,7 +861,7 @@ INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNet
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetLocalPlayerByUserIndex(int userIndex )
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
|
||||
return getNetworkPlayer(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetPlayerByIndex(int playerIndex)
|
||||
|
||||
Reference in New Issue
Block a user