Merge branch 'dev' into feat/tracy
Some checks failed
Build (Linux, x86-64) / build-linux-amalgamate (push) Has been cancelled
Build (Linux, x86-64) / build-linux-full (push) Has been cancelled
Format Check / clang-format (push) Has been cancelled
Release Nightly (Linux, x86-64) / release-linux (push) Has been cancelled

This commit is contained in:
JuiceyDev 2026-04-07 13:18:59 +02:00 committed by GitHub
commit 1386b366a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
767 changed files with 12589 additions and 10751 deletions

View file

@ -0,0 +1,463 @@
#include "app/common/AppGameServices.h"
#include "app/common/Game.h"
#include "java/Class.h" // eINSTANCEOF
AppGameServices::AppGameServices(Game& game, IMenuService& menus)
: game_(game), menus_(menus) {}
// -- Strings --
const wchar_t* AppGameServices::getString(int id) {
return Game::GetString(id);
}
// -- Debug settings --
bool AppGameServices::debugSettingsOn() {
return game_.DebugSettingsOn();
}
bool AppGameServices::debugArtToolsOn() {
return game_.DebugArtToolsOn();
}
unsigned int AppGameServices::debugGetMask(int iPad, bool overridePlayer) {
return game_.GetGameSettingsDebugMask(iPad, overridePlayer);
}
bool AppGameServices::debugMobsDontAttack() {
return game_.GetMobsDontAttackEnabled();
}
bool AppGameServices::debugMobsDontTick() {
return game_.GetMobsDontTickEnabled();
}
bool AppGameServices::debugFreezePlayers() {
return game_.GetFreezePlayers();
}
// -- Game host options --
unsigned int AppGameServices::getGameHostOption(eGameHostOption option) {
return game_.GetGameHostOption(option);
}
void AppGameServices::setGameHostOption(eGameHostOption option,
unsigned int value) {
game_.SetGameHostOption(option, value);
}
// -- Level generation --
LevelGenerationOptions* AppGameServices::getLevelGenerationOptions() {
return game_.getLevelGenerationOptions();
}
LevelRuleset* AppGameServices::getGameRuleDefinitions() {
return game_.getGameRuleDefinitions();
}
// -- Texture cache --
void AppGameServices::addMemoryTextureFile(const std::wstring& name,
std::uint8_t* data,
unsigned int size) {
game_.AddMemoryTextureFile(name, data, size);
}
void AppGameServices::removeMemoryTextureFile(const std::wstring& name) {
game_.RemoveMemoryTextureFile(name);
}
void AppGameServices::getMemFileDetails(const std::wstring& name,
std::uint8_t** data,
unsigned int* size) {
game_.GetMemFileDetails(name, data, size);
}
bool AppGameServices::isFileInMemoryTextures(const std::wstring& name) {
return game_.IsFileInMemoryTextures(name);
}
// -- Player settings --
unsigned char AppGameServices::getGameSettings(int iPad, int setting) {
return game_.GetGameSettings(iPad, static_cast<eGameSetting>(setting));
}
unsigned char AppGameServices::getGameSettings(int setting) {
return game_.GetGameSettings(static_cast<eGameSetting>(setting));
}
// -- App time --
float AppGameServices::getAppTime() {
return game_.getAppTime();
}
// -- Game state --
bool AppGameServices::getGameStarted() { return game_.GetGameStarted(); }
void AppGameServices::setGameStarted(bool val) { game_.SetGameStarted(val); }
bool AppGameServices::getTutorialMode() { return game_.GetTutorialMode(); }
void AppGameServices::setTutorialMode(bool val) { game_.SetTutorialMode(val); }
bool AppGameServices::isAppPaused() { return game_.IsAppPaused(); }
int AppGameServices::getLocalPlayerCount() { return game_.GetLocalPlayerCount(); }
bool AppGameServices::autosaveDue() { return game_.AutosaveDue(); }
void AppGameServices::setAutosaveTimerTime() { game_.SetAutosaveTimerTime(); }
int64_t AppGameServices::secondsToAutosave() { return game_.SecondsToAutosave(); }
void AppGameServices::setDisconnectReason(
DisconnectPacket::eDisconnectReason reason) {
game_.SetDisconnectReason(reason);
}
void AppGameServices::lockSaveNotification() { game_.lockSaveNotification(); }
void AppGameServices::unlockSaveNotification() { game_.unlockSaveNotification(); }
bool AppGameServices::getResetNether() { return game_.GetResetNether(); }
bool AppGameServices::getUseDPadForDebug() { return game_.GetUseDPadForDebug(); }
bool AppGameServices::getWriteSavesToFolderEnabled() {
return game_.GetWriteSavesToFolderEnabled();
}
bool AppGameServices::isLocalMultiplayerAvailable() {
return game_.IsLocalMultiplayerAvailable();
}
bool AppGameServices::dlcInstallPending() {
return game_.DLCInstallPending();
}
bool AppGameServices::dlcInstallProcessCompleted() {
return game_.DLCInstallProcessCompleted();
}
bool AppGameServices::canRecordStatsAndAchievements() {
return game_.CanRecordStatsAndAchievements();
}
bool AppGameServices::getTMSGlobalFileListRead() {
return game_.GetTMSGlobalFileListRead();
}
void AppGameServices::setRequiredTexturePackID(std::uint32_t id) {
game_.SetRequiredTexturePackID(id);
}
void AppGameServices::setSpecialTutorialCompletionFlag(int iPad, int index) {
game_.SetSpecialTutorialCompletionFlag(iPad, index);
}
void AppGameServices::setBanListCheck(int iPad, bool val) {
game_.SetBanListCheck(iPad, val);
}
bool AppGameServices::getBanListCheck(int iPad) {
return game_.GetBanListCheck(iPad);
}
unsigned int AppGameServices::getGameNewWorldSize() {
return game_.GetGameNewWorldSize();
}
unsigned int AppGameServices::getGameNewWorldSizeUseMoat() {
return game_.GetGameNewWorldSizeUseMoat();
}
unsigned int AppGameServices::getGameNewHellScale() {
return game_.GetGameNewHellScale();
}
// -- UI dispatch --
void AppGameServices::setAction(int iPad, eXuiAction action, void* param) {
game_.SetAction(iPad, action, param);
}
void AppGameServices::setXuiServerAction(int iPad, eXuiServerAction action,
void* param) {
game_.SetXuiServerAction(iPad, action, param);
}
eXuiAction AppGameServices::getXuiAction(int iPad) {
return game_.GetXuiAction(iPad);
}
eXuiServerAction AppGameServices::getXuiServerAction(int iPad) {
return game_.GetXuiServerAction(iPad);
}
void* AppGameServices::getXuiServerActionParam(int iPad) {
return game_.GetXuiServerActionParam(iPad);
}
void AppGameServices::setGlobalXuiAction(eXuiAction action) {
game_.SetGlobalXuiAction(action);
}
void AppGameServices::handleButtonPresses() {
game_.HandleButtonPresses();
}
void AppGameServices::setTMSAction(int iPad, eTMSAction action) {
game_.SetTMSAction(iPad, action);
}
// -- Skin / cape / animation --
std::wstring AppGameServices::getPlayerSkinName(int iPad) {
return game_.GetPlayerSkinName(iPad);
}
std::uint32_t AppGameServices::getPlayerSkinId(int iPad) {
return game_.GetPlayerSkinId(iPad);
}
std::wstring AppGameServices::getPlayerCapeName(int iPad) {
return game_.GetPlayerCapeName(iPad);
}
std::uint32_t AppGameServices::getPlayerCapeId(int iPad) {
return game_.GetPlayerCapeId(iPad);
}
std::uint32_t AppGameServices::getAdditionalModelPartsForPad(int iPad) {
return game_.GetAdditionalModelParts(iPad);
}
void AppGameServices::setAdditionalSkinBoxes(std::uint32_t dwSkinID,
SKIN_BOX* boxA,
unsigned int boxC) {
game_.SetAdditionalSkinBoxes(dwSkinID, boxA, boxC);
}
std::vector<SKIN_BOX*>* AppGameServices::getAdditionalSkinBoxes(
std::uint32_t dwSkinID) {
return game_.GetAdditionalSkinBoxes(dwSkinID);
}
std::vector<ModelPart*>* AppGameServices::getAdditionalModelParts(
std::uint32_t dwSkinID) {
return game_.GetAdditionalModelParts(dwSkinID);
}
std::vector<ModelPart*>* AppGameServices::setAdditionalSkinBoxesFromVec(
std::uint32_t dwSkinID, std::vector<SKIN_BOX*>* pvSkinBoxA) {
return game_.SetAdditionalSkinBoxes(dwSkinID, pvSkinBoxA);
}
void AppGameServices::setAnimOverrideBitmask(std::uint32_t dwSkinID,
unsigned int bitmask) {
game_.SetAnimOverrideBitmask(dwSkinID, bitmask);
}
unsigned int AppGameServices::getAnimOverrideBitmask(
std::uint32_t dwSkinID) {
return game_.GetAnimOverrideBitmask(dwSkinID);
}
std::uint32_t AppGameServices::getSkinIdFromPath(const std::wstring& skin) {
return Game::getSkinIdFromPath(skin);
}
std::wstring AppGameServices::getSkinPathFromId(std::uint32_t skinId) {
return Game::getSkinPathFromId(skinId);
}
bool AppGameServices::defaultCapeExists() {
return game_.DefaultCapeExists();
}
bool AppGameServices::isXuidNotch(PlayerUID xuid) {
return game_.isXuidNotch(xuid);
}
bool AppGameServices::isXuidDeadmau5(PlayerUID xuid) {
return game_.isXuidDeadmau5(xuid);
}
// -- Platform features --
void AppGameServices::fatalLoadError() { game_.FatalLoadError(); }
void AppGameServices::setRichPresenceContext(int iPad, int contextId) {
game_.SetRichPresenceContext(iPad, contextId);
}
void AppGameServices::captureSaveThumbnail() { game_.CaptureSaveThumbnail(); }
void AppGameServices::getSaveThumbnail(std::uint8_t** data,
unsigned int* size) {
game_.GetSaveThumbnail(data, size);
}
void AppGameServices::readBannedList(int iPad, eTMSAction action,
bool bCallback) {
game_.ReadBannedList(iPad, action, bCallback);
}
void AppGameServices::updatePlayerInfo(std::uint8_t networkSmallId,
int16_t playerColourIndex,
unsigned int playerPrivileges) {
game_.UpdatePlayerInfo(networkSmallId, playerColourIndex, playerPrivileges);
}
unsigned int AppGameServices::getPlayerPrivileges(
std::uint8_t networkSmallId) {
return game_.GetPlayerPrivileges(networkSmallId);
}
void AppGameServices::setGameSettingsDebugMask(int iPad, unsigned int uiVal) {
game_.SetGameSettingsDebugMask(iPad, uiVal);
}
// -- Schematics / terrain --
void AppGameServices::processSchematics(LevelChunk* chunk) {
game_.processSchematics(chunk);
}
void AppGameServices::processSchematicsLighting(LevelChunk* chunk) {
game_.processSchematicsLighting(chunk);
}
void AppGameServices::addTerrainFeaturePosition(_eTerrainFeatureType type,
int x, int z) {
game_.AddTerrainFeaturePosition(type, x, z);
}
bool AppGameServices::getTerrainFeaturePosition(_eTerrainFeatureType type,
int* pX, int* pZ) {
return game_.GetTerrainFeaturePosition(type, pX, pZ);
}
void AppGameServices::loadDefaultGameRules() {
game_.loadDefaultGameRules();
}
// -- Archive / resources --
bool AppGameServices::hasArchiveFile(const std::wstring& filename) {
return game_.hasArchiveFile(filename);
}
std::vector<std::uint8_t> AppGameServices::getArchiveFile(
const std::wstring& filename) {
return game_.getArchiveFile(filename);
}
// -- Strings / formatting / misc queries --
int AppGameServices::getHTMLColour(eMinecraftColour colour) {
return game_.GetHTMLColour(colour);
}
std::wstring AppGameServices::getEntityName(EntityTypeId type) {
return game_.getEntityName(static_cast<eINSTANCEOF>(type));
}
const wchar_t* AppGameServices::getGameRulesString(const std::wstring& key) {
return game_.GetGameRulesString(key);
}
unsigned int AppGameServices::createImageTextData(std::uint8_t* textMetadata,
int64_t seed, bool hasSeed,
unsigned int uiHostOptions,
unsigned int uiTexturePackId) {
return game_.CreateImageTextData(textMetadata, seed, hasSeed,
uiHostOptions, uiTexturePackId);
}
std::wstring AppGameServices::getFilePath(std::uint32_t packId,
std::wstring filename,
bool bAddDataFolder,
std::wstring mountPoint) {
return game_.getFilePath(packId, filename, bAddDataFolder, mountPoint);
}
char* AppGameServices::getUniqueMapName() {
return game_.GetUniqueMapName();
}
void AppGameServices::setUniqueMapName(char* name) {
game_.SetUniqueMapName(name);
}
unsigned int AppGameServices::getOpacityTimer(int iPad) {
return game_.GetOpacityTimer(iPad);
}
void AppGameServices::setOpacityTimer(int iPad) {
game_.SetOpacityTimer(iPad);
}
void AppGameServices::tickOpacityTimer(int iPad) {
game_.TickOpacityTimer(iPad);
}
bool AppGameServices::isInBannedLevelList(int iPad, PlayerUID xuid,
char* levelName) {
return game_.IsInBannedLevelList(iPad, xuid, levelName);
}
MOJANG_DATA* AppGameServices::getMojangDataForXuid(PlayerUID xuid) {
return game_.GetMojangDataForXuid(xuid);
}
void AppGameServices::debugPrintf(const char* msg) {
game_.DebugPrintf("%s", msg);
}
// -- DLC --
DLCSkinFile* AppGameServices::getDLCSkinFile(const std::wstring& name) {
return game_.m_dlcManager.getSkinFile(name);
}
bool AppGameServices::dlcNeedsCorruptCheck() {
return game_.m_dlcManager.NeedsCorruptCheck();
}
unsigned int AppGameServices::dlcCheckForCorrupt(bool showMessage) {
return game_.m_dlcManager.checkForCorruptDLCAndAlert(showMessage);
}
bool AppGameServices::dlcReadDataFile(unsigned int& filesProcessed,
const std::wstring& path,
DLCPack* pack, bool fromArchive) {
return game_.m_dlcManager.readDLCDataFile(filesProcessed, path, pack,
fromArchive);
}
void AppGameServices::dlcRemovePack(DLCPack* pack) {
game_.m_dlcManager.removePack(pack);
}
// -- Game rules --
LevelGenerationOptions* AppGameServices::loadGameRules(std::uint8_t* data,
unsigned int size) {
return game_.m_gameRules.loadGameRules(data, size);
}
void AppGameServices::saveGameRules(std::uint8_t** data, unsigned int* size) {
game_.m_gameRules.saveGameRules(data, size);
}
void AppGameServices::unloadCurrentGameRules() {
game_.m_gameRules.unloadCurrentGameRules();
}
void AppGameServices::setLevelGenerationOptions(LevelGenerationOptions* levelGen) {
game_.m_gameRules.setLevelGenerationOptions(levelGen);
}
// -- Shared data --
std::vector<std::wstring>& AppGameServices::getSkinNames() {
return game_.vSkinNames;
}
std::vector<FEATURE_DATA*>& AppGameServices::getTerrainFeatures() {
return *game_.m_terrainFeatureManager.features();
}
// -- Menu service --
IMenuService& AppGameServices::menus() { return menus_; }

