forked from cafeberry/cafeberry
added 360 support and fixed vita again again
This commit is contained in:
1 parent
92891de261
commit
1005e64629
17 files changed
+591
-208
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
// Wrappers around the 4J profile library's Xbox Live entitlement queries.
|
||||
// Include this after stdafx.h; it needs ProfileManager to be declared.
|
||||
|
||||
inline bool Live_MultiplayerAllowed(int iPad)
|
||||
{
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
return true;
|
||||
#else
|
||||
return ProfileManager.IsSignedInLive(iPad) && ProfileManager.AllowedToPlayMultiplayer(iPad);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool Live_AllowedToPlayMultiplayer(int iPad)
|
||||
{
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
return true;
|
||||
#else
|
||||
return ProfileManager.AllowedToPlayMultiplayer(iPad);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void Live_AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed)
|
||||
{
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
if(allAllowed != NULL) *allAllowed = TRUE;
|
||||
if(friendsAllowed != NULL) *friendsAllowed = TRUE;
|
||||
#else
|
||||
ProfileManager.AllowedPlayerCreatedContent(iPad, thisQuadrantOnly, allAllowed, friendsAllowed);
|
||||
#endif
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "..\..\..\Minecraft.World\AABB.h"
|
||||
#include "..\..\..\Minecraft.World\Vec3.h"
|
||||
@@ -794,7 +795,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
if(ProfileManager.IsSignedIn(index) )
|
||||
{
|
||||
++joiningUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
@@ -1743,7 +1744,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
if(index==userIndex || pMinecraft->localplayers[index]!=NULL )
|
||||
{
|
||||
++joiningUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
@@ -1757,7 +1758,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
#if defined(__PS3__) || defined(__PSVITA__)
|
||||
ProfileManager.GetChatAndContentRestrictions(userIndex,false,&noUGC,&bContentRestricted,NULL);
|
||||
#else
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
#endif
|
||||
|
||||
@@ -1898,7 +1899,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
if(!app.IsLocalMultiplayerAvailable())
|
||||
#endif
|
||||
{
|
||||
bool noPrivileges=!ProfileManager.AllowedToPlayMultiplayer(userIndex);
|
||||
bool noPrivileges=!Live_AllowedToPlayMultiplayer(userIndex);
|
||||
|
||||
if(noPrivileges)
|
||||
{
|
||||
|
||||
@@ -88,6 +88,25 @@ bool NetworkSocketLayer::Initialize()
|
||||
}
|
||||
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
#if defined _XBOX
|
||||
// XNet has to be up before Winsock, and it has to be up insecure.
|
||||
static bool s_xnetStarted = false;
|
||||
if (!s_xnetStarted)
|
||||
{
|
||||
XNetStartupParams xnsp;
|
||||
memset(&xnsp, 0, sizeof(xnsp));
|
||||
xnsp.cfgSizeOfStruct = sizeof(XNetStartupParams);
|
||||
xnsp.cfgFlags = XNET_STARTUP_BYPASS_SECURITY;
|
||||
|
||||
int xnetResult = XNetStartup(&xnsp);
|
||||
if (xnetResult != 0)
|
||||
{
|
||||
app.DebugPrintf("XNetStartup failed: %d\n", xnetResult);
|
||||
return false;
|
||||
}
|
||||
s_xnetStarted = true;
|
||||
}
|
||||
#endif
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
@@ -486,31 +505,43 @@ bool NetworkSocketLayer::JoinGame(const char *ip, int port)
|
||||
s_hostConnectionSocket = INVALID_SOCKET;
|
||||
}
|
||||
|
||||
XNDNS *pDns = NULL;
|
||||
int iResult = XNetDnsLookup(ip, NULL, &pDns);
|
||||
if (iResult != 0 || pDns == NULL)
|
||||
{
|
||||
app.DebugPrintf("XNetDnsLookup failed for %s - %d\n", ip, iResult);
|
||||
return false;
|
||||
}
|
||||
|
||||
while (pDns->iStatus == WSAEINPROGRESS)
|
||||
{
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
if (pDns->iStatus != 0 || pDns->cina == 0)
|
||||
{
|
||||
app.DebugPrintf("pDns->iStatus failed for %s - %d\n", ip, iResult);
|
||||
XNetDnsRelease(pDns);
|
||||
return false;
|
||||
}
|
||||
int iResult;
|
||||
|
||||
struct sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons((WORD)port);
|
||||
addr.sin_addr = pDns->aina[0];
|
||||
XNetDnsRelease(pDns);
|
||||
|
||||
// The discovery broadcast always hands an ip and a LAN has no reason to run a DNS server, so only fall back to XNetDnsLookup for actual host names.
|
||||
unsigned long literalAddr = inet_addr(ip);
|
||||
if (literalAddr != INADDR_NONE)
|
||||
{
|
||||
addr.sin_addr.s_addr = literalAddr;
|
||||
}
|
||||
else
|
||||
{
|
||||
XNDNS *pDns = NULL;
|
||||
iResult = XNetDnsLookup(ip, NULL, &pDns);
|
||||
if (iResult != 0 || pDns == NULL)
|
||||
{
|
||||
app.DebugPrintf("XNetDnsLookup failed for %s - %d\n", ip, iResult);
|
||||
return false;
|
||||
}
|
||||
|
||||
while (pDns->iStatus == WSAEINPROGRESS)
|
||||
{
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
if (pDns->iStatus != 0 || pDns->cina == 0)
|
||||
{
|
||||
app.DebugPrintf("pDns->iStatus failed for %s - %d\n", ip, pDns->iStatus);
|
||||
XNetDnsRelease(pDns);
|
||||
return false;
|
||||
}
|
||||
|
||||
addr.sin_addr = pDns->aina[0];
|
||||
XNetDnsRelease(pDns);
|
||||
}
|
||||
|
||||
bool connected = false;
|
||||
BYTE assignedSmallId = 0;
|
||||
@@ -1224,7 +1255,7 @@ void NetworkSocketLayer::StopAdvertising()
|
||||
{
|
||||
s_advertising = false;
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_advertiseSock != INVALID_SOCKET)
|
||||
{
|
||||
closesocket(s_advertiseSock);
|
||||
@@ -1507,7 +1538,7 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
|
||||
(struct sockaddr *)&senderAddr, &senderLen);
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (recvLen == SOCKET_ERROR)
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -379,6 +379,17 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
|
||||
if (!NetworkSocketLayer::IsActive())
|
||||
NetworkSocketLayer::HostGame(port);
|
||||
|
||||
//Fall back to the local name.
|
||||
if (IQNet::m_player[0].m_gamertag[0] == 0)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if (pMinecraft != NULL && pMinecraft->user != NULL)
|
||||
{
|
||||
wcsncpy(IQNet::m_player[0].m_gamertag, pMinecraft->user->name.c_str(), 31);
|
||||
IQNet::m_player[0].m_gamertag[31] = L'\0';
|
||||
}
|
||||
}
|
||||
|
||||
const wchar_t *hostName = IQNet::m_player[0].m_gamertag;
|
||||
unsigned int settings = app.GetGameHostOption(eGameHostOption_All);
|
||||
NetworkSocketLayer::StartAdvertising(port, hostName, settings, 0, 0, MINECRAFT_NET_VERSION);
|
||||
@@ -731,19 +742,47 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < friendsSessions[0].size(); i++)
|
||||
delete friendsSessions[0][i];
|
||||
friendsSessions[0].clear();
|
||||
std::vector<FriendSessionInfo *> updatedSessions;
|
||||
|
||||
for (size_t i = 0; i < lanSessions.size(); i++)
|
||||
{
|
||||
FriendSessionInfo *info = new FriendSessionInfo();
|
||||
size_t nameLen = wcslen(lanSessions[i].hostName);
|
||||
info->displayLabel = new wchar_t[nameLen + 1];
|
||||
wcsncpy(info->displayLabel, lanSessions[i].hostName, nameLen);
|
||||
info->displayLabel[nameLen] = L'\0';
|
||||
info->displayLabelLength = (unsigned char)nameLen;
|
||||
info->displayLabelViewableStartIndex = 0;
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
SceNetInAddr ip_addr = {};
|
||||
sceNetInetPton(SCE_NET_AF_INET, lanSessions[i].hostIP, &ip_addr);
|
||||
SessionID sessionId = (ULONGLONG)((uint64_t)ip_addr.s_addr | ((uint64_t)lanSessions[i].hostPort << 32));
|
||||
#else
|
||||
SessionID sessionId = (ULONGLONG)((unsigned __int64)inet_addr(lanSessions[i].hostIP) | ((unsigned __int64)lanSessions[i].hostPort << 32));
|
||||
#endif
|
||||
|
||||
FriendSessionInfo *info = NULL;
|
||||
for (size_t j = 0; j < friendsSessions[0].size(); j++)
|
||||
{
|
||||
if (friendsSessions[0][j] != NULL && friendsSessions[0][j]->sessionId == sessionId)
|
||||
{
|
||||
info = friendsSessions[0][j];
|
||||
friendsSessions[0][j] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (info == NULL)
|
||||
info = new FriendSessionInfo();
|
||||
|
||||
info->sessionId = sessionId;
|
||||
|
||||
// Only reallocate the label when the name actually changed, so it stays put as well
|
||||
if (info->displayLabel == NULL || wcscmp(info->displayLabel, lanSessions[i].hostName) != 0)
|
||||
{
|
||||
size_t nameLen = wcslen(lanSessions[i].hostName);
|
||||
wchar_t *newLabel = new wchar_t[nameLen + 1];
|
||||
wcsncpy(newLabel, lanSessions[i].hostName, nameLen);
|
||||
newLabel[nameLen] = L'\0';
|
||||
|
||||
delete [] info->displayLabel;
|
||||
info->displayLabel = newLabel;
|
||||
info->displayLabelLength = (unsigned char)nameLen;
|
||||
info->displayLabelViewableStartIndex = 0;
|
||||
}
|
||||
|
||||
info->data.netVersion = lanSessions[i].netVersion;
|
||||
info->data.m_uiGameHostSettings = lanSessions[i].gameHostSettings;
|
||||
@@ -770,16 +809,14 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
SceNetInAddr ip_addr = {};
|
||||
sceNetInetPton(SCE_NET_AF_INET, lanSessions[i].hostIP, &ip_addr);
|
||||
info->sessionId = (ULONGLONG)((uint64_t)ip_addr.s_addr | ((uint64_t)lanSessions[i].hostPort << 32));
|
||||
#else
|
||||
info->sessionId = (ULONGLONG)((unsigned __int64)inet_addr(lanSessions[i].hostIP) | ((unsigned __int64)lanSessions[i].hostPort << 32));
|
||||
#endif
|
||||
friendsSessions[0].push_back(info);
|
||||
updatedSessions.push_back(info);
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < friendsSessions[0].size(); j++)
|
||||
delete friendsSessions[0][j];
|
||||
|
||||
friendsSessions[0] = updatedSessions;
|
||||
|
||||
m_searchResultsCount[0] = (int)friendsSessions[0].size();
|
||||
|
||||
if (m_SessionsUpdatedCallback != NULL)
|
||||
@@ -820,6 +857,7 @@ bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID session
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include <xuiresource.h>
|
||||
#include <xuiapp.h>
|
||||
#include <assert.h>
|
||||
@@ -76,7 +77,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
|
||||
XuiControlSetText(m_ButtonLoad,app.GetString(IDS_LOAD));
|
||||
XuiControlSetText(m_pTexturePacksList->m_hObj,app.GetString(IDS_DLC_MENU_TEXTUREPACKS));
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
m_bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
|
||||
bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0);
|
||||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=false;
|
||||
@@ -741,7 +742,7 @@ HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandle
|
||||
{
|
||||
case GAME_CREATE_ONLINE_TIMER_ID:
|
||||
{
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
bool bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
|
||||
if(bMultiplayerAllowed != m_bMultiplayerAllowed)
|
||||
{
|
||||
@@ -859,7 +860,7 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue)
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
@@ -1015,7 +1016,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(index) )
|
||||
{
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
|
||||
}
|
||||
}
|
||||
@@ -1024,7 +1025,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(), false, &pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(), false, &pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && (noPrivileges || noUGC) )
|
||||
@@ -1407,7 +1408,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include "..\..\..\Minecraft.World\Random.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "XUI_MultiGameCreate.h"
|
||||
@@ -67,7 +68,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||
m_iPad=params->iPad;
|
||||
delete params;
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
m_bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
|
||||
bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0);
|
||||
m_MoreOptionsParams.bOnlineSettingChangedBySystem=false;
|
||||
@@ -476,7 +477,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
@@ -581,7 +582,7 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
@@ -663,7 +664,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
|
||||
|
||||
case GAME_CREATE_ONLINE_TIMER_ID:
|
||||
{
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
bool bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
|
||||
if(bMultiplayerAllowed != m_bMultiplayerAllowed)
|
||||
{
|
||||
@@ -778,7 +779,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && noUGC )
|
||||
@@ -824,7 +825,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(index) )
|
||||
{
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
|
||||
}
|
||||
}
|
||||
@@ -833,7 +834,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(isClientSide && (noPrivileges || noUGC) )
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "XUI_MultiGameInfo.h"
|
||||
#include "XUI_MultiGameJoinLoad.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include "..\..\..\Minecraft.World\LevelSettings.h"
|
||||
#include "..\..\..\Minecraft.World\Difficulty.h"
|
||||
|
||||
@@ -37,7 +38,19 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
|
||||
// 4J-PB - don't delete this - it's part of the joinload structure
|
||||
//delete initData;
|
||||
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
// No gamercards on a LAN session - the names come straight out of the broadcast
|
||||
for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
{
|
||||
if( m_selectedSession->data.players[i] == 0 || m_selectedSession->data.szPlayers[i][0] == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
playersList.InsertItems(i,1);
|
||||
playersList.SetText(i, convStringToWstring( m_selectedSession->data.szPlayers[i] ).c_str() );
|
||||
}
|
||||
#else
|
||||
for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
{
|
||||
if( m_selectedSession->data.players[i] != NULL )
|
||||
@@ -223,7 +236,11 @@ HRESULT CScene_MultiGameInfo::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocu
|
||||
{
|
||||
if( playersList.TreeHasFocus() && playersList.GetItemCount() > 0 )
|
||||
{
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, -1, IDS_TOOLTIPS_BACK );
|
||||
#else
|
||||
ui.SetTooltips( DEFAULT_XUI_MENU_USER, -1, IDS_TOOLTIPS_BACK, -1, IDS_TOOLTIPS_VIEW_GAMERCARD );
|
||||
#endif
|
||||
bHandled = TRUE;
|
||||
}
|
||||
return S_OK;
|
||||
@@ -274,7 +291,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
|
||||
if(ProfileManager.IsSignedIn(index) )
|
||||
{
|
||||
++dwSignedInUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
|
||||
}
|
||||
}
|
||||
@@ -284,7 +301,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
|
||||
if(ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()) )
|
||||
{
|
||||
++dwSignedInUsers;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true;
|
||||
if( !Live_AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
|
||||
}
|
||||
}
|
||||
@@ -293,7 +310,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
|
||||
bool noUGC = false;
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
Live_AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
|
||||
if(noUGC)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "XUI_LoadSettings.h"
|
||||
#include "XUI_MultiGameInfo.h"
|
||||
#include "XUI_MultiGameJoinLoad.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include "XUI_MultiGameCreate.h"
|
||||
#include "..\..\MinecraftServer.h"
|
||||
#include "..\..\Options.h"
|
||||
@@ -73,8 +74,8 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
|
||||
// }
|
||||
|
||||
m_initData= new JoinMenuInitData();
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
m_bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
|
||||
XPARTY_USER_LIST partyList;
|
||||
|
||||
if((XPartyGetUserList( &partyList ) != XPARTY_E_NOT_IN_PARTY ) && (partyList.dwUserCount>1))
|
||||
@@ -768,8 +769,8 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled
|
||||
// start the texture pack timer again
|
||||
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
|
||||
m_bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
|
||||
// re-enable button presses
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
@@ -1643,7 +1644,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
|
||||
m_bInParty=false;
|
||||
}
|
||||
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
|
||||
bool bMultiplayerAllowed = Live_MultiplayerAllowed( m_iPad );
|
||||
if(bMultiplayerAllowed != m_bMultiplayerAllowed)
|
||||
{
|
||||
if( bMultiplayerAllowed )
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\LivePrivileges.h"
|
||||
#include "XUI_MultiGameCreate.h"
|
||||
#include "XUI_MultiGameLaunchMoreOptions.h"
|
||||
#include "..\..\TexturePackRepository.h"
|
||||
@@ -99,7 +100,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnInit( XUIMessageInit* pInitData, BO
|
||||
m_CheckboxInviteOnly.SetCheck(m_params->bInviteOnly);
|
||||
m_CheckboxAllowFoF.SetCheck(m_params->bAllowFriendsOfFriends);
|
||||
|
||||
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_params->iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
|
||||
m_bMultiplayerAllowed = Live_MultiplayerAllowed( m_params->iPad );
|
||||
if(m_params->bOnlineSettingChangedBySystem)
|
||||
{
|
||||
m_CheckboxOnline.SetCheck(FALSE);
|
||||
@@ -270,7 +271,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnTimer( XUIMessageTimer *pTimer, BOO
|
||||
// 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly
|
||||
if( pTimer->nId == GAME_CREATE_ONLINE_TIMER_ID)
|
||||
{
|
||||
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_params->iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
|
||||
bool bMultiplayerAllowed = Live_MultiplayerAllowed( m_params->iPad );
|
||||
|
||||
if(bMultiplayerAllowed != m_bMultiplayerAllowed)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user