split out platform/profile to its own folder

This commit is contained in:
Tropical 2026-04-07 12:24:36 -05:00
parent a3a21557f8
commit 25e6f7159e
79 changed files with 761 additions and 763 deletions

View file

@ -13,7 +13,7 @@
#include <unordered_map>
#include <utility>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "DLCFile.h"
#include "DLCPack.h"
@ -361,12 +361,12 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA, 1,
ProfileManager.GetPrimaryPad(), nullptr, nullptr, wchFormat);
PlatformProfile.GetPrimaryPad(), nullptr, nullptr, wchFormat);
} else {
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC_MULTIPLE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
}

View file

@ -6,7 +6,7 @@
#include <sstream>
#include <utility>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "DLCAudioFile.h"
#include "DLCCapeFile.h"
#include "DLCColourTableFile.h"
@ -332,7 +332,7 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type,
return false;
}
#if !defined(_CONTENT_PACKAGE)
if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
if (app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_UnlockAllDLC)) {
return true;
} else

View file

@ -10,7 +10,7 @@
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/sdl2/Storage.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h"
#include <cstring>
@ -413,8 +413,8 @@ unsigned int DLCController::addDLCRequest(eDLCMarketplaceType eType,
}
bool DLCController::retrieveNextDLCContent() {
int primPad = ProfileManager.GetPrimaryPad();
if (primPad == -1 || !ProfileManager.IsSignedInLive(primPad)) {
int primPad = PlatformProfile.GetPrimaryPad();
if (primPad == -1 || !PlatformProfile.IsSignedInLive(primPad)) {
return true;
}
@ -437,7 +437,7 @@ bool DLCController::retrieveNextDLCContent() {
pCurrent->dwType);
#endif
C4JStorage::EDLCStatus status = StorageManager.GetDLCOffers(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
[this](int iOfferC, std::uint32_t dwType, int pad) {
return dlcOffersReturned(iOfferC, dwType, pad);
},

View file

@ -3,7 +3,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "app/common/App_Defines.h"
@ -240,7 +240,7 @@ int Game::BannedLevelDialogReturned(
if (result == C4JStorage::EMessage_ResultAccept) {
} else {
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pApp->SetAction(iPad, eAppAction_ExitWorld);
} else {
pApp->SetAction(iPad, eAppAction_ExitPlayer);
@ -253,7 +253,7 @@ int Game::BannedLevelDialogReturned(
#if defined(_DEBUG_MENUS_ENABLED)
bool Game::DebugArtToolsOn() {
return m_debugOptions.debugArtToolsOn(
GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()));
GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()));
}
#endif
@ -318,7 +318,7 @@ int Game::GetLocalPlayerCount(void) {
// // 4J-PB - out for now for DaveK so he doesn't get the
// birthday cape #ifdef _CONTENT_PACKAGE
// C4JStorage::ETMSStatus eTMSStatus;
// eTMSStatus=StorageManager.ReadTMSFile(ProfileManager.GetPrimaryPad(),C4JStorage::eGlobalStorage_Title,C4JStorage::eTMS_FileType_Graphic,
// eTMSStatus=StorageManager.ReadTMSFile(PlatformProfile.GetPrimaryPad(),C4JStorage::eGlobalStorage_Title,C4JStorage::eTMS_FileType_Graphic,
// L"Default_Cape.png",&pBuffer, &dwSize);
// if(eTMSStatus==C4JStorage::ETMSStatus_Idle)
// {
@ -608,7 +608,7 @@ int32_t Game::RegisterConfigValues(wchar_t* pType, int iValue) {
// AUTOSAVE
void Game::SetAutosaveTimerTime(void) {
int settingValue = GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_Autosave);
int settingValue = GetGameSettings(PlatformProfile.GetPrimaryPad(), eGameSetting_Autosave);
m_saveManager.setAutosaveTimerTime(settingValue);
}
@ -624,7 +624,7 @@ float Game::getTrialTimer(void) {
bool Game::IsLocalMultiplayerAvailable() {
unsigned int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
@ -637,7 +637,7 @@ bool Game::IsLocalMultiplayerAvailable() {
// iOtherConnectedControllers =
// PlatformInput.GetConnectedGamepadCount();
// if((PlatformInput.IsPadConnected(userIndex) ||
// ProfileManager.IsSignedIn(userIndex)))
// PlatformProfile.IsSignedIn(userIndex)))
// {
// --iOtherConnectedControllers;
// }
@ -645,7 +645,7 @@ bool Game::IsLocalMultiplayerAvailable() {
// for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
// {
// if( (i!=userIndex) && (PlatformInput.IsPadConnected(i) ||
// ProfileManager.IsSignedIn(i)) )
// PlatformProfile.IsSignedIn(i)) )
// {
// iOtherConnectedControllers++;
// }

View file

@ -4,7 +4,7 @@
#include <mutex>
#include "util/Timer.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
// using namespace std;
@ -344,11 +344,11 @@ public:
}
static int DefaultOptionsCallback(void* pParam,
C_4JProfile::PROFILESETTINGS* pSettings,
IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) {
return GameSettingsManager::defaultOptionsCallback(pParam, pSettings, iPad);
}
int SetDefaultOptions(C_4JProfile::PROFILESETTINGS* pSettings,
int SetDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) {
return m_gameSettingsManager.setDefaultOptions(pSettings, iPad);
}

View file

@ -31,7 +31,7 @@
#include "minecraft/world/level/levelgen/structure/BoundingBox.h"
#include "minecraft/world/phys/AABB.h"
#include "platform/PlatformServices.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "strings.h"
#include "util/StringHelpers.h"
@ -552,7 +552,7 @@ void LevelGenerationOptions::loadBaseSaveData() {
if (mountIndex > -1) {
if (StorageManager.MountInstalledDLC(
ProfileManager.GetPrimaryPad(), mountIndex,
PlatformProfile.GetPrimaryPad(), mountIndex,
[this](int pad, std::uint32_t err, std::uint32_t lic) {
return onPackMounted(pad, err, lic);
},
@ -560,7 +560,7 @@ void LevelGenerationOptions::loadBaseSaveData() {
// corrupt DLC
setLoadedData();
app.DebugPrintf("Failed to mount LGO DLC %d for pad %d\n",
mountIndex, ProfileManager.GetPrimaryPad());
mountIndex, PlatformProfile.GetPrimaryPad());
} else {
m_bLoadingData = true;
app.DebugPrintf("Attempted to mount DLC data for LGO %d\n",
@ -568,7 +568,7 @@ void LevelGenerationOptions::loadBaseSaveData() {
}
} else {
setLoadedData();
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_ReloadTexturePack);
}
}

View file

@ -35,26 +35,26 @@ GameSettingsManager::GameSettingsManager() {
void GameSettingsManager::initGameSettings() {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
GameSettingsA[i] =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(i);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(i);
// clear the flag to say the settings have changed
GameSettingsA[i]->bSettingsChanged = false;
#if defined(_WINDOWS64)
C_4JProfile::PROFILESETTINGS* pProfileSettings =
ProfileManager.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(C_4JProfile::PROFILESETTINGS));
IPlatformProfile::PROFILESETTINGS* pProfileSettings =
PlatformProfile.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(IPlatformProfile::PROFILESETTINGS));
setDefaultOptions(pProfileSettings, i);
#else
C_4JProfile::PROFILESETTINGS* pProfileSettings =
ProfileManager.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(C_4JProfile::PROFILESETTINGS));
IPlatformProfile::PROFILESETTINGS* pProfileSettings =
PlatformProfile.GetDashboardProfileSettings(i);
memset(pProfileSettings, 0, sizeof(IPlatformProfile::PROFILESETTINGS));
setDefaultOptions(pProfileSettings, i);
#endif
}
}
int GameSettingsManager::setDefaultOptions(
C_4JProfile::PROFILESETTINGS* pSettings, const int iPad) {
IPlatformProfile::PROFILESETTINGS* pSettings, const int iPad) {
setGameSettings(iPad, eGameSetting_MusicVolume, DEFAULT_VOLUME_LEVEL);
setGameSettings(iPad, eGameSetting_SoundFXVolume, DEFAULT_VOLUME_LEVEL);
setGameSettings(iPad, eGameSetting_Gamma, 50);
@ -133,7 +133,7 @@ int GameSettingsManager::setDefaultOptions(
}
int GameSettingsManager::defaultOptionsCallback(
void* pParam, C_4JProfile::PROFILESETTINGS* pSettings, const int iPad) {
void* pParam, IPlatformProfile::PROFILESETTINGS* pSettings, const int iPad) {
Game* pApp = (Game*)pParam;
pApp->DebugPrintf("Setting default options for player %d", iPad);
@ -249,27 +249,27 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
Minecraft* pMinecraft = Minecraft::GetInstance();
switch (eVal) {
case eGameSetting_MusicVolume:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->set(
Options::Option::MUSIC,
((float)GameSettingsA[iPad]->ucMusicVolume) / 100.0f);
}
break;
case eGameSetting_SoundFXVolume:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->set(
Options::Option::SOUND,
((float)GameSettingsA[iPad]->ucSoundFXVolume) / 100.0f);
}
break;
case eGameSetting_Gamma:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
float fVal = ((float)GameSettingsA[iPad]->ucGamma) * 327.68f;
RenderManager.UpdateGamma((unsigned short)fVal);
}
break;
case eGameSetting_Difficulty:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->options->toggle(
Options::Option::DIFFICULTY,
GameSettingsA[iPad]->usBitmaskValues & 0x03);
@ -282,7 +282,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
bool bInGame = pMinecraft->level != nullptr;
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetXuiServerAction(
iPad, eXuiServerAction_ServerSettingChanged_Difficulty);
}
@ -290,7 +290,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
app.DebugPrintf(
"NOT ACTIONING DIFFICULTY - Primary pad is %d, This pad is "
"%d\n",
ProfileManager.GetPrimaryPad(), iPad);
PlatformProfile.GetPrimaryPad(), iPad);
}
break;
case eGameSetting_Sensitivity_InGame:
@ -336,7 +336,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
}
break;
case eGameSetting_SplitScreenVertical:
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
pMinecraft->updatePlayerViewportAssignments();
}
break;
@ -345,7 +345,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
// Game Host only
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetGameHostOption(
eGameHostOption_Gamertags,
((GameSettingsA[iPad]->usBitmaskValues & 0x0008) != 0) ? 1
@ -403,7 +403,7 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) {
bool bInGame = pMinecraft->level != nullptr;
if (bInGame && g_NetworkManager.IsHost() &&
(iPad == ProfileManager.GetPrimaryPad())) {
(iPad == PlatformProfile.GetPrimaryPad())) {
app.SetGameHostOption(
eGameHostOption_BedrockFog,
getGameSettings(iPad, eGameSetting_BedrockFog) ? 1 : 0);
@ -484,7 +484,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_MusicVolume:
if (GameSettingsA[iPad]->ucMusicVolume != ucVal) {
GameSettingsA[iPad]->ucMusicVolume = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -493,7 +493,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_SoundFXVolume:
if (GameSettingsA[iPad]->ucSoundFXVolume != ucVal) {
GameSettingsA[iPad]->ucSoundFXVolume = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -502,7 +502,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
case eGameSetting_Gamma:
if (GameSettingsA[iPad]->ucGamma != ucVal) {
GameSettingsA[iPad]->ucGamma = ucVal;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -513,7 +513,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
(ucVal & 0x03)) {
GameSettingsA[iPad]->usBitmaskValues &= ~0x03;
GameSettingsA[iPad]->usBitmaskValues |= ucVal & 0x03;
if (iPad == ProfileManager.GetPrimaryPad()) {
if (iPad == PlatformProfile.GetPrimaryPad()) {
actionGameSettings(iPad, eVal);
}
GameSettingsA[iPad]->bSettingsChanged = true;
@ -864,7 +864,7 @@ void GameSettingsManager::setGameSettings(int iPad, eGameSetting eVal,
}
unsigned char GameSettingsManager::getGameSettings(eGameSetting eVal) {
int iPad = ProfileManager.GetPrimaryPad();
int iPad = PlatformProfile.GetPrimaryPad();
return getGameSettings(iPad, eVal);
}
@ -979,13 +979,13 @@ void GameSettingsManager::checkGameSettingsChanged(bool bOverride5MinuteTimer,
if (iPad == XUSER_INDEX_ANY) {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
if (GameSettingsA[i]->bSettingsChanged) {
ProfileManager.WriteToProfile(i, true, bOverride5MinuteTimer);
PlatformProfile.WriteToProfile(i, true, bOverride5MinuteTimer);
GameSettingsA[i]->bSettingsChanged = false;
}
}
} else {
if (GameSettingsA[iPad]->bSettingsChanged) {
ProfileManager.WriteToProfile(iPad, true, bOverride5MinuteTimer);
PlatformProfile.WriteToProfile(iPad, true, bOverride5MinuteTimer);
GameSettingsA[iPad]->bSettingsChanged = false;
}
}
@ -1011,7 +1011,7 @@ void GameSettingsManager::actionDebugMask(int iPad, bool bSetAllClear) {}
unsigned int GameSettingsManager::getGameSettingsDebugMask(
int iPad, bool bOverridePlayer) {
if (iPad == -1) {
iPad = ProfileManager.GetPrimaryPad();
iPad = PlatformProfile.GetPrimaryPad();
}
if (iPad < 0) iPad = 0;
@ -1046,7 +1046,7 @@ void GameSettingsManager::actionDebugMask(int iPad, bool bSetAllClear) {
if (bSetAllClear) ulBitmask = 0L;
if (ProfileManager.GetPrimaryPad() != iPad) return;
if (PlatformProfile.GetPrimaryPad() != iPad) return;
for (int i = 0; i < eDebugSetting_Max; i++) {
switch (i) {

View file

@ -3,7 +3,7 @@
#include <cstdint>
#include "app/common/App_structs.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h"
class GameSettingsManager {
@ -15,9 +15,9 @@ public:
const unsigned short usVersion,
const int iPad);
static int defaultOptionsCallback(void* pParam,
C_4JProfile::PROFILESETTINGS* pSettings,
IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad);
int setDefaultOptions(C_4JProfile::PROFILESETTINGS* pSettings,
int setDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad);
void setGameSettings(int iPad, eGameSetting eVal, unsigned char ucVal);

View file

@ -28,7 +28,7 @@
#include "minecraft/server/MinecraftServer.h"
#include "minecraft/stats/StatsCounter.h"
#include "platform/PlatformTypes.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "util/StringHelpers.h"
#include "app/common/Audio/SoundEngine.h"
@ -71,7 +71,7 @@ void Game::HandleXuiActions(void) {
switch (eAction) {
// // the renderer will capture a screenshot
// case eAppAction_SocialPost:
// if (ProfileManager.IsFullVersion()) {
// if (PlatformProfile.IsFullVersion()) {
// // Facebook Share
// if (CSocialManager::Instance()
// ->IsTitleAllowedToPostImages() &&
@ -159,12 +159,12 @@ void Game::HandleXuiActions(void) {
// Hide the other players scenes
ui.ShowOtherPlayersBaseScene(
ProfileManager.GetPrimaryPad(), false);
PlatformProfile.GetPrimaryPad(), false);
// int saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
LoadingInputParams* loadingParams =
@ -184,9 +184,9 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
if (ui.IsSceneInStack(ProfileManager.GetPrimaryPad(),
if (ui.IsSceneInStack(PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->scene = eUIScene_EndPoem;
} else {
@ -197,7 +197,7 @@ void Game::HandleXuiActions(void) {
// 4J Stu - Xbox only
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams, eUILayer_Fullscreen,
eUIGroup_Fullscreen);
@ -215,22 +215,22 @@ void Game::HandleXuiActions(void) {
// app.CloseAllPlayersXuiScenes();
// Hide the other players scenes
ui.ShowOtherPlayersBaseScene(ProfileManager.GetPrimaryPad(),
ui.ShowOtherPlayersBaseScene(PlatformProfile.GetPrimaryPad(),
false);
// This just allows it to be shown
if (pMinecraft
->localgameModes[ProfileManager.GetPrimaryPad()] !=
->localgameModes[PlatformProfile.GetPrimaryPad()] !=
nullptr)
pMinecraft
->localgameModes[ProfileManager.GetPrimaryPad()]
->localgameModes[PlatformProfile.GetPrimaryPad()]
->getTutorial()
->showTutorialPopup(false);
// int saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
LoadingInputParams* loadingParams =
@ -246,13 +246,13 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->type =
e_ProgressCompletion_AutosaveNavigateBack;
completionData->iPad = ProfileManager.GetPrimaryPad();
// completionData->bAutosaveWasMenuDisplayed=ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad());
completionData->iPad = PlatformProfile.GetPrimaryPad();
// completionData->bAutosaveWasMenuDisplayed=ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad());
loadingParams->completionData = completionData;
// 4J Stu - Xbox only
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams, eUILayer_Fullscreen,
eUIGroup_Fullscreen);
@ -265,7 +265,7 @@ void Game::HandleXuiActions(void) {
// Since the player is exiting, let's flush any profile
// writes for them, and hope we're not breaking TCR
// 136...
ProfileManager.ForceQueuedProfileWrites(i);
PlatformProfile.ForceQueuedProfileWrites(i);
// not required - it's done within the
// removeLocalPlayerIdx
@ -285,7 +285,7 @@ void Game::HandleXuiActions(void) {
// Make sure we've not got this player selected as
// current - this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
// Wipe out the tooltips
@ -303,12 +303,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER,
false);
@ -321,12 +321,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1P,
false);
@ -342,7 +342,7 @@ void Game::HandleXuiActions(void) {
int iPlayerC = g_NetworkManager.GetPlayerCount();
// Since the player is exiting, let's flush any profile
// writes for them, and hope we're not breaking TCR 136...
ProfileManager.ForceQueuedProfileWrites(i);
PlatformProfile.ForceQueuedProfileWrites(i);
// if there are any tips showing, we need to close them
pMinecraft->gui->clearMessages(i);
@ -350,7 +350,7 @@ void Game::HandleXuiActions(void) {
// Make sure we've not got this player selected as current -
// this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
// Wipe out the tooltips
@ -367,12 +367,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer, CONTEXT_PRESENCE_MULTIPLAYER,
false);
}
@ -384,12 +384,12 @@ void Game::HandleXuiActions(void) {
if ((iPlayer != i) &&
pMinecraft->localplayers[iPlayer]) {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPlayer,
CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
@ -434,11 +434,11 @@ void Game::HandleXuiActions(void) {
// In a split screen, only the primary player actually
// quits the game, others just remove their players
if (i != ProfileManager.GetPrimaryPad()) {
if (i != PlatformProfile.GetPrimaryPad()) {
// Make sure we've not got this player selected as
// current - this shouldn't be the case anyway
pMinecraft->setLocalPlayerIdx(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
pMinecraft->removeLocalPlayerIdx(i);
SetAction(i, eAppAction_Idle);
@ -456,13 +456,13 @@ void Game::HandleXuiActions(void) {
if (g_NetworkManager.IsLocalGame()) {
app.SetRichPresenceContext(
j, CONTEXT_GAME_STATE_BLANK);
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
j, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,
false);
} else {
app.SetRichPresenceContext(
j, CONTEXT_GAME_STATE_BLANK);
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
j, CONTEXT_PRESENCE_MULTIPLAYER, false);
}
}
@ -470,11 +470,11 @@ void Game::HandleXuiActions(void) {
} else {
app.SetRichPresenceContext(i, CONTEXT_GAME_STATE_BLANK);
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
i, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,
false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
i, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
}
@ -524,7 +524,7 @@ void Game::HandleXuiActions(void) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
} break;
@ -566,7 +566,7 @@ void Game::HandleXuiActions(void) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -823,7 +823,7 @@ void Game::HandleXuiActions(void) {
ui.HideAllGameUIElements();
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
if (g_NetworkManager.IsLeavingGame()) {
// 4J Stu - If we are already leaving the game, then we
@ -867,7 +867,7 @@ void Game::HandleXuiActions(void) {
e_ProgressCompletion_NavigateToHomeMenu;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -875,7 +875,7 @@ void Game::HandleXuiActions(void) {
case eAppAction_PrimaryPlayerSignedOutReturned_Menus:
SetAction(i, eAppAction_Idle);
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
// clear the save device
StorageManager.SetSaveDeviceSelected(i, false);
@ -888,7 +888,7 @@ void Game::HandleXuiActions(void) {
case eAppAction_EthernetDisconnectedReturned_Menus:
SetAction(i, eAppAction_Idle);
// set the state back to pre-game
ProfileManager.ResetProfileProcessState();
PlatformProfile.ResetProfileProcessState();
ui.UpdatePlayerBasePositions();
@ -927,7 +927,7 @@ void Game::HandleXuiActions(void) {
// Check the player really wants to do this
if (!StorageManager.GetSaveDisabled() &&
i == ProfileManager.GetPrimaryPad() &&
i == PlatformProfile.GetPrimaryPad() &&
g_NetworkManager.IsHost() && GetGameStarted()) {
uiIDA[0] = IDS_CONFIRM_CANCEL;
uiIDA[1] = IDS_EXIT_GAME_SAVE;
@ -1018,7 +1018,7 @@ void Game::HandleXuiActions(void) {
completionData->type = e_ProgressCompletion_NoAction;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -1043,15 +1043,15 @@ void Game::HandleXuiActions(void) {
app.DebugPrintf(
"Changing Primary Pad on an invite accept - pad was "
"%d, and is now %d\n",
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
inviteData->dwUserIndex);
ProfileManager.SetLockedProfile(inviteData->dwUserIndex);
ProfileManager.SetPrimaryPad(inviteData->dwUserIndex);
PlatformProfile.SetLockedProfile(inviteData->dwUserIndex);
PlatformProfile.SetPrimaryPad(inviteData->dwUserIndex);
// change the minecraft player name
Minecraft::GetInstance()->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
inviteData->dwUserIndex, // dwUserIndex
@ -1069,7 +1069,7 @@ void Game::HandleXuiActions(void) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER,
uiIDA, 1, ProfileManager.GetPrimaryPad());
uiIDA, 1, PlatformProfile.GetPrimaryPad());
ui.NavigateToHomeMenu();
ui.UpdatePlayerBasePositions();
@ -1097,12 +1097,12 @@ void Game::HandleXuiActions(void) {
ui.HideAllGameUIElements();
if (!ui.IsSceneInStack(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
ui.CloseAllPlayersScenes();
}
ui.ShowOtherPlayersBaseScene(
ProfileManager.GetPrimaryPad(), true);
PlatformProfile.GetPrimaryPad(), true);
// Remove this line to fix:
// #49084 - TU5: Code: Gameplay: The title crashes
@ -1125,7 +1125,7 @@ void Game::HandleXuiActions(void) {
completionData->bShowLogo = true;
completionData->iPad = DEFAULT_XUI_MENU_USER;
if (ui.IsSceneInStack(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
@ -1136,7 +1136,7 @@ void Game::HandleXuiActions(void) {
}
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
}
@ -1148,7 +1148,7 @@ void Game::HandleXuiActions(void) {
} break;
case eAppAction_SetDefaultOptions:
SetAction(i, eAppAction_Idle);
SetDefaultOptions((C_4JProfile::PROFILESETTINGS*)param, i);
SetDefaultOptions((IPlatformProfile::PROFILESETTINGS*)param, i);
// if the profile data has been changed, then force a
// profile write It seems we're allowed to break the 5
@ -1161,7 +1161,7 @@ void Game::HandleXuiActions(void) {
// If the remote server save has already finished, don't
// complete the action
if (GetGameStarted()) {
SetAction(ProfileManager.GetPrimaryPad(),
SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_Idle);
break;
}
@ -1187,7 +1187,7 @@ void Game::HandleXuiActions(void) {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->iPad = DEFAULT_XUI_MENU_USER;
if (ui.IsSceneInStack(ProfileManager.GetPrimaryPad(),
if (ui.IsSceneInStack(PlatformProfile.GetPrimaryPad(),
eUIScene_EndPoem)) {
completionData->type =
e_ProgressCompletion_NavigateBackToScene;
@ -1201,7 +1201,7 @@ void Game::HandleXuiActions(void) {
loadingParams->cancelFunc = &Game::ExitGameFromRemoteSave;
loadingParams->cancelText = IDS_TOOLTIPS_EXIT;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress,
loadingParams);
} break;
@ -1214,7 +1214,7 @@ void Game::HandleXuiActions(void) {
C4JStorage::EMessageResult result = ui.RequestErrorMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
if (result != C4JStorage::EMessage_Busy)
SetAction(i, eAppAction_Idle);
} break;
@ -1245,7 +1245,7 @@ void Game::HandleXuiActions(void) {
!g_NetworkManager.IsLeavingGame()) {
// primary player would exit the world, secondary would
// exit the player
if (ProfileManager.GetPrimaryPad() == i) {
if (PlatformProfile.GetPrimaryPad() == i) {
SetAction(i, eAppAction_ExitWorld);
} else {
SetAction(i, eAppAction_ExitPlayer);
@ -1341,7 +1341,7 @@ void Game::HandleXuiActions(void) {
ui.RequestErrorMessage(
IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&Game::TexturePackDialogReturned, this);
SetAction(i, eAppAction_Idle);
}
@ -1437,8 +1437,8 @@ void Game::HandleXuiActions(void) {
// selected
// // ensure we've applied
// this player's settings
// app.ApplyGameSettingsChanged(ProfileManager.GetPrimaryPad());
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// app.ApplyGameSettingsChanged(PlatformProfile.GetPrimaryPad());
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// }
break;
default:

View file

@ -18,7 +18,7 @@
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/HopperTileEntity.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include <cstring>
@ -489,17 +489,17 @@ int MenuController::remoteSaveThreadProc(void* lpParameter) {
pMinecraft->progressRenderer->progressStagePercentage(0);
while (!app.GetGameStarted() &&
app.GetXuiAction(ProfileManager.GetPrimaryPad()) ==
app.GetXuiAction(PlatformProfile.GetPrimaryPad()) ==
eAppAction_WaitRemoteServerSaveComplete) {
pMinecraft->tickAllConnections();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
if (app.GetXuiAction(ProfileManager.GetPrimaryPad()) !=
if (app.GetXuiAction(PlatformProfile.GetPrimaryPad()) !=
eAppAction_WaitRemoteServerSaveComplete) {
return ERROR_CANCELLED;
}
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_Idle);
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_Idle);
ui.UpdatePlayerBasePositions();
@ -509,7 +509,7 @@ int MenuController::remoteSaveThreadProc(void* lpParameter) {
}
void MenuController::exitGameFromRemoteSave(void* lpParameter) {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
unsigned int uiIDA[3];
uiIDA[0] = IDS_CONFIRM_CANCEL;

View file

@ -10,7 +10,7 @@
#include <vector>
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "minecraft/GameEnums.h"
@ -108,7 +108,7 @@ bool CGameNetworkManager::_RunNetworkGame(void* lpParameter) {
success = s_pPlatformNetworkManager->_RunNetworkGame();
if (!success) {
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
return true;
}
@ -118,7 +118,7 @@ bool CGameNetworkManager::_RunNetworkGame(void* lpParameter) {
app.SetGameStarted(true);
// app.CloseXuiScenes(ProfileManager.GetPrimaryPad());
// app.CloseXuiScenes(PlatformProfile.GetPrimaryPad());
return success;
}
@ -268,10 +268,10 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
} else {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(
ProfileManager.GetLockedProfile());
PlatformProfile.GetLockedProfile());
if (pNetworkPlayer == nullptr) {
MinecraftServer::HaltServer();
app.DebugPrintf("%d\n", ProfileManager.GetLockedProfile());
app.DebugPrintf("%d\n", PlatformProfile.GetLockedProfile());
// If the player is nullptr here then something went wrong in the
// session setup, and continuing will end up in a crash
return false;
@ -341,33 +341,33 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
if (connection->isStarted() && !connection->isClosed()) {
createdConnections.push_back(connection);
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
app.SetRichPresenceContext(primaryPad, CONTEXT_GAME_STATE_BLANK);
if (GetPlayerCount() >
1) // Are we offline or online, and how many players are there
{
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
primaryPad, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
// ALL OTHER LOCAL PLAYERS
for (int idx = 0; idx < XUSER_MAX_COUNT; ++idx) {
// Already have setup the primary pad
if (idx == ProfileManager.GetPrimaryPad()) continue;
if (idx == PlatformProfile.GetPrimaryPad()) continue;
if (GetLocalPlayerByUserIndex(idx) != nullptr &&
!ProfileManager.IsSignedIn(idx)) {
!PlatformProfile.IsSignedIn(idx)) {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(idx);
Socket* socket = pNetworkPlayer->GetSocket();
@ -396,13 +396,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
minecraft->addPendingLocalConnection(idx, connection);
// minecraft->createExtraLocalPlayer(idx, (convStringToWstring(
// ProfileManager.GetGamertag(idx) )).c_str(), idx, connection);
// PlatformProfile.GetGamertag(idx) )).c_str(), idx, connection);
// Open the socket on the server end to accept incoming data
Socket::addIncomingSocket(socket);
connection->send(std::shared_ptr<PreLoginPacket>(new PreLoginPacket(
convStringToWstring(ProfileManager.GetGamertag(idx)))));
convStringToWstring(PlatformProfile.GetGamertag(idx)))));
createdConnections.push_back(connection);
@ -427,11 +427,11 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
app.DebugPrintf("<***> %d %d %d %d %d\n", IsInSession(),
!connection->isStarted(),
!connection->isClosed(),
ProfileManager.IsSignedIn(idx),
PlatformProfile.IsSignedIn(idx),
!g_NetworkManager.IsLeavingGame());
// TODO - This SHOULD be something just like the code above but
// temporarily changing here so that we don't have to depend on
// the profilemanager behaviour
// the platformprofile behaviour
} while (IsInSession() && !connection->isStarted() &&
!connection->isClosed() &&
!g_NetworkManager.IsLeavingGame());
@ -443,13 +443,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
// get closed at the end of the thread
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) break;
if (ProfileManager.IsSignedIn(idx) && !connection->isClosed()) {
if (PlatformProfile.IsSignedIn(idx) && !connection->isClosed()) {
app.SetRichPresenceContext(idx, CONTEXT_GAME_STATE_BLANK);
if (IsLocalGame())
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
idx, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
connection->close();
@ -639,13 +639,13 @@ CGameNetworkManager::eJoinGameResult CGameNetworkManager::JoinGame(
app.SetTutorialMode(false);
g_NetworkManager.SetLocalGame(false);
int primaryUserIndex = ProfileManager.GetLockedProfile();
int primaryUserIndex = PlatformProfile.GetLockedProfile();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
// Make sure that the Primary Pad is in by default
localUsersMask |= GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
localUsersMask |= GetLocalPlayerMask(PlatformProfile.GetPrimaryPad());
return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame(
searchResult, localUsersMask, primaryUserIndex));
@ -666,8 +666,8 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
if (bContinue == true) {
app.DebugPrintf("JoinFromInvite_SignInReturned, iPad %d\n", iPad);
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(iPad) &&
ProfileManager.IsSignedInLive(iPad)) {
if (PlatformProfile.IsSignedIn(iPad) &&
PlatformProfile.IsSignedInLive(iPad)) {
app.DebugPrintf(
"JoinFromInvite_SignInReturned, passed sign-in tests\n");
int localUsersMask = 0;
@ -675,9 +675,9 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
bool noPrivileges = false;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (PlatformProfile.IsSignedIn(index)) {
++joiningUsers;
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
localUsersMask |= GetLocalPlayerMask(index);
}
@ -701,24 +701,24 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
ProfileManager.SetLockedProfile(iPad);
ProfileManager.SetPrimaryPad(iPad);
PlatformProfile.SetLockedProfile(iPad);
PlatformProfile.SetPrimaryPad(iPad);
g_NetworkManager.SetLocalGame(false);
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
iPad, // dwUserIndex
@ -731,8 +731,8 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
} else {
app.DebugPrintf(
"JoinFromInvite_SignInReturned, failed sign-in tests :%d %d\n",
ProfileManager.IsSignedIn(iPad),
ProfileManager.IsSignedInLive(iPad));
PlatformProfile.IsSignedIn(iPad),
PlatformProfile.IsSignedInLive(iPad));
}
}
return 0;
@ -875,12 +875,12 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
pMinecraft->progressRenderer->progressStage(
IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME);
while (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) !=
while (app.GetXuiServerAction(PlatformProfile.GetPrimaryPad()) !=
eXuiServerAction_Idle &&
!MinecraftServer::serverHalted()) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)true);
// wait for the server to be in a non-ticking state
@ -937,7 +937,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
int localUsersMask = 0;
char numLocalPlayers = 0;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index) &&
if (PlatformProfile.IsSignedIn(index) &&
pMinecraft->localplayers[index] != nullptr) {
numLocalPlayers++;
localUsersMask |= GetLocalPlayerMask(index);
@ -956,7 +956,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
// Restore the network player of all the server players that are local
if (pServer != nullptr) {
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index) &&
if (PlatformProfile.IsSignedIn(index) &&
pMinecraft->localplayers[index] != nullptr) {
PlayerUID localPlayerXuid =
pMinecraft->localplayers[index]->getXuid();
@ -1008,7 +1008,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
// Start the game again
app.SetGameStarted(true);
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)false);
app.SetChangingSessionType(false);
app.SetReallyChangingSessionType(false);
@ -1048,13 +1048,13 @@ void CGameNetworkManager::StateChange_AnyToJoining() {
Minecraft::GetInstance()->clearPendingClientTextureRequests();
ConnectionProgressParams* param = new ConnectionProgressParams();
param->iPad = ProfileManager.GetPrimaryPad();
param->iPad = PlatformProfile.GetPrimaryPad();
param->stringId = -1;
param->showTooltips = false;
param->setFailTimer = true;
param->timerTime = CONNECTING_PROGRESS_CHECK_TIME;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_ConnectingProgress, param);
}
@ -1068,7 +1068,7 @@ void CGameNetworkManager::StateChange_JoiningToIdle(
case IPlatformNetwork::JOIN_FAILED_INSUFFICIENT_PRIVILEGES:
disconnectReason =
DisconnectPacket::eDisconnect_NoMultiplayerPrivilegesJoin;
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_FailedToJoinNoPrivileges);
break;
default:
@ -1077,7 +1077,7 @@ void CGameNetworkManager::StateChange_JoiningToIdle(
break;
};
Minecraft::GetInstance()->connectionDisconnected(
ProfileManager.GetPrimaryPad(), disconnectReason);
PlatformProfile.GetPrimaryPad(), disconnectReason);
}
void CGameNetworkManager::StateChange_AnyToStarting() {
@ -1091,10 +1091,10 @@ void CGameNetworkManager::StateChange_AnyToStarting() {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
}
@ -1106,7 +1106,7 @@ void CGameNetworkManager::StateChange_AnyToEnding(bool bStateWasPlaying) {
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
INetworkPlayer* pNetworkPlayer =
g_NetworkManager.GetLocalPlayerByUserIndex(i);
if (pNetworkPlayer != nullptr && ProfileManager.IsSignedIn(i)) {
if (pNetworkPlayer != nullptr && PlatformProfile.IsSignedIn(i)) {
app.DebugPrintf(
"Stats save for an offline game for the player at index "
"%d\n",
@ -1127,7 +1127,7 @@ void CGameNetworkManager::StateChange_AnyToEnding(bool bStateWasPlaying) {
// The host has notified that the game is about to end
if (app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
app.SetDisconnectReason(DisconnectPacket::eDisconnect_Quitting);
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
}
}
@ -1221,17 +1221,17 @@ void CGameNetworkManager::PlayerJoining(INetworkPlayer* pNetworkPlayer) {
app.SetRichPresenceContext(iPad, CONTEXT_GAME_STATE_BLANK);
if (multiplayer) {
if (localgame)
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER, false);
} else {
if (localgame)
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, false);
else
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
}
@ -1240,14 +1240,14 @@ void CGameNetworkManager::PlayerJoining(INetworkPlayer* pNetworkPlayer) {
void CGameNetworkManager::PlayerLeaving(INetworkPlayer* pNetworkPlayer) {
if (pNetworkPlayer->IsLocal()) {
ProfileManager.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),
PlatformProfile.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),
CONTEXT_PRESENCE_IDLE, false);
}
}
void CGameNetworkManager::HostChanged() {
// Disable host migration
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
}
@ -1263,7 +1263,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
bool noPrivileges = false;
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (PlatformProfile.IsSignedIn(index)) {
// 4J-PB we shouldn't bring any inactive players into the game,
// except for the invited player (who may be an inactive player) 4J
// Stu - If we are not in a game, then bring in all players signed
@ -1271,7 +1271,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
if (index == userIndex ||
pMinecraft->localplayers[index] != nullptr) {
++joiningUsers;
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
localUsersMask |= GetLocalPlayerMask(index);
}
@ -1284,8 +1284,8 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
bool bContentRestricted = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
if (noUGC) {
@ -1303,7 +1303,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
// invite from the dashboard
// StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
// IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
// uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr,
// uiIDA,1,PlatformProfile.GetPrimaryPad(),nullptr,nullptr,
// app.GetStringTable());
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
@ -1336,7 +1336,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// We are in the root menus somewhere
{
ProfileManager.SetPrimaryPad(userIndex);
PlatformProfile.SetPrimaryPad(userIndex);
// 4J Stu - If we accept an invite from the main menu before going to
// play game we need to load the DLC These checks are done within the
@ -1348,11 +1348,11 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// stuck in a soft-locked state after selecting the guest account when
// prompted The locked profile should not be changed if we are in menus
// as the main player might sign out in the sign-in ui
// ProfileManager.SetLockedProfile(-1);
// PlatformProfile.SetLockedProfile(-1);
if (!app.IsLocalMultiplayerAvailable()) {
bool noPrivileges =
!ProfileManager.AllowedToPlayMultiplayer(userIndex);
!PlatformProfile.AllowedToPlayMultiplayer(userIndex);
if (noPrivileges) {
unsigned int uiIDA[1];
@ -1360,10 +1360,10 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
ProfileManager.SetLockedProfile(userIndex);
ProfileManager.SetPrimaryPad(userIndex);
PlatformProfile.SetLockedProfile(userIndex);
PlatformProfile.SetPrimaryPad(userIndex);
int localUsersMask = 0;
localUsersMask |= GetLocalPlayerMask(userIndex);
@ -1371,7 +1371,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed();
@ -1380,7 +1380,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
bool success = g_NetworkManager.JoinGameFromInviteInfo(
userIndex, localUsersMask, pInviteInfo);
@ -1398,7 +1398,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
};
info.requireOnline = true;
app.DebugPrintf("Using fullscreen layer\n");
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info, eUILayer_Alert,
eUIGroup_Fullscreen);
}
@ -1426,23 +1426,23 @@ void CGameNetworkManager::HandleDisconnect(bool bLostRoomOnly) {
}
int CGameNetworkManager::GetPrimaryPad() {
return ProfileManager.GetPrimaryPad();
return PlatformProfile.GetPrimaryPad();
}
int CGameNetworkManager::GetLockedProfile() {
return ProfileManager.GetLockedProfile();
return PlatformProfile.GetLockedProfile();
}
bool CGameNetworkManager::IsSignedInLive(int playerIdx) {
return ProfileManager.IsSignedInLive(playerIdx);
return PlatformProfile.IsSignedInLive(playerIdx);
}
bool CGameNetworkManager::AllowedToPlayMultiplayer(int playerIdx) {
return ProfileManager.AllowedToPlayMultiplayer(playerIdx);
return PlatformProfile.AllowedToPlayMultiplayer(playerIdx);
}
char* CGameNetworkManager::GetOnlineName(int playerIdx) {
return ProfileManager.GetGamertag(playerIdx);
return PlatformProfile.GetGamertag(playerIdx);
}
void CGameNetworkManager::ServerReadyCreate(bool create) {
@ -1504,7 +1504,7 @@ void CGameNetworkManager::ServerStoppedWait() {
RenderManager.StartFrame();
result = m_hServerStoppedEvent->waitForSignal(20);
// Tick some simple things
ProfileManager.Tick();
PlatformProfile.Tick();
StorageManager.Tick();
PlatformInput.Tick();
RenderManager.Tick();

View file

@ -18,7 +18,7 @@
#include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "app/common/Audio/SoundEngine.h"
@ -121,7 +121,7 @@ int NetworkController::ethernetDisconnectReturned(
void NetworkController::profileReadErrorCallback(void* pParam) {
Game* pApp = (Game*)pParam;
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
pApp->SetAction(iPrimaryPlayer, eAppAction_ProfileReadError);
}
@ -219,7 +219,7 @@ int NetworkController::signoutExitWorldThreadProc(void* lpParameter) {
}
void NetworkController::clearSignInChangeUsersMask() {
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
if (m_uiLastSignInData != 0) {
if (iPrimaryPlayer >= 0) {
@ -234,9 +234,9 @@ void NetworkController::signInChangeCallback(void* pParam,
bool bPrimaryPlayerChanged,
unsigned int uiSignInData) {
Game* pApp = (Game*)pParam;
int iPrimaryPlayer = ProfileManager.GetPrimaryPad();
int iPrimaryPlayer = PlatformProfile.GetPrimaryPad();
if ((ProfileManager.GetLockedProfile() != -1) && iPrimaryPlayer != -1) {
if ((PlatformProfile.GetLockedProfile() != -1) && iPrimaryPlayer != -1) {
if (((uiSignInData & (1 << iPrimaryPlayer)) == 0) ||
bPrimaryPlayerChanged) {
pApp->SetAction(iPrimaryPlayer, eAppAction_PrimaryPlayerSignedOut);
@ -251,7 +251,7 @@ void NetworkController::signInChangeCallback(void* pParam,
bool hasGuestIdChanged = false;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
unsigned int guestNumber = 0;
if (ProfileManager.IsSignedIn(i)) {
if (PlatformProfile.IsSignedIn(i)) {
XUSER_SIGNIN_INFO info;
XUserGetSigninInfo(
i, XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY, &info);
@ -274,12 +274,12 @@ void NetworkController::signInChangeCallback(void* pParam,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_GUEST_ORDER_CHANGED_TITLE,
IDS_GUEST_ORDER_CHANGED_TEXT, uiIDA,
1, ProfileManager.GetPrimaryPad());
1, PlatformProfile.GetPrimaryPad());
}
bool switchToOffline = false;
if (!ProfileManager.IsSignedInLive(
ProfileManager.GetLockedProfile()) &&
if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetLockedProfile()) &&
!g_NetworkManager.IsLocalGame()) {
switchToOffline = true;
}
@ -309,7 +309,7 @@ void NetworkController::signInChangeCallback(void* pParam,
if (bPlayerChanged &&
(!bPlayerSignedIn ||
(bPlayerSignedIn &&
!ProfileManager.AreXUIDSEqual(
!PlatformProfile.AreXUIDSEqual(
pApp->m_networkController
.m_currentSigninInfo[i]
.xuid,
@ -338,8 +338,8 @@ void NetworkController::signInChangeCallback(void* pParam,
g_NetworkManager.HandleSignInChange();
} else if (pApp->GetLiveLinkRequired() &&
!ProfileManager.IsSignedInLive(
ProfileManager.GetLockedProfile())) {
!PlatformProfile.IsSignedInLive(
PlatformProfile.GetLockedProfile())) {
{
pApp->SetAction(iPrimaryPlayer,
eAppAction_EthernetDisconnected);
@ -396,7 +396,7 @@ void NetworkController::notificationsCallback(void* pParam,
break;
case XN_LIVE_CONTENT_INSTALLED: {
app.ClearDLCInstalled();
ui.HandleDLCInstalled(ProfileManager.GetPrimaryPad());
ui.HandleDLCInstalled(PlatformProfile.GetPrimaryPad());
} break;
case XN_SYS_STORAGEDEVICESCHANGED: {
} break;
@ -453,7 +453,7 @@ int NetworkController::exitAndJoinFromInviteSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&NetworkController::exitAndJoinFromInviteAndSaveReturned,
pClass);
return 0;
@ -466,13 +466,13 @@ int NetworkController::exitAndJoinFromInviteSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME,
uiIDA, 2, ProfileManager.GetPrimaryPad(),
uiIDA, 2, PlatformProfile.GetPrimaryPad(),
&NetworkController::exitAndJoinFromInviteDeclineSaveReturned,
pClass);
return 0;
}
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_ExitAndJoinFromInviteConfirmed);
}
return 0;

View file

@ -6,7 +6,7 @@
#include "app/common/Game.h"
#include "app/common/Network/GameNetworkManager.h"
#include "minecraft/server/MinecraftServer.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
void SaveManager::setAutosaveTimerTime(int settingValue) {
m_uiAutosaveTimer =
@ -35,7 +35,7 @@ void SaveManager::lock() {
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)true);
}
@ -54,7 +54,7 @@ void SaveManager::unlock() {
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)false);
}

View file

@ -17,7 +17,7 @@
#include "minecraft/client/renderer/entity/EntityRenderer.h"
#include "minecraft/client/renderer/entity/EntityRenderDispatcher.h"
#include "minecraft/world/entity/player/Player.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
SkinManager::SkinManager() : m_xuidNotch(INVALID_XUID) {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
@ -183,7 +183,7 @@ void SkinManager::validateFavoriteSkins(int iPad,
bool SkinManager::isXuidNotch(PlayerUID xuid) {
if (m_xuidNotch != INVALID_XUID && xuid != INVALID_XUID) {
return ProfileManager.AreXUIDSEqual(xuid, m_xuidNotch);
return PlatformProfile.AreXUIDSEqual(xuid, m_xuidNotch);
}
return false;
}

View file

@ -1,6 +1,6 @@
#include "StatTask.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/stats/StatsCounter.h"
@ -14,7 +14,7 @@ StatTask::StatTask(Tutorial* tutorial, int descriptionId,
Minecraft* minecraft = Minecraft::GetInstance();
targetValue =
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) +
minecraft->stats[PlatformProfile.GetPrimaryPad()]->getTotalValue(stat) +
variance;
}
@ -23,7 +23,7 @@ bool StatTask::isCompleted() {
Minecraft* minecraft = Minecraft::GetInstance();
bIsCompleted =
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) >=
minecraft->stats[PlatformProfile.GetPrimaryPad()]->getTotalValue(stat) >=
(unsigned int)targetValue;
return bIsCompleted;
}

View file

@ -7,7 +7,7 @@
#include <compare>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h"
#include "app/common/Tutorial/Constraints/TutorialConstraint.h"
@ -1969,7 +1969,7 @@ Tutorial::~Tutorial() {
void Tutorial::debugResetPlayerSavedProgress(int iPad) {
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(iPad);
memset(pGameSettings->ucTutorialCompletion, 0,
TUTORIAL_PROFILE_STORAGE_BYTES);
pGameSettings->uiSpecialTutorialBitmask = 0;
@ -1994,7 +1994,7 @@ void Tutorial::setCompleted(int completableId) {
completableIndex < TUTORIAL_PROFILE_STORAGE_BITS) {
// Set the bit for this position
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(m_iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(m_iPad);
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);
pGameSettings->ucTutorialCompletion[arrayIndex] |= 1 << bitIndex;
@ -2023,7 +2023,7 @@ bool Tutorial::getCompleted(int completableId) {
// Read the bit for this position
// Retrieve the data pointer from the profile
GAME_SETTINGS* pGameSettings =
(GAME_SETTINGS*)ProfileManager.GetGameDefinedProfileData(m_iPad);
(GAME_SETTINGS*)PlatformProfile.GetGameDefinedProfileData(m_iPad);
int arrayIndex = completableIndex >> 3;
int bitIndex = 7 - (completableIndex % 8);
return (pGameSettings->ucTutorialCompletion[arrayIndex] &

View file

@ -8,7 +8,7 @@
#include <vector>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "minecraft/GameEnums.h"
#include "app/common/Console_Debug_enum.h"
@ -199,7 +199,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) {
// Force a make if the debug is on
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(
ProfileManager.GetPrimaryPad()) &
PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
if (CanBeMadeA[m_iCurrentSlotHIndex].iCount != 0) {
int iSlot = iVSlotIndexA[m_iCurrentSlotVIndex];
@ -907,7 +907,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
unsigned int uiAlpha;
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
uiAlpha = 31;
} else {
@ -1054,7 +1054,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() {
unsigned int uiAlpha;
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
uiAlpha = 31;
} else {
@ -1171,7 +1171,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() {
setCraftingOutputSlotItem(getPad(), pTempItemInst);
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()) &
app.GetGameSettingsDebugMask(PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
setCraftingOutputSlotRedBox(false);
} else {
@ -1212,7 +1212,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() {
// recipe
if (app.DebugSettingsOn() &&
app.GetGameSettingsDebugMask(
ProfileManager.GetPrimaryPad()) &
PlatformProfile.GetPrimaryPad()) &
(1L << eDebugSetting_CraftAnything)) {
setIngredientSlotRedBox(index, false);
} else {

View file

@ -3,7 +3,7 @@
#include <cmath>
#include <memory>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "minecraft/GameEnums.h"
#include "app/linux/LinuxGame.h"
@ -77,10 +77,10 @@ void IUIScene_HUD::updateFrameTick() {
}
SetHudSize(iGuiScale);
SetDisplayName(ProfileManager.GetDisplayName(iPad));
SetDisplayName(PlatformProfile.GetDisplayName(iPad));
SetTooltipsEnabled(((ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) ||
(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
SetTooltipsEnabled(((ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad())) ||
(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_Tooltips) != 0)));
SetActiveSlot(pMinecraft->localplayers[iPad]->inventory->selected);
@ -137,7 +137,7 @@ void IUIScene_HUD::updateFrameTick() {
}
}
unsigned char ucAlpha = app.GetGameSettings(ProfileManager.GetPrimaryPad(),
unsigned char ucAlpha = app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_InterfaceOpacity);
float fVal;

View file

@ -9,7 +9,7 @@
#include <thread>
#include <vector>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
@ -76,7 +76,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
ui.RequestAlertMessage(
IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::WarningTrialTexturePackReturned,
pParam);
@ -96,7 +96,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameAndSaveReturned, pParam);
return 0;
} else {
@ -109,7 +109,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(
uiIDA[1] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(
IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME,
uiIDA, 2, ProfileManager.GetPrimaryPad(),
uiIDA, 2, PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameDeclineSaveReturned, pParam);
return 0;
}
@ -132,7 +132,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
// int32_t saveOrCheckpointId = 0;
// bool validSave =
// StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
// SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(),
// SentientManager.RecordLevelSaveOrCheckpoint(PlatformProfile.GetPrimaryPad(),
// saveOrCheckpointId);
if (pScene) pScene->SetIgnoreInput(true);
MinecraftServer::getInstance()->setSaveOnExit(true);
@ -141,7 +141,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
} else {
// has someone disconnected the ethernet here, causing the pause menu to
// shut?
if (ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) {
if (ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad())) {
unsigned int uiIDA[3];
// you cancelled the save on exit after choosing exit and save? You
// go back to the Exit choices then.
@ -153,12 +153,12 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(
ui.RequestAlertMessage(
IDS_EXIT_GAME,
IDS_CONFIRM_EXIT_GAME_CONFIRM_DISCONNECT_SAVE, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
} else {
ui.RequestAlertMessage(
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
@ -180,7 +180,7 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
} else {
// has someone disconnected the ethernet here, causing the pause menu to
// shut?
if (ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) {
if (ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad())) {
unsigned int uiIDA[3];
// you cancelled the save on exit after choosing exit and save? You
// go back to the Exit choices then.
@ -192,12 +192,12 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(
ui.RequestAlertMessage(
IDS_EXIT_GAME,
IDS_CONFIRM_EXIT_GAME_CONFIRM_DISCONNECT_SAVE, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
} else {
ui.RequestAlertMessage(
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam);
}
}
@ -213,10 +213,10 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(
int IUIScene_PauseMenu::SaveWorldThreadProc(void* lpParameter) {
bool bAutosave = (bool)lpParameter;
if (bAutosave) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_AutoSaveGame);
} else {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SaveGame);
}
@ -230,7 +230,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc(void* lpParameter) {
app.SetGameStarted(false);
while (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) !=
while (app.GetXuiServerAction(PlatformProfile.GetPrimaryPad()) !=
eXuiServerAction_Idle &&
!MinecraftServer::serverHalted()) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
@ -272,7 +272,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
if (pMinecraft->isClientSide() || g_NetworkManager.IsInSession()) {
if (lpParameter != nullptr) {
// 4J-PB - check if we have lost connection to Live
// if (ProfileManager.GetLiveConnectionStatus() !=
// if (PlatformProfile.GetLiveConnectionStatus() !=
// XONLINE_S_LOGON_CONNECTION_ESTABLISHED) {
// exitReasonStringId = IDS_CONNECTION_LOST_LIVE;
// } else {
@ -336,10 +336,10 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
// that is most likely the cause of the disconnection so don't
// display a message box. This will allow the message box requested
// by the libraries to be brought up
if (ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()))
if (PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad()))
ui.RequestErrorMessage(exitReasonTitleId, exitReasonStringId,
uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
// 4J - Force a disconnection, this handles the situation that the
@ -375,7 +375,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
g_NetworkManager.LeaveGame(false);
} else {
if (lpParameter != nullptr &&
ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad())) {
switch (app.GetDisconnectReason()) {
case DisconnectPacket::eDisconnect_Kicked:
exitReasonStringId = IDS_DISCONNECTED_KICKED;
@ -417,7 +417,7 @@ void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(exitReasonTitleId, exitReasonStringId, uiIDA,
1, ProfileManager.GetPrimaryPad());
1, PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
}
}

View file

@ -1,6 +1,6 @@
#pragma once
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "app/common/DLC/DLCPack.h"

View file

@ -1,6 +1,6 @@
#include "UIComponent_Tooltips.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -120,7 +120,7 @@ void UIComponent_Tooltips::tick() {
UIScene::tick();
// set the opacity of the tooltip items
unsigned char ucAlpha = app.GetGameSettings(ProfileManager.GetPrimaryPad(),
unsigned char ucAlpha = app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_InterfaceOpacity);
float fVal;
@ -167,7 +167,7 @@ void UIComponent_Tooltips::tick() {
void UIComponent_Tooltips::render(S32 width, S32 height,
C4JRender::eViewportType viewport) {
if ((ProfileManager.GetLockedProfile() != -1) &&
if ((PlatformProfile.GetLockedProfile() != -1) &&
!ui.GetMenuDisplayed(m_iPad) &&
(app.GetGameSettings(m_iPad, eGameSetting_Tooltips) == 0 ||
app.GetGameSettings(m_iPad, eGameSetting_DisplayHUD) == 0)) {

View file

@ -4,7 +4,7 @@
#include <vector>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
@ -67,12 +67,12 @@ void UIComponent_TutorialPopup::UpdateTutorialPopup() {
// has the Splitscreen Gamertag visibility been changed? Re-Adjust Layout to
// prevent overlaps!
if (m_bSplitscreenGamertagVisible !=
(bool)(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
(bool)(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) !=
0)) {
m_bSplitscreenGamertagVisible =
(bool)(app.GetGameSettings(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) != 0);
handleReload();
}
@ -83,7 +83,7 @@ void UIComponent_TutorialPopup::handleReload() {
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_boolean;
value[0].boolval =
(bool)((app.GetGameSettings(ProfileManager.GetPrimaryPad(),
(bool)((app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) !=
0) &&
!m_bContainerMenuVisible); // 4J - TomK - Offset for splitscreen
@ -232,7 +232,7 @@ void UIComponent_TutorialPopup::_SetDescription(UIScene* interactScene,
// Layout function (so we can offset it to stay clear of the gamertag)
m_bSplitscreenGamertagVisible =
(bool)(app.GetGameSettings(
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) != 0);
IggyDataValue result;
IggyDataValue value[1];

View file

@ -4,7 +4,7 @@
#include <algorithm>
#include <memory>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Components/UIComponent_Chat.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -169,7 +169,7 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion* region) {
std::shared_ptr<ItemInstance> item = invSlot->getItem();
if (item != nullptr) {
unsigned char ucAlpha = app.GetGameSettings(
ProfileManager.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
PlatformProfile.GetPrimaryPad(), eGameSetting_InterfaceOpacity);
float fVal;
if (ucAlpha < 80) {
@ -257,12 +257,12 @@ void UIScene_HUD::handleReload() {
}
SetHudSize(iGuiScale);
SetDisplayName(ProfileManager.GetDisplayName(m_iPad));
SetDisplayName(PlatformProfile.GetDisplayName(m_iPad));
repositionHud();
SetTooltipsEnabled(((ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) ||
(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
SetTooltipsEnabled(((ui.GetMenuDisplayed(PlatformProfile.GetPrimaryPad())) ||
(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_Tooltips) != 0)));
}

View file

@ -5,7 +5,7 @@
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -116,7 +116,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) {
else if (m_data->endZ < 0 && m_data->endZ % 2 == 0)
m_data->endZ += 1;
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_ExportSchematic,
(void*)m_data);

View file

@ -6,7 +6,7 @@
#include <memory>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h"
@ -199,17 +199,17 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) {
// app.SetXuiServerAction(m_iPad, eXuiServerAction_DropItem, (void
// *)m_itemIds[id]);
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(GiveItemCommand::preparePacket(
std::dynamic_pointer_cast<Player>(
Minecraft::GetInstance()
->localplayers[ProfileManager.GetPrimaryPad()]),
->localplayers[PlatformProfile.GetPrimaryPad()]),
m_itemIds[id]));
} break;
case eControl_Mobs: {
int id = childId;
if (id < m_mobFactories.size()) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SpawnMob,
(void*)m_mobFactories[id]);
}
@ -217,50 +217,50 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) {
case eControl_Enchantments: {
int id = childId;
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(EnchantItemCommand::preparePacket(
std::dynamic_pointer_cast<Player>(
Minecraft::GetInstance()
->localplayers[ProfileManager.GetPrimaryPad()]),
->localplayers[PlatformProfile.GetPrimaryPad()]),
m_enchantmentIdAndLevels[id].first,
m_enchantmentIdAndLevels[id].second));
} break;
case eControl_Schematic: {
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DebugCreateSchematic, nullptr,
eUILayer_Debug);
#endif
} break;
case eControl_SetCamera: {
#ifndef _CONTENT_PACKAGE
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DebugSetCamera, nullptr,
eUILayer_Debug);
#endif
} break;
case eControl_Rain: {
// app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleRain);
// app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),eXuiServerAction_ToggleRain);
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(ToggleDownfallCommand::preparePacket());
} break;
case eControl_Thunder:
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_ToggleThunder);
break;
case eControl_ResetTutorial:
Tutorial::debugResetPlayerSavedProgress(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
break;
case eControl_SetDay: {
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(TimeCommand::preparePacket(false));
} break;
case eControl_SetNight: {
ClientConnection* conn = Minecraft::GetInstance()->getConnection(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
conn->send(TimeCommand::preparePacket(true));
} break;
};

View file

@ -7,7 +7,7 @@
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -109,7 +109,7 @@ void UIScene_DebugSetCamera::handleInput(int iPad, int key, bool repeat,
void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_Teleport:
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_SetCameraLocation,
(void*)currentPosition);
break;

View file

@ -4,7 +4,7 @@
#include <cstdint>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
@ -228,7 +228,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) {
// Give the player a warning about the texture pack missing
ui.RequestErrorMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 3,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
& : TexturePackDialogReturned, this);
// do set the texture pack id, and on the user pressing create world,
@ -258,7 +258,7 @@ int IUIScene_StartGame::UnlockTexturePackReturned(
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
if (result == C4JStorage::EMessage_ResultAccept) {
if (ProfileManager.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedIn(iPad)) {
// the license change coming in when the offer has been installed
// will cause this scene to refresh
}

View file

@ -9,7 +9,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
@ -112,8 +112,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
m_pDLCPack = nullptr;
m_bRebuildTouchBoxes = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(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 =
@ -125,9 +125,9 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
// create, but this matches the behaviour of load game, and lets the player
// know why they can't play online, instead of just greying out the online
// setting in the More Options #ifdef 0
// if(ProfileManager.IsSignedInLive( m_iPad ))
// if(PlatformProfile.IsSignedInLive( m_iPad ))
// {
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// PlatformProfile.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// }
// #endif
@ -159,7 +159,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
m_checkboxOnline.SetEnable(true);
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_iPad) == false) {
m_checkboxOnline.SetEnable(false);
}
@ -438,7 +438,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
// Give the player a warning about the texture pack missing
ui.RequestAlertMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&TexturePackDialogReturned, this);
return;
}
@ -483,7 +483,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
if(!ProfileManager.IsSignedInLive(m_iPad))
if(!PlatformProfile.IsSignedInLive(m_iPad))
{
// need to be signed in to live
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
@ -531,8 +531,8 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) {
switch (id) {
case GAME_CREATE_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
@ -574,21 +574,21 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack) {
void UIScene_CreateWorldMenu::checkStateAndStartGame() {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
bool isSignedInLive = true;
bool isOnlineGame = m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; i++) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
(i == primaryPad || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive = isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -599,7 +599,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
uiIDA, 1, ProfileManager.GetPrimaryPad());
uiIDA, 1, PlatformProfile.GetPrimaryPad());
return;
}
@ -623,22 +623,22 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
// the sign-in UI again
int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
// Check if user-created content is allowed, as we cannot play
// multiplayer if it's not
// bool isClientSide =
// ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
// PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
// m_MoreOptionsParams.bOnlineGame;
bool noUGC = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
bool bContentRestricted = false;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
noUGC = !pccAllowed && !pccFriendsAllowed;
@ -655,15 +655,15 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() {
m_bIgnoreInput = false;
ui.RequestContentRestrictedMessageBox();
} else {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&CScene_MultiGameCreate::StartGame_SignInReturned,
// this,ProfileManager.GetPrimaryPad());
// this,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [this](bool bContinue, int pad) {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
} else {
@ -694,7 +694,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
#endif
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool isPrivate = pClass->m_MoreOptionsParams.bInviteOnly ? true : false;
@ -894,33 +894,33 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
if (bContinue == true) {
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(pClass->m_iPad)) {
if (PlatformProfile.IsSignedIn(pClass->m_iPad)) {
bool isOnlineGame =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
// bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
bool noPrivileges = false;
int localUsersMask = 0;
bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad);
bool isSignedInLive = PlatformProfile.IsSignedInLive(primaryPad);
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable =
app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == primaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
if (!ProfileManager.AllowedToPlayMultiplayer(i))
if (!PlatformProfile.AllowedToPlayMultiplayer(i))
noPrivileges = true;
localUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(i);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -932,7 +932,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -942,8 +942,8 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -955,7 +955,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnoreInput = false;
unsigned int uiIDA[1];
@ -963,7 +963,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void* pParam,
ui.RequestAlertMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
} else {
// This is NOT called from a storage manager thread, and is in
@ -983,40 +983,40 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(
if (result == C4JStorage::EMessage_ResultAccept) {
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
// 4J Stu - If we only have one controller connected, then don't show
// the sign-in UI again
int connectedControllers = 0;
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))
if (PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))
++connectedControllers;
}
if (isClientSide && app.IsLocalMultiplayerAvailable()) {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&UIScene_CreateWorldMenu::StartGame_SignInReturned,
// pClass,ProfileManager.GetPrimaryPad());
// pClass,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [pClass](bool bContinue, int pad) {
return StartGame_SignInReturned(pClass, bContinue, pad);
};
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
} else {
// Check if user-created content is allowed, as we cannot play
// multiplayer if it's not
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool noUGC = false;
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -1027,7 +1027,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
CreateGame(pClass, 0);
}

View file

@ -6,7 +6,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_Button.h"
@ -46,7 +46,7 @@ UIScene_EULA::UIScene_EULA(int iPad, void* initData, UILayer* parentLayer)
// 4J-PB - If we have a signed in user connected, let's get the DLC now
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if ((PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) {
if ((PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))) {
if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) {
app.StartInstallDLCProcess(i);
break;

View file

@ -6,7 +6,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
@ -293,15 +293,15 @@ void UIScene_JoinMenu::StartSharedLaunchFlow() {
if (!app.IsLocalMultiplayerAvailable()) {
JoinGame(this);
} else {
// ProfileManager.RequestSignInUI(false, false, false, true,
// PlatformProfile.RequestSignInUI(false, false, false, true,
// false,&UIScene_JoinMenu::StartGame_SignInReturned,
// this,ProfileManager.GetPrimaryPad());
// this,PlatformProfile.GetPrimaryPad());
SignInInfo info;
info.Func = [this](bool bContinue, int pad) {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = true;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
}
@ -315,7 +315,7 @@ int UIScene_JoinMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
}
if (bContinue == true && pClass != nullptr &&
ProfileManager.IsSignedIn(iPad)) {
PlatformProfile.IsSignedIn(iPad)) {
JoinGame(pClass);
}
@ -336,35 +336,35 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
bool isSignedInLive = true;
int iPadNotSignedInLive = -1;
ProfileManager.SetLockedProfile(0); // TEMP!
PlatformProfile.SetLockedProfile(0); // TEMP!
// If we're in SD mode, then only the primary player gets to play
if (app.IsLocalMultiplayerAvailable()) {
for (unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) {
if (ProfileManager.IsSignedIn(index)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(index)) {
if (PlatformProfile.IsSignedIn(index)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(index)) {
// Record the first non signed in live pad
iPadNotSignedInLive = index;
}
if (!ProfileManager.AllowedToPlayMultiplayer(index))
if (!PlatformProfile.AllowedToPlayMultiplayer(index))
noPrivileges = true;
dwLocalUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(index);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(index);
isSignedInLive && PlatformProfile.IsSignedInLive(index);
}
}
} else {
if (ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) {
if (!ProfileManager.AllowedToPlayMultiplayer(
ProfileManager.GetPrimaryPad()))
if (PlatformProfile.IsSignedIn(PlatformProfile.GetPrimaryPad())) {
if (!PlatformProfile.AllowedToPlayMultiplayer(
PlatformProfile.GetPrimaryPad()))
noPrivileges = true;
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
isSignedInLive =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad());
}
}
@ -377,7 +377,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
return;
}
@ -388,8 +388,8 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
if (noUGC) {
@ -408,7 +408,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
CGameNetworkManager::eJoinGameResult result = g_NetworkManager.JoinGame(
pClass->m_selectedSession, dwLocalUsersMask);
@ -434,7 +434,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_CONNECTION_FAILED,
exitReasonStringId, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
ui.NavigateToHomeMenu();

View file

@ -6,7 +6,7 @@
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
@ -74,8 +74,8 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(
#endif
m_bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_params->iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.IsSignedInLive(m_params->iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
bool bOnlineGame, bInviteOnly, bAllowFriendsOfFriends;
bOnlineGame = m_params->bOnlineGame;
@ -83,7 +83,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(
bAllowFriendsOfFriends = m_params->bAllowFriendsOfFriends;
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_params->iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_params->iPad) == false) {
m_checkboxes[eLaunchCheckbox_Online].SetEnable(false);
}
@ -263,8 +263,8 @@ void UIScene_LaunchMoreOptionsMenu::tick() {
UIScene::tick();
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_params->iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.IsSignedInLive(m_params->iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
m_checkboxes[eLaunchCheckbox_Online].SetEnable(bMultiplayerAllowed);
@ -520,9 +520,9 @@ void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id) {
case GAME_CREATE_ONLINE_TIMER_ID:
{
bool bMultiplayerAllowed
= ProfileManager.IsSignedInLive(m_params->iPad)
= PlatformProfile.IsSignedInLive(m_params->iPad)
&&
ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
PlatformProfile.AllowedToPlayMultiplayer(m_params->iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed)
{

View file

@ -9,7 +9,7 @@
#include <memory>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/Leaderboards/LeaderboardInterface.h"
#include "app/common/Leaderboards/LeaderboardManager.h"
@ -375,7 +375,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) {
} break;
case IPlatformLeaderboard::eFM_MyScore: {
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(), &uid, true);
PlatformProfile.GetXUID(PlatformProfile.GetPrimaryPad(), &uid, true);
m_interface.ReadStats_MyScore(
this, m_currentDifficulty,
(IPlatformLeaderboard::EStatsType)m_currentLeaderboard,
@ -383,7 +383,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) {
} break;
case IPlatformLeaderboard::eFM_Friends: {
PlayerUID uid;
ProfileManager.GetXUID(ProfileManager.GetPrimaryPad(), &uid, true);
PlatformProfile.GetXUID(PlatformProfile.GetPrimaryPad(), &uid, true);
m_interface.ReadStats_Friends(
this, m_currentDifficulty,
(IPlatformLeaderboard::EStatsType)m_currentLeaderboard,

View file

@ -6,7 +6,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
@ -123,8 +123,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void* initData,
m_seed = 0;
m_bIsCorrupt = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(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 =
@ -159,7 +159,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void* initData,
m_checkboxOnline.SetEnable(true);
// 4J-PB - to stop an offline game being able to select the online flag
if (ProfileManager.IsSignedInLive(m_iPad) == false) {
if (PlatformProfile.IsSignedInLive(m_iPad) == false) {
m_checkboxOnline.SetEnable(false);
}
@ -447,7 +447,7 @@ void UIScene_LoadMenu::tick() {
return StartGame_SignInReturned(this, bContinue, pad);
};
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_QuadrantSignin, &info);
}
@ -574,7 +574,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() {
// Give the player a warning about the texture pack missing
ui.RequestAlertMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
&TexturePackDialogReturned, this);
return;
}
@ -619,7 +619,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() {
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
if(!ProfileManager.IsSignedInLive(m_iPad))
if(!PlatformProfile.IsSignedInLive(m_iPad))
{
// need to be signed in to live
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE,
@ -689,8 +689,8 @@ void UIScene_LoadMenu::handleTimerComplete(int id) {
switch (id) {
case GAME_CREATE_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
@ -917,22 +917,22 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)pParam;
if (!pClass->m_bIsCorrupt) {
int iPrimaryPad = ProfileManager.GetPrimaryPad();
int iPrimaryPad = PlatformProfile.GetPrimaryPad();
bool isSignedInLive = true;
bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == iPrimaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -944,7 +944,7 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -954,8 +954,8 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
bool pccAllowed = true;
bool pccFriendsAllowed = true;
bool bContentRestricted = false;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
noUGC = !pccAllowed && !pccFriendsAllowed;
@ -974,7 +974,7 @@ int UIScene_LoadMenu::LoadDataComplete(void* pParam) {
pClass->m_bIgnoreInput = false;
} else {
int localUsersMask = CGameNetworkManager::GetLocalPlayerMask(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
// No guest problems so we don't need to force a sign-in of
// players here
@ -1073,7 +1073,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass,
}
bool isClientSide =
ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) &&
PlatformProfile.IsSignedInLive(PlatformProfile.GetPrimaryPad()) &&
pClass->m_MoreOptionsParams.bOnlineGame;
bool isPrivate =
@ -1176,7 +1176,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass,
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1202,30 +1202,30 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
if (bContinue == true) {
// It's possible that the player has not signed in - they can back out
if (ProfileManager.IsSignedIn(pClass->m_iPad)) {
int primaryPad = ProfileManager.GetPrimaryPad();
if (PlatformProfile.IsSignedIn(pClass->m_iPad)) {
int primaryPad = PlatformProfile.GetPrimaryPad();
bool noPrivileges = false;
int localUsersMask = 0;
bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad);
bool isSignedInLive = PlatformProfile.IsSignedInLive(primaryPad);
bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame;
int iPadNotSignedInLive = -1;
bool isLocalMultiplayerAvailable =
app.IsLocalMultiplayerAvailable();
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) &&
if (PlatformProfile.IsSignedIn(i) &&
((i == primaryPad) || isLocalMultiplayerAvailable)) {
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) {
if (isSignedInLive && !PlatformProfile.IsSignedInLive(i)) {
// Record the first non signed in live pad
iPadNotSignedInLive = i;
}
if (!ProfileManager.AllowedToPlayMultiplayer(i))
if (!PlatformProfile.AllowedToPlayMultiplayer(i))
noPrivileges = true;
localUsersMask |=
CGameNetworkManager::GetLocalPlayerMask(i);
isSignedInLive =
isSignedInLive && ProfileManager.IsSignedInLive(i);
isSignedInLive && PlatformProfile.IsSignedInLive(i);
}
}
@ -1237,7 +1237,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestAlertMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
return 0;
}
@ -1247,8 +1247,8 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
bool pccAllowed = true;
bool pccFriendsAllowed = true;
ProfileManager.AllowedPlayerCreatedContent(
ProfileManager.GetPrimaryPad(), false, &pccAllowed,
PlatformProfile.AllowedPlayerCreatedContent(
PlatformProfile.GetPrimaryPad(), false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
@ -1261,7 +1261,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
ui.RequestAlertMessage(
IDS_FAILED_TO_CREATE_GAME_TITLE,
IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnoreInput = false;
pClass->setVisible(true);
@ -1270,7 +1270,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void* pParam, bool bContinue,
ui.RequestAlertMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
}
} else {
// This is NOT called from a storage manager thread, and is in

View file

@ -8,7 +8,7 @@
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
@ -115,8 +115,8 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void* initData,
m_bSaveTransferInProgress = false;
m_eAction = eAction_None;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
int iLB = -1;
@ -226,7 +226,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() {
// available
// if(app.getRemoteStorage()->saveIsAvailable())
{
bool bSignedInLive = ProfileManager.IsSignedInLive(m_iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(m_iPad);
if (bSignedInLive) {
iX = IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD;
}
@ -296,8 +296,8 @@ void UIScene_LoadOrJoinMenu::handleGainFocus(bool navBack) {
if (navBack) {
app.SetLiveLinkRequired(true);
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
m_bMultiplayerAllowed = PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
// re-enable button presses
m_bIgnoreInput = false;
@ -704,7 +704,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
// Save Transfer
#if defined(SONY_REMOTE_STORAGE_DOWNLOAD)
{
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
if (bSignedInLive) {
LaunchSaveTransfer();
}
@ -742,8 +742,8 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat,
uiIDA[2] = IDS_TOOLTIPS_DELETESAVE;
int numOptions = 3;
#if defined(SONY_REMOTE_STORAGE_UPLOAD)
if (ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
numOptions = 4;
uiIDA[3] = IDS_TOOLTIPS_SAVETRANSFER_UPLOAD;
}
@ -911,7 +911,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) {
params->saveDetails = nullptr;
// navigate to the settings scene
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadMenu, params);
}
} else {
@ -937,7 +937,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) {
{
// navigate to the settings scene
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadMenu, params);
}
}
@ -1011,7 +1011,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) {
m_controlJoinTimer.setVisible(false);
m_bIgnoreInput = true;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_JoinMenu,
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(), eUIScene_JoinMenu,
m_initData);
}
}
@ -1068,7 +1068,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions* levelGen) {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1264,8 +1264,8 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id) {
switch (id) {
case JOIN_LOAD_ONLINE_TIMER_ID: {
bool bMultiplayerAllowed =
ProfileManager.IsSignedInLive(m_iPad) &&
ProfileManager.AllowedToPlayMultiplayer(m_iPad);
PlatformProfile.IsSignedInLive(m_iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(m_iPad);
if (bMultiplayerAllowed != m_bMultiplayerAllowed) {
if (bMultiplayerAllowed) {
// m_CheckboxOnline.SetEnable(true);
@ -1336,7 +1336,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1401,7 +1401,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() {
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}
@ -1680,7 +1680,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
ui.RequestAlertMessage(
IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_WRONG_VERSION, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
RemoteSaveNotFoundCallback, pClass);
}
} else {
@ -1691,7 +1691,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
ui.RequestAlertMessage(
IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_NOT_AVAILABLE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
RemoteSaveNotFoundCallback, pClass);
}
}
@ -1988,7 +1988,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
// player
ui.RequestErrorMessage(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE,
uiIDA, 1, ProfileManager.GetPrimaryPad(),
uiIDA, 1, PlatformProfile.GetPrimaryPad(),
CrossSaveFinishedCallback, pClass);
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
} break;
@ -2071,14 +2071,14 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
uint32_t errorMessage = IDS_SAVE_TRANSFER_DOWNLOADFAILED;
if (!ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
errorMessage =
IDS_ERROR_NETWORK; // show "A network error has
// occurred."
#if defined(__VITA__)
if (!ProfileManager.IsSignedInPSN(
ProfileManager.GetPrimaryPad())) {
if (!PlatformProfile.IsSignedInPSN(
PlatformProfile.GetPrimaryPad())) {
errorMessage =
IDS_PRO_NOTONLINE_TEXT; // show "not signed
// into PSN"
@ -2087,7 +2087,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc(void* lpParameter) {
}
ui.RequestErrorMessage(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD,
errorMessage, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
CrossSaveFinishedCallback, pClass);
pClass->m_eSaveTransferState = eSaveTransfer_Finished;
}

View file

@ -8,7 +8,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/App_Defines.h"
#include "minecraft/GameEnums.h"
@ -145,13 +145,13 @@ void UIScene_MainMenu::handleGainFocus(bool navBack) {
if (!navBack) {
for (int iPad = 0; iPad < MAX_LOCAL_PLAYERS; iPad++) {
// For returning to menus after exiting a game.
if (ProfileManager.IsSignedIn(iPad)) {
ProfileManager.SetCurrentGameActivity(
if (PlatformProfile.IsSignedIn(iPad)) {
PlatformProfile.SetCurrentGameActivity(
iPad, CONTEXT_PRESENCE_MENUS, false);
}
}
}
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
m_bIgnorePress = false;
updateTooltips();
@ -214,8 +214,8 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
switch (key) {
case ACTION_MENU_OK:
if (pressed) {
ProfileManager.SetPrimaryPad(iPad);
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetPrimaryPad(iPad);
PlatformProfile.SetLockedProfile(-1);
sendInputToMovie(key, repeat, pressed, released);
}
break;
@ -228,7 +228,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
}
void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
int primaryPad = ProfileManager.GetPrimaryPad();
int primaryPad = PlatformProfile.GetPrimaryPad();
std::function<int(bool, int)> signInReturnedFunc;
@ -294,9 +294,9 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) {
// Note: if no sign in returned func, assume this isn't required
if (signInReturnedFunc) {
if (ProfileManager.IsSignedIn(primaryPad)) {
if (PlatformProfile.IsSignedIn(primaryPad)) {
if (confirmUser) {
ProfileManager.RequestSignInUI(false, false, true, false, true,
PlatformProfile.RequestSignInUI(false, false, true, false, true,
signInReturnedFunc,
primaryPad);
} else {
@ -403,7 +403,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
// in the list
switch (pClass->m_eAction) {
case eAction_RunGame:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, true, false, false, true,
[pClass](bool b, int p) {
return CreateLoad_SignInReturned(pClass, b, p);
@ -411,7 +411,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunHelpAndOptions:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return HelpAndOptions_SignInReturned(pClass, b, p);
@ -419,7 +419,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunLeaderboards:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return Leaderboards_SignInReturned(pClass, b, p);
@ -427,7 +427,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunAchievements:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return Achievements_SignInReturned(pClass, b, p);
@ -435,7 +435,7 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
iPad);
break;
case eAction_RunUnlockOrDLC:
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, true, false, true,
[pClass](bool b, int p) {
return UnlockFullGame_SignInReturned(pClass, b, p);
@ -448,11 +448,11 @@ int UIScene_MainMenu::MustSignInReturned(void* pParam, int iPad,
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -468,14 +468,14 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void* pParam,
if (bContinue) {
// 4J-JEV: Don't we only need to update rich-presence if the sign-in
// status changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
#if TO_BE_IMPLEMENTED
if (app.GetTMSDLCInfoRead())
#endif
{
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
}
#if TO_BE_IMPLEMENTED
@ -500,11 +500,11 @@ int UIScene_MainMenu::HelpAndOptions_SignInReturned(void* pParam,
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -520,24 +520,24 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
unsigned int uiIDA[1] = {IDS_OK};
if (ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsGuest(PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
// change the minecraft player name
Minecraft::GetInstance()->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
{
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
// Check if we're signed in to LIVE
if (bSignedInLive) {
@ -545,7 +545,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
if (!app.DLCInstallProcessCompleted())
app.StartInstallDLCProcess(iPad);
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA,
@ -564,14 +564,14 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
// check for DLC
// start timer to track DLC check finished
pClass->m_Timer.SetShow(true);
XuiSetTimer(pClass->m_hObj,
DLC_INSTALLED_TIMER_ID,
DLC_INSTALLED_TIMER_TIME);
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_MultiGameJoinLoad);
}
} else {
// Changing to async TMS calls
@ -595,29 +595,29 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
#else
Minecraft* pMinecraft = Minecraft::GetInstance();
pMinecraft->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
} else {
#if TO_BE_IMPLEMENTED
// offline
ProfileManager.DisplayOfflineProfile(
PlatformProfile.DisplayOfflineProfile(
[pClass](bool b, int p) {
return CScene_Main::CreateLoad_OfflineProfileReturned(
pClass, b, p);
},
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
#else
app.DebugPrintf(
"Offline Profile returned not implemented\n");
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
@ -627,11 +627,11 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void* pParam, bool bContinue,
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -646,18 +646,18 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void* pParam, bool bContinue,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
unsigned int uiIDA[1] = {IDS_OK};
// guests can't look at leaderboards
if (ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) {
if (PlatformProfile.IsGuest(PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else if (!ProfileManager.IsSignedInLive(
ProfileManager.GetPrimaryPad())) {
} else if (!PlatformProfile.IsSignedInLive(
PlatformProfile.GetPrimaryPad())) {
pClass->m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1);
@ -672,22 +672,22 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void* pParam, bool bContinue,
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE,
IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
#endif
} else {
ProfileManager.SetLockedProfile(ProfileManager.GetPrimaryPad());
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(PlatformProfile.GetPrimaryPad());
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LeaderboardsMenu);
}
}
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -703,18 +703,18 @@ int UIScene_MainMenu::Achievements_SignInReturned(void* pParam, bool bContinue,
pClass->m_bIgnorePress = false;
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
// XShowAchievementsUI(ProfileManager.GetPrimaryPad());
// XShowAchievementsUI(PlatformProfile.GetPrimaryPad());
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -729,18 +729,18 @@ int UIScene_MainMenu::UnlockFullGame_SignInReturned(void* pParam,
if (bContinue) {
// 4J-JEV: We only need to update rich-presence if the sign-in status
// changes.
ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
PlatformProfile.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS,
false);
pClass->RunUnlockOrDLC(iPad);
} else {
pClass->m_bIgnorePress = false;
// unlock the profile
ProfileManager.SetLockedProfile(-1);
PlatformProfile.SetLockedProfile(-1);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
// if the user is valid, we should set the presence
if (ProfileManager.IsSignedIn(i)) {
ProfileManager.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
if (PlatformProfile.IsSignedIn(i)) {
PlatformProfile.SetCurrentGameActivity(i, CONTEXT_PRESENCE_MENUS,
false);
}
}
@ -770,7 +770,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
app.ReleaseSaveThumbnail();
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
@ -778,23 +778,23 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
// 4J-PB - Need to check for installed DLC
if (!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(iPad);
{
// are we offline?
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
bool bSignedInLive = PlatformProfile.IsSignedInLive(iPad);
if (!bSignedInLive) {
ProfileManager.SetLockedProfile(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
} else {
#if TO_BE_IMPLEMENTED
@ -809,8 +809,8 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
&CScene_Main::DeviceSelectReturned, this) == true) {
// change the minecraft player name
pMinecraft->user->name =
convStringToWstring(ProfileManager.GetGamertag(
ProfileManager.GetPrimaryPad()));
convStringToWstring(PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad()));
// save device already selected
// ensure we've applied this player's settings
@ -841,12 +841,12 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
}
#else
pMinecraft->user->name = convStringToWstring(
ProfileManager.GetGamertag(ProfileManager.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()));
// ensure we've applied this player's settings
app.ApplyGameSettingsChanged(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_LoadOrJoinMenu);
#endif
}
@ -859,10 +859,10 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) {
uiIDA[0] = IDS_OK;
// guests can't look at leaderboards
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else if (!ProfileManager.IsSignedInLive(iPad)) {
} else if (!PlatformProfile.IsSignedInLive(iPad)) {
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT,
uiIDA, 1);
} else {
@ -885,14 +885,14 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(
IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad(), nullptr, this);
PlatformProfile.GetPrimaryPad(), nullptr, this);
#endif
} else {
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
proceedToScene(iPad, eUIScene_LeaderboardsMenu);
}
@ -903,8 +903,8 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
uiIDA[0] = IDS_OK;
// downloadable content
if (ProfileManager.IsSignedInLive(iPad)) {
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsSignedInLive(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
m_bIgnorePress = false;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
@ -912,7 +912,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
// If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get
// this to happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
{
bool bContentRestricted = false;
@ -925,12 +925,12 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_ONLINE_SERVICE_TITLE,
IDS_CONTENT_RESTRICTION, uiIDA, 1,
ProfileManager.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(),
nullptr, this);
#endif
} else {
ProfileManager.SetLockedProfile(iPad);
proceedToScene(ProfileManager.GetPrimaryPad(),
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_DLCMainMenu);
}
}
@ -941,7 +941,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
// We want to navigate to the DLC scene, but block input until
// we get the DLC file in from TMS Don't navigate - we might
// have an uplink disconnect
// app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DLCMainMenu);
// app.NavigateToScene(PlatformProfile.GetPrimaryPad(),eUIScene_DLCMainMenu);
}
} else {
unsigned int uiIDA[1];
@ -976,7 +976,7 @@ void UIScene_MainMenu::tick() {
#endif
if ((eNavigateWhenReady >= 0)) {
int lockedProfile = ProfileManager.GetLockedProfile();
int lockedProfile = PlatformProfile.GetLockedProfile();
{
app.DebugPrintf("[MainMenu] Navigating away from MainMenu.\n");
@ -992,7 +992,7 @@ void UIScene_MainMenu::RunAchievements(int iPad) {
uiIDA[0] = IDS_OK;
// guests can't look at achievements
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1);
} else {
@ -1002,7 +1002,7 @@ void UIScene_MainMenu::RunAchievements(int iPad) {
}
void UIScene_MainMenu::RunHelpAndOptions(int iPad) {
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestErrorMessage(IDS_PRO_GUESTPROFILE_TITLE,
@ -1011,14 +1011,14 @@ void UIScene_MainMenu::RunHelpAndOptions(int iPad) {
// If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to
// happen
ProfileManager.QuerySigninStatus();
PlatformProfile.QuerySigninStatus();
#if TO_BE_IMPLEMENTED
// 4J-PB - You can be offline and still can go into help and options
if (app.GetTMSDLCInfoRead() || !ProfileManager.IsSignedInLive(iPad))
if (app.GetTMSDLCInfoRead() || !PlatformProfile.IsSignedInLive(iPad))
#endif
{
ProfileManager.SetLockedProfile(iPad);
PlatformProfile.SetLockedProfile(iPad);
proceedToScene(iPad, eUIScene_HelpAndOptionsMenu);
}
#if TO_BE_IMPLEMENTED
@ -1087,12 +1087,12 @@ void UIScene_MainMenu::LoadTrial(void) {
completionData->bShowBackground = true;
completionData->bShowLogo = true;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = ProfileManager.GetPrimaryPad();
completionData->iPad = PlatformProfile.GetPrimaryPad();
loadingParams->completionData = completionData;
ui.ShowTrialTimer(true);
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_FullscreenProgress, loadingParams);
}

View file

@ -4,7 +4,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -39,7 +39,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void* initData,
// 4J-PB - If we have a signed in user connected, let's get the DLC now
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if ((PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) {
if ((PlatformInput.IsPadConnected(i) || PlatformProfile.IsSignedIn(i))) {
if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) {
app.StartInstallDLCProcess(i);
break;

View file

@ -2,7 +2,7 @@
#include "UIScene_TrialExitUpsell.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_Defines.h"
#include "app/common/UI/UIScene.h"
#include "app/linux/LinuxGame.h"
@ -49,7 +49,7 @@ void UIScene_TrialExitUpsell::handleInput(int iPad, int key, bool repeat,
}
break;
case ACTION_MENU_X:
if (ProfileManager.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedIn(iPad)) {
// CD - Added for audio
ui.PlayUISFX(eSFX_Press);
}

View file

@ -2,7 +2,7 @@
#include "UIScene_HelpAndOptionsMenu.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
@ -47,7 +47,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData,
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
// any content to be re-installed?
if (m_iPad == ProfileManager.GetPrimaryPad() && bNotInGame) {
if (m_iPad == PlatformProfile.GetPrimaryPad() && bNotInGame) {
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
} else {
@ -61,7 +61,7 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void* initData,
#if TO_BE_IMPLEMENTED
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad, false);
#endif
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_HAO_REINSTALL], false);
}
}
@ -117,7 +117,7 @@ void UIScene_HelpAndOptionsMenu::handleReload() {
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
// any content to be re-installed?
if (m_iPad == ProfileManager.GetPrimaryPad() && bNotInGame) {
if (m_iPad == PlatformProfile.GetPrimaryPad() && bNotInGame) {
// We should show the reinstall menu
app.DebugPrintf("Reinstall Menu required...\n");
} else {
@ -131,7 +131,7 @@ void UIScene_HelpAndOptionsMenu::handleReload() {
#if TO_BE_IMPLEMENTED
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad, false);
#endif
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_HAO_REINSTALL], false);
}
}

View file

@ -3,7 +3,7 @@
#include <wchar.h>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
#include "app/common/UI/Controls/UIControl_CheckBox.h"
@ -51,7 +51,7 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad,
doHorizontalResizeCheck();
bool bInGame = (Minecraft::GetInstance()->level != nullptr);
bool bIsPrimaryPad = (ProfileManager.GetPrimaryPad() == m_iPad);
bool bIsPrimaryPad = (PlatformProfile.GetPrimaryPad() == m_iPad);
// if we're not in the game, we need to use basescene 0
if (bInGame) {
// If the game has started, then you need to be the host to change the

View file

@ -2,7 +2,7 @@
#include "UIScene_SettingsMenu.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/UILayer.h"
#include "app/common/UI/UIScene.h"
@ -28,7 +28,7 @@ UIScene_SettingsMenu::UIScene_SettingsMenu(int iPad, void* initData,
m_buttons[BUTTON_ALL_RESETTODEFAULTS].init(IDS_RESET_TO_DEFAULTS,
BUTTON_ALL_RESETTODEFAULTS);
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_ALL_AUDIO], bNotInGame);
removeControl(&m_buttons[BUTTON_ALL_GRAPHICS], bNotInGame);
}
@ -55,7 +55,7 @@ std::wstring UIScene_SettingsMenu::getMoviePath() {
void UIScene_SettingsMenu::handleReload() {
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
if (ProfileManager.GetPrimaryPad() != m_iPad) {
if (PlatformProfile.GetPrimaryPad() != m_iPad) {
removeControl(&m_buttons[BUTTON_ALL_AUDIO], bNotInGame);
removeControl(&m_buttons[BUTTON_ALL_GRAPHICS], bNotInGame);
}
@ -151,7 +151,7 @@ int UIScene_SettingsMenu::ResetDefaultsDialogReturned(
// results switched for this dialog
if (result == C4JStorage::EMessage_ResultDecline) {
app.SetDefaultOptions(
ProfileManager.GetDashboardProfileSettings(pClass->m_iPad),
PlatformProfile.GetDashboardProfileSettings(pClass->m_iPad),
pClass->m_iPad);
// if the profile data has been changed, then force a profile write
// It seems we're allowed to break the 5 minute rule if it's the result

View file

@ -4,7 +4,7 @@
#include <wchar.h>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
@ -114,7 +114,7 @@ UIScene_SettingsOptionsMenu::UIScene_SettingsOptionsMenu(int iPad,
bool bRemoveInGameGamertags = false;
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
bool bPrimaryPlayer = ProfileManager.GetPrimaryPad() == m_iPad;
bool bPrimaryPlayer = PlatformProfile.GetPrimaryPad() == m_iPad;
if (!bPrimaryPlayer) {
bRemoveDifficulty = true;
bRemoveAutosave = true;
@ -318,7 +318,7 @@ void UIScene_SettingsOptionsMenu::handleReload() {
bool bRemoveInGameGamertags = false;
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
bool bPrimaryPlayer = ProfileManager.GetPrimaryPad() == m_iPad;
bool bPrimaryPlayer = PlatformProfile.GetPrimaryPad() == m_iPad;
if (!bPrimaryPlayer) {
bRemoveDifficulty = true;
bRemoveAutosave = true;

View file

@ -4,7 +4,7 @@
#include <wchar.h>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/UI/Controls/UIControl_CheckBox.h"
#include "app/common/UI/Controls/UIControl_Slider.h"
@ -63,7 +63,7 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void* initData,
doHorizontalResizeCheck();
bool bInGame = (Minecraft::GetInstance()->level != nullptr);
bool bPrimaryPlayer = ProfileManager.GetPrimaryPad() == m_iPad;
bool bPrimaryPlayer = PlatformProfile.GetPrimaryPad() == m_iPad;
// if we're not in the game, we need to use basescene 0
if (bInGame) {

View file

@ -6,7 +6,7 @@
#include <vector>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/App_Defines.h"
#include "app/common/Minecraft_Macros.h"
@ -427,7 +427,7 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad) {
uiIDA[0] = IDS_OK;
// We need to upsell the full version
if (ProfileManager.IsGuest(iPad)) {
if (PlatformProfile.IsGuest(iPad)) {
// can't buy
ui.RequestAlertMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT,
@ -1234,8 +1234,8 @@ int UIScene_SkinSelectMenu::UnlockSkinReturned(
UIScene_SkinSelectMenu* pScene = (UIScene_SkinSelectMenu*)pParam;
if ((result == C4JStorage::EMessage_ResultAccept) &&
ProfileManager.IsSignedIn(iPad)) {
if (ProfileManager.IsSignedInLive(iPad)) {
PlatformProfile.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedInLive(iPad)) {
} else // Is signed in, but not live.
{
pScene->showNotOnlineDialog(iPad);

View file

@ -8,7 +8,7 @@
#include <utility>
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -2,7 +2,7 @@
#include <assert.h>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -5,7 +5,7 @@
#include <memory>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -3,7 +3,7 @@
#include <assert.h>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -6,7 +6,7 @@
#include <vector>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -2,7 +2,7 @@
#include "UIScene_CraftingMenu.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"

View file

@ -4,7 +4,7 @@
#include <memory>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
@ -101,7 +101,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) {
// then cancels the exit player becomes stuck at game over screen
// m_bIgnoreInput = true;
// is it the primary player exiting?
if (m_iPad == ProfileManager.GetPrimaryPad()) {
if (m_iPad == PlatformProfile.GetPrimaryPad()) {
unsigned int uiIDA[3];
int playTime = -1;
if (pMinecraft->localplayers[m_iPad] != nullptr) {

View file

@ -8,7 +8,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/UIScene.h"
@ -62,7 +62,7 @@ UIScene_EndPoem::UIScene_EndPoem(int iPad, void* initData, UILayer* parentLayer)
pMinecraft->localplayers[ui.GetWinUserIndex()]->getDisplayName());
} else {
playerName =
escapeXML(pMinecraft->localplayers[ProfileManager.GetPrimaryPad()]
escapeXML(pMinecraft->localplayers[PlatformProfile.GetPrimaryPad()]
->getDisplayName());
}
noNoiseString = replaceAll(noNoiseString, L"{*PLAYER*}", playerName);
@ -168,9 +168,9 @@ void UIScene_EndPoem::handleInput(int iPad, int key, bool repeat, bool pressed,
// This just allows it to be shown
if (pMinecraft
->localgameModes[ProfileManager.GetPrimaryPad()] !=
->localgameModes[PlatformProfile.GetPrimaryPad()] !=
nullptr)
pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]
pMinecraft->localgameModes[PlatformProfile.GetPrimaryPad()]
->getTutorial()
->showTutorialPopup(true);

View file

@ -4,7 +4,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/Network/GameNetworkManager.h"
@ -269,7 +269,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat,
if (player != nullptr) {
PlayerUID uid = player->GetUID();
if (uid != INVALID_XUID) {
ProfileManager.ShowProfileCard(iPad, uid);
PlatformProfile.ShowProfileCard(iPad, uid);
}
}
}

View file

@ -6,7 +6,7 @@
#include <memory>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
@ -65,7 +65,7 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void* initData,
// IsLocalGame() issues on Iggy
if (/*g_NetworkManager.IsLocalGame() &&*/ g_NetworkManager
.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)true);
}
@ -107,9 +107,9 @@ std::wstring UIScene_PauseMenu::getMoviePath() {
void UIScene_PauseMenu::tick() { UIScene::tick(); }
void UIScene_PauseMenu::updateTooltips() {
// bool bUserisClientSide = ProfileManager.IsSignedInLive(m_iPad);
// bool bUserisClientSide = PlatformProfile.IsSignedInLive(m_iPad);
// bool bIsisPrimaryHost =
// g_NetworkManager.IsHost() && (ProfileManager.GetPrimaryPad() ==
// g_NetworkManager.IsHost() && (PlatformProfile.GetPrimaryPad() ==
// m_iPad);
int iY = -1;
@ -146,7 +146,7 @@ void UIScene_PauseMenu::updateControlsVisibility() {
// Pause Menu does not have a Leaderboards option. TCR # 128: XLA Pause
// Menu: When in a multiplayer game as a client the Pause Menu does not
// have an Achievements option.
if (ProfileManager.GetPrimaryPad() ==
if (PlatformProfile.GetPrimaryPad() ==
m_iPad) // && g_NetworkManager.IsHost())
{
// are we in splitscreen?
@ -192,10 +192,10 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat,
// TODO: proper fix for pausing
// 4jcraft: replace IsLocalGame() with GetPlayerCount() == 1 due
// to IsLocalGame() issues on Iggy
if (iPad == ProfileManager.GetPrimaryPad() &&
if (iPad == PlatformProfile.GetPrimaryPad() &&
/*g_NetworkManager.IsLocalGame()*/ g_NetworkManager
.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)false);
}
@ -261,10 +261,10 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
// TODO: proper fix for pausing
// 4jcraft: replace IsLocalGame() with GetPlayerCount() == 1 due to
// IsLocalGame() issues on Iggy
if (m_iPad == ProfileManager.GetPrimaryPad() &&
if (m_iPad == PlatformProfile.GetPrimaryPad() &&
/*g_NetworkManager.IsLocalGame()*/ g_NetworkManager
.GetPlayerCount() == 1) {
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
app.SetXuiServerAction(PlatformProfile.GetPrimaryPad(),
eXuiServerAction_PauseServer,
(void*)false);
}
@ -276,11 +276,11 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
// 4J Gordon: Being used for the leaderboards proper now
// guests can't look at leaderboards
if (ProfileManager.IsGuest(m_iPad)) {
if (PlatformProfile.IsGuest(m_iPad)) {
ui.RequestAlertMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
} else if (!ProfileManager.IsSignedInLive(m_iPad)) {
PlatformProfile.GetPrimaryPad());
} else if (!PlatformProfile.IsSignedInLive(m_iPad)) {
unsigned int uiIDA[1] = {IDS_OK};
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE,
IDS_PRO_NOTONLINE_TEXT, uiIDA, 1,
@ -304,12 +304,12 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
} break;
case BUTTON_PAUSE_ACHIEVEMENTS:
// guests can't look at achievements
if (ProfileManager.IsGuest(m_iPad)) {
if (PlatformProfile.IsGuest(m_iPad)) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
ui.RequestAlertMessage(IDS_PRO_GUESTPROFILE_TITLE,
IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1,
ProfileManager.GetPrimaryPad());
PlatformProfile.GetPrimaryPad());
} else {
// XShowAchievementsUI(m_iPad);
}
@ -326,7 +326,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
unsigned int uiIDA[3];
// is it the primary player exiting?
if (m_iPad == ProfileManager.GetPrimaryPad()) {
if (m_iPad == PlatformProfile.GetPrimaryPad()) {
int playTime = -1;
if (pMinecraft->localplayers[m_iPad] != nullptr) {
playTime = (int)pMinecraft->localplayers[m_iPad]

View file

@ -2,7 +2,7 @@
#include "UIScene_ConnectingProgress.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
#include "app/common/UI/All Platforms/UIStructs.h"
@ -148,7 +148,7 @@ void UIScene_ConnectingProgress::handleTimerComplete(int id) {
break;
}
if (m_iPad != ProfileManager.GetPrimaryPad() &&
if (m_iPad != PlatformProfile.GetPrimaryPad() &&
g_NetworkManager.IsInSession()) {
m_buttonConfirm.setVisible(true);
m_showingButton = true;
@ -162,11 +162,11 @@ void UIScene_ConnectingProgress::handleTimerComplete(int id) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
ui.RequestErrorMessage(IDS_CONNECTION_FAILED, exitReasonStringId,
uiIDA, 1, ProfileManager.GetPrimaryPad());
uiIDA, 1, PlatformProfile.GetPrimaryPad());
exitReasonStringId = -1;
// app.NavigateToHomeMenu();
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld,
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ExitWorld,
(void*)true);
}
}
@ -219,7 +219,7 @@ void UIScene_ConnectingProgress::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_Confirm:
if (m_showingButton) {
if (m_iPad != ProfileManager.GetPrimaryPad() &&
if (m_iPad != PlatformProfile.GetPrimaryPad() &&
g_NetworkManager.IsInSession()) {
// The connection failed if we see the button, so the temp
// player should be removed and the viewports updated again
@ -228,7 +228,7 @@ void UIScene_ConnectingProgress::handlePress(F64 controlId, F64 childId) {
m_removeLocalPlayer = true;
} else {
ui.NavigateToHomeMenu();
// app.NavigateBack( ProfileManager.GetPrimaryPad() );
// app.NavigateBack( PlatformProfile.GetPrimaryPad() );
}
}
break;

View file

@ -6,7 +6,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Network/GameNetworkManager.h"
#include "app/common/Tutorial/Tutorial.h"
@ -233,9 +233,9 @@ void UIScene_FullscreenProgress::tick() {
// This just allows it to be shown
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localgameModes
[ProfileManager.GetPrimaryPad()] != nullptr)
[PlatformProfile.GetPrimaryPad()] != nullptr)
pMinecraft
->localgameModes[ProfileManager
->localgameModes[PlatformProfile
.GetPrimaryPad()]
->getTutorial()
->showTutorialPopup(true);

View file

@ -3,7 +3,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Controls/UIControl_Button.h"
#include "app/common/UI/Controls/UIControl_Label.h"
@ -156,7 +156,7 @@ bool UIScene_MessageBox::hasFocus(int iPad) {
if (m_iPad == 255) {
// Message box is for everyone
return bHasFocus;
} else if (ProfileManager.IsSignedIn(m_iPad)) {
} else if (PlatformProfile.IsSignedIn(m_iPad)) {
// Owner is still present
return bHasFocus && (iPad == m_iPad);
} else {

View file

@ -6,7 +6,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
#include "app/common/UI/Controls/UIControl_Label.h"
#include "app/common/UI/UILayer.h"
@ -81,7 +81,7 @@ void UIScene_QuadrantSignin::handleInput(int iPad, int key, bool repeat,
{
m_bIgnoreInput = true;
m_signInInfo.Func(false, iPad);
ProfileManager.CancelProfileAvatarRequest();
PlatformProfile.CancelProfileAvatarRequest();
navigateBack();
}
@ -90,16 +90,16 @@ void UIScene_QuadrantSignin::handleInput(int iPad, int key, bool repeat,
case ACTION_MENU_OK:
if (pressed) {
m_bIgnoreInput = true;
if (ProfileManager.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedIn(iPad)) {
app.DebugPrintf("Signed in pad pressed\n");
ProfileManager.CancelProfileAvatarRequest();
PlatformProfile.CancelProfileAvatarRequest();
navigateBack();
m_signInInfo.Func(true, m_iPad);
} else {
{
app.DebugPrintf("Non-signed in pad pressed\n");
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false, false, false, true, true,
[this](bool bContinue, int pad) {
return SignInReturned(this, bContinue, pad);
@ -137,20 +137,20 @@ int UIScene_QuadrantSignin::SignInReturned(void* pParam, bool bContinue,
void UIScene_QuadrantSignin::updateState() {
for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) {
if (ProfileManager.IsSignedIn(i) && PlatformInput.IsPadConnected(i)) {
if (PlatformProfile.IsSignedIn(i) && PlatformInput.IsPadConnected(i)) {
// app.DebugPrintf("Index %d is signed in, display name - '%s'\n",
// i, ProfileManager.GetDisplayName(i).data());
// i, PlatformProfile.GetDisplayName(i).data());
{
setControllerState(i, eControllerStatus_PlayerDetails);
}
m_labelDisplayName[i].setLabel(ProfileManager.GetDisplayName(i));
m_labelDisplayName[i].setLabel(PlatformProfile.GetDisplayName(i));
// m_buttonControllers[i].setLabel(app.GetString(IDS_TOOLTIPS_CONTINUE),i);
if (!m_iconRequested[i]) {
app.DebugPrintf(app.USER_SR, "Requesting avatar for %d\n", i);
if (ProfileManager.GetProfileAvatar(
if (PlatformProfile.GetProfileAvatar(
i,
[this](std::uint8_t* data, unsigned int bytes) {
return AvatarReturned(this, data, bytes);
@ -226,14 +226,14 @@ void UIScene_QuadrantSignin::_initQuadrants() {
m_controllerStatus[i] = eControllerStatus_ConnectController;
if (ProfileManager.IsSignedIn(i)) {
if (PlatformProfile.IsSignedIn(i)) {
app.DebugPrintf("Index %d is signed in\n", i);
{
setControllerState(i, eControllerStatus_PlayerDetails);
}
m_labelDisplayName[i].init(ProfileManager.GetDisplayName(i));
m_labelDisplayName[i].init(PlatformProfile.GetDisplayName(i));
} else if (PlatformInput.IsPadConnected(i)) {
app.DebugPrintf("Index %d is not signed in\n", i);

View file

@ -11,7 +11,7 @@
#include <utility>
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/Audio/SoundEngine.h"
#include "app/common/DLC/DLCManager.h"
@ -387,7 +387,7 @@ void UIController::SetupFont() {
if (m_eTargetFont == m_eCurrentFont) {
// 4J-JEV: If we're ingame, reload the font to update all the text.
if (app.GetGameStarted())
app.SetAction(ProfileManager.GetPrimaryPad(),
app.SetAction(PlatformProfile.GetPrimaryPad(),
eAppAction_ReloadFont);
return;
}
@ -434,7 +434,7 @@ void UIController::SetupFont() {
// Reload ui to set new font.
if (m_eCurrentFont != eFont_NotLoaded) {
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ReloadFont);
app.SetAction(PlatformProfile.GetPrimaryPad(), eAppAction_ReloadFont);
} else {
updateCurrentFont();
}
@ -459,7 +459,7 @@ void UIController::tick() {
ui.CleanUpSkinReload();
if (m_navigateToHomeOnReload || !g_NetworkManager.IsInSession()) {
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(),
eUIScene_MainMenu);
} else {
ui.CloseAllPlayersScenes();
@ -737,7 +737,7 @@ void UIController::tickInput() {
if (!m_bSystemUIShowing) {
#if defined(ENABLE_IGGY_PERFMON)
if (m_iggyPerfmonEnabled) {
if (PlatformInput.ButtonPressed(ProfileManager.GetPrimaryPad(),
if (PlatformInput.ButtonPressed(PlatformProfile.GetPrimaryPad(),
ACTION_MENU_STICK_PRESS))
m_iggyPerfmonEnabled = !m_iggyPerfmonEnabled;
} else
@ -848,29 +848,29 @@ void UIController::renderScenes() {
pm_pad.bits = 0;
pm_pad.field.dpad_up = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_UP);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_UP);
pm_pad.field.dpad_down = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_DOWN);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_DOWN);
pm_pad.field.dpad_left = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_LEFT);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_LEFT);
pm_pad.field.dpad_right = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_RIGHT);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_RIGHT);
pm_pad.field.button_up = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_Y);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_Y);
pm_pad.field.button_down = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_A);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_A);
pm_pad.field.button_left = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_X);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_X);
pm_pad.field.button_right = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_B);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_B);
pm_pad.field.shoulder_left_hi = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_LEFT_SCROLL);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_LEFT_SCROLL);
pm_pad.field.shoulder_right_hi = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_RIGHT_SCROLL);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_RIGHT_SCROLL);
pm_pad.field.trigger_left_low = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_PAGEUP);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_PAGEUP);
pm_pad.field.trigger_right_low = PlatformInput.ButtonPressed(
ProfileManager.GetPrimaryPad(), ACTION_MENU_PAGEDOWN);
PlatformProfile.GetPrimaryPad(), ACTION_MENU_PAGEDOWN);
// IggyPerfmonPadFromXInputStatePointer(pm_pad, &xi_pad);
// gdraw_D3D_SetTileOrigin( fb,
@ -1195,7 +1195,7 @@ bool UIController::NavigateToScene(int iPad, EUIScene scene, void* initData,
// times
if ((scene == eUIScene_LoadOrJoinMenu) &&
(bSeenUpdateTextThisSession == false) &&
(app.GetGameSettings(ProfileManager.GetPrimaryPad(),
(app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplayUpdateMessage) != 0)) {
scene = eUIScene_NewUpdateMessage;
bSeenUpdateTextThisSession = true;
@ -1378,7 +1378,7 @@ void UIController::NavigateToHomeMenu() {
if (pMinecraft->skins->needsUIUpdate()) {
m_navigateToHomeOnReload = true;
} else {
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_MainMenu);
ui.NavigateToScene(PlatformProfile.GetPrimaryPad(), eUIScene_MainMenu);
#if defined(ENABLE_JAVA_GUIS)
pMinecraft->setScreen(new TitleScreen());
#endif
@ -1482,7 +1482,7 @@ void UIController::CloseUIScenes(int iPad, bool forceIPad) {
void UIController::setFullscreenMenuDisplayed(bool displayed) {
// Show/hide the tooltips for the fullscreen group
m_groups[(int)eUIGroup_Fullscreen]->showComponent(
ProfileManager.GetPrimaryPad(), eUIComponent_Tooltips,
PlatformProfile.GetPrimaryPad(), eUIComponent_Tooltips,
eUILayer_Tooltips, displayed);
// Show/hide tooltips for the other layers
@ -1777,7 +1777,7 @@ void UIController::PlayUISFX(ESoundEffect eSound) {
void UIController::DisplayGamertag(unsigned int iPad, bool show) {
// The host decides whether these are on or off
if (app.GetGameSettings(ProfileManager.GetPrimaryPad(),
if (app.GetGameSettings(PlatformProfile.GetPrimaryPad(),
eGameSetting_DisplaySplitscreenGamertags) == 0) {
show = false;
}
@ -2234,7 +2234,7 @@ C4JStorage::EMessageResult UIController::RequestUGCMessageBox(
}
// Default pad to primary player
if (iPad == -1) iPad = ProfileManager.GetPrimaryPad();
if (iPad == -1) iPad = PlatformProfile.GetPrimaryPad();
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;
@ -2261,7 +2261,7 @@ C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(
}
// Default pad to primary player
if (iPad == -1) iPad = ProfileManager.GetPrimaryPad();
if (iPad == -1) iPad = PlatformProfile.GetPrimaryPad();
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;

View file

@ -1,6 +1,6 @@
#include "UIGroup.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialMode.h"
@ -84,7 +84,7 @@ void UIGroup::ReloadAll() {
void UIGroup::tick() {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
for (unsigned int i = 0; i < eUILayer_COUNT; ++i) {
m_layers[i]->tick();
@ -101,7 +101,7 @@ void UIGroup::tick() {
void UIGroup::render() {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
S32 width = 0;
S32 height = 0;
ui.getRenderDimensions(m_viewportType, width, height);
@ -117,7 +117,7 @@ void UIGroup::render() {
bool UIGroup::hidesLowerScenes() {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return false;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return false;
bool hidesScenes = false;
for (int i = eUILayer_COUNT - 1; i >= 0; --i) {
hidesScenes = m_layers[i]->hidesLowerScenes();
@ -203,7 +203,7 @@ bool UIGroup::HasFocus(int iPad) {
void UIGroup::handleInput(int iPad, int key, bool repeat, bool pressed,
bool released, bool& handled) {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
for (unsigned int i = 0; i < eUILayer_COUNT; ++i) {
m_layers[i]->handleInput(iPad, key, repeat, pressed, released, handled);
if (handled) break;
@ -255,7 +255,7 @@ C4JRender::eViewportType UIGroup::GetViewportType() { return m_viewportType; }
void UIGroup::HandleDLCMountingComplete() {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
for (unsigned int i = 0; i < eUILayer_COUNT; ++i) {
app.DebugPrintf("UIGroup::HandleDLCMountingComplete - m_layers[%d]\n",
i);
@ -265,7 +265,7 @@ void UIGroup::HandleDLCMountingComplete() {
void UIGroup::HandleDLCInstalled() {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
for (unsigned int i = 0; i < eUILayer_COUNT; ++i) {
m_layers[i]->HandleDLCInstalled();
}
@ -273,7 +273,7 @@ void UIGroup::HandleDLCInstalled() {
void UIGroup::HandleMessage(EUIMessage message, void* data) {
// Ignore this group if the player isn't signed in
if (m_iPad >= 0 && !ProfileManager.IsSignedIn(m_iPad)) return;
if (m_iPad >= 0 && !PlatformProfile.IsSignedIn(m_iPad)) return;
for (unsigned int i = 0; i < eUILayer_COUNT; ++i) {
m_layers[i]->HandleMessage(message, data);
}

View file

@ -4,7 +4,7 @@
#include <string>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "minecraft/GameEnums.h"
@ -54,7 +54,7 @@ void LinuxGame::TemporaryCreateGameStart() {
// From CScene_Main::RunPlayGame
Minecraft* pMinecraft = Minecraft::GetInstance();
app.ReleaseSaveThumbnail();
ProfileManager.SetLockedProfile(0);
PlatformProfile.SetLockedProfile(0);
pMinecraft->user->name = L"Windows";
app.ApplyGameSettingsChanged(0);

View file

@ -56,7 +56,7 @@ static void sigsegv_handler(int sig) {
#include "platform/PlatformTypes.h"
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "app/common/App_Defines.h"
@ -484,7 +484,7 @@ int main(int argc, const char* argv[]) {
// Initialise the profile manager with the game Title ID, Offer ID, a
// profile version number, and the number of profile values and settings
ProfileManager.Initialise(
PlatformProfile.Initialise(
TITLEID_MINECRAFT, app.m_dwOfferID, PROFILE_VERSION_10,
NUM_PROFILE_VALUES, NUM_PROFILE_SETTINGS, dwProfileSettingsA,
app.GAME_DEFINED_PROFILE_DATA_BYTES * XUSER_MAX_COUNT,
@ -492,7 +492,7 @@ int main(int argc, const char* argv[]) {
// set a function to be called when there's a sign in change, so we can exit
// a level if the primary player signs out
ProfileManager.SetSignInChangeCallback(
PlatformProfile.SetSignInChangeCallback(
[](bool bVal, unsigned int uiSignInData) {
Game::SignInChangeCallback(&app, bVal, uiSignInData);
});
@ -503,13 +503,13 @@ int main(int argc, const char* argv[]) {
// QNet needs to be setup after profile manager, as we do not want its
// Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does
// mean that we need to have a callback in the ProfileManager for
// mean that we need to have a callback in the PlatformProfile for
// XN_LIVE_INVITE_ACCEPTED for QNet.
g_NetworkManager.Initialise();
// debug switch to trial version
ProfileManager.SetDebugFullOverride(true);
PlatformProfile.SetDebugFullOverride(true);
// Initialise TLS for tesselator, for this main thread
Tesselator::CreateNewThreadStorage(1024 * 1024);
// Initialise TLS for AABB and Vec3 pools, for this main thread
@ -534,7 +534,7 @@ int main(int argc, const char* argv[]) {
app.UpdateTime();
PlatformInput.Tick();
ProfileManager.Tick();
PlatformProfile.Tick();
StorageManager.Tick();
@ -564,7 +564,7 @@ int main(int argc, const char* argv[]) {
//
// g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1 &&
ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()));
ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad()));
} else {
pMinecraft->soundEngine->tick(nullptr, 0.0f);
pMinecraft->textures->tick(true, false);

View file

@ -19,7 +19,7 @@ WindowsGame app;
WindowsGame::WindowsGame() : Game() {}
void WindowsGame::SetRichPresenceContext(int iPad, int contextId) {
ProfileManager.SetRichPresenceContextValue(iPad, CONTEXT_GAME_STATE,
PlatformProfile.SetRichPresenceContextValue(iPad, CONTEXT_GAME_STATE,
contextId);
}
@ -45,7 +45,7 @@ void WindowsGame::TemporaryCreateGameStart() {
// From CScene_Main::RunPlayGame
Minecraft* pMinecraft = Minecraft::GetInstance();
app.ReleaseSaveThumbnail();
ProfileManager.SetLockedProfile(0);
PlatformProfile.SetLockedProfile(0);
pMinecraft->user->name = L"Windows";
app.ApplyGameSettingsChanged(0);

View file

@ -727,21 +727,21 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// Initialise the profile manager with the game Title ID, Offer ID, a
// profile version number, and the number of profile values and settings
ProfileManager.Initialise(
PlatformProfile.Initialise(
TITLEID_MINECRAFT, app.m_dwOfferID, PROFILE_VERSION_10,
NUM_PROFILE_VALUES, NUM_PROFILE_SETTINGS, dwProfileSettingsA,
app.GAME_DEFINED_PROFILE_DATA_BYTES * XUSER_MAX_COUNT,
&app.uiGameDefinedDataChangedBitmask);
// Set a callback for the default player options to be set - when there is
// no profile data for the player
ProfileManager.SetDefaultOptionsCallback(
[](C_4JProfile::PROFILESETTINGS* pSettings, int iPad) {
PlatformProfile.SetDefaultOptionsCallback(
[](IPlatformProfile::PROFILESETTINGS* pSettings, int iPad) {
return Game::DefaultOptionsCallback(&app, pSettings,
iPad);
});
// QNet needs to be setup after profile manager, as we do not want its
// Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does
// mean that we need to have a callback in the ProfileManager for
// mean that we need to have a callback in the PlatformProfile for
// XN_LIVE_INVITE_ACCEPTED for QNet.
g_NetworkManager.Initialise();
@ -749,7 +749,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// app.InitGameSettings();
// debug switch to trial version
ProfileManager.SetDebugFullOverride(true);
PlatformProfile.SetDebugFullOverride(true);
// Initialise TLS for tesselator, for this main thread
Tesselator::CreateNewThreadStorage(1024 * 1024);
@ -792,7 +792,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
app.UpdateTime();
PlatformInput.Tick();
// ProfileManager.Tick();
// PlatformProfile.Tick();
StorageManager.Tick();
@ -813,7 +813,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
app.SetAppPaused(
g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1 &&
ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()));
ui.IsPauseMenuDisplayed(PlatformProfile.GetPrimaryPad()));
} else {
pMinecraft->soundEngine->tick(nullptr, 0.0f);
pMinecraft->textures->tick(true, false);

View file

@ -14,7 +14,7 @@
#include <thread>
#include "platform/input/InputActions.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "minecraft/GameEnums.h"
@ -886,13 +886,13 @@ std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(
PlayerUID playerXUIDOffline = INVALID_XUID;
PlayerUID playerXUIDOnline = INVALID_XUID;
ProfileManager.GetXUID(idx, &playerXUIDOffline, false);
ProfileManager.GetXUID(idx, &playerXUIDOnline, true);
PlatformProfile.GetXUID(idx, &playerXUIDOffline, false);
PlatformProfile.GetXUID(idx, &playerXUIDOnline, true);
localplayers[idx]->setXuid(playerXUIDOffline);
localplayers[idx]->setOnlineXuid(playerXUIDOnline);
localplayers[idx]->setIsGuest(ProfileManager.IsGuest(idx));
localplayers[idx]->setIsGuest(PlatformProfile.IsGuest(idx));
localplayers[idx]->m_displayName = ProfileManager.GetDisplayName(idx);
localplayers[idx]->m_displayName = PlatformProfile.GetDisplayName(idx);
localplayers[idx]->m_iScreenSection = tempScreenSection;
@ -940,9 +940,9 @@ void Minecraft::storeExtraLocalPlayer(int idx) {
if (localplayers[idx]->input != nullptr) delete localplayers[idx]->input;
localplayers[idx]->input = new Input();
if (ProfileManager.IsSignedIn(idx)) {
if (PlatformProfile.IsSignedIn(idx)) {
localplayers[idx]->name =
convStringToWstring(ProfileManager.GetGamertag(idx));
convStringToWstring(PlatformProfile.GetGamertag(idx));
}
}
@ -1014,9 +1014,9 @@ void Minecraft::createPrimaryLocalPlayer(int iPad) {
localplayers[iPad] = player;
// gameRenderer->itemInHandRenderer = localitemInHandRenderers[iPad];
// Give them the gamertag if they're signed in
if (ProfileManager.IsSignedIn(PlatformInput.GetPrimaryPad())) {
if (PlatformProfile.IsSignedIn(PlatformInput.GetPrimaryPad())) {
user->name = convStringToWstring(
ProfileManager.GetGamertag(PlatformInput.GetPrimaryPad()));
PlatformProfile.GetGamertag(PlatformInput.GetPrimaryPad()));
}
}
@ -1171,11 +1171,11 @@ void Minecraft::run_middle() {
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
if (localplayers[i] && (gameServices().getBanListCheck(i) == false) &&
!Minecraft::GetInstance()->isTutorial() &&
ProfileManager.IsSignedInLive(i) &&
!ProfileManager.IsGuest(i)) {
PlatformProfile.IsSignedInLive(i) &&
!PlatformProfile.IsGuest(i)) {
// If there is a sys ui displayed, we can't display the
// message box here, so ignore until we can
if (!ProfileManager.IsSystemUIDisplayed()) {
if (!PlatformProfile.IsSystemUIDisplayed()) {
gameServices().setBanListCheck(i, true);
// 4J-PB - check if the level is in the banned level
// list get the unique save name and xuid from
@ -1199,7 +1199,7 @@ void Minecraft::run_middle() {
}
}
if (!ProfileManager.IsSystemUIDisplayed() &&
if (!PlatformProfile.IsSystemUIDisplayed() &&
gameServices().dlcInstallProcessCompleted() &&
!gameServices().dlcInstallPending() &&
gameServices().dlcNeedsCorruptCheck()) {
@ -1398,12 +1398,12 @@ void Minecraft::run_middle() {
// Let them join
// are they signed in?
if (ProfileManager.IsSignedIn(i)) {
if (PlatformProfile.IsSignedIn(i)) {
// if this is a local game, then the
// player just needs to be signed in
if (g_NetworkManager.IsLocalGame() ||
(ProfileManager.IsSignedInLive(i) &&
ProfileManager
(PlatformProfile.IsSignedInLive(i) &&
PlatformProfile
.AllowedToPlayMultiplayer(
i))) {
if (level->isClientSide) {
@ -1415,7 +1415,7 @@ void Minecraft::run_middle() {
"Bringing up the sign "
"in "
"ui\n");
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false,
g_NetworkManager
.IsLocalGame(),
@ -1436,7 +1436,7 @@ void Minecraft::run_middle() {
createExtraLocalPlayer(
i,
(convStringToWstring(
ProfileManager
PlatformProfile
.GetGamertag(
i)))
.c_str(),
@ -1446,13 +1446,13 @@ void Minecraft::run_middle() {
}
}
} else {
if (ProfileManager.IsSignedInLive(
ProfileManager
if (PlatformProfile.IsSignedInLive(
PlatformProfile
.GetPrimaryPad()) &&
!ProfileManager
!PlatformProfile
.AllowedToPlayMultiplayer(
i)) {
ProfileManager
PlatformProfile
.RequestConvertOfflineToGuestUI(
[this](bool b, int p) {
return InGame_SignInReturned(
@ -1470,7 +1470,7 @@ void Minecraft::run_middle() {
// signs-in on console which
// takes part in Xbox LIVE
// multiplayer session.
// ProfileManager.RequestConvertOfflineToGuestUI(
// PlatformProfile.RequestConvertOfflineToGuestUI(
// &Minecraft::InGame_SignInReturned,
// this,i);
@ -1491,7 +1491,7 @@ void Minecraft::run_middle() {
Log::info(
"Bringing up the sign in "
"ui\n");
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false,
g_NetworkManager
.IsLocalGame(),
@ -1507,7 +1507,7 @@ void Minecraft::run_middle() {
// bring up the sign in dialog
Log::info(
"Bringing up the sign in ui\n");
ProfileManager.RequestSignInUI(
PlatformProfile.RequestSignInUI(
false,
g_NetworkManager.IsLocalGame(),
true, false, true,
@ -3690,11 +3690,11 @@ void Minecraft::forceStatsSave(int idx) {
stats[idx]->save(idx, true);
// 4J Gordon: If the player is signed in, save the leaderboards
if (ProfileManager.IsSignedInLive(idx)) {
int tempLockedProfile = ProfileManager.GetLockedProfile();
ProfileManager.SetLockedProfile(idx);
if (PlatformProfile.IsSignedInLive(idx)) {
int tempLockedProfile = PlatformProfile.GetLockedProfile();
PlatformProfile.SetLockedProfile(idx);
stats[idx]->saveLeaderboards();
ProfileManager.SetLockedProfile(tempLockedProfile);
PlatformProfile.SetLockedProfile(tempLockedProfile);
}
}
@ -3845,13 +3845,13 @@ void Minecraft::setLevel(MultiPlayerLevel* level, int message /*=-1*/,
PlayerUID playerXUIDOffline = INVALID_XUID;
PlayerUID playerXUIDOnline = INVALID_XUID;
ProfileManager.GetXUID(iPrimaryPlayer, &playerXUIDOffline, false);
ProfileManager.GetXUID(iPrimaryPlayer, &playerXUIDOnline, true);
PlatformProfile.GetXUID(iPrimaryPlayer, &playerXUIDOffline, false);
PlatformProfile.GetXUID(iPrimaryPlayer, &playerXUIDOnline, true);
player->setXuid(playerXUIDOffline);
player->setOnlineXuid(playerXUIDOnline);
player->m_displayName =
ProfileManager.GetDisplayName(iPrimaryPlayer);
PlatformProfile.GetDisplayName(iPrimaryPlayer);
player->resetPos();
gameMode->initPlayer(player);
@ -4012,13 +4012,13 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) {
PlayerUID playerXUIDOffline = INVALID_XUID;
PlayerUID playerXUIDOnline = INVALID_XUID;
ProfileManager.GetXUID(iTempPad, &playerXUIDOffline, false);
ProfileManager.GetXUID(iTempPad, &playerXUIDOnline, true);
PlatformProfile.GetXUID(iTempPad, &playerXUIDOffline, false);
PlatformProfile.GetXUID(iTempPad, &playerXUIDOnline, true);
player->setXuid(playerXUIDOffline);
player->setOnlineXuid(playerXUIDOnline);
player->setIsGuest(ProfileManager.IsGuest(iTempPad));
player->setIsGuest(PlatformProfile.IsGuest(iTempPad));
player->m_displayName = ProfileManager.GetDisplayName(iPad);
player->m_displayName = PlatformProfile.GetDisplayName(iPad);
player->SetXboxPad(iTempPad);
@ -4471,7 +4471,7 @@ int Minecraft::InGame_SignInReturned(void* pParam, bool bContinue, int iPad) {
pMinecraftClass->localplayers[iPad] == nullptr) {
// It's possible that the player has not signed in - they can back out
// or choose no for the converttoguest
if (ProfileManager.IsSignedIn(iPad)) {
if (PlatformProfile.IsSignedIn(iPad)) {
if (!g_NetworkManager.SessionHasSpace()) {
unsigned int uiIDA[1];
uiIDA[0] = IDS_OK;
@ -4480,8 +4480,8 @@ int Minecraft::InGame_SignInReturned(void* pParam, bool bContinue, int iPad) {
}
// if this is a local game then profiles just need to be signed in
else if (g_NetworkManager.IsLocalGame() ||
(ProfileManager.IsSignedInLive(iPad) &&
ProfileManager.AllowedToPlayMultiplayer(iPad))) {
(PlatformProfile.IsSignedInLive(iPad) &&
PlatformProfile.AllowedToPlayMultiplayer(iPad))) {
if (pMinecraftClass->level->isClientSide) {
pMinecraftClass->addLocalPlayer(iPad);
} else {
@ -4492,20 +4492,20 @@ int Minecraft::InGame_SignInReturned(void* pParam, bool bContinue, int iPad) {
player = pMinecraftClass->createExtraLocalPlayer(
iPad,
(convStringToWstring(
ProfileManager.GetGamertag(iPad)))
PlatformProfile.GetGamertag(iPad)))
.c_str(),
iPad, pMinecraftClass->level->dimension->id);
}
}
} else if (ProfileManager.IsSignedInLive(
} else if (PlatformProfile.IsSignedInLive(
PlatformInput.GetPrimaryPad()) &&
!ProfileManager.AllowedToPlayMultiplayer(iPad)) {
!PlatformProfile.AllowedToPlayMultiplayer(iPad)) {
// 4J Stu - Don't allow converting to guests as we don't allow
// any guest sign-in while in the game Fix for #66516 - TCR
// #124: MPS Guest Support ; #001: BAS Game Stability: TU8: The
// game crashes when second Guest signs-in on console which
// takes part in Xbox LIVE multiplayer session.
// ProfileManager.RequestConvertOfflineToGuestUI(
// PlatformProfile.RequestConvertOfflineToGuestUI(
// &Minecraft::InGame_SignInReturned, pMinecraftClass,iPad);
unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK;

View file

@ -3,7 +3,7 @@
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "Button.h"
#include "minecraft/GameEnums.h"
#include "app/common/Audio/SoundEngine.h"

View file

@ -14,7 +14,7 @@
#include "platform/PlatformTypes.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h"
#include "app/common/ConsoleGameMode.h"
@ -272,7 +272,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
if (done) return;
PlayerUID OnlineXuid;
ProfileManager.GetXUID(m_userIndex, &OnlineXuid, true); // online xuid
PlatformProfile.GetXUID(m_userIndex, &OnlineXuid, true); // online xuid
MOJANG_DATA* pMojangData = nullptr;
if (!g_NetworkManager.IsLocalGame()) {
@ -445,7 +445,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet) {
dimensionLevel->difficulty = packet->difficulty; // 4J Added
dimensionLevel->isClientSide = true;
level = dimensionLevel;
// 4J Stu - At time of writing ProfileManager.GetGamertag() does not
// 4J Stu - At time of writing PlatformProfile.GetGamertag() does not
// always return the correct name, if sign-ins are turned off while
// the player signed in. Using the qnetPlayer instead. need to have
// a level before create extra local player
@ -869,12 +869,12 @@ void ClientConnection::handleAddPlayer(
// need to use the XUID here
PlayerUID playerXUIDOnline = INVALID_XUID,
playerXUIDOffline = INVALID_XUID;
ProfileManager.GetXUID(idx, &playerXUIDOnline, true);
ProfileManager.GetXUID(idx, &playerXUIDOffline, false);
PlatformProfile.GetXUID(idx, &playerXUIDOnline, true);
PlatformProfile.GetXUID(idx, &playerXUIDOffline, false);
if ((playerXUIDOnline != INVALID_XUID &&
ProfileManager.AreXUIDSEqual(playerXUIDOnline, packet->xuid)) ||
PlatformProfile.AreXUIDSEqual(playerXUIDOnline, packet->xuid)) ||
(playerXUIDOffline != INVALID_XUID &&
ProfileManager.AreXUIDSEqual(playerXUIDOffline, packet->xuid))) {
PlatformProfile.AreXUIDSEqual(playerXUIDOffline, packet->xuid))) {
Log::info(
"AddPlayerPacket received with XUID of local player\n");
return;
@ -2040,22 +2040,22 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
// need to use the XUID here
PlayerUID offlineXUID = INVALID_XUID;
PlayerUID onlineXUID = INVALID_XUID;
if (ProfileManager.IsSignedInLive(m_userIndex)) {
if (PlatformProfile.IsSignedInLive(m_userIndex)) {
// Guest don't have an offline XUID as they cannot play offline, so
// use their online one
ProfileManager.GetXUID(m_userIndex, &onlineXUID, true);
PlatformProfile.GetXUID(m_userIndex, &onlineXUID, true);
}
// On PS3, all non-signed in players (even guests) can get a useful
// offlineXUID
if (!ProfileManager.IsGuest(m_userIndex)) {
if (!PlatformProfile.IsGuest(m_userIndex)) {
// All other players we use their offline XUID so that they can play
// the game offline
ProfileManager.GetXUID(m_userIndex, &offlineXUID, false);
PlatformProfile.GetXUID(m_userIndex, &offlineXUID, false);
}
bool allAllowed = false;
bool friendsAllowed = false;
ProfileManager.AllowedPlayerCreatedContent(
PlatformProfile.AllowedPlayerCreatedContent(
m_userIndex, true, &allAllowed, &friendsAllowed);
fprintf(stderr,
"[LOGIN] Sending LoginPacket: user=%ls netVer=%d userIdx=%d "
@ -2068,7 +2068,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr<PreLoginPacket> packet) {
offlineXUID, onlineXUID, (!allAllowed && friendsAllowed),
packet->m_ugcPlayersVersion, gameServices().getPlayerSkinId(m_userIndex),
gameServices().getPlayerCapeId(m_userIndex),
ProfileManager.IsGuest(m_userIndex)));
PlatformProfile.IsGuest(m_userIndex)));
fprintf(stderr, "[LOGIN] LoginPacket sent successfully\n");
if (!g_NetworkManager.IsHost()) {

View file

@ -30,7 +30,7 @@
// 4J Stu - Added for tutorial callbacks
#include "platform/input/InputActions.h"
#include "platform/input/input.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Render.h"
#include "app/common/App_structs.h"
#include "app/common/Audio/SoundEngine.h"
@ -486,7 +486,7 @@ void LocalPlayer::aiStep() {
// Check if the player is idle and the rich presence needs updated
if (!m_bIsIdle && PlatformInput.GetIdleSeconds(m_iPad) > PLAYER_IDLE_TIME) {
ProfileManager.SetCurrentGameActivity(m_iPad, CONTEXT_PRESENCE_IDLE,
PlatformProfile.SetCurrentGameActivity(m_iPad, CONTEXT_PRESENCE_IDLE,
false);
m_bIsIdle = true;
} else if (m_bIsIdle &&
@ -495,18 +495,18 @@ void LocalPlayer::aiStep() {
if (g_NetworkManager.GetPlayerCount() > 1) {
// only do it for this player here - each player will run this code
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
m_iPad, CONTEXT_PRESENCE_MULTIPLAYEROFFLINE, false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
m_iPad, CONTEXT_PRESENCE_MULTIPLAYER, false);
}
} else {
if (g_NetworkManager.IsLocalGame()) {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
m_iPad, CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE, false);
} else {
ProfileManager.SetCurrentGameActivity(
PlatformProfile.SetCurrentGameActivity(
m_iPad, CONTEXT_PRESENCE_MULTIPLAYER_1P, false);
}
}
@ -845,14 +845,14 @@ void LocalPlayer::awardStat(Stat* stat, const std::vector<uint8_t>& param) {
// achievements don't get awarded to all players e.g. Splitscreen
// players cannot get theme/avatar/gamerpic and Trial players cannot
// get any This causes some extreme flooding of some awards
if (ProfileManager.CanBeAwarded(m_iPad, ach->getAchievementID())) {
if (PlatformProfile.CanBeAwarded(m_iPad, ach->getAchievementID())) {
// 4J Stu - Some awards cause a menu to popup. This can be bad,
// especially if you are surrounded by mobs! We cannot pause the
// game unless in offline single player, but lets at least do it
// then
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1 &&
ProfileManager.GetAwardType(ach->getAchievementID()) !=
PlatformProfile.GetAwardType(ach->getAchievementID()) !=
EAwardType::Achievement) {
ui.CloseUIScenes(m_iPad);
ui.NavigateToScene(m_iPad, eUIScene_PauseMenu);
@ -863,7 +863,7 @@ void LocalPlayer::awardStat(Stat* stat, const std::vector<uint8_t>& param) {
unsigned long long achBit = ((unsigned long long)1)
<< ach->getAchievementID();
if (!(achBit & m_awardedThisSession)) {
ProfileManager.Award(m_iPad, ach->getAchievementID());
PlatformProfile.Award(m_iPad, ach->getAchievementID());
m_awardedThisSession |= achBit;
}
}

View file

@ -13,7 +13,7 @@
#include <utility>
#include "platform/PlatformTypes.h"
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "platform/sdl2/Storage.h"
#include "ConsoleInput.h"
#include "DispenserBootstrap.h"
@ -903,7 +903,7 @@ void MinecraftServer::stopServer(bool didInit) {
// also need to check for a profile switch here - primary player signs out,
// and another player signs in before dismissing the dash
if ((m_bPrimaryPlayerSignedOut == false) &&
ProfileManager.IsSignedIn(PlatformInput.GetPrimaryPad())) {
PlatformProfile.IsSignedIn(PlatformInput.GetPrimaryPad())) {
// if trial version or saving is disabled, then don't save anything.
// Also don't save anything if we didn't actually get through the server
// initialisation.

View file

@ -239,7 +239,7 @@ private:
m_bPrimaryPlayerSignedOut; // 4J-PB added to tell the stopserver not to
// save the game - another player may have
// signed in in their place, so
// ProfileManager.IsSignedIn isn't enough
// PlatformProfile.IsSignedIn isn't enough
static bool s_bServerHalted; // 4J Stu Added so that we can halt the server
// even before it's been created properly
static bool s_bSaveOnExitAnswered; // 4J Stu Added so that we only ask this

View file

@ -10,7 +10,7 @@
#include <compare>
#include <cstdint>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "minecraft/GameEnums.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
@ -1083,7 +1083,7 @@ void PlayerList::tick() {
std::shared_ptr<ServerPlayer> p = players.at(i);
PlayerUID playersXuid = p->getOnlineXuid();
if (p != nullptr &&
ProfileManager.AreXUIDSEqual(playersXuid, xuid)) {
PlatformProfile.AreXUIDSEqual(playersXuid, xuid)) {
player = p;
break;
}
@ -1690,7 +1690,7 @@ bool PlayerList::isXuidBanned(PlayerUID xuid) {
bool banned = false;
for (auto it = m_bannedXuids.begin(); it != m_bannedXuids.end(); ++it) {
if (ProfileManager.AreXUIDSEqual(xuid, *it)) {
if (PlatformProfile.AreXUIDSEqual(xuid, *it)) {
banned = true;
break;
}

View file

@ -10,7 +10,7 @@
#include <utility>
#include <vector>
#include "platform/sdl2/Profile.h"
#include "platform/profile/profile.h"
#include "app/common/App_structs.h"
#include "app/common/Leaderboards/LeaderboardManager.h"
#include "app/linux/LinuxGame.h"
@ -191,7 +191,7 @@ void StatsCounter::save(int player, bool force) {
// Retrieve the data pointer from the profile
std::uint8_t* pbData = reinterpret_cast<std::uint8_t*>(
ProfileManager.GetGameDefinedProfileData(player));
PlatformProfile.GetGameDefinedProfileData(player));
pbData += sizeof(GAME_SETTINGS);
// Pointer to current position in stat array
@ -285,7 +285,7 @@ void StatsCounter::writeStats() {
// unsigned int locale = XGetLocale();
int viewCount = 0;
int iPad = ProfileManager.GetLockedProfile();
int iPad = PlatformProfile.GetLockedProfile();
}
void StatsCounter::setupStatBoards() {

View file

@ -8,6 +8,6 @@
static StdFileIO s_stdFileIO;
IPlatformFileIO& PlatformFileIO = s_stdFileIO;
IPlatformProfile& PlatformProfile = ProfileManager;
IPlatformProfile& PlatformProfile = PlatformProfile;
IPlatformRenderer& PlatformRender = RenderManager;
IPlatformStorage& PlatformStorage = StorageManager;

View file

@ -3,7 +3,6 @@
#include "IPlatformFileIO.h"
#include "IPlatformLeaderboard.h"
#include "IPlatformNetwork.h"
#include "IPlatformProfile.h"
#include "IPlatformRenderer.h"
#include "IPlatformStorage.h"
@ -12,6 +11,5 @@
// by the app layer at startup.
extern IPlatformFileIO& PlatformFileIO;
extern IPlatformProfile& PlatformProfile;
extern IPlatformRenderer& PlatformRender;
extern IPlatformStorage& PlatformStorage;

View file

@ -26,7 +26,7 @@ endif
sdl2_sources = files(
'input/sdl2/SDL2Input.cpp',
'sdl2/Profile.cpp',
'profile/stub/StubProfile.cpp',
'sdl2/Render.cpp',
'sdl2/render_stubs.cpp',
'sdl2/Storage.cpp',

View file

@ -4,11 +4,35 @@
#include <functional>
#include <string>
#include "PlatformTypes.h"
#include "PlatformTypes.h"
class CXuiStringTable;
#define TITLEID_MINECRAFT 0x584111F7
#define CONTEXT_GAME_STATE 0
#define CONTEXT_GAME_STATE_BLANK 0
#define CONTEXT_GAME_STATE_RIDING_PIG 1
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
#define CONTEXT_GAME_STATE_BOATING 3
#define CONTEXT_GAME_STATE_FISHING 4
#define CONTEXT_GAME_STATE_CRAFTING 5
#define CONTEXT_GAME_STATE_FORGING 6
#define CONTEXT_GAME_STATE_NETHER 7
#define CONTEXT_GAME_STATE_CD 8
#define CONTEXT_GAME_STATE_MAP 9
#define CONTEXT_GAME_STATE_ENCHANTING 5
#define CONTEXT_GAME_STATE_BREWING 5
#define CONTEXT_GAME_STATE_ANVIL 6
#define CONTEXT_GAME_STATE_TRADING 0
#define CONTEXT_PRESENCE_IDLE 0
#define CONTEXT_PRESENCE_MENUS 1
#define CONTEXT_PRESENCE_MULTIPLAYER 2
#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
class IPlatformProfile {
public:
struct PROFILESETTINGS {

View file

@ -0,0 +1,3 @@
#include "IPlatformProfile.h"
extern IPlatformProfile& PlatformProfile;

View file

@ -1,4 +1,4 @@
#include "Profile.h"
#include "StubProfile.h"
#include <cstdio>
#include <cstring>
@ -7,7 +7,8 @@
#include "../ProfileConstants.h"
#include "input/input.h"
C_4JProfile ProfileManager;
StubProfile stub_profile_instance;
IPlatformProfile& PlatformProfile = stub_profile_instance;
namespace {
constexpr PlayerUID kFakeXuidBase = 0xe000d45248242f2eULL;
@ -46,11 +47,11 @@ static_assert(sizeof(ProfileGameSettings) == 204,
"ProfileGameSettings must match GAME_SETTINGS profile storage");
void* s_profileData[XUSER_MAX_COUNT] = {};
C_4JProfile::PROFILESETTINGS s_dashboardSettings[XUSER_MAX_COUNT] = {};
IPlatformProfile::PROFILESETTINGS s_dashboardSettings[XUSER_MAX_COUNT] = {};
char s_gamertags[XUSER_MAX_COUNT][16] = {};
std::wstring s_displayNames[XUSER_MAX_COUNT];
int s_lockedProfile = 0;
std::function<int(C_4JProfile::PROFILESETTINGS*, int)>
std::function<int(IPlatformProfile::PROFILESETTINGS*, int)>
s_defaultOptionsCallback;
bool isValidPad(int iPad) { return iPad >= 0 && iPad < XUSER_MAX_COUNT; }
@ -103,7 +104,7 @@ void initialiseDefaultGameSettings(ProfileGameSettings* gameSettings) {
}
} // namespace
void C_4JProfile::Initialise(std::uint32_t, std::uint32_t, unsigned short,
void StubProfile::Initialise(std::uint32_t, std::uint32_t, unsigned short,
unsigned int, unsigned int, std::uint32_t*,
int iGameDefinedDataSizeX4, unsigned int*) {
s_lockedProfile = 0;
@ -119,27 +120,27 @@ void C_4JProfile::Initialise(std::uint32_t, std::uint32_t, unsigned short,
}
}
int C_4JProfile::GetLockedProfile() { return s_lockedProfile; }
void C_4JProfile::SetLockedProfile(int iProf) { s_lockedProfile = iProf; }
bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; }
bool C_4JProfile::IsSignedInLive(int iProf) { return IsSignedIn(iProf); }
bool C_4JProfile::IsGuest(int) { return false; }
bool C_4JProfile::QuerySigninStatus() { return true; }
int StubProfile::GetLockedProfile() { return s_lockedProfile; }
void StubProfile::SetLockedProfile(int iProf) { s_lockedProfile = iProf; }
bool StubProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; }
bool StubProfile::IsSignedInLive(int iProf) { return IsSignedIn(iProf); }
bool StubProfile::IsGuest(int) { return false; }
bool StubProfile::QuerySigninStatus() { return true; }
void C_4JProfile::GetXUID(int iPad, PlayerUID* pXuid, bool) {
void StubProfile::GetXUID(int iPad, PlayerUID* pXuid, bool) {
if (pXuid)
*pXuid =
kFakeXuidBase + static_cast<PlayerUID>(isValidPad(iPad) ? iPad : 0);
}
bool C_4JProfile::AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2) {
bool StubProfile::AreXUIDSEqual(PlayerUID xuid1, PlayerUID xuid2) {
return xuid1 == xuid2;
}
bool C_4JProfile::XUIDIsGuest(PlayerUID) { return false; }
bool C_4JProfile::AllowedToPlayMultiplayer(int) { return true; }
bool StubProfile::XUIDIsGuest(PlayerUID) { return false; }
bool StubProfile::AllowedToPlayMultiplayer(int) { return true; }
bool C_4JProfile::GetChatAndContentRestrictions(int, bool* pbChatRestricted,
bool StubProfile::GetChatAndContentRestrictions(int, bool* pbChatRestricted,
bool* pbContentRestricted,
int* piAge) {
if (pbChatRestricted) *pbChatRestricted = false;
@ -148,50 +149,50 @@ bool C_4JProfile::GetChatAndContentRestrictions(int, bool* pbChatRestricted,
return true;
}
char* C_4JProfile::GetGamertag(int iPad) {
char* StubProfile::GetGamertag(int iPad) {
const int p = isValidPad(iPad) ? iPad : 0;
ensureFakeIdentity(p);
return s_gamertags[p];
}
std::wstring C_4JProfile::GetDisplayName(int iPad) {
std::wstring StubProfile::GetDisplayName(int iPad) {
const int p = isValidPad(iPad) ? iPad : 0;
ensureFakeIdentity(p);
return s_displayNames[p];
}
int C_4JProfile::SetDefaultOptionsCallback(
int StubProfile::SetDefaultOptionsCallback(
std::function<int(PROFILESETTINGS*, int)> callback) {
s_defaultOptionsCallback = std::move(callback);
return 0;
}
C_4JProfile::PROFILESETTINGS* C_4JProfile::GetDashboardProfileSettings(
IPlatformProfile::PROFILESETTINGS* StubProfile::GetDashboardProfileSettings(
int iPad) {
return &s_dashboardSettings[isValidPad(iPad) ? iPad : 0];
}
void* C_4JProfile::GetGameDefinedProfileData(int iQuadrant) {
void* StubProfile::GetGameDefinedProfileData(int iQuadrant) {
return isValidPad(iQuadrant) ? s_profileData[iQuadrant] : nullptr;
}
void C_4JProfile::AllowedPlayerCreatedContent(int, bool, bool* allAllowed,
void StubProfile::AllowedPlayerCreatedContent(int, bool, bool* allAllowed,
bool* friendsAllowed) {
if (allAllowed) *allAllowed = true;
if (friendsAllowed) *friendsAllowed = true;
}
bool C_4JProfile::CanViewPlayerCreatedContent(int, bool, PlayerUID*,
bool StubProfile::CanViewPlayerCreatedContent(int, bool, PlayerUID*,
unsigned int) {
return true;
}
// GetPrimaryPad/SetPrimaryPad — delegates to PlatformPlatft.
// Kept here temporarily for call sites that still use ProfileManager.
// Kept here temporarily for call sites that still use PlatformPlatfore.
// These forward to the canonical copies in SDL2Input.
int C_4JProfile::GetPrimaryPad() {
int StubProfile::GetPrimaryPad() {
return PlatformInput.GetPrimaryPad();
}
void C_4JProfile::SetPrimaryPad(int iPad) {
void StubProfile::SetPrimaryPad(int iPad) {
PlatformInput.SetPrimaryPad(iPad);
}

View file

@ -8,32 +8,7 @@
#include "../IPlatformProfile.h"
#include "../PlatformTypes.h"
#define TITLEID_MINECRAFT 0x584111F7
#define CONTEXT_GAME_STATE 0
#define CONTEXT_GAME_STATE_BLANK 0
#define CONTEXT_GAME_STATE_RIDING_PIG 1
#define CONTEXT_GAME_STATE_RIDING_MINECART 2
#define CONTEXT_GAME_STATE_BOATING 3
#define CONTEXT_GAME_STATE_FISHING 4
#define CONTEXT_GAME_STATE_CRAFTING 5
#define CONTEXT_GAME_STATE_FORGING 6
#define CONTEXT_GAME_STATE_NETHER 7
#define CONTEXT_GAME_STATE_CD 8
#define CONTEXT_GAME_STATE_MAP 9
#define CONTEXT_GAME_STATE_ENCHANTING 5
#define CONTEXT_GAME_STATE_BREWING 5
#define CONTEXT_GAME_STATE_ANVIL 6
#define CONTEXT_GAME_STATE_TRADING 0
#define CONTEXT_PRESENCE_IDLE 0
#define CONTEXT_PRESENCE_MENUS 1
#define CONTEXT_PRESENCE_MULTIPLAYER 2
#define CONTEXT_PRESENCE_MULTIPLAYEROFFLINE 3
#define CONTEXT_PRESENCE_MULTIPLAYER_1P 4
#define CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE 5
class C_4JProfile : public IPlatformProfile {
class StubProfile : public IPlatformProfile {
public:
// --- Methods with real logic (implemented in .cpp) ---
@ -123,6 +98,3 @@ public:
int GetPrimaryPad();
void SetPrimaryPad(int iPad);
};
// Singleton
extern C_4JProfile ProfileManager;