View file

@ -0,0 +1,185 @@
#pragma once
#include "minecraft/IGameServices.h"
class Game;
class IMenuService;
class AppGameServices : public IGameServices {
public:
AppGameServices(Game& game, IMenuService& menus);
// -- Strings --
const wchar_t* getString(int id) override;
// -- Debug settings --
bool debugSettingsOn() override;
bool debugArtToolsOn() override;
unsigned int debugGetMask(int iPad, bool overridePlayer) override;
bool debugMobsDontAttack() override;
bool debugMobsDontTick() override;
bool debugFreezePlayers() override;
// -- Game host options --
unsigned int getGameHostOption(eGameHostOption option) override;
void setGameHostOption(eGameHostOption option,
unsigned int value) override;
// -- Level generation --
LevelGenerationOptions* getLevelGenerationOptions() override;
LevelRuleset* getGameRuleDefinitions() override;
// -- Texture cache --
void addMemoryTextureFile(const std::wstring& name, std::uint8_t* data,
unsigned int size) override;
void removeMemoryTextureFile(const std::wstring& name) override;
void getMemFileDetails(const std::wstring& name, std::uint8_t** data,
unsigned int* size) override;
bool isFileInMemoryTextures(const std::wstring& name) override;
// -- Player settings --
unsigned char getGameSettings(int iPad, int setting) override;
unsigned char getGameSettings(int setting) override;
// -- App time --
float getAppTime() override;
// -- Game state --
bool getGameStarted() override;
void setGameStarted(bool val) override;
bool getTutorialMode() override;
void setTutorialMode(bool val) override;
bool isAppPaused() override;
int getLocalPlayerCount() override;
bool autosaveDue() override;
void setAutosaveTimerTime() override;
int64_t secondsToAutosave() override;
void setDisconnectReason(
DisconnectPacket::eDisconnectReason reason) override;
void lockSaveNotification() override;
void unlockSaveNotification() override;
bool getResetNether() override;
bool getUseDPadForDebug() override;
bool getWriteSavesToFolderEnabled() override;
bool isLocalMultiplayerAvailable() override;
bool dlcInstallPending() override;
bool dlcInstallProcessCompleted() override;
bool canRecordStatsAndAchievements() override;
bool getTMSGlobalFileListRead() override;
void setRequiredTexturePackID(std::uint32_t id) override;
void setSpecialTutorialCompletionFlag(int iPad, int index) override;
void setBanListCheck(int iPad, bool val) override;
bool getBanListCheck(int iPad) override;
unsigned int getGameNewWorldSize() override;
unsigned int getGameNewWorldSizeUseMoat() override;
unsigned int getGameNewHellScale() override;
// -- UI dispatch --
void setAction(int iPad, eXuiAction action, void* param) override;
void setXuiServerAction(int iPad, eXuiServerAction action,
void* param) override;
eXuiAction getXuiAction(int iPad) override;
eXuiServerAction getXuiServerAction(int iPad) override;
void* getXuiServerActionParam(int iPad) override;
void setGlobalXuiAction(eXuiAction action) override;
void handleButtonPresses() override;
void setTMSAction(int iPad, eTMSAction action) override;
// -- Skin / cape / animation --
std::wstring getPlayerSkinName(int iPad) override;
std::uint32_t getPlayerSkinId(int iPad) override;
std::wstring getPlayerCapeName(int iPad) override;
std::uint32_t getPlayerCapeId(int iPad) override;
std::uint32_t getAdditionalModelPartsForPad(int iPad) override;
void setAdditionalSkinBoxes(std::uint32_t dwSkinID, SKIN_BOX* boxA,
unsigned int boxC) override;
std::vector<SKIN_BOX*>* getAdditionalSkinBoxes(
std::uint32_t dwSkinID) override;
std::vector<ModelPart*>* getAdditionalModelParts(
std::uint32_t dwSkinID) override;
std::vector<ModelPart*>* setAdditionalSkinBoxesFromVec(
std::uint32_t dwSkinID, std::vector<SKIN_BOX*>* pvSkinBoxA) override;
void setAnimOverrideBitmask(std::uint32_t dwSkinID,
unsigned int bitmask) override;
unsigned int getAnimOverrideBitmask(std::uint32_t dwSkinID) override;
std::uint32_t getSkinIdFromPath(const std::wstring& skin) override;
std::wstring getSkinPathFromId(std::uint32_t skinId) override;
bool defaultCapeExists() override;
bool isXuidNotch(PlayerUID xuid) override;
bool isXuidDeadmau5(PlayerUID xuid) override;
// -- Platform features --
void fatalLoadError() override;
void setRichPresenceContext(int iPad, int contextId) override;
void captureSaveThumbnail() override;
void getSaveThumbnail(std::uint8_t** data, unsigned int* size) override;
void readBannedList(int iPad, eTMSAction action,
bool bCallback) override;
void updatePlayerInfo(std::uint8_t networkSmallId,
int16_t playerColourIndex,
unsigned int playerPrivileges) override;
unsigned int getPlayerPrivileges(std::uint8_t networkSmallId) override;
void setGameSettingsDebugMask(int iPad, unsigned int uiVal) override;
// -- Schematics / terrain --
void processSchematics(LevelChunk* chunk) override;
void processSchematicsLighting(LevelChunk* chunk) override;
void addTerrainFeaturePosition(_eTerrainFeatureType type, int x,
int z) override;
bool getTerrainFeaturePosition(_eTerrainFeatureType type, int* pX,
int* pZ) override;
void loadDefaultGameRules() override;
// -- Archive / resources --
bool hasArchiveFile(const std::wstring& filename) override;
std::vector<std::uint8_t> getArchiveFile(
const std::wstring& filename) override;
// -- Strings / formatting / misc queries --
int getHTMLColour(eMinecraftColour colour) override;
std::wstring getEntityName(EntityTypeId type) override;
const wchar_t* getGameRulesString(const std::wstring& key) override;
unsigned int createImageTextData(std::uint8_t* textMetadata,
int64_t seed, bool hasSeed,
unsigned int uiHostOptions,
unsigned int uiTexturePackId) override;
std::wstring getFilePath(std::uint32_t packId, std::wstring filename,
bool bAddDataFolder,
std::wstring mountPoint) override;
char* getUniqueMapName() override;
void setUniqueMapName(char* name) override;
unsigned int getOpacityTimer(int iPad) override;
void setOpacityTimer(int iPad) override;
void tickOpacityTimer(int iPad) override;
bool isInBannedLevelList(int iPad, PlayerUID xuid,
char* levelName) override;
MOJANG_DATA* getMojangDataForXuid(PlayerUID xuid) override;
void debugPrintf(const char* msg) override;
// -- DLC --
DLCSkinFile* getDLCSkinFile(const std::wstring& name) override;
bool dlcNeedsCorruptCheck() override;
unsigned int dlcCheckForCorrupt(bool showMessage) override;
bool dlcReadDataFile(unsigned int& filesProcessed,
const std::wstring& path, DLCPack* pack,
bool fromArchive) override;
void dlcRemovePack(DLCPack* pack) override;
// -- Game rules --
LevelGenerationOptions* loadGameRules(std::uint8_t* data,
unsigned int size) override;
void saveGameRules(std::uint8_t** data, unsigned int* size) override;
void unloadCurrentGameRules() override;
void setLevelGenerationOptions(LevelGenerationOptions* levelGen) override;
// -- Shared data --
std::vector<std::wstring>& getSkinNames() override;
std::vector<FEATURE_DATA*>& getTerrainFeatures() override;
// -- Menu service --
IMenuService& menus() override;
private:
Game& game_;
IMenuService& menus_;
};

