forked from pieeebot/cafeberry
Offline LAN crossplay fixes and correct PS3 tutorial pack source
- Handle pre-login permission checks in offline/system-link mode when Xbox Live is disabled (grant canPlay/canPlayLocal/friends permissions) - Log Offline LAN handshake events (PreLogin/Login/GAME_PLAY state) - Stub: set QNET_STATE_GAME_PLAY on SetGamePlayState and advertise the session joinable when hosting - PS3 postbuild: source the PS3 tutorial pack from the PS3 tree instead of the PSVita tree so the big-endian PS3 DLC parser doesn't read a little-endian pack as garbage (fixes RPCS3 boot crash in DLCManager::processDLCDataFile)
This commit is contained in:
@@ -159,6 +159,8 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> 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<EntityActionAtPos
|
||||
|
||||
void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
||||
|
||||
@@ -398,6 +398,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
return false;
|
||||
}
|
||||
|
||||
app.DebugPrintf("Offline LAN: sending PreLogin\n");
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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" }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user