mirror of
https://github.com/Minecraft-Community-Edition/client.git
synced 2026-05-27 03:24:32 +00:00
Whisper Yelled At me 😢
This commit is contained in:
@@ -40,10 +40,6 @@
|
||||
#include "..\Minecraft.World\DurangoStats.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include "..\..\Windows64\Network\P2PConnectionManagerWin.h"
|
||||
#endif
|
||||
|
||||
// Global instance
|
||||
CGameNetworkManager g_NetworkManager;
|
||||
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
|
||||
@@ -62,10 +58,6 @@ CGameNetworkManager::CGameNetworkManager()
|
||||
m_pUpsell = NULL;
|
||||
m_pInviteInfo = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
m_p2pManager = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CGameNetworkManager::Initialise()
|
||||
@@ -91,9 +83,6 @@ void CGameNetworkManager::Terminate()
|
||||
{
|
||||
if( m_bInitialised )
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
TeardownP2PMesh();
|
||||
#endif
|
||||
s_pPlatformNetworkManager->Terminate();
|
||||
}
|
||||
}
|
||||
@@ -129,10 +118,6 @@ void CGameNetworkManager::DoWork()
|
||||
#endif
|
||||
s_pPlatformNetworkManager->DoWork();
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
TickP2P();
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
if (m_pUpsell != NULL && m_pUpsell->hasResponse())
|
||||
{
|
||||
@@ -181,16 +166,14 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Client needs QNET_STATE_GAME_PLAY so that IsInGameplay() returns true
|
||||
s_pPlatformNetworkManager->SetGamePlayState();
|
||||
}
|
||||
|
||||
if( g_NetworkManager.IsLeavingGame() ) return false;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (!g_NetworkManager.IsLocalGame())
|
||||
{
|
||||
g_NetworkManager.EstablishP2PMesh();
|
||||
}
|
||||
#endif
|
||||
|
||||
app.SetGameStarted(true);
|
||||
|
||||
// 4J-PB - if this is the trial game, start the trial timer
|
||||
@@ -1283,15 +1266,7 @@ bool CGameNetworkManager::SystemFlagGet(INetworkPlayer *pNetworkPlayer, int inde
|
||||
|
||||
wstring CGameNetworkManager::GatherStats()
|
||||
{
|
||||
wstring stats = s_pPlatformNetworkManager->GatherStats();
|
||||
#ifdef _WINDOWS64
|
||||
if (m_p2pManager != NULL)
|
||||
{
|
||||
stats += L"\n";
|
||||
stats += GatherP2PStats();
|
||||
}
|
||||
#endif
|
||||
return stats;
|
||||
return s_pPlatformNetworkManager->GatherStats();
|
||||
}
|
||||
|
||||
void CGameNetworkManager::renderQueueMeter()
|
||||
@@ -1421,7 +1396,10 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
Socket *socket = NULL;
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = nullptr;
|
||||
int userIdx = pNetworkPlayer->GetUserIndex();
|
||||
if (userIdx >= 0 && userIdx < XUSER_MAX_COUNT)
|
||||
mpPlayer = pMinecraft->localplayers[userIdx];
|
||||
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
|
||||
{
|
||||
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change
|
||||
@@ -1518,7 +1496,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
||||
else
|
||||
{
|
||||
if( !pNetworkPlayer->IsHost() )
|
||||
{
|
||||
{
|
||||
for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(Minecraft::GetInstance()->localplayers[idx] != NULL)
|
||||
@@ -1529,29 +1507,10 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (m_p2pManager != NULL && !pNetworkPlayer->IsLocal())
|
||||
{
|
||||
INetworkPlayer* localPlayer = GetLocalPlayerByUserIndex(0);
|
||||
if (localPlayer != NULL)
|
||||
{
|
||||
m_p2pManager->EstablishDirectConnection(localPlayer, pNetworkPlayer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CGameNetworkManager::PlayerLeaving( INetworkPlayer *pNetworkPlayer )
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
// Disconnect P2P with the leaving player
|
||||
if (m_p2pManager != NULL && !pNetworkPlayer->IsLocal())
|
||||
{
|
||||
m_p2pManager->DisconnectPeer(pNetworkPlayer);
|
||||
}
|
||||
#endif
|
||||
|
||||
if( pNetworkPlayer->IsLocal() )
|
||||
{
|
||||
ProfileManager.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),CONTEXT_PRESENCE_IDLE,false);
|
||||
@@ -2047,101 +2006,3 @@ void CGameNetworkManager::startAdhocMatching()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
|
||||
///////////////////////////////////// P2P Networking /////////////////////////////////////
|
||||
|
||||
void CGameNetworkManager::InitializeP2PConnections()
|
||||
{
|
||||
if (m_p2pManager != NULL)
|
||||
return; // Already initialized
|
||||
|
||||
CP2PConnectionManagerWin* winP2P = new CP2PConnectionManagerWin();
|
||||
if (winP2P->Initialize())
|
||||
{
|
||||
m_p2pManager = winP2P;
|
||||
|
||||
// Wire up the P2P manager to the socket layer and packet router
|
||||
Socket::SetP2PManager(m_p2pManager);
|
||||
g_PacketRouter.Initialize(m_p2pManager);
|
||||
|
||||
app.DebugPrintf("P2P: Network manager initialized\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
delete winP2P;
|
||||
app.DebugPrintf("P2P: Failed to initialize network manager\n");
|
||||
}
|
||||
}
|
||||
|
||||
void CGameNetworkManager::EstablishP2PMesh()
|
||||
{
|
||||
if (m_p2pManager == NULL)
|
||||
InitializeP2PConnections();
|
||||
|
||||
if (m_p2pManager == NULL)
|
||||
return;
|
||||
|
||||
// Discover our public endpoint
|
||||
m_p2pManager->DiscoverPublicEndpoint();
|
||||
|
||||
INetworkPlayer* localPlayer = GetLocalPlayerByUserIndex(0);
|
||||
if (localPlayer == NULL)
|
||||
return;
|
||||
|
||||
int playerCount = GetPlayerCount();
|
||||
for (int i = 0; i < playerCount; i++)
|
||||
{
|
||||
INetworkPlayer* player = GetPlayerByIndex(i);
|
||||
if (player != NULL && !player->IsLocal() && player != localPlayer)
|
||||
{
|
||||
m_p2pManager->EstablishDirectConnection(localPlayer, player);
|
||||
}
|
||||
}
|
||||
|
||||
app.DebugPrintf("P2P: Mesh establishment initiated for %d players\n", playerCount);
|
||||
}
|
||||
|
||||
void CGameNetworkManager::TeardownP2PMesh()
|
||||
{
|
||||
if (m_p2pManager == NULL)
|
||||
return;
|
||||
|
||||
// Disconnect the P2P manager from socket layer and packet router
|
||||
Socket::SetP2PManager(NULL);
|
||||
g_PacketRouter.Shutdown();
|
||||
|
||||
// Shutdown and delete
|
||||
m_p2pManager->Shutdown();
|
||||
delete m_p2pManager;
|
||||
m_p2pManager = NULL;
|
||||
|
||||
app.DebugPrintf("P2P: Mesh torn down\n");
|
||||
}
|
||||
|
||||
void CGameNetworkManager::TickP2P()
|
||||
{
|
||||
if (m_p2pManager != NULL)
|
||||
{
|
||||
m_p2pManager->Tick();
|
||||
}
|
||||
}
|
||||
|
||||
EP2PConnectionState CGameNetworkManager::GetP2PConnectionState(INetworkPlayer* player)
|
||||
{
|
||||
if (m_p2pManager == NULL || player == NULL)
|
||||
return P2P_STATE_DISCONNECTED;
|
||||
|
||||
return m_p2pManager->GetConnectionState(player);
|
||||
}
|
||||
|
||||
wstring CGameNetworkManager::GatherP2PStats()
|
||||
{
|
||||
if (m_p2pManager == NULL)
|
||||
return L"P2P: Not active\n";
|
||||
|
||||
return m_p2pManager->GetDebugStats();
|
||||
}
|
||||
|
||||
#endif // _WINDOWS64
|
||||
|
||||
@@ -15,11 +15,6 @@ using namespace std;
|
||||
#endif
|
||||
#include "SessionInfo.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include "P2PConnectionManager.h"
|
||||
#include "PacketRouter.h"
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#include "..\..\Orbis\Network\PsPlusUpsellWrapper_Orbis.h"
|
||||
#endif
|
||||
@@ -164,17 +159,6 @@ public:
|
||||
void renderQueueMeter();
|
||||
wstring GatherRTTStats();
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
void InitializeP2PConnections();
|
||||
void EstablishP2PMesh();
|
||||
void TeardownP2PMesh();
|
||||
void TickP2P();
|
||||
IP2PConnectionManager* GetP2PManager() { return m_p2pManager; }
|
||||
EP2PConnectionState GetP2PConnectionState(INetworkPlayer* player);
|
||||
bool IsP2PActive() { return m_p2pManager != NULL; }
|
||||
wstring GatherP2PStats();
|
||||
#endif
|
||||
|
||||
// GUI debug output
|
||||
|
||||
// Used for debugging output
|
||||
@@ -228,10 +212,6 @@ private:
|
||||
int GetJoiningReadyPercentage();
|
||||
bool m_bLastDisconnectWasLostRoomOnly;
|
||||
bool m_bFullSessionMessageOnNextSessionChange;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
IP2PConnectionManager* m_p2pManager;
|
||||
#endif
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
bool m_bSignedOutofPSN;
|
||||
#endif
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "PacketRouter.h"
|
||||
|
||||
PacketRouter g_PacketRouter;
|
||||
|
||||
PacketRouter::PacketRouter()
|
||||
{
|
||||
m_p2pManager = NULL;
|
||||
m_p2pEnabled = false;
|
||||
m_p2pRoutedCount = 0;
|
||||
m_hostRoutedCount = 0;
|
||||
}
|
||||
|
||||
void PacketRouter::Initialize(IP2PConnectionManager* p2pManager)
|
||||
{
|
||||
m_p2pManager = p2pManager;
|
||||
m_p2pEnabled = (p2pManager != NULL);
|
||||
}
|
||||
|
||||
void PacketRouter::Shutdown()
|
||||
{
|
||||
m_p2pManager = NULL;
|
||||
m_p2pEnabled = false;
|
||||
ResetStats();
|
||||
}
|
||||
|
||||
ERouteDecision PacketRouter::GetRouteDecision(shared_ptr<Packet> packet, INetworkPlayer* targetPlayer)
|
||||
{
|
||||
// If P2P is disabled or no manager, always use host
|
||||
if (!m_p2pEnabled || m_p2pManager == NULL || targetPlayer == NULL)
|
||||
return ROUTE_VIA_HOST;
|
||||
|
||||
// Local players don't need P2P
|
||||
if (targetPlayer->IsLocal())
|
||||
return ROUTE_VIA_HOST;
|
||||
|
||||
int packetId = packet->getId();
|
||||
EPacketRoutingMode routingMode = Packet::GetRoutingMode(packetId);
|
||||
|
||||
switch (routingMode)
|
||||
{
|
||||
case ROUTING_HOST_ONLY:
|
||||
return ROUTE_VIA_HOST;
|
||||
|
||||
case ROUTING_PREFER_DIRECT:
|
||||
// Use P2P if we have a direct connection to this player
|
||||
if (m_p2pManager->IsDirectConnectionAvailable(targetPlayer))
|
||||
return ROUTE_VIA_P2P;
|
||||
return ROUTE_VIA_HOST;
|
||||
|
||||
case ROUTING_DIRECT_ONLY:
|
||||
if (m_p2pManager->IsDirectConnectionAvailable(targetPlayer))
|
||||
return ROUTE_VIA_P2P;
|
||||
return ROUTE_VIA_HOST; // Fallback to host if no direct link
|
||||
|
||||
case ROUTING_BROADCAST:
|
||||
return ROUTE_VIA_HOST; // Broadcasts always go through host
|
||||
|
||||
default:
|
||||
return ROUTE_VIA_HOST;
|
||||
}
|
||||
}
|
||||
|
||||
bool PacketRouter::RoutePacket(shared_ptr<Packet> packet, INetworkPlayer* targetPlayer,
|
||||
const void* serializedData, int dataSize)
|
||||
{
|
||||
ERouteDecision decision = GetRouteDecision(packet, targetPlayer);
|
||||
|
||||
if (decision == ROUTE_VIA_P2P && m_p2pManager != NULL)
|
||||
{
|
||||
EP2PChannel channel = GetChannelForPacket(packet->getId());
|
||||
m_p2pManager->SendDirect(targetPlayer, serializedData, dataSize, channel);
|
||||
m_p2pRoutedCount++;
|
||||
return true;
|
||||
}
|
||||
|
||||
m_hostRoutedCount++;
|
||||
return false; // Caller should use existing host path
|
||||
}
|
||||
|
||||
EP2PChannel PacketRouter::GetChannelForPacket(int packetId)
|
||||
{
|
||||
// Movement packets
|
||||
if ((packetId >= 10 && packetId <= 13) || // MovePlayerPacket variants
|
||||
(packetId >= 30 && packetId <= 34) || // MoveEntityPacket variants
|
||||
(packetId >= 162 && packetId <= 165)) // MoveEntityPacketSmall variants
|
||||
{
|
||||
return P2P_CHANNEL_MOVEMENT;
|
||||
}
|
||||
|
||||
// Animation packets
|
||||
if (packetId == 18 || packetId == 35) // AnimatePacket, RotateHeadPacket
|
||||
{
|
||||
return P2P_CHANNEL_ANIMATION;
|
||||
}
|
||||
|
||||
// Effects/sounds
|
||||
if (packetId == 62) // LevelSoundPacket
|
||||
{
|
||||
return P2P_CHANNEL_EFFECTS;
|
||||
}
|
||||
|
||||
// Default
|
||||
return P2P_CHANNEL_MOVEMENT;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#pragma once
|
||||
#include "..\..\..\Minecraft.World\Packet.h"
|
||||
#include "P2PConnectionManager.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
|
||||
// Packet routing decision
|
||||
enum ERouteDecision
|
||||
{
|
||||
ROUTE_VIA_HOST = 0, // Send through host TCP (existing path)
|
||||
ROUTE_VIA_P2P, // Send directly via P2P UDP
|
||||
ROUTE_VIA_BOTH // Send via both paths (redundancy for critical packets)
|
||||
};
|
||||
|
||||
class PacketRouter
|
||||
{
|
||||
public:
|
||||
PacketRouter();
|
||||
|
||||
// Initialize with P2P manager reference
|
||||
void Initialize(IP2PConnectionManager* p2pManager);
|
||||
void Shutdown();
|
||||
|
||||
// Determine how to route a packet to a specific player
|
||||
ERouteDecision GetRouteDecision(shared_ptr<Packet> packet, INetworkPlayer* targetPlayer);
|
||||
|
||||
// Route a serialized packet - returns true if sent via P2P
|
||||
bool RoutePacket(shared_ptr<Packet> packet, INetworkPlayer* targetPlayer,
|
||||
const void* serializedData, int dataSize);
|
||||
|
||||
// Enable/disable P2P routing (global toggle)
|
||||
void SetP2PEnabled(bool enabled) { m_p2pEnabled = enabled; }
|
||||
bool IsP2PEnabled() const { return m_p2pEnabled; }
|
||||
|
||||
// Map packet IDs to P2P channels
|
||||
static EP2PChannel GetChannelForPacket(int packetId);
|
||||
|
||||
// Stats
|
||||
int GetP2PRoutedCount() const { return m_p2pRoutedCount; }
|
||||
int GetHostRoutedCount() const { return m_hostRoutedCount; }
|
||||
void ResetStats() { m_p2pRoutedCount = 0; m_hostRoutedCount = 0; }
|
||||
|
||||
private:
|
||||
IP2PConnectionManager* m_p2pManager;
|
||||
bool m_p2pEnabled;
|
||||
int m_p2pRoutedCount;
|
||||
int m_hostRoutedCount;
|
||||
};
|
||||
|
||||
extern PacketRouter g_PacketRouter;
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
virtual void HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0) = 0;
|
||||
virtual int JoinGame(FriendSessionInfo *searchResult, int dwLocalUsersMask, int dwPrimaryUserIndex ) = 0;
|
||||
virtual void CancelJoinGame() {};
|
||||
virtual void SetGamePlayState() {};
|
||||
virtual bool SetLocalGame(bool isLocal) = 0;
|
||||
virtual bool IsLocalGame() = 0;
|
||||
virtual void SetPrivateGame(bool isPrivate) = 0;
|
||||
|
||||
@@ -480,6 +480,14 @@ void CPlatformNetworkManagerStub::HandleSignInChange()
|
||||
return;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetGamePlayState()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual bool _RunNetworkGame();
|
||||
virtual void SetGamePlayState();
|
||||
|
||||
private:
|
||||
bool isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer);
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
#include "UI.h"
|
||||
#include "UIScene_LoadOrJoinMenu.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include "..\Network\P2PConnectionManager.h"
|
||||
#include "..\Network\GameNetworkManager.h"
|
||||
#endif
|
||||
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
|
||||
@@ -288,13 +283,8 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu()
|
||||
g_NetworkManager.SetSessionsUpdatedCallback( NULL, NULL );
|
||||
app.SetLiveLinkRequired( false );
|
||||
|
||||
if(m_currentSessions)
|
||||
{
|
||||
for(AUTO_VAR(it, m_currentSessions->begin()); it < m_currentSessions->end(); ++it)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
}
|
||||
delete m_currentSessions;
|
||||
m_currentSessions = NULL;
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
// Reset the background downloading, in case we changed it by attempting to download a texture pack
|
||||
@@ -1739,24 +1729,6 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (g_NetworkManager.IsP2PActive() && g_NetworkManager.IsInGameplay())
|
||||
{
|
||||
int directPeers = g_NetworkManager.GetP2PManager()->GetDirectPeerCount();
|
||||
int totalOnline = g_NetworkManager.GetOnlinePlayerCount();
|
||||
if (directPeers > 0 && totalOnline > 1)
|
||||
{
|
||||
wchar_t labelWithP2P[256];
|
||||
swprintf_s(labelWithP2P, 256, L"%s [P2P:%d/%d]", sessionInfo->displayLabel, directPeers, totalOnline - 1);
|
||||
m_buttonListGames.addItem(labelWithP2P, textureName);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_buttonListGames.addItem(sessionInfo->displayLabel, textureName);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
m_buttonListGames.addItem( sessionInfo->displayLabel, textureName );
|
||||
|
||||
if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0)
|
||||
|
||||
@@ -105,7 +105,6 @@ private:
|
||||
bool m_bSaveTransferCancelled;
|
||||
#endif
|
||||
bool m_bUpdateSaveSize;
|
||||
wstring m_directConnectAddress;
|
||||
|
||||
public:
|
||||
UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
@@ -154,7 +153,6 @@ public:
|
||||
static int DeleteSaveDataReturned(LPVOID lpParam,bool bRes);
|
||||
static int RenameSaveDataReturned(LPVOID lpParam,bool bRes);
|
||||
static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes);
|
||||
static int KeyboardCompleteDirectConnectCallback(LPVOID lpParam,bool bRes);
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
void LoadLevelGen(LevelGenerationOptions *levelGen);
|
||||
|
||||
@@ -21562,7 +21562,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClCompile Include="Common\Network\GameNetworkManager.cpp" />
|
||||
<ClCompile Include="Common\Network\NATTraversal.cpp" />
|
||||
<ClCompile Include="Common\Network\LANSessionManager.cpp" />
|
||||
<ClCompile Include="Common\Network\PacketRouter.cpp" />
|
||||
<ClCompile Include="Common\Network\STUNClient.cpp" />
|
||||
<ClCompile Include="ConnectScreen.cpp" />
|
||||
<ClCompile Include="KeyboardMouseInput.cpp" />
|
||||
|
||||
BIN
Minecraft.Client/Windows64/GameHDD/20260304091252/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304091252/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304093601/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304093601/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304095754/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304095754/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304100244/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304100244/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304101040/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304101040/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304103510/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304103510/saveData.ms
Normal file
Binary file not shown.
BIN
Minecraft.Client/Windows64/GameHDD/20260304103542/saveData.ms
Normal file
BIN
Minecraft.Client/Windows64/GameHDD/20260304103542/saveData.ms
Normal file
Binary file not shown.
@@ -161,12 +161,17 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
||||
|
||||
success = s_pPlatformNetworkManager->_RunNetworkGame();
|
||||
if(!success)
|
||||
{
|
||||
{
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(),eAppAction_ExitWorld,(void *)TRUE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Client needs QNET_STATE_GAME_PLAY so that IsInGameplay() returns true
|
||||
s_pPlatformNetworkManager->SetGamePlayState();
|
||||
}
|
||||
|
||||
if( g_NetworkManager.IsLeavingGame() ) return false;
|
||||
|
||||
app.SetGameStarted(true);
|
||||
@@ -1391,7 +1396,10 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
Socket *socket = NULL;
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = nullptr;
|
||||
int userIdx = pNetworkPlayer->GetUserIndex();
|
||||
if (userIdx >= 0 && userIdx < XUSER_MAX_COUNT)
|
||||
mpPlayer = pMinecraft->localplayers[userIdx];
|
||||
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
|
||||
{
|
||||
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
virtual void HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0) = 0;
|
||||
virtual int JoinGame(FriendSessionInfo *searchResult, int dwLocalUsersMask, int dwPrimaryUserIndex ) = 0;
|
||||
virtual void CancelJoinGame() {};
|
||||
virtual void SetGamePlayState() {};
|
||||
virtual bool SetLocalGame(bool isLocal) = 0;
|
||||
virtual bool IsLocalGame() = 0;
|
||||
virtual void SetPrivateGame(bool isPrivate) = 0;
|
||||
|
||||
@@ -313,6 +313,12 @@ void CPlatformNetworkManagerStub::HandleSignInChange()
|
||||
return;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetGamePlayState()
|
||||
{
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual bool _RunNetworkGame();
|
||||
virtual void SetGamePlayState();
|
||||
|
||||
private:
|
||||
bool isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer);
|
||||
|
||||
@@ -1353,7 +1353,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0,"Network manager do work #1");
|
||||
// g_NetworkManager.DoWork();
|
||||
g_NetworkManager.DoWork();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
// LeaderboardManager::Instance()->Tick();
|
||||
|
||||
Reference in New Issue
Block a user