View file

@ -4,12 +4,13 @@
#include "platform/sdl2/Storage.h"
#include "app/common/App_Defines.h"
#include "app/common/App_enums.h"
#include "app/common/src/Tutorial/TutorialEnum.h"
#include "app/common/src/UI/All Platforms/UIEnums.h"
#include "app/include/NetTypes.h"
#include "app/include/SkinBox.h"
#include "app/include/XboxStubs.h"
#include "minecraft/GameEnums.h"
#include "minecraft/GameTypes.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/UI/All Platforms/UIEnums.h"
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h"
typedef struct {
wchar_t* wchFilename;
@ -144,12 +145,6 @@ typedef struct {
int uiStringID;
} TIPSTRUCT;
typedef struct {
eXUID eXuid;
wchar_t wchCape[MAX_CAPENAME_SIZE];
wchar_t wchSkin[MAX_CAPENAME_SIZE];
} MOJANG_DATA;
typedef struct {
eDLCContentType eDLCType;
@ -162,11 +157,6 @@ typedef struct {
unsigned int uiSortIndex;
} DLC_INFO;
typedef struct {
int x, z;
_eTerrainFeatureType eTerrainFeature;
} FEATURE_DATA;
// banned list
typedef struct {
std::uint8_t* pBannedList;

View file

@ -0,0 +1,128 @@
#include "app/common/ArchiveManager.h"
#include <mutex>
#include <string>
#include "app/common/UI/All Platforms/ArchiveFile.h"
#include "app/linux/LinuxGame.h"
#include "java/File.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/PlatformServices.h"
#include "platform/PlatformTypes.h"
ArchiveManager::ArchiveManager()
: m_mediaArchive(nullptr), m_dwRequiredTexturePackID(0) {}
void ArchiveManager::loadMediaArchive() {
std::wstring mediapath = L"";
#if _WINDOWS64
mediapath = L"Common\\Media\\MediaWindows64.arc";
#elif __linux__
mediapath = L"app/common/Media/MediaLinux.arc";
#endif
if (!mediapath.empty()) {
#if defined(__linux__)
std::wstring exeDirW = PlatformFileIO.getBasePath().wstring();
std::wstring candidate = exeDirW + File::pathSeparator + mediapath;
if (File(candidate).exists()) {
m_mediaArchive = new ArchiveFile(File(candidate));
} else {
m_mediaArchive = new ArchiveFile(File(mediapath));
}
#else
m_mediaArchive = new ArchiveFile(File(mediapath));
#endif
}
}
int ArchiveManager::getArchiveFileSize(const std::wstring& filename) {
TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins)
tPack = pMinecraft->skins->getSelected();
if (tPack && tPack->hasData() && tPack->getArchiveFile() &&
tPack->getArchiveFile()->hasFile(filename)) {
return tPack->getArchiveFile()->getFileSize(filename);
} else
return m_mediaArchive->getFileSize(filename);
}
bool ArchiveManager::hasArchiveFile(const std::wstring& filename) {
TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins)
tPack = pMinecraft->skins->getSelected();
if (tPack && tPack->hasData() && tPack->getArchiveFile() &&
tPack->getArchiveFile()->hasFile(filename))
return true;
else
return m_mediaArchive->hasFile(filename);
}
std::vector<uint8_t> ArchiveManager::getArchiveFile(
const std::wstring& filename) {
TexturePack* tPack = nullptr;
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft && pMinecraft->skins)
tPack = pMinecraft->skins->getSelected();
if (tPack && tPack->hasData() && tPack->getArchiveFile() &&
tPack->getArchiveFile()->hasFile(filename)) {
return tPack->getArchiveFile()->getFile(filename);
} else
return m_mediaArchive->getFile(filename);
}
void ArchiveManager::addMemoryTPDFile(int iConfig, std::uint8_t* pbData,
unsigned int byteCount) {
std::lock_guard<std::mutex> lock(csMemTPDLock);
PMEMDATA pData = nullptr;
auto it = m_MEM_TPD.find(iConfig);
if (it == m_MEM_TPD.end()) {
pData = new MEMDATA();
pData->pbData = pbData;
pData->byteCount = byteCount;
pData->ucRefCount = 1;
m_MEM_TPD[iConfig] = pData;
}
}
void ArchiveManager::removeMemoryTPDFile(int iConfig) {
std::lock_guard<std::mutex> lock(csMemTPDLock);
PMEMDATA pData = nullptr;
auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) {
pData = m_MEM_TPD[iConfig];
delete pData;
m_MEM_TPD.erase(iConfig);
}
}
int ArchiveManager::getTPConfigVal(wchar_t* pwchDataFile) { return -1; }
bool ArchiveManager::isFileInTPD(int iConfig) {
bool val = false;
{
std::lock_guard<std::mutex> lock(csMemTPDLock);
auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) val = true;
}
return val;
}
void ArchiveManager::getTPD(int iConfig, std::uint8_t** ppbData,
unsigned int* pByteCount) {
std::lock_guard<std::mutex> lock(csMemTPDLock);
auto it = m_MEM_TPD.find(iConfig);
if (it != m_MEM_TPD.end()) {
PMEMDATA pData = (*it).second;
*ppbData = pData->pbData;
*pByteCount = pData->byteCount;
}
}

View file

@ -0,0 +1,54 @@
#pragma once
#include <cstdint>
#include <mutex>
#include <string>
#include <unordered_map>
#include <vector>
#include "app/common/App_structs.h"
class ArchiveFile;
class ArchiveManager {
public:
ArchiveManager();
void loadMediaArchive();
ArchiveFile* getMediaArchive() const { return m_mediaArchive; }
int getArchiveFileSize(const std::wstring& filename);
bool hasArchiveFile(const std::wstring& filename);
std::vector<uint8_t> getArchiveFile(const std::wstring& filename);
// Texture Pack Data files (icon, banner, comparison shot & text)
void addMemoryTPDFile(int iConfig, std::uint8_t* pbData,
unsigned int byteCount);
void removeMemoryTPDFile(int iConfig);
bool isFileInTPD(int iConfig);
void getTPD(int iConfig, std::uint8_t** ppbData, unsigned int* pByteCount);
int getTPDSize() { return m_MEM_TPD.size(); }
int getTPConfigVal(wchar_t* pwchDataFile);
void setRequiredTexturePackID(std::uint32_t texturePackId) {
m_dwRequiredTexturePackID = texturePackId;
}
std::uint32_t getRequiredTexturePackID() const {
return m_dwRequiredTexturePackID;
}
virtual void getFileFromTPD(eTPDFileType eType, std::uint8_t* pbData,
unsigned int byteCount, std::uint8_t** ppbData,
unsigned int* pByteCount) {
*ppbData = nullptr;
*pByteCount = 0;
}
protected:
ArchiveFile* m_mediaArchive;
private:
std::unordered_map<int, PMEMDATA> m_MEM_TPD;
std::mutex csMemTPDLock;
std::uint32_t m_dwRequiredTexturePackID;
};

View file

@ -12,7 +12,7 @@
#include "platform/PlatformTypes.h"
#include "app/common/App_Defines.h"
#include "app/common/src/Audio/Consoles_SoundEngine.h"
#include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/linux/Iggy/include/rrCore.h"
#include "app/linux/LinuxGame.h"
#include "platform/C4JThread.h"

View file

@ -7,7 +7,7 @@ class Random;
#include <string>
#include "app/common/App_Defines.h"
#include "app/common/src/Audio/Consoles_SoundEngine.h"
#include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/linux/Iggy/include/rrCore.h"
#include "minecraft/sounds/SoundTypes.h"
#include "miniaudio.h"

View file

