diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index d4fa38c5..8e03fa34 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -159,6 +159,8 @@ void ClientConnection::handleLogin(shared_ptr packet) { if (done) return; + app.DebugPrintf("Offline LAN: received Login\n"); + PlayerUID OnlineXuid; ProfileManager.GetXUID(m_userIndex,&OnlineXuid,true); // online xuid MOJANG_DATA *pMojangData = NULL; @@ -1769,6 +1771,7 @@ void ClientConnection::handleEntityActionAtPosition(shared_ptr packet) { + app.DebugPrintf("Offline LAN: received PreLogin\n"); // printf("Client: handlePreLogin\n"); #if 1 // 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set @@ -1791,6 +1794,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } #ifdef _XBOX +#if !defined(_DISABLE_XBLIVE) if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends)) { if(m_userIndex == ProfileManager.GetPrimaryPad() ) @@ -1934,6 +1938,16 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } } } +#else + // Offline/system-link games have no Xbox Live friend list, so grant all + // pre-login permissions (the Xbox Live-only checks above would otherwise + // fail and reject the client's own pre-login before Login is ever sent). + canPlay = TRUE; + canPlayLocal = TRUE; + isAtLeastOneFriend = TRUE; + isFriendsWithHost = TRUE; + cantPlayContentRestricted = FALSE; +#endif // _DISABLE_XBLIVE #else // TODO - handle this kind of things for non-360 platforms canPlay = TRUE; @@ -2211,6 +2225,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) // All other players we use their offline XUID so that they can play the game offline ProfileManager.GetXUID(m_userIndex,&offlineXUID,false); } + app.DebugPrintf("Offline LAN: sending Login\n"); BOOL allAllowed, friendsAllowed; ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed); send( shared_ptr( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE), diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index e92ea362..3fbb6962 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -398,6 +398,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame return false; } + app.DebugPrintf("Offline LAN: sending PreLogin\n"); connection->send( shared_ptr( new PreLoginPacket(minecraft->user->name) ) ); // Tick connection until we're ready to go. The stages involved in this are: diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index 8767120e..7a08ce33 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -170,6 +170,8 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa m_bLeaveGameOnTick = false; m_bHostChanged = false; + app.DebugPrintf("Using offline LAN network backend\n"); + m_bSearchResultsReady = false; m_bSearchPending = false; @@ -475,6 +477,20 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame() return true; } +void CPlatformNetworkManagerStub::SetGamePlayState() +{ + extern QNET_STATE _iQNetStubState; + + _iQNetStubState = QNET_STATE_GAME_PLAY; + + if (m_pIQNet->IsHost()) + { + WinsockNetLayer::UpdateAdvertiseJoinable(true); + } + + app.DebugPrintf("Offline LAN: entered GAME_PLAY state\n"); +} + void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/) { // DWORD playerCount = m_pIQNet->GetPlayerCount(); diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h index 1cfce001..23215b7d 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h @@ -52,6 +52,8 @@ public: virtual void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); virtual void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); + virtual void SetGamePlayState(); + virtual void HandleSignInChange(); virtual bool _RunNetworkGame(); diff --git a/Minecraft.Client/Common/Postbuilds/PS3-postbuild.ps1 b/Minecraft.Client/Common/Postbuilds/PS3-postbuild.ps1 index 277115d0..839c86be 100644 --- a/Minecraft.Client/Common/Postbuilds/PS3-postbuild.ps1 +++ b/Minecraft.Client/Common/Postbuilds/PS3-postbuild.ps1 @@ -24,7 +24,7 @@ $folderCopies = @( @{ Source = "Common\res"; Dest = "PS3_GAME\USRDIR\Common\res" }, @{ Source = "PS3Media\DLC"; Dest = "PS3_GAME\USRDIR\DLC" }, @{ Source = "PS3\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" }, - @{ Source = "PSVita\Tutorial"; Dest = "PS3_GAME\USRDIR\PS3\Tutorial" } + @{ Source = "PS3_GAME\USRDIR\PS3\Tutorial"; Dest = "PS3_GAME\USRDIR\PS3\Tutorial" } @{ Source = "Common\Postbuilds\Contents\PS3\PS3_GAME\LICDIR"; Dest = "PS3_GAME\LICDIR" }, @{ Source = "Common\Postbuilds\Contents\PS3\PS3_GAME\TROPDIR"; Dest = "PS3_GAME\TROPDIR" } )