From e00c95e7ab7c65d34ebe1e7b5cd241ca0872aea1 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 30 Mar 2026 21:48:54 -0500 Subject: [PATCH] nuke SocialManager --- minecraft/Minecraft.Client/Common/App_enums.h | 4 +- .../Minecraft.Client/Common/Consoles_App.cpp | 79 +++++------ .../UIScene_PauseMenu.cpp | 40 +++--- .../Minecraft.Client/Header Files/stdafx.h | 2 - .../Linux/Linux_Minecraft.cpp | 1 - .../Linux/Social/SocialManager.h | 41 ------ .../Source Files/Extrax64Stubs.cpp | 35 ----- .../Source Files/Social/SocialManager.h | 134 ------------------ 8 files changed, 61 insertions(+), 275 deletions(-) delete mode 100644 minecraft/Minecraft.Client/Linux/Social/SocialManager.h delete mode 100644 minecraft/Minecraft.Client/Windows64/Source Files/Social/SocialManager.h diff --git a/minecraft/Minecraft.Client/Common/App_enums.h b/minecraft/Minecraft.Client/Common/App_enums.h index 68d2f1af8..38a8cd618 100644 --- a/minecraft/Minecraft.Client/Common/App_enums.h +++ b/minecraft/Minecraft.Client/Common/App_enums.h @@ -45,8 +45,8 @@ enum eXuiAction { eAppAction_TrialOver, eAppAction_ExitTrial, eAppAction_WaitForDimensionChangeComplete, - eAppAction_SocialPost, - eAppAction_SocialPostScreenshot, + // eAppAction_SocialPost, + // eAppAction_SocialPostScreenshot, eAppAction_EthernetDisconnected, eAppAction_EthernetDisconnectedReturned, eAppAction_EthernetDisconnectedReturned_Menus, diff --git a/minecraft/Minecraft.Client/Common/Consoles_App.cpp b/minecraft/Minecraft.Client/Common/Consoles_App.cpp index 5c8f38766..ac76248de 100644 --- a/minecraft/Minecraft.Client/Common/Consoles_App.cpp +++ b/minecraft/Minecraft.Client/Common/Consoles_App.cpp @@ -26,7 +26,6 @@ #include "Minecraft.World/ConsoleHelpers/PathHelper.h" #include "../net/minecraft/stats/StatsCounter.h" #include "../net/minecraft/server/level/GameMode.h" -#include "../Windows64/Source Files/Social/SocialManager.h" #include "Source Files/Tutorial/TutorialMode.h" #if defined(_WINDOWS64) #include "../Windows64/XML/ATGXmlParser.h" @@ -2199,48 +2198,48 @@ void CMinecraftApp::HandleXuiActions(void) { if (eAction != eAppAction_Idle) { switch (eAction) { - // the renderer will capture a screenshot - case eAppAction_SocialPost: - if (ProfileManager.IsFullVersion()) { - // Facebook Share - if (CSocialManager::Instance() - ->IsTitleAllowedToPostImages() && - CSocialManager::Instance() - ->AreAllUsersAllowedToPostImages()) { - // disable character name tags for the shot - // m_bwasHidingGui = pMinecraft->options->hideGui; - // // 4J Stu - Removed 1.8.2 bug fix (TU6) as don't - // need this - pMinecraft->options->hideGui = true; + // // the renderer will capture a screenshot + // case eAppAction_SocialPost: + // if (ProfileManager.IsFullVersion()) { + // // Facebook Share + // if (CSocialManager::Instance() + // ->IsTitleAllowedToPostImages() && + // CSocialManager::Instance() + // ->AreAllUsersAllowedToPostImages()) { + // // disable character name tags for the shot + // // m_bwasHidingGui = pMinecraft->options->hideGui; + // // // 4J Stu - Removed 1.8.2 bug fix (TU6) as don't + // // need this + // pMinecraft->options->hideGui = true; - SetAction(i, eAppAction_SocialPostScreenshot); - } else { - SetAction(i, eAppAction_Idle); - } - } else { - SetAction(i, eAppAction_Idle); - } - break; - case eAppAction_SocialPostScreenshot: { - SetAction(i, eAppAction_Idle); - bool bKeepHiding = false; - for (int j = 0; j < XUSER_MAX_COUNT; ++j) { - if (app.GetXuiAction(j) == - eAppAction_SocialPostScreenshot) { - bKeepHiding = true; - break; - } - } - pMinecraft->options->hideGui = bKeepHiding; + // SetAction(i, eAppAction_SocialPostScreenshot); + // } else { + // SetAction(i, eAppAction_Idle); + // } + // } else { + // SetAction(i, eAppAction_Idle); + // } + // break; + // case eAppAction_SocialPostScreenshot: { + // SetAction(i, eAppAction_Idle); + // bool bKeepHiding = false; + // for (int j = 0; j < XUSER_MAX_COUNT; ++j) { + // if (app.GetXuiAction(j) == + // eAppAction_SocialPostScreenshot) { + // bKeepHiding = true; + // break; + // } + // } + // pMinecraft->options->hideGui = bKeepHiding; - // Facebook Share + // // Facebook Share - if (app.GetLocalPlayerCount() > 1) { - ui.NavigateToScene(i, eUIScene_SocialPost); - } else { - ui.NavigateToScene(i, eUIScene_SocialPost); - } - } break; + // if (app.GetLocalPlayerCount() > 1) { + // ui.NavigateToScene(i, eUIScene_SocialPost); + // } else { + // ui.NavigateToScene(i, eUIScene_SocialPost); + // } + // } break; case eAppAction_SaveGame: SetAction(i, eAppAction_Idle); if (!GetChangingSessionType()) { diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp index 4d7325607..3cfcd0ff4 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp @@ -92,31 +92,31 @@ std::wstring UIScene_PauseMenu::getMoviePath() { void UIScene_PauseMenu::tick() { UIScene::tick(); } void UIScene_PauseMenu::updateTooltips() { - bool bUserisClientSide = ProfileManager.IsSignedInLive(m_iPad); - bool bIsisPrimaryHost = - g_NetworkManager.IsHost() && (ProfileManager.GetPrimaryPad() == m_iPad); + // bool bUserisClientSide = ProfileManager.IsSignedInLive(m_iPad); + // bool bIsisPrimaryHost = + // g_NetworkManager.IsHost() && (ProfileManager.GetPrimaryPad() == m_iPad); int iY = -1; int iRB = -1; int iX = -1; - if (ProfileManager.IsFullVersion()) { - if (StorageManager.GetSaveDisabled()) { - iX = bIsisPrimaryHost ? IDS_TOOLTIPS_SELECTDEVICE : -1; - if (CSocialManager::Instance()->IsTitleAllowedToPostImages() && - CSocialManager::Instance()->AreAllUsersAllowedToPostImages() && - bUserisClientSide) { - iY = IDS_TOOLTIPS_SHARE; - } - } else { - iX = bIsisPrimaryHost ? IDS_TOOLTIPS_CHANGEDEVICE : -1; - if (CSocialManager::Instance()->IsTitleAllowedToPostImages() && - CSocialManager::Instance()->AreAllUsersAllowedToPostImages() && - bUserisClientSide) { - iY = IDS_TOOLTIPS_SHARE; - } - } - } + // if (ProfileManager.IsFullVersion()) { + // if (StorageManager.GetSaveDisabled()) { + // iX = bIsisPrimaryHost ? IDS_TOOLTIPS_SELECTDEVICE : -1; + // if (CSocialManager::Instance()->IsTitleAllowedToPostImages() && + // CSocialManager::Instance()->AreAllUsersAllowedToPostImages() && + // bUserisClientSide) { + // iY = IDS_TOOLTIPS_SHARE; + // } + // } else { + // iX = bIsisPrimaryHost ? IDS_TOOLTIPS_CHANGEDEVICE : -1; + // if (CSocialManager::Instance()->IsTitleAllowedToPostImages() && + // CSocialManager::Instance()->AreAllUsersAllowedToPostImages() && + // bUserisClientSide) { + // iY = IDS_TOOLTIPS_SHARE; + // } + // } + // } ui.SetTooltips(m_iPad, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, iX, iY, -1, -1, -1, iRB); } diff --git a/minecraft/Minecraft.Client/Header Files/stdafx.h b/minecraft/Minecraft.Client/Header Files/stdafx.h index 7df4404e8..3e0dfe14f 100644 --- a/minecraft/Minecraft.Client/Header Files/stdafx.h +++ b/minecraft/Minecraft.Client/Header Files/stdafx.h @@ -103,7 +103,6 @@ using namespace DirectX; #include "../Windows64/Windows64_App.h" #include "Minecraft.spa.h" #include "../Windows64/XML/ATGXmlParser.h" -#include "../Windows64/Source Files/Social/SocialManager.h" #include "../Common/Source Files/Audio/SoundEngine.h" #include "../Windows64/Iggy/include/iggy.h" #include "../Windows64/Iggy/gdraw/gdraw_d3d11.h" @@ -114,7 +113,6 @@ using namespace DirectX; #include "Minecraft.spa.h" #include "../Common/Source Files/Audio/SoundEngine.h" #include "../Linux/Linux_UIController.h" -#include "../Linux/Social/SocialManager.h" #endif #include "../Common/Source Files/ConsoleGameMode.h" diff --git a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp index d10950cdc..bc5cbf0bd 100644 --- a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp @@ -58,7 +58,6 @@ static void sigsegv_handler(int sig) { #include "Minecraft.World/ConsoleHelpers/ThreadName.h" #include "../net/minecraft/stats/StatsCounter.h" #include "../net/minecraft/client/multiplayer/ConnectScreen.h" -// #include "../../Windows64/Source Files/Social/SocialManager.h" // #include "../../Common/Source Files/Leaderboards/LeaderboardManager.h" // #include "../Common/XUI/XUI_Scene_Container.h" // #include "NetworkManager.h" diff --git a/minecraft/Minecraft.Client/Linux/Social/SocialManager.h b/minecraft/Minecraft.Client/Linux/Social/SocialManager.h deleted file mode 100644 index e3ae30431..000000000 --- a/minecraft/Minecraft.Client/Linux/Social/SocialManager.h +++ /dev/null @@ -1,41 +0,0 @@ -// ts just stink, social manager is a stupid stub rn -#pragma once -#include "../Stubs/winapi_stubs.h" - -#ifndef _SOCIAL_MANAGER_H -#define _SOCIAL_MANAGER_H - -enum ESocialNetwork { eFacebook = 0, eNumSocialNetworks }; - -class CSocialManager { -public: - static CSocialManager* Instance() { - static CSocialManager s_instance; - return &s_instance; - } - - void Initialise() {} - void Tick() {} - - bool RefreshPostingCapability() { return false; } - bool IsTitleAllowedToPostAnything() { return false; } - bool IsTitleAllowedToPostImages() { return false; } - bool IsTitleAllowedToPostLinks() { return false; } - bool AreAllUsersAllowedToPostImages() { return false; } - - bool PostLinkToSocialNetwork(ESocialNetwork, uint32_t, bool) { - return false; - } - bool PostImageToSocialNetwork(ESocialNetwork, uint32_t, bool) { - return false; - } - - void SetSocialPostText(const wchar_t*, const wchar_t*, const wchar_t*) {} - -private: - CSocialManager() {} - CSocialManager(const CSocialManager&); - CSocialManager& operator=(const CSocialManager&); -}; - -#endif // _SOCIAL_MANAGER_H diff --git a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp index 88b632cb7..cff710ba3 100644 --- a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp +++ b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp @@ -1,19 +1,6 @@ #include "Minecraft.World/Header Files/stdafx.h" -// #include -#if defined(_WINDOWS64) #include "../net/minecraft/stats/StatsCounter.h" -#include "../Windows64/Source Files/Social/SocialManager.h" -#include "../Windows64/Source Files/Sentient/DynamicConfigurations.h" -#elif defined(__linux__) -// On Linux, stdafx.h already provides Orbis-compatible Sentient/Dynamic headers -// via #pragma once. Pull in SentientManager for CSentientManager class -// declaration and StatsCounter; CSocialManager is provided as inline stubs via -// Linux/Social/SocialManager.h. -#include "../net/minecraft/stats/StatsCounter.h" -#else -#include "../net/minecraft/stats/StatsCounter.h" -#endif #if defined(_WINDOWS64) // C4JStorage StorageManager; @@ -37,28 +24,6 @@ void ATG::XMLParser::RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback) { } #endif -#if !defined(__linux__) -bool CSocialManager::IsTitleAllowedToPostAnything() { return false; } -bool CSocialManager::AreAllUsersAllowedToPostImages() { return false; } -bool CSocialManager::IsTitleAllowedToPostImages() { return false; } - -bool CSocialManager::PostLinkToSocialNetwork(ESocialNetwork eSocialNetwork, - uint32_t dwUserIndex, - bool bUsingKinect) { - return false; -} -bool CSocialManager::PostImageToSocialNetwork(ESocialNetwork eSocialNetwork, - uint32_t dwUserIndex, - bool bUsingKinect) { - return false; -} - -CSocialManager* CSocialManager::Instance() { return nullptr; } -void CSocialManager::SetSocialPostText(const wchar_t* Title, - const wchar_t* Caption, - const wchar_t* Desc) {}; -#endif - uint32_t XShowPartyUI(uint32_t dwUserIndex) { return 0; } uint32_t XShowFriendsUI(uint32_t dwUserIndex) { return 0; } int32_t XPartyGetUserList(XPARTY_USER_LIST* pUserList) { return S_OK; } diff --git a/minecraft/Minecraft.Client/Windows64/Source Files/Social/SocialManager.h b/minecraft/Minecraft.Client/Windows64/Source Files/Social/SocialManager.h deleted file mode 100644 index de278e62f..000000000 --- a/minecraft/Minecraft.Client/Windows64/Source Files/Social/SocialManager.h +++ /dev/null @@ -1,134 +0,0 @@ -// -// Class to handle and manage integration with social networks. -// 4J Studios Ltd, 2011. -// Andy West -// - -#if !defined(_SOCIAL_MANAGER_H) -#define _SOCIAL_MANAGER_H - -#if !defined(__linux__) -#include -#endif - -#define MAX_SOCIALPOST_CAPTION 60 -#define MAX_SOCIALPOST_DESC 100 - -// XDK only provides for facebook so far. Others may follow!? -enum ESocialNetwork { eFacebook = 0, eNumSocialNetworks }; - -// Class follows singleton design pattern. -class CSocialManager { -private: - // Default constructor, copy constructor and assignment operator are all - // private. - CSocialManager(); - CSocialManager(const CSocialManager&); - CSocialManager& operator=(const CSocialManager&); - - // Static private instance. - static CSocialManager* m_pInstance; - - // Bitset of title posting capability flags ( XSOCIAL_CAPABILITY_POSTIMAGE, - // XSOCIAL_CAPABILITY_POSTLINK ). - uint32_t m_dwSocialPostingCapability; - - // Index of user who made current active request. - uint32_t m_dwCurrRequestUser; - - // WESTY : Not sure if we even need to get social access key! - /* - // Size of the social network access key text buffer. - uint32_t m_dwAccessKeyTextSize; - - // Pointer to the social network access key text buffer. - wchar_t* m_pAccessKeyText; - */ - - // The various states of the manager. - enum EState { - eStateUnitialised = 0, - eStateReady, - eStateGetPostingCapability, - eStatePostingImage, - eStatePostingLink, - }; - - // Current state that manager is in. - EState m_eCurrState; - - // For xsocial asyncronous operations. - XOVERLAPPED m_Overlapped; - uint32_t m_dwOverlappedResultCode; - - // Social post preview image struct. - XSOCIAL_PREVIEWIMAGE m_PostPreviewImage; - - // Image details for posting an image to social network. - unsigned char* m_pMainImageBuffer; - uint32_t m_dwMainImageBufferSize; - - void DestroyMainPostImage(); - void DestroyPreviewPostImage(); - - // WESTY : Not sure if we even need to get social access key! - /* - bool GetSocialNetworkAccessKey( ESocialNetwork - eSocialNetwork, uint32_t dwUserIndex, bool bUsingKinect, uint32_t - dwUserTrackingIndex, bool bShowNetworkSignin ); - */ - -public: - // Retrieve singleton instance. - static CSocialManager* Instance(); - - // To be called once during game init. - void Initialise(); - - // Tick the social manager. Only does anything in async mode, polls for - // results of async actions. - void Tick(); - - // May need to be called if something changes (i.e. player signs in to live - // ). - bool RefreshPostingCapability(); - - // Returns true if any social newtork posting is allowed by us, false if not - // (if false, game must not display any social network UI). - bool IsTitleAllowedToPostAnything(); - - // Returns true if we are allowed to post images to social networks. - bool IsTitleAllowedToPostImages(); - - // Returns true if we are allowed to post links to social networks. - bool IsTitleAllowedToPostLinks(); - - // Returns false if any of the live signed in users have disabled - // XPRIVILEGE_SOCIAL_NETWORK_SHARING - bool AreAllUsersAllowedToPostImages(); - - // Post a test link to social network. - bool PostLinkToSocialNetwork(ESocialNetwork eSocialNetwork, - uint32_t dwUserIndex, bool bUsingKinect); - - // Post a test image to social network. - bool PostImageToSocialNetwork(ESocialNetwork eSocialNetwork, - uint32_t dwUserIndex, bool bUsingKinect); - - void SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, - const wchar_t* Desc); - - // WESTY : Not sure if we even need to get social access key! - /* - // We do not currently know what this is used for. We may not even - need it? bool ObtainSocialNetworkAccessKey( ESocialNetwork - eSocialNetwork, uint32_t dwUserIndex, bool bUsingKinect ); - */ - -private: - wchar_t m_wchTitleA[MAX_SOCIALPOST_CAPTION + 1]; - wchar_t m_wchCaptionA[MAX_SOCIALPOST_CAPTION + 1]; - wchar_t m_wchDescA[MAX_SOCIALPOST_DESC + 1]; -}; - -#endif