@ -0,0 +1,131 @@
#include "app/common/BannedListManager.h"
#include <cstring>
#include "platform/XboxStubs.h"
BannedListManager::BannedListManager() {
m_pBannedListFileBuffer = nullptr;
m_dwBannedListFileSize = 0;
std::memset(m_pszUniqueMapName, 0, 14);
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
m_bRead_BannedListA[i] = false;
m_BanListCheck[i] = false;
m_vBannedListA[i] = new std::vector<PBANNEDLISTDATA>;
}
}
void BannedListManager::invalidate(int iPad) {
if (m_bRead_BannedListA[iPad] == true) {
m_bRead_BannedListA[iPad] = false;
setBanListCheck(iPad, false);
m_vBannedListA[iPad]->clear();
if (BannedListA[iPad].pBannedList) {
delete[] BannedListA[iPad].pBannedList;
BannedListA[iPad].pBannedList = nullptr;
}
}
}
void BannedListManager::addLevel(int iPad, PlayerUID xuid,
char* pszLevelName, bool bWriteToTMS) {
// we will have retrieved the banned level list from TMS, so add this one to
// it and write it back to TMS
BANNEDLISTDATA* pBannedListData = new BANNEDLISTDATA;
memset(pBannedListData, 0, sizeof(BANNEDLISTDATA));
memcpy(&pBannedListData->xuid, &xuid, sizeof(PlayerUID));
strcpy(pBannedListData->pszLevelName, pszLevelName);
m_vBannedListA[iPad]->push_back(pBannedListData);
if (bWriteToTMS) {
const std::size_t bannedListCount = m_vBannedListA[iPad]->size();
const unsigned int dataBytes =
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount];
int iCount = 0;
for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end(); ++it) {
PBANNEDLISTDATA pData = *it;
memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA));
}
// 4J-PB - write to TMS++ now
// bool
// bRes=StorageManager.WriteTMSFile(iPad,C4JStorage::eGlobalStorage_TitleUser,L"BannedList",(std::uint8_t*)pBannedList,
// dwDataBytes);
delete[] pBannedList;
}
// update telemetry too
}
bool BannedListManager::isInList(int iPad, PlayerUID xuid,
char* pszLevelName) {
for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end(); ++it) {
PBANNEDLISTDATA pData = *it;
if (IsEqualXUID(pData->xuid, xuid) &&
(strcmp(pData->pszLevelName, pszLevelName) == 0)) {
return true;
}
}
return false;
}
void BannedListManager::removeLevel(int iPad, PlayerUID xuid,
char* pszLevelName) {
// bool bFound=false;
// bool bRes;
// we will have retrieved the banned level list from TMS, so remove this one
// from it and write it back to TMS
for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end();) {
PBANNEDLISTDATA pBannedListData = *it;
if (pBannedListData != nullptr) {
if (IsEqualXUID(pBannedListData->xuid, xuid) &&
(strcmp(pBannedListData->pszLevelName, pszLevelName) == 0)) {
// match found, so remove this entry
it = m_vBannedListA[iPad]->erase(it);
} else {
++it;
}
} else {
++it;
}
}
const std::size_t bannedListCount = m_vBannedListA[iPad]->size();
const unsigned int dataBytes =
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
if (dataBytes == 0) {
// wipe the file
} else {
PBANNEDLISTDATA pBannedList =
(BANNEDLISTDATA*)(new std::uint8_t[dataBytes]);
for (std::size_t i = 0; i < bannedListCount; ++i) {
PBANNEDLISTDATA pBannedListData = m_vBannedListA[iPad]->at(i);
memcpy(&pBannedList[i], pBannedListData, sizeof(BANNEDLISTDATA));
}
delete[] pBannedList;
}
// update telemetry too
}
void BannedListManager::setUniqueMapName(char* pszUniqueMapName) {
memcpy(m_pszUniqueMapName, pszUniqueMapName, 14);
}
char* BannedListManager::getUniqueMapName() {
return m_pszUniqueMapName;
}

View file

@ -0,0 +1,46 @@
#pragma once
#include <cstdint>
#include <cstring>
#include <vector>
#include "app/common/App_structs.h"
#include "platform/XboxStubs.h"
class BannedListManager {
public:
BannedListManager();
void invalidate(int iPad);
void addLevel(int iPad, PlayerUID xuid, char* pszLevelName,
bool bWriteToTMS);
bool isInList(int iPad, PlayerUID xuid, char* pszLevelName);
void removeLevel(int iPad, PlayerUID xuid, char* pszLevelName);
void setUniqueMapName(char* pszUniqueMapName);
char* getUniqueMapName();
void setBanListCheck(int iPad, bool bVal) { m_BanListCheck[iPad] = bVal; }
bool getBanListCheck(int iPad) const { return m_BanListCheck[iPad]; }
bool getBanListRead(int iPad) const { return m_bRead_BannedListA[iPad]; }
void setBanListRead(int iPad, bool bVal) {
m_bRead_BannedListA[iPad] = bVal;
}
void clearBanList(int iPad) {
BannedListA[iPad].pBannedList = nullptr;
BannedListA[iPad].byteCount = 0;
}
BANNEDLIST BannedListA[XUSER_MAX_COUNT];
std::uint8_t* m_pBannedListFileBuffer;
unsigned int m_dwBannedListFileSize;
private:
VBANNEDLIST* m_vBannedListA[XUSER_MAX_COUNT];
bool m_bRead_BannedListA[XUSER_MAX_COUNT];
char m_pszUniqueMapName[14];
bool m_BanListCheck[XUSER_MAX_COUNT];
};

View file

@ -4,7 +4,7 @@
#include <utility>
#include <vector>
#include "app/common/App_enums.h"
#include "minecraft/GameEnums.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/ByteArrayInputStream.h"
#include "java/InputOutputStream/DataInputStream.h"

View file

