fix PS4 networking support (#20)

gonna mark this a WIP till i test more with large worlds and achievements issues i dont wanna break the PS3 and other builds by enabling it freely,

ideally i can get it to work without it

also i wanna remove the GetLocalIPv4Interfaces auto discovery feature i just did that cause i had so many local networks it got confusing, will remove on Final PR editReviewed-on: #20

Co-authored-by: NaN <nan@str1k3r.xyz>
This commit was merged in pull request #20.
This commit is contained in:
NaN
2026-08-04 22:49:46 +00:00
committed by pieeebot
parent 2840b7620b
commit 4b0520c938
8 changed files with 115 additions and 39 deletions
@@ -14,6 +14,7 @@
#include "..\..\TexturePackRepository.h"
#include "..\..\TexturePack.h"
#include "..\Network\SessionInfo.h"
#include "..\..\Common\Network\NetworkSocketLayer.h"
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
#include "Common\Network\Sony\SonyHttp.h"
#include "Common\Network\Sony\SonyRemoteStorage.h"
@@ -1385,20 +1386,24 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
if( m_buttonListGames.getItemCount() > 0 && gameIndex < m_currentSessions->size() )
{
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
const bool bManualJoin = (g_MultiplayerJoin == true);
// 4J-PB - is the player allowed to join games?
bool noUGC=false;
bool bContentRestricted=false;
// we're online, since we are joining a game
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,NULL);
// A direct LAN join should probnot use PSN matchmaking or account privileges (nansess)
if(!bManualJoin)
{
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,NULL);
}
#ifdef __ORBIS__
// 4J Stu - On PS4 we don't restrict playing multiplayer based on chat restriction, so remove this check
noUGC = false;
bool bPlayStationPlus=true;
int iPadWithNoPlaystationPlus=0;
bool isSignedInLive = true;
int iPadWithNoPlaystationPlus=-1;
bool isSignedInLive = true;
int iPadNotSignedInLive = -1;
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
{
@@ -1414,6 +1419,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
if(ProfileManager.HasPlayStationPlus(i)==false)
{
bPlayStationPlus=false;
iPadWithNoPlaystationPlus = (int)i;
break;
}
}
@@ -1427,7 +1433,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
}
#endif
if(noUGC)
if(!bManualJoin && noUGC)
{
// not allowed to join
#ifndef __PSVITA__
@@ -1443,7 +1449,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
m_bIgnoreInput=false;
return;
}
else if(bContentRestricted)
else if(!bManualJoin && bContentRestricted)
{
ui.RequestContentRestrictedMessageBox();
@@ -1452,7 +1458,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
}
#ifdef __ORBIS__
// If this is an online game but not all players are signed in to Live, stop!
else if (!isSignedInLive)
else if (!bManualJoin && !isSignedInLive)
{
UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK;
@@ -1471,7 +1477,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
}
return;
}
else if(bPlayStationPlus==false)
else if(!bManualJoin && bPlayStationPlus==false)
{
if(ProfileManager.RequestingPlaystationPlus(iPadWithNoPlaystationPlus))
@@ -1480,6 +1486,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
m_bIgnoreInput=false;
return;
}