@ -3,7 +3,7 @@
#include <string>
#include <unordered_map>
#include "app/common/App_enums.h"
#include "minecraft/GameEnums.h"
class ColourTable {
private:

View file

@ -1,7 +1,7 @@
#include "ConsoleGameMode.h"
#include "app/common/src/Tutorial/Tutorial.h"
#include "app/common/src/Tutorial/TutorialMode.h"
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialMode.h"
class ClientConnection;
class Minecraft;

View file

@ -1,5 +1,5 @@
#pragma once
#include "app/common/src/Tutorial/TutorialMode.h"
#include "app/common/Tutorial/TutorialMode.h"
class ClientConnection;
class Minecraft;

View file

@ -8,9 +8,9 @@
#include "platform/sdl2/Render.h"
#include "platform/sdl2/Storage.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
#include "app/include/XboxStubs.h"
#include "platform/XboxStubs.h"
#if defined(_WINDOWS64)
#include "app/windows/XML/ATGXmlParser.h"
#include "app/windows/XML/xmlFilesCallback.h"

View file

@ -1,7 +1,7 @@
#include "DLCCapeFile.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
DLCCapeFile::DLCCapeFile(const std::wstring& path)

View file

@ -1,8 +1,8 @@
#include "DLCColourTableFile.h"
#include "DLCManager.h"
#include "app/common/src/Colours/ColourTable.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/Colours/ColourTable.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"

View file

@ -3,7 +3,7 @@
#include <sstream>
#include "app/common/Minecraft_Macros.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/common/DLC/DLCManager.h"
DLCFile::DLCFile(DLCManager::EDLCType type, const std::wstring& path) {
m_type = type;

View file

@ -1,7 +1,7 @@
#pragma once
#include "DLCFile.h"
#include "app/common/src/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h"
class DLCGameRules : public DLCFile {
public:

View file

@ -1,7 +1,7 @@
#include "DLCGameRulesFile.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCGameRules.h"
#include "app/common/DLC/DLCGameRules.h"
DLCGameRulesFile::DLCGameRulesFile(const std::wstring& path)
: DLCGameRules(DLCManager::e_DLCType_GameRules, path) {

View file

@ -3,8 +3,8 @@
#include <string>
#include "DLCManager.h"
#include "app/common/src/DLC/DLCGameRules.h"
#include "app/common/src/GameRules/GameRuleManager.h"
#include "app/common/DLC/DLCGameRules.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "app/linux/LinuxGame.h"
class StringTable;

View file

@ -4,7 +4,7 @@
#include <string>
#include "DLCGameRules.h"
#include "app/common/src/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h"
class StringTable;

View file

@ -1,8 +1,8 @@
#include "DLCLocalisationFile.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/src/Localisation/StringTable.h"
#include "app/common/DLC/DLCFile.h"
#include "app/common/Localisation/StringTable.h"
DLCLocalisationFile::DLCLocalisationFile(const std::wstring& path)
: DLCFile(DLCManager::e_DLCType_LocalisationData, path) {

View file

@ -17,7 +17,7 @@
#include "platform/sdl2/Storage.h"
#include "DLCFile.h"
#include "DLCPack.h"
#include "app/common/src/GameRules/GameRuleManager.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "platform/PlatformServices.h"

View file

@ -15,11 +15,11 @@
#include "DLCLocalisationFile.h"
#include "DLCTextureFile.h"
#include "DLCUIDataFile.h"
#include "app/common/src/Console_Debug_enum.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/common/src/DLC/DLCSkinFile.h"
#include "app/common/src/Localisation/StringTable.h"
#include "app/common/Console_Debug_enum.h"
#include "app/common/DLC/DLCFile.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h"
#include "app/common/Localisation/StringTable.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "util/StringHelpers.h"

View file

@ -7,7 +7,7 @@
#include "platform/PlatformTypes.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCSkinFile.h"
#include "app/common/DLC/DLCSkinFile.h"
class DLCFile;
class DLCSkinFile;

View file

@ -5,10 +5,10 @@
#include "platform/sdl2/Render.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
#include "app/include/SkinBox.h"
#include "app/include/XboxStubs.h"
#include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h"
DLCSkinFile::DLCSkinFile(const std::wstring& path)
: DLCFile(DLCManager::e_DLCType_Skin, path) {

View file

@ -5,8 +5,8 @@
#include <vector>
#include "DLCFile.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/include/SkinBox.h"
#include "app/common/DLC/DLCManager.h"
#include "minecraft/client/model/SkinBox.h"
#include "minecraft/client/model/HumanoidModel.h"
class DLCSkinFile : public DLCFile {

View file

@ -1,7 +1,7 @@
#include "DLCTextureFile.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/DLC/DLCFile.h"
DLCTextureFile::DLCTextureFile(const std::wstring& path)
: DLCFile(DLCManager::e_DLCType_Texture, path) {

View file

@ -3,7 +3,7 @@
#include <string>
#include "DLCFile.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/common/DLC/DLCManager.h"
class DLCTextureFile : public DLCFile {
private:

View file

@ -1,7 +1,7 @@
#include "DLCUIDataFile.h"
#include "DLCManager.h"
#include "app/common/src/DLC/DLCFile.h"
#include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h"
DLCUIDataFile::DLCUIDataFile(const std::wstring& path)

View file

@ -0,0 +1,719 @@
#include "app/common/DLCController.h"
#include "app/common/Game.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/sdl2/Storage.h"
#include "platform/sdl2/Profile.h"
#include "platform/XboxStubs.h"
#include <cstring>
#include <mutex>
DLCController::DLCController() {
m_pDLCFileBuffer = nullptr;
m_dwDLCFileSize = 0;
m_bDefaultCapeInstallAttempted = false;
m_bDLCInstallProcessCompleted = false;
m_bDLCInstallPending = false;
m_iTotalDLC = 0;
m_iTotalDLCInstalled = 0;
m_bNewDLCAvailable = false;
m_bSeenNewDLCTip = false;
m_iDLCOfferC = 0;
m_bAllDLCContentRetrieved = true;
m_bAllTMSContentRetrieved = true;
m_bTickTMSDLCFiles = true;
}
std::unordered_map<PlayerUID, MOJANG_DATA*> DLCController::MojangData;
std::unordered_map<int, uint64_t> DLCController::DLCTextures_PackID;
std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Trial;
std::unordered_map<uint64_t, DLC_INFO*> DLCController::DLCInfo_Full;
std::unordered_map<std::wstring, uint64_t> DLCController::DLCInfo_SkinName;
std::uint32_t DLCController::m_dwContentTypeA[e_Marketplace_MAX] = {
XMARKETPLACE_OFFERING_TYPE_CONTENT,
XMARKETPLACE_OFFERING_TYPE_THEME,
XMARKETPLACE_OFFERING_TYPE_AVATARITEM,
XMARKETPLACE_OFFERING_TYPE_TILE,
};
int DLCController::marketplaceCountsCallback(
void* pParam, C4JStorage::DLC_TMS_DETAILS* pTMSDetails, int iPad) {
app.DebugPrintf("Marketplace Counts= New - %d Total - %d\n",
pTMSDetails->dwNewOffers, pTMSDetails->dwTotalOffers);
if (pTMSDetails->dwNewOffers > 0) {
app.m_dlcController.m_bNewDLCAvailable = true;
app.m_dlcController.m_bSeenNewDLCTip = false;
} else {
app.m_dlcController.m_bNewDLCAvailable = false;
app.m_dlcController.m_bSeenNewDLCTip = true;
}
return 0;
}
bool DLCController::startInstallDLCProcess(int iPad) {
app.DebugPrintf("--- DLCController::startInstallDLCProcess: pad=%i.\n",
iPad);
if ((dlcInstallProcessCompleted() == false) &&
(m_bDLCInstallPending == false)) {
app.m_dlcManager.resetUnnamedCorruptCount();
m_bDLCInstallPending = true;
m_iTotalDLC = 0;
m_iTotalDLCInstalled = 0;
app.DebugPrintf(
"--- DLCController::startInstallDLCProcess - "
"StorageManager.GetInstalledDLC\n");
StorageManager.GetInstalledDLC(
iPad, [this](int iInstalledC, int pad) {
return dlcInstalledCallback(iInstalledC, pad);
});
return true;
} else {
app.DebugPrintf(
"--- DLCController::startInstallDLCProcess - nothing to do\n");
return false;
}
}
int DLCController::dlcInstalledCallback(int iInstalledC, int iPad) {
app.DebugPrintf(
"--- DLCController::dlcInstalledCallback: totalDLC=%i, pad=%i.\n",
iInstalledC, iPad);
m_iTotalDLC = iInstalledC;
mountNextDLC(iPad);
return 0;
}
void DLCController::mountNextDLC(int iPad) {
app.DebugPrintf("--- DLCController::mountNextDLC: pad=%i.\n", iPad);
if (m_iTotalDLCInstalled < m_iTotalDLC) {
if (StorageManager.MountInstalledDLC(
iPad, m_iTotalDLCInstalled,
[this](int pad, std::uint32_t dwErr,
std::uint32_t dwLicenceMask) {
return dlcMountedCallback(pad, dwErr, dwLicenceMask);
}) != ERROR_IO_PENDING) {
app.DebugPrintf("Failed to mount DLC %d for pad %d\n",
m_iTotalDLCInstalled, iPad);
++m_iTotalDLCInstalled;
mountNextDLC(iPad);
} else {
app.DebugPrintf("StorageManager.MountInstalledDLC ok\n");
}
} else {
m_bDLCInstallPending = false;
m_bDLCInstallProcessCompleted = true;
ui.HandleDLCMountingComplete();
}
}
#if defined(_WINDOWS64)
#define CONTENT_DATA_DISPLAY_NAME(a) (a.szDisplayName)
#else
#define CONTENT_DATA_DISPLAY_NAME(a) (a.wszDisplayName)
#endif
int DLCController::dlcMountedCallback(int iPad, std::uint32_t dwErr,
std::uint32_t dwLicenceMask) {
#if defined(_WINDOWS64)
app.DebugPrintf("--- DLCController::dlcMountedCallback\n");
if (dwErr != ERROR_SUCCESS) {
app.DebugPrintf("Failed to mount DLC for pad %d: %u\n", iPad, dwErr);
app.m_dlcManager.incrementUnnamedCorruptCount();
} else {
XCONTENT_DATA ContentData =
StorageManager.GetDLC(m_iTotalDLCInstalled);
DLCPack* pack =
app.m_dlcManager.getPack(CONTENT_DATA_DISPLAY_NAME(ContentData));
if (pack != nullptr && pack->IsCorrupt()) {
app.DebugPrintf(
"Pack '%ls' is corrupt, removing it from the DLC Manager.\n",
CONTENT_DATA_DISPLAY_NAME(ContentData));
app.m_dlcManager.removePack(pack);
pack = nullptr;
}
if (pack == nullptr) {
app.DebugPrintf("Pack \"%ls\" is not installed, so adding it\n",
CONTENT_DATA_DISPLAY_NAME(ContentData));
#if defined(_WINDOWS64)
pack = new DLCPack(ContentData.szDisplayName, dwLicenceMask);
#else
pack = new DLCPack(ContentData.wszDisplayName, dwLicenceMask);
#endif
pack->SetDLCMountIndex(m_iTotalDLCInstalled);
pack->SetDLCDeviceID(ContentData.DeviceID);
app.m_dlcManager.addPack(pack);
handleDLC(pack);
if (pack->getDLCItemsCount(DLCManager::e_DLCType_Texture) > 0) {
Minecraft::GetInstance()->skins->addTexturePackFromDLC(
pack, pack->GetPackId());
}
} else {
app.DebugPrintf(
"Pack \"%ls\" is already installed. Updating license to %u\n",
CONTENT_DATA_DISPLAY_NAME(ContentData), dwLicenceMask);
pack->SetDLCMountIndex(m_iTotalDLCInstalled);
pack->SetDLCDeviceID(ContentData.DeviceID);
pack->updateLicenseMask(dwLicenceMask);
}
StorageManager.UnmountInstalledDLC();
}
++m_iTotalDLCInstalled;
mountNextDLC(iPad);
#endif
return 0;
}
#undef CONTENT_DATA_DISPLAY_NAME
void DLCController::handleDLC(DLCPack* pack) {
unsigned int dwFilesProcessed = 0;
#if defined(_WINDOWS64) || defined(__linux__)
std::vector<std::string> dlcFilenames;
#endif
StorageManager.GetMountedDLCFileList("DLCDrive", dlcFilenames);
for (int i = 0; i < dlcFilenames.size(); i++) {
app.m_dlcManager.readDLCDataFile(dwFilesProcessed, dlcFilenames[i],
pack);
}
if (dwFilesProcessed == 0) app.m_dlcManager.removePack(pack);
}
void DLCController::addCreditText(const wchar_t* lpStr) {
app.DebugPrintf("ADDING CREDIT - %ls\n", lpStr);
SCreditTextItemDef* pCreditStruct = new SCreditTextItemDef;
pCreditStruct->m_eType = eSmallText;
pCreditStruct->m_iStringID[0] = NO_TRANSLATED_STRING;
pCreditStruct->m_iStringID[1] = NO_TRANSLATED_STRING;
pCreditStruct->m_Text = new wchar_t[wcslen(lpStr) + 1];
wcscpy((wchar_t*)pCreditStruct->m_Text, lpStr);
vDLCCredits.push_back(pCreditStruct);
}
bool DLCController::alreadySeenCreditText(const std::wstring& wstemp) {
for (unsigned int i = 0; i < m_vCreditText.size(); i++) {
std::wstring temp = m_vCreditText.at(i);
if (temp.compare(wstemp) == 0) {
return true;
}
}
m_vCreditText.push_back((wchar_t*)wstemp.c_str());
return false;
}
unsigned int DLCController::getDLCCreditsCount() {
return (unsigned int)vDLCCredits.size();
}
SCreditTextItemDef* DLCController::getDLCCredits(int iIndex) {
return vDLCCredits.at(iIndex);
}
#if defined(_WINDOWS64)
int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial,
wchar_t* pFirstSkin,
unsigned int uiSortIndex, int iConfig,
wchar_t* pDataFile) {
int32_t hr = 0;
DLC_INFO* pDLCData = new DLC_INFO;
memset(pDLCData, 0, sizeof(DLC_INFO));
pDLCData->ullOfferID_Full = ullOfferID_Full;
pDLCData->ullOfferID_Trial = ullOfferID_Trial;
pDLCData->eDLCType = e_DLC_NotDefined;
pDLCData->iGender = iGender;
pDLCData->uiSortIndex = uiSortIndex;
pDLCData->iConfig = iConfig;
if (pBannerName != L"") {
wcsncpy_s(pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE);
}
if (pDataFile[0] != 0) {
wcsncpy_s(pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE);
}
if (pType != nullptr) {
if (wcscmp(pType, L"Skin") == 0) {
pDLCData->eDLCType = e_DLC_SkinPack;
} else if (wcscmp(pType, L"Gamerpic") == 0) {
pDLCData->eDLCType = e_DLC_Gamerpics;
} else if (wcscmp(pType, L"Theme") == 0) {
pDLCData->eDLCType = e_DLC_Themes;
} else if (wcscmp(pType, L"Avatar") == 0) {
pDLCData->eDLCType = e_DLC_AvatarItems;
} else if (wcscmp(pType, L"MashUpPack") == 0) {
pDLCData->eDLCType = e_DLC_MashupPacks;
DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full;
} else if (wcscmp(pType, L"TexturePack") == 0) {
pDLCData->eDLCType = e_DLC_TexturePacks;
DLCTextures_PackID[pDLCData->iConfig] = ullOfferID_Full;
}
}
if (ullOfferID_Trial != 0ll) DLCInfo_Trial[ullOfferID_Trial] = pDLCData;
if (ullOfferID_Full != 0ll) DLCInfo_Full[ullOfferID_Full] = pDLCData;
if (pFirstSkin[0] != 0) DLCInfo_SkinName[pFirstSkin] = ullOfferID_Full;
return hr;
}
#elif defined(__linux__)
int32_t DLCController::registerDLCData(wchar_t* pType, wchar_t* pBannerName,
int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial,
wchar_t* pFirstSkin,
unsigned int uiSortIndex, int iConfig,
wchar_t* pDataFile) {
fprintf(stderr,
"warning: DLCController::registerDLCData unimplemented for "
"platform `__linux__`\n");
return 0;
}
#endif
bool DLCController::getDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
uint64_t* pullVal) {
auto it = DLCInfo_SkinName.find(FirstSkin);
if (it == DLCInfo_SkinName.end()) {
return false;
} else {
*pullVal = (uint64_t)it->second;
return true;
}
}
bool DLCController::getDLCFullOfferIDForPackID(const int iPackID,
uint64_t* pullVal) {
auto it = DLCTextures_PackID.find(iPackID);
if (it == DLCTextures_PackID.end()) {
*pullVal = (uint64_t)0;
return false;
} else {
*pullVal = (uint64_t)it->second;
return true;
}
}
DLC_INFO* DLCController::getDLCInfoForTrialOfferID(
uint64_t ullOfferID_Trial) {
if (DLCInfo_Trial.size() > 0) {
auto it = DLCInfo_Trial.find(ullOfferID_Trial);
if (it == DLCInfo_Trial.end()) {
return nullptr;
} else {
return it->second;
}
} else
return nullptr;
}
DLC_INFO* DLCController::getDLCInfoForFullOfferID(uint64_t ullOfferID_Full) {
if (DLCInfo_Full.size() > 0) {
auto it = DLCInfo_Full.find(ullOfferID_Full);
if (it == DLCInfo_Full.end()) {
return nullptr;
} else {
return it->second;
}
} else
return nullptr;
}
DLC_INFO* DLCController::getDLCInfoTrialOffer(int iIndex) {
std::unordered_map<uint64_t, DLC_INFO*>::iterator it =
DLCInfo_Trial.begin();
for (int i = 0; i < iIndex; i++) {
++it;
}
return it->second;
}
DLC_INFO* DLCController::getDLCInfoFullOffer(int iIndex) {
std::unordered_map<uint64_t, DLC_INFO*>::iterator it = DLCInfo_Full.begin();
for (int i = 0; i < iIndex; i++) {
++it;
}
return it->second;
}
uint64_t DLCController::getDLCInfoTexturesFullOffer(int iIndex) {
std::unordered_map<int, uint64_t>::iterator it = DLCTextures_PackID.begin();
for (int i = 0; i < iIndex; i++) {
++it;
}
return it->second;
}
int DLCController::getDLCInfoTrialOffersCount() {
return (int)DLCInfo_Trial.size();
}
int DLCController::getDLCInfoFullOffersCount() {
return (int)DLCInfo_Full.size();
}
int DLCController::getDLCInfoTexturesOffersCount() {
return (int)DLCTextures_PackID.size();
}
unsigned int DLCController::addDLCRequest(eDLCMarketplaceType eType,
bool bPromote) {
{
std::lock_guard<std::mutex> lock(csDLCDownloadQueue);
int iPosition = 0;
for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it;
if (pCurrent->dwType == m_dwContentTypeA[eType]) {
if (pCurrent->eState == e_DLC_ContentState_Retrieving ||
pCurrent->eState == e_DLC_ContentState_Retrieved) {
return 0;
} else {
if (bPromote) {
m_DLCDownloadQueue.erase(m_DLCDownloadQueue.begin() +
iPosition);
m_DLCDownloadQueue.insert(m_DLCDownloadQueue.begin(),
pCurrent);
}
return 0;
}
}
iPosition++;
}
DLCRequest* pDLCreq = new DLCRequest;
pDLCreq->dwType = m_dwContentTypeA[eType];
pDLCreq->eState = e_DLC_ContentState_Idle;
m_DLCDownloadQueue.push_back(pDLCreq);
m_bAllDLCContentRetrieved = false;
}
app.DebugPrintf("[Consoles_App] Added DLC request.\n");
return 1;
}
bool DLCController::retrieveNextDLCContent() {
int primPad = ProfileManager.GetPrimaryPad();
if (primPad == -1 || !ProfileManager.IsSignedInLive(primPad)) {
return true;
}
{
std::lock_guard<std::mutex> lock(csDLCDownloadQueue);
for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it;
if (pCurrent->eState == e_DLC_ContentState_Retrieving) {
return true;
}
}
for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it;
if (pCurrent->eState == e_DLC_ContentState_Idle) {
#if defined(_DEBUG)
app.DebugPrintf("RetrieveNextDLCContent - type = %d\n",
pCurrent->dwType);
#endif
C4JStorage::EDLCStatus status = StorageManager.GetDLCOffers(
ProfileManager.GetPrimaryPad(),
[this](int iOfferC, std::uint32_t dwType, int pad) {
return dlcOffersReturned(iOfferC, dwType, pad);
},
pCurrent->dwType);
if (status == C4JStorage::EDLC_Pending) {
pCurrent->eState = e_DLC_ContentState_Retrieving;
} else {
app.DebugPrintf("RetrieveNextDLCContent - PROBLEM\n");
pCurrent->eState = e_DLC_ContentState_Retrieved;
}
return true;
}
}
}
app.DebugPrintf("[Consoles_App] Finished downloading dlc content.\n");
return false;
}
bool DLCController::checkTMSDLCCanStop() {
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it;
if (pCurrent->eState == e_TMS_ContentState_Retrieving) {
return false;
}
}
return true;
}
int DLCController::dlcOffersReturned(int iOfferC, std::uint32_t dwType,
int iPad) {
{
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it;
if (pCurrent->dwType == static_cast<std::uint32_t>(dwType)) {
m_iDLCOfferC = iOfferC;
app.DebugPrintf(
"DLCOffersReturned - type %u, count %d - setting to "
"retrieved\n",
dwType, iOfferC);
pCurrent->eState = e_DLC_ContentState_Retrieved;
break;
}
}
}
return 0;
}
eDLCContentType DLCController::find_eDLCContentType(std::uint32_t dwType) {
for (int i = 0; i < e_DLC_MAX; i++) {
if (m_dwContentTypeA[i] == dwType) {
return (eDLCContentType)i;
}
}
return (eDLCContentType)0;
}
bool DLCController::dlcContentRetrieved(eDLCMarketplaceType eType) {
std::lock_guard<std::mutex> lock(csDLCDownloadQueue);
for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end();
++it) {
DLCRequest* pCurrent = *it;
if ((pCurrent->dwType == m_dwContentTypeA[eType]) &&
(pCurrent->eState == e_DLC_ContentState_Retrieved)) {
return true;
}
}
return false;
}
void DLCController::tickDLCOffersRetrieved() {
if (!m_bAllDLCContentRetrieved) {
if (!retrieveNextDLCContent()) {
app.DebugPrintf("[Consoles_App] All content retrieved.\n");
m_bAllDLCContentRetrieved = true;
}
}
}
void DLCController::clearAndResetDLCDownloadQueue() {
app.DebugPrintf("[Consoles_App] Clear and reset download queue.\n");
int iPosition = 0;
{
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
for (auto it = m_DLCDownloadQueue.begin();
it != m_DLCDownloadQueue.end(); ++it) {
DLCRequest* pCurrent = *it;
delete pCurrent;
iPosition++;
}
m_DLCDownloadQueue.clear();
m_bAllDLCContentRetrieved = true;
}
}
bool DLCController::retrieveNextTMSPPContent() { return false; }
void DLCController::tickTMSPPFilesRetrieved() {
if (m_bTickTMSDLCFiles && !m_bAllTMSContentRetrieved) {
if (retrieveNextTMSPPContent() == false) {
m_bAllTMSContentRetrieved = true;
}
}
}
void DLCController::clearTMSPPFilesRetrieved() {
int iPosition = 0;
{
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it;
delete pCurrent;
iPosition++;
}
m_TMSPPDownloadQueue.clear();
m_bAllTMSContentRetrieved = true;
}
}
unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
bool bPromote) {
std::lock_guard<std::mutex> lock(csTMSPPDownloadQueue);
if (eType == e_DLC_TexturePackData) {
int iCount = getDLCInfoFullOffersCount();
for (int i = 0; i < iCount; i++) {
DLC_INFO* pDLC = getDLCInfoFullOffer(i);
if ((pDLC->eDLCType == e_DLC_TexturePacks) ||
(pDLC->eDLCType == e_DLC_MashupPacks)) {
if (pDLC->wchDataFile[0] != 0) {
{
bool bPresent = app.IsFileInTPD(pDLC->iConfig);
if (!bPresent) {
bool bAlreadyInQueue = false;
for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it;
if (wcscmp(pDLC->wchDataFile,
pCurrent->wchFilename) == 0) {
bAlreadyInQueue = true;
break;
}
}
if (!bAlreadyInQueue) {
TMSPPRequest* pTMSPPreq = new TMSPPRequest;
pTMSPPreq->CallbackFunc =
&DLCController::tmsPPFileReturned;
pTMSPPreq->lpCallbackParam = this;
pTMSPPreq->eStorageFacility =
C4JStorage::eGlobalStorage_Title;
pTMSPPreq->eFileTypeVal =
C4JStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename,
pDLC->wchDataFile,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = e_DLC_TexturePackData;
pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false;
m_TMSPPDownloadQueue.push_back(pTMSPPreq);
}
} else {
app.DebugPrintf(
"Texture data already present in the TPD\n");
}
}
}
}
}
} else {
int iCount;
iCount = getDLCInfoFullOffersCount();
for (int i = 0; i < iCount; i++) {
DLC_INFO* pDLC = getDLCInfoFullOffer(i);
if (pDLC->eDLCType == eType) {
wchar_t* cString = pDLC->wchBanner;
{
bool bPresent = app.IsFileInMemoryTextures(cString);
if (!bPresent) {
bool bAlreadyInQueue = false;
for (auto it = m_TMSPPDownloadQueue.begin();
it != m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it;
if (wcscmp(pDLC->wchBanner,
pCurrent->wchFilename) == 0) {
bAlreadyInQueue = true;
break;
}
}
if (!bAlreadyInQueue) {
TMSPPRequest* pTMSPPreq = new TMSPPRequest;
memset(pTMSPPreq, 0, sizeof(TMSPPRequest));
pTMSPPreq->CallbackFunc =
&DLCController::tmsPPFileReturned;
pTMSPPreq->lpCallbackParam = this;
pTMSPPreq->eStorageFacility =
C4JStorage::eGlobalStorage_Title;
pTMSPPreq->eFileTypeVal =
C4JStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename, pDLC->wchBanner,
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = eType;
pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false;
m_TMSPPDownloadQueue.push_back(pTMSPPreq);
app.DebugPrintf(
"===m_TMSPPDownloadQueue Adding %ls, q size is "
"%d\n",
pTMSPPreq->wchFilename,
m_TMSPPDownloadQueue.size());
}
}
}
}
}
}
return 1;
}
int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData,
C4JStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename) {
DLCController* pClass = (DLCController*)pParam;
{
std::lock_guard<std::mutex> lock(pClass->csTMSPPDownloadQueue);
for (auto it = pClass->m_TMSPPDownloadQueue.begin();
it != pClass->m_TMSPPDownloadQueue.end(); ++it) {
TMSPPRequest* pCurrent = *it;
#if defined(_WINDOWS64)
char szFile[MAX_TMSFILENAME_SIZE];
wcstombs(szFile, pCurrent->wchFilename, MAX_TMSFILENAME_SIZE);
if (strcmp(szFilename, szFile) == 0)
#endif
{
pCurrent->eState = e_TMS_ContentState_Retrieved;
if (pFileData != nullptr) {
switch (pCurrent->eType) {
case e_DLC_TexturePackData: {
app.DebugPrintf("--- Got texturepack data %ls\n",
pCurrent->wchFilename);
int iConfig =
app.GetTPConfigVal(pCurrent->wchFilename);
app.AddMemoryTPDFile(iConfig, pFileData->pbData,
pFileData->size);
} break;
default:
app.DebugPrintf("--- Got image data - %ls\n",
pCurrent->wchFilename);
app.AddMemoryTextureFile(pCurrent->wchFilename,
pFileData->pbData,
pFileData->size);
break;
}
} else {
app.DebugPrintf("TMSImageReturned failed (%s)...\n",
szFilename);
}
break;
}
}
}
return 0;
}

View file

@ -0,0 +1,137 @@
#pragma once
#include <cstdint>
#include <mutex>
#include <string>
#include <unordered_map>
#include <vector>
#include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h"
#include "platform/sdl2/Storage.h"
#include "platform/XboxStubs.h"
struct SCreditTextItemDef;
class DLCPack;
class DLCController {
public:
DLCController();
// Install process
bool startInstallDLCProcess(int iPad);
int dlcInstalledCallback(int iInstalledC, int iPad);
void mountNextDLC(int iPad);
int dlcMountedCallback(int iPad, std::uint32_t dwErr,
std::uint32_t dwLicenceMask);
void handleDLC(DLCPack* pack);
bool dlcInstallPending() { return m_bDLCInstallPending; }
bool dlcInstallProcessCompleted() { return m_bDLCInstallProcessCompleted; }
void clearDLCInstalled() { m_bDLCInstallProcessCompleted = false; }
static int marketplaceCountsCallback(void* pParam,
C4JStorage::DLC_TMS_DETAILS*,
int iPad);
// DLC info registration
static int32_t registerDLCData(wchar_t*, wchar_t*, int, uint64_t, uint64_t,
wchar_t*, unsigned int, int,
wchar_t* pDataFile);
bool getDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
uint64_t* pullVal);
bool getDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal);
DLC_INFO* getDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial);
DLC_INFO* getDLCInfoForFullOfferID(uint64_t ullOfferID_Full);
DLC_INFO* getDLCInfoTrialOffer(int iIndex);
DLC_INFO* getDLCInfoFullOffer(int iIndex);
uint64_t getDLCInfoTexturesFullOffer(int iIndex);
int getDLCInfoTrialOffersCount();
int getDLCInfoFullOffersCount();
int getDLCInfoTexturesOffersCount();
// DLC content/offers
unsigned int addDLCRequest(eDLCMarketplaceType eContentType,
bool bPromote = false);
bool retrieveNextDLCContent();
bool checkTMSDLCCanStop();
int dlcOffersReturned(int iOfferC, std::uint32_t dwType, int iPad);
std::uint32_t getDLCContentType(eDLCContentType eType) {
return m_dwContentTypeA[eType];
}
eDLCContentType find_eDLCContentType(std::uint32_t dwType);
int getDLCOffersCount() { return m_iDLCOfferC; }
bool dlcContentRetrieved(eDLCMarketplaceType eType);
void tickDLCOffersRetrieved();
void clearAndResetDLCDownloadQueue();
// TMS/TMSPP
bool retrieveNextTMSPPContent();
void tickTMSPPFilesRetrieved();
void clearTMSPPFilesRetrieved();
unsigned int addTMSPPFileTypeRequest(eDLCContentType eType,
bool bPromote = false);
static int tmsPPFileReturned(void* pParam, int iPad, int iUserData,
C4JStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename);
// Credit text
void addCreditText(const wchar_t* lpStr);
bool alreadySeenCreditText(const std::wstring& wstemp);
unsigned int getDLCCreditsCount();
SCreditTextItemDef* getDLCCredits(int iIndex);
// New DLC available
void clearNewDLCAvailable() {
m_bNewDLCAvailable = false;
m_bSeenNewDLCTip = true;
}
bool getNewDLCAvailable() { return m_bNewDLCAvailable; }
void displayNewDLCTipAgain() { m_bSeenNewDLCTip = false; }
bool displayNewDLCTip() {
if (!m_bSeenNewDLCTip) {
m_bSeenNewDLCTip = true;
return true;
} else
return false;
}
void setTickTMSDLCFiles(bool bVal) { m_bTickTMSDLCFiles = bVal; }
// Public data needed by other parts
std::vector<std::wstring> m_vCreditText;
std::uint8_t* m_pDLCFileBuffer;
unsigned int m_dwDLCFileSize;
// DLC install counters (accessed by dlcMountedCallback)
int m_iTotalDLC;
int m_iTotalDLCInstalled;
// Static maps
static std::unordered_map<PlayerUID, MOJANG_DATA*> MojangData;
static std::unordered_map<int, uint64_t> DLCTextures_PackID;
static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Trial;
static std::unordered_map<uint64_t, DLC_INFO*> DLCInfo_Full;
static std::unordered_map<std::wstring, uint64_t> DLCInfo_SkinName;
static std::uint32_t m_dwContentTypeA[e_Marketplace_MAX];
private:
std::vector<SCreditTextItemDef*> vDLCCredits;
std::vector<DLCRequest*> m_DLCDownloadQueue;
std::vector<TMSPPRequest*> m_TMSPPDownloadQueue;
int m_iDLCOfferC;
bool m_bAllDLCContentRetrieved;
bool m_bAllTMSContentRetrieved;
bool m_bTickTMSDLCFiles;
std::mutex csDLCDownloadQueue;
std::mutex csTMSPPDownloadQueue;
bool m_bDLCInstallProcessCompleted;
bool m_bDLCInstallPending;
bool m_bDefaultCapeInstallAttempted;
bool m_bNewDLCAvailable;
bool m_bSeenNewDLCTip;
};

View file

@ -0,0 +1,33 @@
#include "app/common/DebugOptions.h"
DebugOptions::DebugOptions() {
#if defined(_DEBUG_MENUS_ENABLED)
#if defined(_CONTENT_PACKAGE)
m_bDebugOptions =
false; // make them off by default in a content package build
#else
m_bDebugOptions = true;
#endif
#else
m_bDebugOptions = false;
#endif
m_bLoadSavesFromFolderEnabled = false;
m_bWriteSavesToFolderEnabled = false;
m_bMobsDontAttack = false;
m_bMobsDontTick = false;
m_bFreezePlayers = false;
#if defined(_CONTENT_PACAKGE)
m_bUseDPadForDebug = false;
#else
m_bUseDPadForDebug = true;
#endif
}
#if defined(_DEBUG_MENUS_ENABLED)
bool DebugOptions::debugArtToolsOn(unsigned int debugMask) {
return settingsOn() &&
(debugMask & (1L << eDebugSetting_ArtTools)) != 0;
}
#endif

View file

@ -0,0 +1,52 @@
#pragma once
#include "app/common/Console_Debug_enum.h"
class DebugOptions {
public:
DebugOptions();
bool settingsOn() const { return m_bDebugOptions; }
void setDebugOptions(bool bVal) { m_bDebugOptions = bVal; }
bool getLoadSavesFromFolderEnabled() const {
return m_bLoadSavesFromFolderEnabled;
}
void setLoadSavesFromFolderEnabled(bool bVal) {
m_bLoadSavesFromFolderEnabled = bVal;
}
bool getWriteSavesToFolderEnabled() const {
return m_bWriteSavesToFolderEnabled;
}
void setWriteSavesToFolderEnabled(bool bVal) {
m_bWriteSavesToFolderEnabled = bVal;
}
bool getMobsDontAttack() const { return m_bMobsDontAttack; }
void setMobsDontAttack(bool bVal) { m_bMobsDontAttack = bVal; }
bool getUseDPadForDebug() const { return m_bUseDPadForDebug; }
void setUseDPadForDebug(bool bVal) { m_bUseDPadForDebug = bVal; }
bool getMobsDontTick() const { return m_bMobsDontTick; }
void setMobsDontTick(bool bVal) { m_bMobsDontTick = bVal; }
bool getFreezePlayers() const { return m_bFreezePlayers; }
void setFreezePlayers(bool bVal) { m_bFreezePlayers = bVal; }
#if defined(_DEBUG_MENUS_ENABLED)
bool debugArtToolsOn(unsigned int debugMask);
#else
bool debugArtToolsOn(unsigned int) { return false; }
#endif
private:
bool m_bDebugOptions;
bool m_bLoadSavesFromFolderEnabled;
bool m_bWriteSavesToFolderEnabled;
bool m_bMobsDontAttack;
bool m_bUseDPadForDebug;
bool m_bMobsDontTick;
bool m_bFreezePlayers;
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,58 @@
#include "app/common/GameMenuService.h"
#include "app/common/Game.h"
bool GameMenuService::openInventory(int iPad, std::shared_ptr<LocalPlayer> player, bool navigateBack) {
return game_.LoadInventoryMenu(iPad, player, navigateBack);
}
bool GameMenuService::openCreative(int iPad, std::shared_ptr<LocalPlayer> player, bool navigateBack) {
return game_.LoadCreativeMenu(iPad, player, navigateBack);
}
bool GameMenuService::openCrafting2x2(int iPad, std::shared_ptr<LocalPlayer> player) {
return game_.LoadCrafting2x2Menu(iPad, player);
}
bool GameMenuService::openCrafting3x3(int iPad, std::shared_ptr<LocalPlayer> player, int x, int y, int z) {
return game_.LoadCrafting3x3Menu(iPad, player, x, y, z);
}
bool GameMenuService::openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x, int y, int z, Level* level, const std::wstring& name) {
return game_.LoadEnchantingMenu(iPad, inventory, x, y, z, level, name);
}
bool GameMenuService::openFurnace(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace) {
return game_.LoadFurnaceMenu(iPad, inventory, furnace);
}
bool GameMenuService::openBrewingStand(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand) {
return game_.LoadBrewingStandMenu(iPad, inventory, brewingStand);
}
bool GameMenuService::openContainer(int iPad, std::shared_ptr<Container> inventory, std::shared_ptr<Container> container) {
return game_.LoadContainerMenu(iPad, inventory, container);
}
bool GameMenuService::openTrap(int iPad, std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap) {
return game_.LoadTrapMenu(iPad, inventory, trap);
}
bool GameMenuService::openFireworks(int iPad, std::shared_ptr<LocalPlayer> player, int x, int y, int z) {
return game_.LoadFireworksMenu(iPad, player, x, y, z);
}
bool GameMenuService::openSign(int iPad, std::shared_ptr<SignTileEntity> sign) {
return game_.LoadSignEntryMenu(iPad, sign);
}
bool GameMenuService::openRepairing(int iPad, std::shared_ptr<Inventory> inventory, Level* level, int x, int y, int z) {
return game_.LoadRepairingMenu(iPad, inventory, level, x, y, z);
}
bool GameMenuService::openTrading(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level* level, const std::wstring& name) {
return game_.LoadTradingMenu(iPad, inventory, trader, level, name);
}
bool GameMenuService::openCommandBlock(int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) {
return game_.LoadCommandBlockMenu(iPad, commandBlock);
}
bool GameMenuService::openHopper(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<HopperTileEntity> hopper) {
return game_.LoadHopperMenu(iPad, inventory, hopper);
}
bool GameMenuService::openHopperMinecart(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<MinecartHopper> hopper) {
return game_.LoadHopperMenu(iPad, inventory, hopper);
}
bool GameMenuService::openHorse(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Container> container, std::shared_ptr<EntityHorse> horse) {
return game_.LoadHorseMenu(iPad, inventory, container, horse);
}
bool GameMenuService::openBeacon(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<BeaconTileEntity> beacon) {
return game_.LoadBeaconMenu(iPad, inventory, beacon);
}

View file

@ -0,0 +1,54 @@
#pragma once
#include "minecraft/client/IMenuService.h"
class Game;
class GameMenuService : public IMenuService {
public:
explicit GameMenuService(Game& game) : game_(game) {}
bool openInventory(int iPad, std::shared_ptr<LocalPlayer> player,
bool navigateBack) override;
bool openCreative(int iPad, std::shared_ptr<LocalPlayer> player,
bool navigateBack) override;
bool openCrafting2x2(int iPad,
std::shared_ptr<LocalPlayer> player) override;
bool openCrafting3x3(int iPad, std::shared_ptr<LocalPlayer> player, int x,
int y, int z) override;
bool openEnchanting(int iPad, std::shared_ptr<Inventory> inventory, int x,
int y, int z, Level* level,
const std::wstring& name) override;
bool openFurnace(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<FurnaceTileEntity> furnace) override;
bool openBrewingStand(
int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<BrewingStandTileEntity> brewingStand) override;
bool openContainer(int iPad, std::shared_ptr<Container> inventory,
std::shared_ptr<Container> container) override;
bool openTrap(int iPad, std::shared_ptr<Container> inventory,
std::shared_ptr<DispenserTileEntity> trap) override;
bool openFireworks(int iPad, std::shared_ptr<LocalPlayer> player, int x,
int y, int z) override;
bool openSign(int iPad, std::shared_ptr<SignTileEntity> sign) override;
bool openRepairing(int iPad, std::shared_ptr<Inventory> inventory,
Level* level, int x, int y, int z) override;
bool openTrading(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Merchant> trader, Level* level,
const std::wstring& name) override;
bool openCommandBlock(
int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) override;
bool openHopper(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<HopperTileEntity> hopper) override;
bool openHopperMinecart(
int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<MinecartHopper> hopper) override;
bool openHorse(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Container> container,
std::shared_ptr<EntityHorse> horse) override;
bool openBeacon(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<BeaconTileEntity> beacon) override;
private:
Game& game_;
};

View file

@ -0,0 +1,25 @@
#pragma once
#include "ConsoleGameRulesConstants.h"
#include "GameRuleManager.h"
#include "app/common/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h"
#include "app/common/GameRules/LevelGeneration/BiomeOverride.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/StartFeature.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddEnchantmentRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h"
#include "app/common/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"

View file

@ -7,18 +7,18 @@
#include <utility>
#include <vector>
#include "app/common/src/DLC/DLCGameRulesFile.h"
#include "app/common/src/DLC/DLCGameRulesHeader.h"
#include "app/common/src/DLC/DLCLocalisationFile.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/common/src/DLC/DLCPack.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/src/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/common/src/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/src/GameRules/LevelRules/LevelRules.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/src/Localisation/StringTable.h"
#include "app/common/DLC/DLCGameRulesFile.h"
#include "app/common/DLC/DLCGameRulesHeader.h"
#include "app/common/DLC/DLCLocalisationFile.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/GameRules/LevelRules/LevelRules.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/Localisation/StringTable.h"
#include "app/linux/LinuxGame.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/File.h"

View file

@ -7,10 +7,10 @@
#include <string>
#include <unordered_map>
#include "app/common/src/DLC/DLCGameRulesHeader.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/src/GameRules/LevelRules/LevelRules.h"
#include "app/common/DLC/DLCGameRulesHeader.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/GameRules/LevelRules/LevelRules.h"
class LevelGenerationOptions;
class RootGameRulesDefinition;

View file

@ -5,8 +5,8 @@
#include "ConsoleSchematicFile.h"
#include "LevelGenerationOptions.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -5,8 +5,8 @@
#include <string>
#include "ConsoleSchematicFile.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "minecraft/world/phys/AABB.h"
#include "minecraft/world/phys/Vec3.h"

View file

@ -1,7 +1,7 @@
#include "BiomeOverride.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -4,8 +4,8 @@
#include <cstdint>
#include <string>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
class BiomeOverride : public GameRuleDefinition {
private:

View file

@ -4,13 +4,13 @@
#include <algorithm>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -2,8 +2,8 @@
#include <string>
#include <vector>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "minecraft/world/level/levelgen/structure/StructureFeatureIO.h"
#include "minecraft/world/level/levelgen/structure/StructurePiece.h"

View file

@ -1,6 +1,6 @@
#pragma once
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
class ConsoleGenerateStructureAction : public GameRuleDefinition {
public:

View file

@ -6,18 +6,18 @@
#include <unordered_set>
#include <utility>
#include "app/common/App_enums.h"
#include "app/common/src/DLC/DLCGameRulesHeader.h"
#include "app/common/src/DLC/DLCManager.h"
#include "app/common/src/DLC/DLCPack.h"
#include "app/common/src/GameRules/GameRuleManager.h"
#include "app/common/src/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h"
#include "app/common/src/GameRules/LevelGeneration/BiomeOverride.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructure.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/src/GameRules/LevelGeneration/StartFeature.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/Localisation/StringTable.h"
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCGameRulesHeader.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "app/common/GameRules/LevelGeneration/ApplySchematicRuleDefinition.h"
#include "app/common/GameRules/LevelGeneration/BiomeOverride.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/GameRules/LevelGeneration/StartFeature.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/Localisation/StringTable.h"
#include "app/linux/LinuxGame.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "java/File.h"

View file

@ -8,10 +8,10 @@
#include <unordered_map>
#include <vector>
#include "app/common/src/DLC/DLCPack.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/Localisation/StringTable.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/Localisation/StringTable.h"
#include "minecraft/world/level/levelgen/structure/StructureFeature.h"
class ApplySchematicRuleDefinition;

View file

@ -1,7 +1,7 @@
#include "StartFeature.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -3,8 +3,8 @@
#include <string>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "minecraft/world/level/levelgen/structure/StructureFeature.h"
class StartFeature : public GameRuleDefinition {

View file

@ -1,8 +1,8 @@
#include "XboxStructureActionGenerateBox.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -1,8 +1,8 @@
#pragma once
#include <string>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
class StructurePiece;
class Level;

View file

@ -1,8 +1,8 @@
#include "XboxStructureActionPlaceBlock.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -1,8 +1,8 @@
#pragma once
#include <string>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
class StructurePiece;
class Level;

View file

@ -4,9 +4,9 @@
#include <memory>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "minecraft/world/Container.h"

View file

@ -3,7 +3,7 @@
#include <string>
#include <vector>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "XboxStructureActionPlaceBlock.h"
class AddItemRuleDefinition;

View file

@ -4,8 +4,8 @@
#include <memory>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/Level.h"
#include "minecraft/world/level/levelgen/structure/BoundingBox.h"

View file

@ -2,7 +2,7 @@
#include <string>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "XboxStructureActionPlaceBlock.h"
class StructurePiece;

View file

@ -3,8 +3,8 @@
#include <algorithm>
#include <vector>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -4,7 +4,7 @@
#include <string>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
class ItemInstance;

View file

@ -3,8 +3,8 @@
#include <algorithm>
#include "AddEnchantmentRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/Container.h"

View file

@ -5,7 +5,7 @@
#include <vector>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
class Container;
class AddEnchantmentRuleDefinition;

View file

@ -1,9 +1,9 @@
#include "CollectItemRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -4,8 +4,8 @@
#include <string>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
class Pos;
class UseTileRuleDefinition;

View file

@ -4,9 +4,9 @@
#include <unordered_map>
#include <utility>
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/Rules/GameRule.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "minecraft/network/Connection.h"

View file

@ -3,7 +3,7 @@
#include <string>
#include "CompoundGameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
class GameRule;

View file

@ -7,14 +7,14 @@
#include <unordered_map>
#include <utility>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h"
#include "app/common/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "util/StringHelpers.h"
CompoundGameRuleDefinition::CompoundGameRuleDefinition() {

View file

@ -3,8 +3,8 @@
#include <vector>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
class CompoundGameRuleDefinition : public GameRuleDefinition {
protected:

View file

@ -1,4 +1,4 @@
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include <assert.h>
#include <wchar.h>
@ -8,11 +8,11 @@
#include <utility>
#include <vector>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/GameRules/LevelRules/Rules/GameRule.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -6,8 +6,8 @@
#include <unordered_map>
#include <vector>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h"
#include "minecraft/world/item/ItemInstance.h"
class GameRule;

View file

@ -1,9 +1,9 @@
#include "LevelRuleset.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h"
#include "app/common/src/Localisation/StringTable.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h"
#include "app/common/Localisation/StringTable.h"
class AABB;

View file

@ -4,7 +4,7 @@
#include <vector>
#include "CompoundGameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
class NamedAreaRuleDefinition;
class AABB;

View file

@ -2,8 +2,8 @@
#include <wchar.h>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -3,7 +3,7 @@
#include <string>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "minecraft/world/phys/AABB.h"
class NamedAreaRuleDefinition : public GameRuleDefinition {

View file

@ -4,9 +4,9 @@
#include <memory>
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -5,7 +5,7 @@
#include <vector>
#include "GameRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
class AddItemRuleDefinition;
class Pos;

View file

@ -1,7 +1,7 @@
#include "UseTileRuleDefinition.h"
#include "app/common/src/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/src/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/common/GameRules/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"

Some files were not shown because too many files have changed in this diff Show more