style: clang-format the entire project

This commit is contained in:
MatthewBeshay 2026-04-09 10:17:55 +10:00
parent 0da697cbd4
commit fac7d99e95
803 changed files with 6092 additions and 6095 deletions

View file

@ -8,19 +8,13 @@ AppGameServices::AppGameServices(Game& game, IMenuService& menus)
// -- Strings -- // -- Strings --
const char* AppGameServices::getString(int id) { const char* AppGameServices::getString(int id) { return Game::GetString(id); }
return Game::GetString(id);
}
// -- Debug settings -- // -- Debug settings --
bool AppGameServices::debugSettingsOn() { bool AppGameServices::debugSettingsOn() { return game_.DebugSettingsOn(); }
return game_.DebugSettingsOn();
}
bool AppGameServices::debugArtToolsOn() { bool AppGameServices::debugArtToolsOn() { return game_.DebugArtToolsOn(); }
return game_.DebugArtToolsOn();
}
unsigned int AppGameServices::debugGetMask(int iPad, bool overridePlayer) { unsigned int AppGameServices::debugGetMask(int iPad, bool overridePlayer) {
return game_.GetGameSettingsDebugMask(iPad, overridePlayer); return game_.GetGameSettingsDebugMask(iPad, overridePlayer);
@ -34,9 +28,7 @@ bool AppGameServices::debugMobsDontTick() {
return game_.GetMobsDontTickEnabled(); return game_.GetMobsDontTickEnabled();
} }
bool AppGameServices::debugFreezePlayers() { bool AppGameServices::debugFreezePlayers() { return game_.GetFreezePlayers(); }
return game_.GetFreezePlayers();
}
// -- Game host options -- // -- Game host options --
@ -93,9 +85,7 @@ unsigned char AppGameServices::getGameSettings(int setting) {
// -- App time -- // -- App time --
float AppGameServices::getAppTime() { float AppGameServices::getAppTime() { return game_.getAppTime(); }
return game_.getAppTime();
}
// -- Game state -- // -- Game state --
@ -104,10 +94,14 @@ void AppGameServices::setGameStarted(bool val) { game_.SetGameStarted(val); }
bool AppGameServices::getTutorialMode() { return game_.GetTutorialMode(); } bool AppGameServices::getTutorialMode() { return game_.GetTutorialMode(); }
void AppGameServices::setTutorialMode(bool val) { game_.SetTutorialMode(val); } void AppGameServices::setTutorialMode(bool val) { game_.SetTutorialMode(val); }
bool AppGameServices::isAppPaused() { return game_.IsAppPaused(); } bool AppGameServices::isAppPaused() { return game_.IsAppPaused(); }
int AppGameServices::getLocalPlayerCount() { return game_.GetLocalPlayerCount(); } int AppGameServices::getLocalPlayerCount() {
return game_.GetLocalPlayerCount();
}
bool AppGameServices::autosaveDue() { return game_.AutosaveDue(); } bool AppGameServices::autosaveDue() { return game_.AutosaveDue(); }
void AppGameServices::setAutosaveTimerTime() { game_.SetAutosaveTimerTime(); } void AppGameServices::setAutosaveTimerTime() { game_.SetAutosaveTimerTime(); }
int64_t AppGameServices::secondsToAutosave() { return game_.SecondsToAutosave(); } int64_t AppGameServices::secondsToAutosave() {
return game_.SecondsToAutosave();
}
void AppGameServices::setDisconnectReason( void AppGameServices::setDisconnectReason(
DisconnectPacket::eDisconnectReason reason) { DisconnectPacket::eDisconnectReason reason) {
@ -115,9 +109,13 @@ void AppGameServices::setDisconnectReason(
} }
void AppGameServices::lockSaveNotification() { game_.lockSaveNotification(); } void AppGameServices::lockSaveNotification() { game_.lockSaveNotification(); }
void AppGameServices::unlockSaveNotification() { game_.unlockSaveNotification(); } void AppGameServices::unlockSaveNotification() {
game_.unlockSaveNotification();
}
bool AppGameServices::getResetNether() { return game_.GetResetNether(); } bool AppGameServices::getResetNether() { return game_.GetResetNether(); }
bool AppGameServices::getUseDPadForDebug() { return game_.GetUseDPadForDebug(); } bool AppGameServices::getUseDPadForDebug() {
return game_.GetUseDPadForDebug();
}
bool AppGameServices::getWriteSavesToFolderEnabled() { bool AppGameServices::getWriteSavesToFolderEnabled() {
return game_.GetWriteSavesToFolderEnabled(); return game_.GetWriteSavesToFolderEnabled();
@ -127,9 +125,7 @@ bool AppGameServices::isLocalMultiplayerAvailable() {
return game_.IsLocalMultiplayerAvailable(); return game_.IsLocalMultiplayerAvailable();
} }
bool AppGameServices::dlcInstallPending() { bool AppGameServices::dlcInstallPending() { return game_.DLCInstallPending(); }
return game_.DLCInstallPending();
}
bool AppGameServices::dlcInstallProcessCompleted() { bool AppGameServices::dlcInstallProcessCompleted() {
return game_.DLCInstallProcessCompleted(); return game_.DLCInstallProcessCompleted();
@ -198,9 +194,7 @@ void AppGameServices::setGlobalXuiAction(eXuiAction action) {
game_.SetGlobalXuiAction(action); game_.SetGlobalXuiAction(action);
} }
void AppGameServices::handleButtonPresses() { void AppGameServices::handleButtonPresses() { game_.HandleButtonPresses(); }
game_.HandleButtonPresses();
}
void AppGameServices::setTMSAction(int iPad, eTMSAction action) { void AppGameServices::setTMSAction(int iPad, eTMSAction action) {
game_.SetTMSAction(iPad, action); game_.SetTMSAction(iPad, action);
@ -254,8 +248,7 @@ void AppGameServices::setAnimOverrideBitmask(std::uint32_t dwSkinID,
game_.SetAnimOverrideBitmask(dwSkinID, bitmask); game_.SetAnimOverrideBitmask(dwSkinID, bitmask);
} }
unsigned int AppGameServices::getAnimOverrideBitmask( unsigned int AppGameServices::getAnimOverrideBitmask(std::uint32_t dwSkinID) {
std::uint32_t dwSkinID) {
return game_.GetAnimOverrideBitmask(dwSkinID); return game_.GetAnimOverrideBitmask(dwSkinID);
} }
@ -267,9 +260,7 @@ std::string AppGameServices::getSkinPathFromId(std::uint32_t skinId) {
return Game::getSkinPathFromId(skinId); return Game::getSkinPathFromId(skinId);
} }
bool AppGameServices::defaultCapeExists() { bool AppGameServices::defaultCapeExists() { return game_.DefaultCapeExists(); }
return game_.DefaultCapeExists();
}
bool AppGameServices::isXuidNotch(PlayerUID xuid) { bool AppGameServices::isXuidNotch(PlayerUID xuid) {
return game_.isXuidNotch(xuid); return game_.isXuidNotch(xuid);
@ -305,8 +296,7 @@ void AppGameServices::updatePlayerInfo(std::uint8_t networkSmallId,
game_.UpdatePlayerInfo(networkSmallId, playerColourIndex, playerPrivileges); game_.UpdatePlayerInfo(networkSmallId, playerColourIndex, playerPrivileges);
} }
unsigned int AppGameServices::getPlayerPrivileges( unsigned int AppGameServices::getPlayerPrivileges(std::uint8_t networkSmallId) {
std::uint8_t networkSmallId) {
return game_.GetPlayerPrivileges(networkSmallId); return game_.GetPlayerPrivileges(networkSmallId);
} }
@ -334,9 +324,7 @@ bool AppGameServices::getTerrainFeaturePosition(_eTerrainFeatureType type,
return game_.GetTerrainFeaturePosition(type, pX, pZ); return game_.GetTerrainFeaturePosition(type, pX, pZ);
} }
void AppGameServices::loadDefaultGameRules() { void AppGameServices::loadDefaultGameRules() { game_.loadDefaultGameRules(); }
game_.loadDefaultGameRules();
}
// -- Archive / resources -- // -- Archive / resources --
@ -363,24 +351,21 @@ const char* AppGameServices::getGameRulesString(const std::string& key) {
return game_.GetGameRulesString(key); return game_.GetGameRulesString(key);
} }
unsigned int AppGameServices::createImageTextData(std::uint8_t* textMetadata, unsigned int AppGameServices::createImageTextData(
int64_t seed, bool hasSeed, std::uint8_t* textMetadata, int64_t seed, bool hasSeed,
unsigned int uiHostOptions, unsigned int uiHostOptions, unsigned int uiTexturePackId) {
unsigned int uiTexturePackId) { return game_.CreateImageTextData(textMetadata, seed, hasSeed, uiHostOptions,
return game_.CreateImageTextData(textMetadata, seed, hasSeed, uiTexturePackId);
uiHostOptions, uiTexturePackId);
} }
std::string AppGameServices::getFilePath(std::uint32_t packId, std::string AppGameServices::getFilePath(std::uint32_t packId,
std::string filename, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::string mountPoint) { std::string mountPoint) {
return game_.getFilePath(packId, filename, bAddDataFolder, mountPoint); return game_.getFilePath(packId, filename, bAddDataFolder, mountPoint);
} }
char* AppGameServices::getUniqueMapName() { char* AppGameServices::getUniqueMapName() { return game_.GetUniqueMapName(); }
return game_.GetUniqueMapName();
}
void AppGameServices::setUniqueMapName(char* name) { void AppGameServices::setUniqueMapName(char* name) {
game_.SetUniqueMapName(name); game_.SetUniqueMapName(name);
@ -390,9 +375,7 @@ unsigned int AppGameServices::getOpacityTimer(int iPad) {
return game_.GetOpacityTimer(iPad); return game_.GetOpacityTimer(iPad);
} }
void AppGameServices::setOpacityTimer(int iPad) { void AppGameServices::setOpacityTimer(int iPad) { game_.SetOpacityTimer(iPad); }
game_.SetOpacityTimer(iPad);
}
void AppGameServices::tickOpacityTimer(int iPad) { void AppGameServices::tickOpacityTimer(int iPad) {
game_.TickOpacityTimer(iPad); game_.TickOpacityTimer(iPad);
@ -423,8 +406,8 @@ unsigned int AppGameServices::dlcCheckForCorrupt(bool showMessage) {
return game_.m_dlcManager.checkForCorruptDLCAndAlert(showMessage); return game_.m_dlcManager.checkForCorruptDLCAndAlert(showMessage);
} }
bool AppGameServices::dlcReadDataFile(unsigned int& filesProcessed, bool AppGameServices::dlcReadDataFile(unsigned int& filesProcessed,
const std::string& path, const std::string& path, DLCPack* pack,
DLCPack* pack, bool fromArchive) { bool fromArchive) {
return game_.m_dlcManager.readDLCDataFile(filesProcessed, path, pack, return game_.m_dlcManager.readDLCDataFile(filesProcessed, path, pack,
fromArchive); fromArchive);
} }
@ -435,7 +418,7 @@ void AppGameServices::dlcRemovePack(DLCPack* pack) {
// -- Game rules -- // -- Game rules --
LevelGenerationOptions* AppGameServices::loadGameRules(std::uint8_t* data, LevelGenerationOptions* AppGameServices::loadGameRules(std::uint8_t* data,
unsigned int size) { unsigned int size) {
return game_.m_gameRules.loadGameRules(data, size); return game_.m_gameRules.loadGameRules(data, size);
} }
void AppGameServices::saveGameRules(std::uint8_t** data, unsigned int* size) { void AppGameServices::saveGameRules(std::uint8_t** data, unsigned int* size) {
@ -444,7 +427,8 @@ void AppGameServices::saveGameRules(std::uint8_t** data, unsigned int* size) {
void AppGameServices::unloadCurrentGameRules() { void AppGameServices::unloadCurrentGameRules() {
game_.m_gameRules.unloadCurrentGameRules(); game_.m_gameRules.unloadCurrentGameRules();
} }
void AppGameServices::setLevelGenerationOptions(LevelGenerationOptions* levelGen) { void AppGameServices::setLevelGenerationOptions(
LevelGenerationOptions* levelGen) {
game_.m_gameRules.setLevelGenerationOptions(levelGen); game_.m_gameRules.setLevelGenerationOptions(levelGen);
} }

View file

@ -22,8 +22,7 @@ public:
// -- Game host options -- // -- Game host options --
unsigned int getGameHostOption(eGameHostOption option) override; unsigned int getGameHostOption(eGameHostOption option) override;
void setGameHostOption(eGameHostOption option, void setGameHostOption(eGameHostOption option, unsigned int value) override;
unsigned int value) override;
// -- Level generation -- // -- Level generation --
LevelGenerationOptions* getLevelGenerationOptions() override; LevelGenerationOptions* getLevelGenerationOptions() override;
@ -113,8 +112,7 @@ public:
void setRichPresenceContext(int iPad, int contextId) override; void setRichPresenceContext(int iPad, int contextId) override;
void captureSaveThumbnail() override; void captureSaveThumbnail() override;
void getSaveThumbnail(std::uint8_t** data, unsigned int* size) override; void getSaveThumbnail(std::uint8_t** data, unsigned int* size) override;
void readBannedList(int iPad, eTMSAction action, void readBannedList(int iPad, eTMSAction action, bool bCallback) override;
bool bCallback) override;
void updatePlayerInfo(std::uint8_t networkSmallId, void updatePlayerInfo(std::uint8_t networkSmallId,
int16_t playerColourIndex, int16_t playerColourIndex,
unsigned int playerPrivileges) override; unsigned int playerPrivileges) override;
@ -139,13 +137,12 @@ public:
int getHTMLColour(eMinecraftColour colour) override; int getHTMLColour(eMinecraftColour colour) override;
std::string getEntityName(EntityTypeId type) override; std::string getEntityName(EntityTypeId type) override;
const char* getGameRulesString(const std::string& key) override; const char* getGameRulesString(const std::string& key) override;
unsigned int createImageTextData(std::uint8_t* textMetadata, unsigned int createImageTextData(std::uint8_t* textMetadata, int64_t seed,
int64_t seed, bool hasSeed, bool hasSeed, unsigned int uiHostOptions,
unsigned int uiHostOptions,
unsigned int uiTexturePackId) override; unsigned int uiTexturePackId) override;
std::string getFilePath(std::uint32_t packId, std::string filename, std::string getFilePath(std::uint32_t packId, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::string mountPoint) override; std::string mountPoint) override;
char* getUniqueMapName() override; char* getUniqueMapName() override;
void setUniqueMapName(char* name) override; void setUniqueMapName(char* name) override;
unsigned int getOpacityTimer(int iPad) override; unsigned int getOpacityTimer(int iPad) override;
@ -160,14 +157,13 @@ public:
DLCSkinFile* getDLCSkinFile(const std::string& name) override; DLCSkinFile* getDLCSkinFile(const std::string& name) override;
bool dlcNeedsCorruptCheck() override; bool dlcNeedsCorruptCheck() override;
unsigned int dlcCheckForCorrupt(bool showMessage) override; unsigned int dlcCheckForCorrupt(bool showMessage) override;
bool dlcReadDataFile(unsigned int& filesProcessed, bool dlcReadDataFile(unsigned int& filesProcessed, const std::string& path,
const std::string& path, DLCPack* pack, DLCPack* pack, bool fromArchive) override;
bool fromArchive) override;
void dlcRemovePack(DLCPack* pack) override; void dlcRemovePack(DLCPack* pack) override;
// -- Game rules -- // -- Game rules --
LevelGenerationOptions* loadGameRules(std::uint8_t* data, LevelGenerationOptions* loadGameRules(std::uint8_t* data,
unsigned int size) override; unsigned int size) override;
void saveGameRules(std::uint8_t** data, unsigned int* size) override; void saveGameRules(std::uint8_t** data, unsigned int* size) override;
void unloadCurrentGameRules() override; void unloadCurrentGameRules() override;
void setLevelGenerationOptions(LevelGenerationOptions* levelGen) override; void setLevelGenerationOptions(LevelGenerationOptions* levelGen) override;

View file

@ -2,16 +2,15 @@
#include <cstdint> #include <cstdint>
#include "platform/storage/storage.h"
#include "minecraft/GameTypes.h"
#include "platform/profile/ProfileConstants.h"
#include "minecraft/GameEnums.h"
#include "minecraft/GameTypes.h"
#include "app/common/Tutorial/TutorialEnum.h" #include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "platform/NetTypes.h" #include "minecraft/GameEnums.h"
#include "minecraft/GameTypes.h"
#include "minecraft/client/model/SkinBox.h" #include "minecraft/client/model/SkinBox.h"
#include "platform/NetTypes.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/profile/ProfileConstants.h"
#include "platform/storage/storage.h"
typedef struct { typedef struct {
char* wchFilename; char* wchFilename;

View file

@ -9,8 +9,8 @@
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/fs/fs.h"
#include "platform/PlatformTypes.h" #include "platform/PlatformTypes.h"
#include "platform/fs/fs.h"
ArchiveManager::ArchiveManager() ArchiveManager::ArchiveManager()
: m_mediaArchive(nullptr), m_dwRequiredTexturePackID(0) {} : m_mediaArchive(nullptr), m_dwRequiredTexturePackID(0) {}

View file

@ -10,13 +10,9 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "platform/PlatformTypes.h"
#include "platform/PlatformTypes.h"
#include "app/common/Audio/Consoles_SoundEngine.h" #include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/linux/Iggy/include/rrCore.h" #include "app/linux/Iggy/include/rrCore.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "platform/C4JThread.h"
#include "platform/fs/fs.h"
#include "java/Random.h" #include "java/Random.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
@ -24,6 +20,9 @@
#include "minecraft/util/Mth.h" #include "minecraft/util/Mth.h"
#include "minecraft/world/entity/Mob.h" #include "minecraft/world/entity/Mob.h"
#include "minecraft/world/level/storage/LevelData.h" #include "minecraft/world/level/storage/LevelData.h"
#include "platform/C4JThread.h"
#include "platform/PlatformTypes.h"
#include "platform/fs/fs.h"
#if defined(__linux__) #if defined(__linux__)
#define STB_VORBIS_HEADER_ONLY #define STB_VORBIS_HEADER_ONLY
@ -132,7 +131,8 @@ struct MiniAudioSound {
bool active; bool active;
}; };
SoundEngine::SoundEngine() : m_audio(std::make_unique<SoundEngineMiniAudio>()) {} SoundEngine::SoundEngine()
: m_audio(std::make_unique<SoundEngineMiniAudio>()) {}
SoundEngine::~SoundEngine() = default; SoundEngine::~SoundEngine() = default;
std::vector<MiniAudioSound*> m_activeSounds; std::vector<MiniAudioSound*> m_activeSounds;
void SoundEngine::init(Options* pOptions) { void SoundEngine::init(Options* pOptions) {
@ -167,7 +167,8 @@ void SoundEngine::init(Options* pOptions) {
m_audio->engineConfig = ma_engine_config_init(); m_audio->engineConfig = ma_engine_config_init();
m_audio->engineConfig.listenerCount = MAX_LOCAL_PLAYERS; m_audio->engineConfig.listenerCount = MAX_LOCAL_PLAYERS;
if (ma_engine_init(&m_audio->engineConfig, &m_audio->engine) != MA_SUCCESS) { if (ma_engine_init(&m_audio->engineConfig, &m_audio->engine) !=
MA_SUCCESS) {
app.DebugPrintf("Failed to initialize miniaudio engine\n"); app.DebugPrintf("Failed to initialize miniaudio engine\n");
return; return;
} }
@ -192,9 +193,8 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
if (szId[i] == '.') szId[i] = '/'; if (szId[i] == '.') szId[i] = '/';
std::string base = PlatformFilesystem.getBasePath().string() + "/"; std::string base = PlatformFilesystem.getBasePath().string() + "/";
const char* roots[] = { const char* roots[] = {"Sound/Minecraft/", "app/common/Sound/Minecraft/",
"Sound/Minecraft/", "app/common/Sound/Minecraft/", "app/common/res/TitleUpdate/res/Sound/Minecraft/"};
"app/common/res/TitleUpdate/res/Sound/Minecraft/"};
char finalPath[512] = {0}; char finalPath[512] = {0};
bool found = false; bool found = false;
@ -237,8 +237,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume,
s->info.pitch = pitch; s->info.pitch = pitch;
s->info.bIs3D = true; s->info.bIs3D = true;
if (ma_sound_init_from_file(&m_audio->engine, finalPath, MA_SOUND_FLAG_ASYNC, if (ma_sound_init_from_file(&m_audio->engine, finalPath,
nullptr, nullptr, &s->sound) == MA_SUCCESS) { MA_SOUND_FLAG_ASYNC, nullptr, nullptr,
&s->sound) == MA_SUCCESS) {
ma_sound_set_spatialization_enabled(&s->sound, MA_TRUE); ma_sound_set_spatialization_enabled(&s->sound, MA_TRUE);
ma_sound_set_min_distance(&s->sound, 2.0f); ma_sound_set_min_distance(&s->sound, 2.0f);
ma_sound_set_max_distance(&s->sound, 48.0f); ma_sound_set_max_distance(&s->sound, 48.0f);
@ -289,8 +290,9 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) {
s->info.pitch = pitch; s->info.pitch = pitch;
s->info.bIs3D = false; s->info.bIs3D = false;
if (ma_sound_init_from_file(&m_audio->engine, finalPath, MA_SOUND_FLAG_ASYNC, if (ma_sound_init_from_file(&m_audio->engine, finalPath,
nullptr, nullptr, &s->sound) == MA_SUCCESS) { MA_SOUND_FLAG_ASYNC, nullptr, nullptr,
&s->sound) == MA_SUCCESS) {
ma_sound_set_spatialization_enabled(&s->sound, MA_FALSE); ma_sound_set_spatialization_enabled(&s->sound, MA_FALSE);
ma_sound_set_volume(&s->sound, volume * m_MasterEffectsVolume); ma_sound_set_volume(&s->sound, volume * m_MasterEffectsVolume);
ma_sound_set_pitch(&s->sound, pitch); ma_sound_set_pitch(&s->sound, pitch);
@ -432,7 +434,8 @@ int SoundEngine::OpenStreamThreadProc(void* lpParameter) {
ma_result result = ma_sound_init_from_file( ma_result result = ma_sound_init_from_file(
&soundEngine->m_audio->engine, soundEngine->m_szStreamName, &soundEngine->m_audio->engine, soundEngine->m_szStreamName,
MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundEngine->m_audio->musicStream); MA_SOUND_FLAG_STREAM, nullptr, nullptr,
&soundEngine->m_audio->musicStream);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
app.DebugPrintf( app.DebugPrintf(
@ -442,7 +445,8 @@ int SoundEngine::OpenStreamThreadProc(void* lpParameter) {
return 0; return 0;
} }
ma_sound_set_spatialization_enabled(&soundEngine->m_audio->musicStream, MA_FALSE); ma_sound_set_spatialization_enabled(&soundEngine->m_audio->musicStream,
MA_FALSE);
ma_sound_set_looping(&soundEngine->m_audio->musicStream, MA_FALSE); ma_sound_set_looping(&soundEngine->m_audio->musicStream, MA_FALSE);
soundEngine->m_musicStreamActive = true; soundEngine->m_musicStreamActive = true;
@ -460,27 +464,29 @@ void SoundEngine::playMusicTick() {
return; return;
} }
if (m_musicID != -1) { if (m_musicID != -1) {
std::string base = PlatformFilesystem.getBasePath().string() + "/"; std::string base =
PlatformFilesystem.getBasePath().string() + "/";
bool isCD = (m_musicID >= m_iStream_CD_1); bool isCD = (m_musicID >= m_iStream_CD_1);
const char* folder = isCD ? "cds/" : "music/"; const char* folder = isCD ? "cds/" : "music/";
const char* track = m_szStreamFileA[m_musicID]; const char* track = m_szStreamFileA[m_musicID];
bool found = false; bool found = false;
m_szStreamName[0] = '\0'; m_szStreamName[0] = '\0';
const char* roots[] = {"app/common/music/", const char* roots[] = {"app/common/music/", "music/", "./"};
"music/", "./"};
for (const char* r : roots) { for (const char* r : roots) {
for (const char* e : {".ogg", ".mp3", ".wav"}) { for (const char* e : {".ogg", ".mp3", ".wav"}) {
// try with folder prefix (music/ or cds/) // try with folder prefix (music/ or cds/)
snprintf(m_szStreamName, sizeof(m_szStreamName), "%s%s%s%s%s", base.c_str(), r, folder, snprintf(m_szStreamName, sizeof(m_szStreamName),
track, e); "%s%s%s%s%s", base.c_str(), r, folder, track,
e);
if (PlatformFilesystem.exists(m_szStreamName)) { if (PlatformFilesystem.exists(m_szStreamName)) {
found = true; found = true;
break; break;
} }
// try without folder prefix // try without folder prefix
snprintf(m_szStreamName, sizeof(m_szStreamName), "%s%s%s%s", base.c_str(), r, track, e); snprintf(m_szStreamName, sizeof(m_szStreamName),
"%s%s%s%s", base.c_str(), r, track, e);
if (PlatformFilesystem.exists(m_szStreamName)) { if (PlatformFilesystem.exists(m_szStreamName)) {
found = true; found = true;
break; break;
@ -526,7 +532,8 @@ void SoundEngine::playMusicTick() {
m_StreamingAudioInfo.y, m_StreamingAudioInfo.z); m_StreamingAudioInfo.y, m_StreamingAudioInfo.z);
} }
ma_sound_set_pitch(&m_audio->musicStream, m_StreamingAudioInfo.pitch); ma_sound_set_pitch(&m_audio->musicStream,
m_StreamingAudioInfo.pitch);
ma_sound_set_volume( ma_sound_set_volume(
&m_audio->musicStream, &m_audio->musicStream,
m_StreamingAudioInfo.volume * getMasterMusicVolume()); m_StreamingAudioInfo.volume * getMasterMusicVolume());
@ -683,7 +690,8 @@ void SoundEngine::updateMiniAudio() {
m_ListenerA[i].vOrientFront.y, m_ListenerA[i].vOrientFront.y,
m_ListenerA[i].vOrientFront.z); m_ListenerA[i].vOrientFront.z);
ma_engine_listener_set_world_up(&m_audio->engine, 0, 0.0f, 1.0f, 0.0f); ma_engine_listener_set_world_up(&m_audio->engine, 0, 0.0f, 1.0f,
0.0f);
break; break;
} }

View file

@ -7,10 +7,10 @@ class Random;
#include <memory> #include <memory>
#include <string> #include <string>
#include "platform/PlatformTypes.h"
#include "app/common/Audio/Consoles_SoundEngine.h" #include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/linux/Iggy/include/rrCore.h" #include "app/linux/Iggy/include/rrCore.h"
#include "minecraft/sounds/SoundTypes.h" #include "minecraft/sounds/SoundTypes.h"
#include "platform/PlatformTypes.h"
// Forward-declare the miniaudio backing state. The full struct lives in // Forward-declare the miniaudio backing state. The full struct lives in
// SoundEngine.cpp where miniaudio.h is actually included. This keeps // SoundEngine.cpp where miniaudio.h is actually included. This keeps

View file

@ -58,7 +58,7 @@ const char* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
"mob/cat/meow", // eSoundType_MOB_CAT_MEOW "mob/cat/meow", // eSoundType_MOB_CAT_MEOW
// 4J-PB - correct the name of the event for hitting ocelots // 4J-PB - correct the name of the event for hitting ocelots
"mob/cat/hitt", // eSoundType_MOB_CAT_HITT "mob/cat/hitt", // eSoundType_MOB_CAT_HITT
// "mob.irongolem.throw", // // "mob.irongolem.throw", //
// eSoundType_MOB_IRONGOLEM_THROW "mob.irongolem.hit", // eSoundType_MOB_IRONGOLEM_THROW "mob.irongolem.hit",
//// eSoundType_MOB_IRONGOLEM_HIT "mob.irongolem.death", //// eSoundType_MOB_IRONGOLEM_HIT "mob.irongolem.death",
//// eSoundType_MOB_IRONGOLEM_DEATH "mob.irongolem.walk", //// eSoundType_MOB_IRONGOLEM_DEATH "mob.irongolem.walk",
@ -205,11 +205,11 @@ const char* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
"mob/horse/jump", // eSoundType_MOB_HORSE_JUMP, "mob/horse/jump", // eSoundType_MOB_HORSE_JUMP,
"mob/witch/idle", // eSoundType_MOB_WITCH_IDLE, <--- "mob/witch/idle", // eSoundType_MOB_WITCH_IDLE, <---
// missing // missing
"mob/witch/hurt", // eSoundType_MOB_WITCH_HURT, <--- "mob/witch/hurt", // eSoundType_MOB_WITCH_HURT, <---
// missing // missing
"mob/witch/death", // eSoundType_MOB_WITCH_DEATH, <--- "mob/witch/death", // eSoundType_MOB_WITCH_DEATH, <---
// missing // missing
"mob/slime/big", // eSoundType_MOB_SLIME_BIG, "mob/slime/big", // eSoundType_MOB_SLIME_BIG,
"mob/slime/small", // eSoundType_MOB_SLIME_SMALL, "mob/slime/small", // eSoundType_MOB_SLIME_SMALL,

View file

@ -29,8 +29,8 @@ void BannedListManager::invalidate(int iPad) {
} }
} }
void BannedListManager::addLevel(int iPad, PlayerUID xuid, void BannedListManager::addLevel(int iPad, PlayerUID xuid, char* pszLevelName,
char* pszLevelName, bool bWriteToTMS) { bool bWriteToTMS) {
// we will have retrieved the banned level list from TMS, so add this one to // we will have retrieved the banned level list from TMS, so add this one to
// it and write it back to TMS // it and write it back to TMS
@ -64,8 +64,7 @@ void BannedListManager::addLevel(int iPad, PlayerUID xuid,
// update telemetry too // update telemetry too
} }
bool BannedListManager::isInList(int iPad, PlayerUID xuid, bool BannedListManager::isInList(int iPad, PlayerUID xuid, char* pszLevelName) {
char* pszLevelName) {
for (auto it = m_vBannedListA[iPad]->begin(); for (auto it = m_vBannedListA[iPad]->begin();
it != m_vBannedListA[iPad]->end(); ++it) { it != m_vBannedListA[iPad]->end(); ++it) {
PBANNEDLISTDATA pData = *it; PBANNEDLISTDATA pData = *it;
@ -126,6 +125,4 @@ void BannedListManager::setUniqueMapName(char* pszUniqueMapName) {
memcpy(m_pszUniqueMapName, pszUniqueMapName, 14); memcpy(m_pszUniqueMapName, pszUniqueMapName, 14);
} }
char* BannedListManager::getUniqueMapName() { char* BannedListManager::getUniqueMapName() { return m_pszUniqueMapName; }
return m_pszUniqueMapName;
}

View file

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

View file

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

View file

@ -13,20 +13,19 @@
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
#include "simdutf.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "DLCFile.h" #include "DLCFile.h"
#include "DLCPack.h" #include "DLCPack.h"
#include "app/common/GameRules/GameRuleManager.h" #include "app/common/GameRules/GameRuleManager.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "platform/fs/fs.h"
#include "util/StringHelpers.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/fs/fs.h"
#include "platform/profile/profile.h"
#include "platform/storage/storage.h"
#include "simdutf.h"
#include "strings.h" #include "strings.h"
#include "util/StringHelpers.h"
// 4jcraft, this is the size of wchar_t on disk // 4jcraft, this is the size of wchar_t on disk
// the DLC was created on windows, with wchar_t beeing 2 bytes and UTF-16 // the DLC was created on windows, with wchar_t beeing 2 bytes and UTF-16
@ -71,7 +70,8 @@ std::string getMountedDlcReadPath(const std::string& path) {
std::string readPath = path; std::string readPath = path;
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
const std::string mountedPath = PlatformStorage.GetMountedPath(path.c_str()); const std::string mountedPath =
PlatformStorage.GetMountedPath(path.c_str());
if (!mountedPath.empty()) { if (!mountedPath.empty()) {
readPath = mountedPath; readPath = mountedPath;
} }
@ -240,7 +240,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
if (pack == nullptr) { if (pack == nullptr) {
app.DebugPrintf( app.DebugPrintf(
"DLCManager: Attempting to find the index for a nullptr pack\n"); "DLCManager: Attempting to find the index for a nullptr pack\n");
//assert(0); // assert(0);
return foundIndex; return foundIndex;
} }
if (type != e_DLCType_All) { if (type != e_DLCType_All) {
@ -401,10 +401,12 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
// for details, read in the function below // for details, read in the function below
#define DLC_PARAM_WSTR(buf, off) \ #define DLC_PARAM_WSTR(buf, off) \
DLC_WSTRING((buf) + (off) + offsetof(IPlatformStorage::DLC_FILE_PARAM, wchData)) DLC_WSTRING((buf) + (off) + \
offsetof(IPlatformStorage::DLC_FILE_PARAM, wchData))
#define DLC_DETAIL_WSTR(buf, off) \ #define DLC_DETAIL_WSTR(buf, off) \
DLC_WSTRING((buf) + (off) + offsetof(IPlatformStorage::DLC_FILE_DETAILS, wchFile)) DLC_WSTRING((buf) + (off) + \
offsetof(IPlatformStorage::DLC_FILE_DETAILS, wchFile))
{ {
std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping; std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte = 0; unsigned int uiCurrentByte = 0;
@ -462,7 +464,8 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
uiCurrentByte += DLC_PARAM_ADV(parBuf.dwWchCount); uiCurrentByte += DLC_PARAM_ADV(parBuf.dwWchCount);
DLC_READ_PARAM(&parBuf, pbData, uiCurrentByte); DLC_READ_PARAM(&parBuf, pbData, uiCurrentByte);
} }
// ulCurrentByte+=ulParameterCount * sizeof(IPlatformStorage::DLC_FILE_PARAM); // ulCurrentByte+=ulParameterCount *
// sizeof(IPlatformStorage::DLC_FILE_PARAM);
unsigned int uiFileCount; unsigned int uiFileCount;
DLC_READ_UINT(&uiFileCount, pbData, uiCurrentByte); DLC_READ_UINT(&uiFileCount, pbData, uiCurrentByte);
@ -477,7 +480,9 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
DLC_READ_DETAIL(&fileBuf, pbData, dwTemp); DLC_READ_DETAIL(&fileBuf, pbData, dwTemp);
} }
std::uint8_t* pbTemp = std::uint8_t* pbTemp =
&pbData[dwTemp]; //+ sizeof(IPlatformStorage::DLC_FILE_DETAILS)*ulFileCount; &pbData
[dwTemp]; //+
//sizeof(IPlatformStorage::DLC_FILE_DETAILS)*ulFileCount;
DLC_READ_DETAIL(&fileBuf, pbData, uiCurrentByte); DLC_READ_DETAIL(&fileBuf, pbData, uiCurrentByte);
for (unsigned int i = 0; i < uiFileCount; i++) { for (unsigned int i = 0; i < uiFileCount; i++) {

View file

@ -21,33 +21,58 @@ public:
static constexpr EDLCType e_DLCType_Skin = ::minecraft::dlc::e_DLCType_Skin; static constexpr EDLCType e_DLCType_Skin = ::minecraft::dlc::e_DLCType_Skin;
static constexpr EDLCType e_DLCType_Cape = ::minecraft::dlc::e_DLCType_Cape; static constexpr EDLCType e_DLCType_Cape = ::minecraft::dlc::e_DLCType_Cape;
static constexpr EDLCType e_DLCType_Texture = ::minecraft::dlc::e_DLCType_Texture; static constexpr EDLCType e_DLCType_Texture =
static constexpr EDLCType e_DLCType_UIData = ::minecraft::dlc::e_DLCType_UIData; ::minecraft::dlc::e_DLCType_Texture;
static constexpr EDLCType e_DLCType_PackConfig = ::minecraft::dlc::e_DLCType_PackConfig; static constexpr EDLCType e_DLCType_UIData =
static constexpr EDLCType e_DLCType_TexturePack = ::minecraft::dlc::e_DLCType_TexturePack; ::minecraft::dlc::e_DLCType_UIData;
static constexpr EDLCType e_DLCType_LocalisationData = ::minecraft::dlc::e_DLCType_LocalisationData; static constexpr EDLCType e_DLCType_PackConfig =
static constexpr EDLCType e_DLCType_GameRules = ::minecraft::dlc::e_DLCType_GameRules; ::minecraft::dlc::e_DLCType_PackConfig;
static constexpr EDLCType e_DLCType_Audio = ::minecraft::dlc::e_DLCType_Audio; static constexpr EDLCType e_DLCType_TexturePack =
static constexpr EDLCType e_DLCType_ColourTable = ::minecraft::dlc::e_DLCType_ColourTable; ::minecraft::dlc::e_DLCType_TexturePack;
static constexpr EDLCType e_DLCType_GameRulesHeader = ::minecraft::dlc::e_DLCType_GameRulesHeader; static constexpr EDLCType e_DLCType_LocalisationData =
::minecraft::dlc::e_DLCType_LocalisationData;
static constexpr EDLCType e_DLCType_GameRules =
::minecraft::dlc::e_DLCType_GameRules;
static constexpr EDLCType e_DLCType_Audio =
::minecraft::dlc::e_DLCType_Audio;
static constexpr EDLCType e_DLCType_ColourTable =
::minecraft::dlc::e_DLCType_ColourTable;
static constexpr EDLCType e_DLCType_GameRulesHeader =
::minecraft::dlc::e_DLCType_GameRulesHeader;
static constexpr EDLCType e_DLCType_Max = ::minecraft::dlc::e_DLCType_Max; static constexpr EDLCType e_DLCType_Max = ::minecraft::dlc::e_DLCType_Max;
static constexpr EDLCType e_DLCType_All = ::minecraft::dlc::e_DLCType_All; static constexpr EDLCType e_DLCType_All = ::minecraft::dlc::e_DLCType_All;
static constexpr EDLCParameterType e_DLCParamType_Invalid = ::minecraft::dlc::e_DLCParamType_Invalid; static constexpr EDLCParameterType e_DLCParamType_Invalid =
static constexpr EDLCParameterType e_DLCParamType_DisplayName = ::minecraft::dlc::e_DLCParamType_DisplayName; ::minecraft::dlc::e_DLCParamType_Invalid;
static constexpr EDLCParameterType e_DLCParamType_ThemeName = ::minecraft::dlc::e_DLCParamType_ThemeName; static constexpr EDLCParameterType e_DLCParamType_DisplayName =
static constexpr EDLCParameterType e_DLCParamType_Free = ::minecraft::dlc::e_DLCParamType_Free; ::minecraft::dlc::e_DLCParamType_DisplayName;
static constexpr EDLCParameterType e_DLCParamType_Credit = ::minecraft::dlc::e_DLCParamType_Credit; static constexpr EDLCParameterType e_DLCParamType_ThemeName =
static constexpr EDLCParameterType e_DLCParamType_Cape = ::minecraft::dlc::e_DLCParamType_Cape; ::minecraft::dlc::e_DLCParamType_ThemeName;
static constexpr EDLCParameterType e_DLCParamType_Box = ::minecraft::dlc::e_DLCParamType_Box; static constexpr EDLCParameterType e_DLCParamType_Free =
static constexpr EDLCParameterType e_DLCParamType_Anim = ::minecraft::dlc::e_DLCParamType_Anim; ::minecraft::dlc::e_DLCParamType_Free;
static constexpr EDLCParameterType e_DLCParamType_PackId = ::minecraft::dlc::e_DLCParamType_PackId; static constexpr EDLCParameterType e_DLCParamType_Credit =
static constexpr EDLCParameterType e_DLCParamType_NetherParticleColour = ::minecraft::dlc::e_DLCParamType_NetherParticleColour; ::minecraft::dlc::e_DLCParamType_Credit;
static constexpr EDLCParameterType e_DLCParamType_EnchantmentTextColour = ::minecraft::dlc::e_DLCParamType_EnchantmentTextColour; static constexpr EDLCParameterType e_DLCParamType_Cape =
static constexpr EDLCParameterType e_DLCParamType_EnchantmentTextFocusColour = ::minecraft::dlc::e_DLCParamType_EnchantmentTextFocusColour; ::minecraft::dlc::e_DLCParamType_Cape;
static constexpr EDLCParameterType e_DLCParamType_DataPath = ::minecraft::dlc::e_DLCParamType_DataPath; static constexpr EDLCParameterType e_DLCParamType_Box =
static constexpr EDLCParameterType e_DLCParamType_PackVersion = ::minecraft::dlc::e_DLCParamType_PackVersion; ::minecraft::dlc::e_DLCParamType_Box;
static constexpr EDLCParameterType e_DLCParamType_Max = ::minecraft::dlc::e_DLCParamType_Max; static constexpr EDLCParameterType e_DLCParamType_Anim =
::minecraft::dlc::e_DLCParamType_Anim;
static constexpr EDLCParameterType e_DLCParamType_PackId =
::minecraft::dlc::e_DLCParamType_PackId;
static constexpr EDLCParameterType e_DLCParamType_NetherParticleColour =
::minecraft::dlc::e_DLCParamType_NetherParticleColour;
static constexpr EDLCParameterType e_DLCParamType_EnchantmentTextColour =
::minecraft::dlc::e_DLCParamType_EnchantmentTextColour;
static constexpr EDLCParameterType
e_DLCParamType_EnchantmentTextFocusColour =
::minecraft::dlc::e_DLCParamType_EnchantmentTextFocusColour;
static constexpr EDLCParameterType e_DLCParamType_DataPath =
::minecraft::dlc::e_DLCParamType_DataPath;
static constexpr EDLCParameterType e_DLCParamType_PackVersion =
::minecraft::dlc::e_DLCParamType_PackVersion;
static constexpr EDLCParameterType e_DLCParamType_Max =
::minecraft::dlc::e_DLCParamType_Max;
const static char* wchTypeNamesA[e_DLCParamType_Max]; const static char* wchTypeNamesA[e_DLCParamType_Max];
@ -85,7 +110,7 @@ public:
EDLCType type = e_DLCType_All); EDLCType type = e_DLCType_All);
DLCSkinFile* getSkinFile( DLCSkinFile* getSkinFile(
const std::string& path); // Will hunt all packs of type skin to find const std::string& path); // Will hunt all packs of type skin to find
// the right skinfile // the right skinfile
DLCPack* getPackContainingSkin(const std::string& path); DLCPack* getPackContainingSkin(const std::string& path);
unsigned int getPackIndexContainingSkin(const std::string& path, unsigned int getPackIndexContainingSkin(const std::string& path,

View file

@ -6,7 +6,6 @@
#include <sstream> #include <sstream>
#include <utility> #include <utility>
#include "platform/profile/profile.h"
#include "DLCAudioFile.h" #include "DLCAudioFile.h"
#include "DLCCapeFile.h" #include "DLCCapeFile.h"
#include "DLCColourTableFile.h" #include "DLCColourTableFile.h"
@ -15,12 +14,13 @@
#include "DLCLocalisationFile.h" #include "DLCLocalisationFile.h"
#include "DLCTextureFile.h" #include "DLCTextureFile.h"
#include "DLCUIDataFile.h" #include "DLCUIDataFile.h"
#include "minecraft/Console_Debug_enum.h"
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h" #include "app/common/DLC/DLCSkinFile.h"
#include "minecraft/locale/StringTable.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/Console_Debug_enum.h"
#include "minecraft/locale/StringTable.h"
#include "platform/profile/profile.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
DLCPack::DLCPack(const std::string& name, std::uint32_t dwLicenseMask) { DLCPack::DLCPack(const std::string& name, std::uint32_t dwLicenseMask) {

View file

@ -5,9 +5,9 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include "platform/PlatformTypes.h"
#include "DLCManager.h" #include "DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h" #include "app/common/DLC/DLCSkinFile.h"
#include "platform/PlatformTypes.h"
class DLCFile; class DLCFile;
class DLCSkinFile; class DLCSkinFile;

View file

@ -3,12 +3,12 @@
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
#include "platform/renderer/renderer.h"
#include "DLCManager.h" #include "DLCManager.h"
#include "app/common/DLC/DLCFile.h" #include "app/common/DLC/DLCFile.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/client/model/SkinBox.h" #include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/renderer/renderer.h"
DLCSkinFile::DLCSkinFile(const std::string& path) DLCSkinFile::DLCSkinFile(const std::string& path)
: DLCFile(DLCManager::e_DLCType_Skin, path) { : DLCFile(DLCManager::e_DLCType_Skin, path) {
@ -56,8 +56,8 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
int maximumChars = 55; int maximumChars = 55;
bool bIsSDMode = bool bIsSDMode = !PlatformRenderer.IsHiDef() &&
!PlatformRenderer.IsHiDef() && !PlatformRenderer.IsWidescreen(); !PlatformRenderer.IsWidescreen();
if (bIsSDMode) { if (bIsSDMode) {
maximumChars = 45; maximumChars = 45;
@ -111,8 +111,8 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
memset(pSkinBox, 0, sizeof(SKIN_BOX)); memset(pSkinBox, 0, sizeof(SKIN_BOX));
sscanf(value.c_str(), "%9s%f%f%f%f%f%f%f%f", wchBodyPart, sscanf(value.c_str(), "%9s%f%f%f%f%f%f%f%f", wchBodyPart,
&pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW, &pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW,
&pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV); &pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV);
if (strcmp(wchBodyPart, "HEAD") == 0) { if (strcmp(wchBodyPart, "HEAD") == 0) {
pSkinBox->ePart = eBodyPart_Head; pSkinBox->ePart = eBodyPart_Head;

View file

@ -6,8 +6,8 @@
#include "DLCFile.h" #include "DLCFile.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "minecraft/client/model/SkinBox.h"
#include "minecraft/client/model/HumanoidModel.h" #include "minecraft/client/model/HumanoidModel.h"
#include "minecraft/client/model/SkinBox.h"
class DLCSkinFile : public DLCFile { class DLCSkinFile : public DLCFile {
private: private:

View file

@ -1,20 +1,20 @@
#include "app/common/DLCController.h" #include "app/common/DLCController.h"
#include "app/common/Game.h" #include <cstring>
#include "app/common/DLC/DLCPack.h" #include <mutex>
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h"
#include "app/common/DLC/DLCSkinFile.h" #include "app/common/DLC/DLCSkinFile.h"
#include "app/common/Game.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "platform/storage/storage.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/profile/profile.h"
#include <cstring> #include "platform/storage/storage.h"
#include <mutex>
DLCController::DLCController() { DLCController::DLCController() {
m_pDLCFileBuffer = nullptr; m_pDLCFileBuffer = nullptr;
@ -75,10 +75,9 @@ bool DLCController::startInstallDLCProcess(int iPad) {
"--- DLCController::startInstallDLCProcess - " "--- DLCController::startInstallDLCProcess - "
"PlatformStorage.GetInstalledDLC\n"); "PlatformStorage.GetInstalledDLC\n");
PlatformStorage.GetInstalledDLC( PlatformStorage.GetInstalledDLC(iPad, [this](int iInstalledC, int pad) {
iPad, [this](int iInstalledC, int pad) { return dlcInstalledCallback(iInstalledC, pad);
return dlcInstalledCallback(iInstalledC, pad); });
});
return true; return true;
} else { } else {
app.DebugPrintf( app.DebugPrintf(
@ -193,7 +192,7 @@ void DLCController::handleDLC(DLCPack* pack) {
PlatformStorage.GetMountedDLCFileList("DLCDrive", dlcFilenames); PlatformStorage.GetMountedDLCFileList("DLCDrive", dlcFilenames);
for (int i = 0; i < dlcFilenames.size(); i++) { for (int i = 0; i < dlcFilenames.size(); i++) {
app.m_dlcManager.readDLCDataFile(dwFilesProcessed, dlcFilenames[i], app.m_dlcManager.readDLCDataFile(dwFilesProcessed, dlcFilenames[i],
pack); pack);
} }
if (dwFilesProcessed == 0) app.m_dlcManager.removePack(pack); if (dwFilesProcessed == 0) app.m_dlcManager.removePack(pack);
} }
@ -313,8 +312,7 @@ bool DLCController::getDLCFullOfferIDForPackID(const int iPackID,
} }
} }
DLC_INFO* DLCController::getDLCInfoForTrialOfferID( DLC_INFO* DLCController::getDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial) {
uint64_t ullOfferID_Trial) {
if (DLCInfo_Trial.size() > 0) { if (DLCInfo_Trial.size() > 0) {
auto it = DLCInfo_Trial.find(ullOfferID_Trial); auto it = DLCInfo_Trial.find(ullOfferID_Trial);
if (it == DLCInfo_Trial.end()) { if (it == DLCInfo_Trial.end()) {
@ -436,12 +434,13 @@ bool DLCController::retrieveNextDLCContent() {
app.DebugPrintf("RetrieveNextDLCContent - type = %d\n", app.DebugPrintf("RetrieveNextDLCContent - type = %d\n",
pCurrent->dwType); pCurrent->dwType);
#endif #endif
IPlatformStorage::EDLCStatus status = PlatformStorage.GetDLCOffers( IPlatformStorage::EDLCStatus status =
PlatformProfile.GetPrimaryPad(), PlatformStorage.GetDLCOffers(
[this](int iOfferC, std::uint32_t dwType, int pad) { PlatformProfile.GetPrimaryPad(),
return dlcOffersReturned(iOfferC, dwType, pad); [this](int iOfferC, std::uint32_t dwType, int pad) {
}, return dlcOffersReturned(iOfferC, dwType, pad);
pCurrent->dwType); },
pCurrent->dwType);
if (status == IPlatformStorage::EDLC_Pending) { if (status == IPlatformStorage::EDLC_Pending) {
pCurrent->eState = e_DLC_ContentState_Retrieving; pCurrent->eState = e_DLC_ContentState_Retrieving;
} else { } else {
@ -669,9 +668,9 @@ unsigned int DLCController::addTMSPPFileTypeRequest(eDLCContentType eType,
return 1; return 1;
} }
int DLCController::tmsPPFileReturned(void* pParam, int iPad, int iUserData, int DLCController::tmsPPFileReturned(
IPlatformStorage::PTMSPP_FILEDATA pFileData, void* pParam, int iPad, int iUserData,
const char* szFilename) { IPlatformStorage::PTMSPP_FILEDATA pFileData, const char* szFilename) {
DLCController* pClass = (DLCController*)pParam; DLCController* pClass = (DLCController*)pParam;
{ {

View file

@ -8,8 +8,8 @@
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/storage/storage.h"
struct SCreditTextItemDef; struct SCreditTextItemDef;
@ -36,9 +36,8 @@ public:
int iPad); int iPad);
// DLC info registration // DLC info registration
static int32_t registerDLCData(char*, char*, int, uint64_t, uint64_t, static int32_t registerDLCData(char*, char*, int, uint64_t, uint64_t, char*,
char*, unsigned int, int, unsigned int, int, char* pDataFile);
char* pDataFile);
bool getDLCFullOfferIDForSkinID(const std::string& FirstSkin, bool getDLCFullOfferIDForSkinID(const std::string& FirstSkin,
uint64_t* pullVal); uint64_t* pullVal);
bool getDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal); bool getDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal);

View file

@ -27,7 +27,6 @@ DebugOptions::DebugOptions() {
#if defined(_DEBUG_MENUS_ENABLED) #if defined(_DEBUG_MENUS_ENABLED)
bool DebugOptions::debugArtToolsOn(unsigned int debugMask) { bool DebugOptions::debugArtToolsOn(unsigned int debugMask) {
return settingsOn() && return settingsOn() && (debugMask & (1L << eDebugSetting_ArtTools)) != 0;
(debugMask & (1L << eDebugSetting_ArtTools)) != 0;
} }
#endif #endif

View file

@ -1,34 +1,27 @@
#include "minecraft/GameHostOptions.h"
#include "app/common/Game.h" #include "app/common/Game.h"
#include "platform/PlatformTypes.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "minecraft/GameTypes.h"
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "minecraft/Console_Debug_enum.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h" #include "app/common/DLC/DLCSkinFile.h"
#include "app/common/GameRules/GameRuleManager.h" #include "app/common/GameRules/GameRuleManager.h"
#include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Scenes/UIScene_FullscreenProgress.h" #include "app/common/UI/Scenes/UIScene_FullscreenProgress.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h"
#include "java/Class.h" #include "java/Class.h"
#include "java/File.h" #include "java/File.h"
#include "java/Random.h" #include "java/Random.h"
#include "minecraft/Console_Debug_enum.h"
#include "minecraft/GameEnums.h"
#include "minecraft/GameHostOptions.h"
#include "minecraft/GameTypes.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/Options.h" #include "minecraft/client/Options.h"
#include "minecraft/client/ProgressRenderer.h" #include "minecraft/client/ProgressRenderer.h"
#include "minecraft/client/model/SkinBox.h"
#include "minecraft/client/model/geom/Model.h" #include "minecraft/client/model/geom/Model.h"
#include "minecraft/client/multiplayer/ClientConnection.h" #include "minecraft/client/multiplayer/ClientConnection.h"
#include "minecraft/client/multiplayer/MultiPlayerGameMode.h" #include "minecraft/client/multiplayer/MultiPlayerGameMode.h"
@ -39,6 +32,7 @@
#include "minecraft/client/renderer/entity/EntityRenderer.h" #include "minecraft/client/renderer/entity/EntityRenderer.h"
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/network/packet/DisconnectPacket.h" #include "minecraft/network/packet/DisconnectPacket.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/server/MinecraftServer.h" #include "minecraft/server/MinecraftServer.h"
#include "minecraft/stats/StatsCounter.h" #include "minecraft/stats/StatsCounter.h"
#include "minecraft/world/Container.h" #include "minecraft/world/Container.h"
@ -47,6 +41,12 @@
#include "minecraft/world/item/crafting/Recipy.h" #include "minecraft/world/item/crafting/Recipy.h"
#include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/HopperTileEntity.h" #include "minecraft/world/level/tile/entity/HopperTileEntity.h"
#include "platform/NetTypes.h"
#include "platform/PlatformTypes.h"
#include "platform/XboxStubs.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "strings.h" #include "strings.h"
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
#include "app/windows/XML/ATGXmlParser.h" #include "app/windows/XML/ATGXmlParser.h"
@ -71,24 +71,24 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "platform/input/input.h"
#include "app/common/Audio/SoundEngine.h" #include "app/common/Audio/SoundEngine.h"
#include "minecraft/client/resources/Colours/ColourTable.h"
#include "app/common/DLC/DLCPack.h" #include "app/common/DLC/DLCPack.h"
#include "minecraft/locale/StringTable.h"
#include "app/common/UI/All Platforms/ArchiveFile.h" #include "app/common/UI/All Platforms/ArchiveFile.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h" #include "app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h"
#include "minecraft/Minecraft_Macros.h" #include "minecraft/Minecraft_Macros.h"
#include "util/Timer.h"
#include "util/StringHelpers.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "minecraft/client/User.h" #include "minecraft/client/User.h"
#include "minecraft/client/gui/Gui.h" #include "minecraft/client/gui/Gui.h"
#include "minecraft/client/renderer/entity/EntityRenderDispatcher.h" #include "minecraft/client/renderer/entity/EntityRenderDispatcher.h"
#include "minecraft/client/resources/Colours/ColourTable.h"
#include "minecraft/client/skins/DLCTexturePack.h" #include "minecraft/client/skins/DLCTexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "minecraft/locale/StringTable.h"
#include "minecraft/server/PlayerList.h" #include "minecraft/server/PlayerList.h"
#include "minecraft/server/level/ServerPlayer.h" #include "minecraft/server/level/ServerPlayer.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/input/input.h"
#include "util/StringHelpers.h"
#include "util/Timer.h"
class BeaconTileEntity; class BeaconTileEntity;
class BrewingStandTileEntity; class BrewingStandTileEntity;
@ -189,31 +189,14 @@ void Game::SetAppPaused(bool val) { m_bIsAppPaused = val; }
// Load*Menu methods moved to MenuController // Load*Menu methods moved to MenuController
////////////////////////////////////////////// //////////////////////////////////////////////
// GAME SETTINGS // GAME SETTINGS
////////////////////////////////////////////// //////////////////////////////////////////////
// Skin/Cape/FavoriteSkin methods moved to SkinManager // Skin/Cape/FavoriteSkin methods moved to SkinManager
// Mash-up pack worlds // Mash-up pack worlds
/////////////////////////// ///////////////////////////
// //
// Remove the debug settings in the content package build // Remove the debug settings in the content package build
@ -221,16 +204,10 @@ void Game::SetAppPaused(bool val) { m_bIsAppPaused = val; }
//////////////////////////// ////////////////////////////
#if !defined(_DEBUG_MENUS_ENABLED) #if !defined(_DEBUG_MENUS_ENABLED)
#else #else
#endif #endif
int Game::BannedLevelDialogReturned( int Game::BannedLevelDialogReturned(
void* pParam, int iPad, const IPlatformStorage::EMessageResult result) { void* pParam, int iPad, const IPlatformStorage::EMessageResult result) {
Game* pApp = (Game*)pParam; Game* pApp = (Game*)pParam;
@ -284,11 +261,8 @@ int Game::GetLocalPlayerCount(void) {
return iPlayerC; return iPlayerC;
} }
// Installed DLC callback // Installed DLC callback
// 4J-JEV: For the sake of clarity in DLCMountedCallback. // 4J-JEV: For the sake of clarity in DLCMountedCallback.
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
#define CONTENT_DATA_DISPLAY_NAME(a) (a.szDisplayName) #define CONTENT_DATA_DISPLAY_NAME(a) (a.szDisplayName)
@ -326,7 +300,6 @@ int Game::GetLocalPlayerCount(void) {
// } // }
// } // }
// int Game::DLCReadCallback(void* // int Game::DLCReadCallback(void*
// pParam,IPlatformStorage::DLC_FILE_DETAILS *pDLCData) // pParam,IPlatformStorage::DLC_FILE_DETAILS *pDLCData)
// { // {
@ -365,8 +338,9 @@ void Game::UpdateTime() {
} }
bool Game::isXuidDeadmau5(PlayerUID xuid) { bool Game::isXuidDeadmau5(PlayerUID xuid) {
auto it = DLCController::MojangData.find(xuid); // 4J Stu - The .at and [] accessors auto it = DLCController::MojangData.find(
// insert elements if they don't exist xuid); // 4J Stu - The .at and [] accessors
// insert elements if they don't exist
if (it != DLCController::MojangData.end()) { if (it != DLCController::MojangData.end()) {
MOJANG_DATA* pMojangData = DLCController::MojangData[xuid]; MOJANG_DATA* pMojangData = DLCController::MojangData[xuid];
if (pMojangData && pMojangData->eXuid == eXUID_Deadmau5) { if (pMojangData && pMojangData->eXuid == eXUID_Deadmau5) {
@ -383,12 +357,6 @@ void Game::ExitGame() {}
// Invites // Invites
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// //
// FatalLoadError // FatalLoadError
@ -400,26 +368,16 @@ void Game::ExitGame() {}
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void Game::FatalLoadError() {} void Game::FatalLoadError() {}
// Game Host options // Game Host options
void Game::SetGameHostOption(eGameHostOption eVal, void Game::SetGameHostOption(eGameHostOption eVal, unsigned int uiVal) {
unsigned int uiVal) {
GameHostOptions::set(m_uiGameHostSettings, eVal, uiVal); GameHostOptions::set(m_uiGameHostSettings, eVal, uiVal);
} }
unsigned int Game::GetGameHostOption(eGameHostOption eVal) { unsigned int Game::GetGameHostOption(eGameHostOption eVal) {
return GameHostOptions::get(m_uiGameHostSettings, eVal); return GameHostOptions::get(m_uiGameHostSettings, eVal);
} }
void Game::processSchematics(LevelChunk* levelChunk) { void Game::processSchematics(LevelChunk* levelChunk) {
m_gameRules.processSchematics(levelChunk); m_gameRules.processSchematics(levelChunk);
} }
@ -428,12 +386,9 @@ void Game::processSchematicsLighting(LevelChunk* levelChunk) {
m_gameRules.processSchematicsLighting(levelChunk); m_gameRules.processSchematicsLighting(levelChunk);
} }
void Game::loadDefaultGameRules() { void Game::loadDefaultGameRules() { m_gameRules.loadDefaultGameRules(); }
m_gameRules.loadDefaultGameRules();
}
void Game::setLevelGenerationOptions( void Game::setLevelGenerationOptions(LevelGenerationOptions* levelGen) {
LevelGenerationOptions* levelGen) {
m_gameRules.setLevelGenerationOptions(levelGen); m_gameRules.setLevelGenerationOptions(levelGen);
} }
@ -441,16 +396,8 @@ const char* Game::GetGameRulesString(const std::string& key) {
return m_gameRules.GetGameRulesString(key); return m_gameRules.GetGameRulesString(key);
} }
// PNG_TAG_tEXt, FromBigEndian, GetImageTextData, CreateImageTextData moved to
// MenuController
// PNG_TAG_tEXt, FromBigEndian, GetImageTextData, CreateImageTextData moved to MenuController
std::string Game::getEntityName(eINSTANCEOF type) { std::string Game::getEntityName(eINSTANCEOF type) {
switch (type) { switch (type) {
@ -506,12 +453,8 @@ std::string Game::getEntityName(eINSTANCEOF type) {
// m_dwContentTypeA moved to DLCController // m_dwContentTypeA moved to DLCController
int32_t Game::RegisterMojangData(char* pXuidName, PlayerUID xuid, char* pSkin,
char* pCape) {
int32_t Game::RegisterMojangData(char* pXuidName, PlayerUID xuid,
char* pSkin, char* pCape) {
int32_t hr = 0; int32_t hr = 0;
eXUID eTempXuid = eXUID_Undefined; eXUID eTempXuid = eXUID_Undefined;
MOJANG_DATA* pMojangData = nullptr; MOJANG_DATA* pMojangData = nullptr;
@ -579,33 +522,12 @@ int32_t Game::RegisterConfigValues(char* pType, int iValue) {
#endif #endif
// DLC // DLC
// AUTOSAVE // AUTOSAVE
void Game::SetAutosaveTimerTime(void) { void Game::SetAutosaveTimerTime(void) {
int settingValue = GetGameSettings(PlatformProfile.GetPrimaryPad(), eGameSetting_Autosave); int settingValue =
GetGameSettings(PlatformProfile.GetPrimaryPad(), eGameSetting_Autosave);
m_saveManager.setAutosaveTimerTime(settingValue); m_saveManager.setAutosaveTimerTime(settingValue);
} }
@ -641,7 +563,8 @@ bool Game::IsLocalMultiplayerAvailable() {
// #else // #else
// for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) // for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
// { // {
// if( (i!=userIndex) && (PlatformInput.IsPadConnected(i) || // if( (i!=userIndex) && (PlatformInput.IsPadConnected(i)
//||
// PlatformProfile.IsSignedIn(i)) ) // PlatformProfile.IsSignedIn(i)) )
// { // {
// iOtherConnectedControllers++; // iOtherConnectedControllers++;
@ -654,10 +577,8 @@ bool Game::IsLocalMultiplayerAvailable() {
// (moved to manager class) // (moved to manager class)
std::string Game::getFilePath(std::uint32_t packId, std::string Game::getFilePath(std::uint32_t packId, std::string filename,
std::string filename, bool bAddDataFolder, std::string mountPoint) {
bool bAddDataFolder,
std::string mountPoint) {
std::string path = std::string path =
getRootPath(packId, true, bAddDataFolder, mountPoint) + filename; getRootPath(packId, true, bAddDataFolder, mountPoint) + filename;
File f(path); File f(path);
@ -689,9 +610,8 @@ std::string titleUpdateTexturePackRoot = "Windows64\\DLC\\";
std::string titleUpdateTexturePackRoot = "CU\\DLC\\"; std::string titleUpdateTexturePackRoot = "CU\\DLC\\";
#endif #endif
std::string Game::getRootPath(std::uint32_t packId, std::string Game::getRootPath(std::uint32_t packId, bool allowOverride,
bool allowOverride, bool bAddDataFolder, bool bAddDataFolder, std::string mountPoint) {
std::string mountPoint) {
std::string path = mountPoint; std::string path = mountPoint;
if (allowOverride) { if (allowOverride) {
switch (packId) { switch (packId) {

View file

@ -3,38 +3,38 @@
#include <cstdint> #include <cstdint>
#include <mutex> #include <mutex>
#include "util/Timer.h"
#include "platform/profile/profile.h" #include "platform/profile/profile.h"
#include "platform/storage/storage.h" #include "platform/storage/storage.h"
#include "util/Timer.h"
// using namespace std; // using namespace std;
#include "app/common/App_structs.h"
#include "app/common/ArchiveManager.h" #include "app/common/ArchiveManager.h"
#include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/common/BannedListManager.h" #include "app/common/BannedListManager.h"
#include "app/common/DebugOptions.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLCController.h" #include "app/common/DLCController.h"
#include "app/common/DebugOptions.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "app/common/GameSettingsManager.h" #include "app/common/GameSettingsManager.h"
#include "app/common/IPlatformGame.h" #include "app/common/IPlatformGame.h"
#include "app/common/App_structs.h"
#include "app/common/LocalizationManager.h" #include "app/common/LocalizationManager.h"
#include "app/common/MenuController.h" #include "app/common/MenuController.h"
#include "app/common/NetworkController.h" #include "app/common/NetworkController.h"
#include "app/common/SaveManager.h" #include "app/common/SaveManager.h"
#include "app/common/SkinManager.h" #include "app/common/SkinManager.h"
#include "app/common/TerrainFeatureManager.h" #include "app/common/TerrainFeatureManager.h"
#include "app/common/Audio/Consoles_SoundEngine.h"
#include "app/common/DLC/DLCManager.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/GameRuleManager.h"
#include "minecraft/locale/StringTable.h"
#include "app/common/Tutorial/TutorialEnum.h" #include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/UI/All Platforms/ArchiveFile.h" #include "app/common/UI/All Platforms/ArchiveFile.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h" #include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h" #include "minecraft/locale/StringTable.h"
#include "minecraft/network/packet/DisconnectPacket.h" #include "minecraft/network/packet/DisconnectPacket.h"
#include "minecraft/world/entity/item/MinecartHopper.h" #include "minecraft/world/entity/item/MinecartHopper.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "platform/NetTypes.h"
#include "platform/XboxStubs.h"
// JoinFromInviteData moved to NetworkController.h // JoinFromInviteData moved to NetworkController.h
@ -145,7 +145,8 @@ public:
bool IsAppPaused(); bool IsAppPaused();
void SetAppPaused(bool val); void SetAppPaused(bool val);
int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg, int iPad) { int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg,
int iPad) {
return m_gameSettingsManager.displaySavingMessage(eMsg, iPad); return m_gameSettingsManager.displaySavingMessage(eMsg, iPad);
} }
bool GetGameStarted() { return m_bGameStarted; } bool GetGameStarted() { return m_bGameStarted; }
@ -169,7 +170,8 @@ public:
bool LoadEnchantingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadEnchantingMenu(int iPad, std::shared_ptr<Inventory> inventory,
int x, int y, int z, Level* level, int x, int y, int z, Level* level,
const std::string& name) { const std::string& name) {
return m_menuController.loadEnchantingMenu(iPad, inventory, x, y, z, level, name); return m_menuController.loadEnchantingMenu(iPad, inventory, x, y, z,
level, name);
} }
bool LoadFurnaceMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadFurnaceMenu(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<FurnaceTileEntity> furnace) { std::shared_ptr<FurnaceTileEntity> furnace) {
@ -178,7 +180,8 @@ public:
bool LoadBrewingStandMenu( bool LoadBrewingStandMenu(
int iPad, std::shared_ptr<Inventory> inventory, int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<BrewingStandTileEntity> brewingStand) { std::shared_ptr<BrewingStandTileEntity> brewingStand) {
return m_menuController.loadBrewingStandMenu(iPad, inventory, brewingStand); return m_menuController.loadBrewingStandMenu(iPad, inventory,
brewingStand);
} }
bool LoadContainerMenu(int iPad, std::shared_ptr<Container> inventory, bool LoadContainerMenu(int iPad, std::shared_ptr<Container> inventory,
std::shared_ptr<Container> container) { std::shared_ptr<Container> container) {
@ -204,12 +207,14 @@ public:
} }
bool LoadRepairingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadRepairingMenu(int iPad, std::shared_ptr<Inventory> inventory,
Level* level, int x, int y, int z) { Level* level, int x, int y, int z) {
return m_menuController.loadRepairingMenu(iPad, inventory, level, x, y, z); return m_menuController.loadRepairingMenu(iPad, inventory, level, x, y,
z);
} }
bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Merchant> trader, Level* level, std::shared_ptr<Merchant> trader, Level* level,
const std::string& name) { const std::string& name) {
return m_menuController.loadTradingMenu(iPad, inventory, trader, level, name); return m_menuController.loadTradingMenu(iPad, inventory, trader, level,
name);
} }
bool LoadCommandBlockMenu( bool LoadCommandBlockMenu(
@ -227,7 +232,8 @@ public:
bool LoadHorseMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadHorseMenu(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Container> container, std::shared_ptr<Container> container,
std::shared_ptr<EntityHorse> horse) { std::shared_ptr<EntityHorse> horse) {
return m_menuController.loadHorseMenu(iPad, inventory, container, horse); return m_menuController.loadHorseMenu(iPad, inventory, container,
horse);
} }
bool LoadBeaconMenu(int iPad, std::shared_ptr<Inventory> inventory, bool LoadBeaconMenu(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<BeaconTileEntity> beacon) { std::shared_ptr<BeaconTileEntity> beacon) {
@ -242,21 +248,31 @@ public:
} }
static const char* GetString(int iID); static const char* GetString(int iID);
StringTable* getStringTable() const { return m_localizationManager.getStringTable(); } StringTable* getStringTable() const {
return m_localizationManager.getStringTable();
}
eGameMode GetGameMode() { return m_eGameMode; } eGameMode GetGameMode() { return m_eGameMode; }
void SetGameMode(eGameMode eMode) { m_eGameMode = eMode; } void SetGameMode(eGameMode eMode) { m_eGameMode = eMode; }
eXuiAction GetGlobalXuiAction() { return m_menuController.getGlobalXuiAction(); } eXuiAction GetGlobalXuiAction() {
void SetGlobalXuiAction(eXuiAction action) { m_menuController.setGlobalXuiAction(action); } return m_menuController.getGlobalXuiAction();
eXuiAction GetXuiAction(int iPad) { return m_menuController.getXuiAction(iPad); } }
void SetGlobalXuiAction(eXuiAction action) {
m_menuController.setGlobalXuiAction(action);
}
eXuiAction GetXuiAction(int iPad) {
return m_menuController.getXuiAction(iPad);
}
void SetAction(int iPad, eXuiAction action, void* param = nullptr) { void SetAction(int iPad, eXuiAction action, void* param = nullptr) {
m_menuController.setAction(iPad, action, param); m_menuController.setAction(iPad, action, param);
} }
void SetTMSAction(int iPad, eTMSAction action) { void SetTMSAction(int iPad, eTMSAction action) {
m_menuController.setTMSAction(iPad, action); m_menuController.setTMSAction(iPad, action);
} }
eTMSAction GetTMSAction(int iPad) { return m_menuController.getTMSAction(iPad); } eTMSAction GetTMSAction(int iPad) {
return m_menuController.getTMSAction(iPad);
}
eXuiServerAction GetXuiServerAction(int iPad) { eXuiServerAction GetXuiServerAction(int iPad) {
return m_menuController.getXuiServerAction(iPad); return m_menuController.getXuiServerAction(iPad);
} }
@ -281,10 +297,16 @@ public:
m_networkController.setDisconnectReason(bVal); m_networkController.setDisconnectReason(bVal);
} }
bool GetChangingSessionType() { return m_networkController.getChangingSessionType(); } bool GetChangingSessionType() {
void SetChangingSessionType(bool bVal) { m_networkController.setChangingSessionType(bVal); } return m_networkController.getChangingSessionType();
}
void SetChangingSessionType(bool bVal) {
m_networkController.setChangingSessionType(bVal);
}
bool GetReallyChangingSessionType() { return m_networkController.getReallyChangingSessionType(); } bool GetReallyChangingSessionType() {
return m_networkController.getReallyChangingSessionType();
}
void SetReallyChangingSessionType(bool bVal) { void SetReallyChangingSessionType(bool bVal) {
m_networkController.setReallyChangingSessionType(bVal); m_networkController.setReallyChangingSessionType(bVal);
} }
@ -340,13 +362,15 @@ public:
static int OldProfileVersionCallback(void* pParam, unsigned char* pucData, static int OldProfileVersionCallback(void* pParam, unsigned char* pucData,
const unsigned short usVersion, const unsigned short usVersion,
const int iPad) { const int iPad) {
return GameSettingsManager::oldProfileVersionCallback(pParam, pucData, usVersion, iPad); return GameSettingsManager::oldProfileVersionCallback(pParam, pucData,
usVersion, iPad);
} }
static int DefaultOptionsCallback(void* pParam, static int DefaultOptionsCallback(
IPlatformProfile::PROFILESETTINGS* pSettings, void* pParam, IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) { const int iPad) {
return GameSettingsManager::defaultOptionsCallback(pParam, pSettings, iPad); return GameSettingsManager::defaultOptionsCallback(pParam, pSettings,
iPad);
} }
int SetDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings, int SetDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad) { const int iPad) {
@ -376,7 +400,8 @@ public:
m_skinManager.setPlayerCape(iPad, dwCapeId, GameSettingsA); m_skinManager.setPlayerCape(iPad, dwCapeId, GameSettingsA);
} }
void SetPlayerFavoriteSkin(int iPad, int iIndex, unsigned int uiSkinID) { void SetPlayerFavoriteSkin(int iPad, int iIndex, unsigned int uiSkinID) {
m_skinManager.setPlayerFavoriteSkin(iPad, iIndex, uiSkinID, GameSettingsA); m_skinManager.setPlayerFavoriteSkin(iPad, iIndex, uiSkinID,
GameSettingsA);
} }
unsigned int GetPlayerFavoriteSkin(int iPad, int iIndex) { unsigned int GetPlayerFavoriteSkin(int iPad, int iIndex) {
return m_skinManager.getPlayerFavoriteSkin(iPad, iIndex, GameSettingsA); return m_skinManager.getPlayerFavoriteSkin(iPad, iIndex, GameSettingsA);
@ -427,9 +452,7 @@ public:
void SetOpacityTimer(int iPad) { void SetOpacityTimer(int iPad) {
m_menuController.setOpacityTimer(iPad); m_menuController.setOpacityTimer(iPad);
} // 6 seconds } // 6 seconds
void TickOpacityTimer(int iPad) { void TickOpacityTimer(int iPad) { m_menuController.tickOpacityTimer(iPad); }
m_menuController.tickOpacityTimer(iPad);
}
public: public:
std::string GetPlayerSkinName(int iPad) { std::string GetPlayerSkinName(int iPad) {
@ -449,7 +472,8 @@ public:
} }
void CheckGameSettingsChanged(bool bOverride5MinuteTimer = false, void CheckGameSettingsChanged(bool bOverride5MinuteTimer = false,
int iPad = XUSER_INDEX_ANY) { int iPad = XUSER_INDEX_ANY) {
m_gameSettingsManager.checkGameSettingsChanged(bOverride5MinuteTimer, iPad); m_gameSettingsManager.checkGameSettingsChanged(bOverride5MinuteTimer,
iPad);
} }
void ApplyGameSettingsChanged(int iPad) { void ApplyGameSettingsChanged(int iPad) {
m_gameSettingsManager.applyGameSettingsChanged(iPad); m_gameSettingsManager.applyGameSettingsChanged(iPad);
@ -462,7 +486,8 @@ public:
} }
unsigned int GetGameSettingsDebugMask(int iPad = -1, unsigned int GetGameSettingsDebugMask(int iPad = -1,
bool bOverridePlayer = false) { bool bOverridePlayer = false) {
return m_gameSettingsManager.getGameSettingsDebugMask(iPad, bOverridePlayer); return m_gameSettingsManager.getGameSettingsDebugMask(iPad,
bOverridePlayer);
} }
void SetGameSettingsDebugMask(int iPad, unsigned int uiVal) { void SetGameSettingsDebugMask(int iPad, unsigned int uiVal) {
m_gameSettingsManager.setGameSettingsDebugMask(iPad, uiVal); m_gameSettingsManager.setGameSettingsDebugMask(iPad, uiVal);
@ -485,13 +510,15 @@ public:
static int SignoutExitWorldThreadProc(void* lpParameter) { static int SignoutExitWorldThreadProc(void* lpParameter) {
return NetworkController::signoutExitWorldThreadProc(lpParameter); return NetworkController::signoutExitWorldThreadProc(lpParameter);
} }
static int PrimaryPlayerSignedOutReturned(void* pParam, int iPad, static int PrimaryPlayerSignedOutReturned(
const IPlatformStorage::EMessageResult result) { void* pParam, int iPad, const IPlatformStorage::EMessageResult result) {
return NetworkController::primaryPlayerSignedOutReturned(pParam, iPad, result); return NetworkController::primaryPlayerSignedOutReturned(pParam, iPad,
result);
} }
static int EthernetDisconnectReturned(void* pParam, int iPad, static int EthernetDisconnectReturned(
const IPlatformStorage::EMessageResult result) { void* pParam, int iPad, const IPlatformStorage::EMessageResult result) {
return NetworkController::ethernetDisconnectReturned(pParam, iPad, result); return NetworkController::ethernetDisconnectReturned(pParam, iPad,
result);
} }
static void ProfileReadErrorCallback(void* pParam) { static void ProfileReadErrorCallback(void* pParam) {
NetworkController::profileReadErrorCallback(pParam); NetworkController::profileReadErrorCallback(pParam);
@ -504,15 +531,20 @@ public:
static void NotificationsCallback(void* pParam, static void NotificationsCallback(void* pParam,
std::uint32_t dwNotification, std::uint32_t dwNotification,
unsigned int uiParam) { unsigned int uiParam) {
NetworkController::notificationsCallback(pParam, dwNotification, uiParam); NetworkController::notificationsCallback(pParam, dwNotification,
uiParam);
} }
// for the ethernet being disconnected // for the ethernet being disconnected
static void LiveLinkChangeCallback(void* pParam, bool bConnected) { static void LiveLinkChangeCallback(void* pParam, bool bConnected) {
NetworkController::liveLinkChangeCallback(pParam, bConnected); NetworkController::liveLinkChangeCallback(pParam, bConnected);
} }
bool GetLiveLinkRequired() { return m_networkController.getLiveLinkRequired(); } bool GetLiveLinkRequired() {
void SetLiveLinkRequired(bool required) { m_networkController.setLiveLinkRequired(required); } return m_networkController.getLiveLinkRequired();
}
void SetLiveLinkRequired(bool required) {
m_networkController.setLiveLinkRequired(required);
}
#if defined(_DEBUG_MENUS_ENABLED) #if defined(_DEBUG_MENUS_ENABLED)
bool DebugSettingsOn() { return m_debugOptions.settingsOn(); } bool DebugSettingsOn() { return m_debugOptions.settingsOn(); }
@ -523,11 +555,15 @@ public:
#endif #endif
void SetDebugSequence(const char* pchSeq); void SetDebugSequence(const char* pchSeq);
// bool UploadFileToGlobalStorage(int iQuadrant, // bool UploadFileToGlobalStorage(int iQuadrant,
// IPlatformStorage::eGlobalStorage eStorageFacility, std::string *wsFile ); // IPlatformStorage::eGlobalStorage eStorageFacility, std::string *wsFile );
// Installed DLC - delegated to DLCController // Installed DLC - delegated to DLCController
bool StartInstallDLCProcess(int iPad) { return m_dlcController.startInstallDLCProcess(iPad); } bool StartInstallDLCProcess(int iPad) {
int dlcInstalledCallback(int iOfferC, int iPad) { return m_dlcController.dlcInstalledCallback(iOfferC, iPad); } return m_dlcController.startInstallDLCProcess(iPad);
}
int dlcInstalledCallback(int iOfferC, int iPad) {
return m_dlcController.dlcInstalledCallback(iOfferC, iPad);
}
void HandleDLCLicenseChange(); void HandleDLCLicenseChange();
int dlcMountedCallback(int iPad, std::uint32_t dwErr, int dlcMountedCallback(int iPad, std::uint32_t dwErr,
std::uint32_t dwLicenceMask) { std::uint32_t dwLicenceMask) {
@ -536,11 +572,12 @@ public:
void MountNextDLC(int iPad) { m_dlcController.mountNextDLC(iPad); } void MountNextDLC(int iPad) { m_dlcController.mountNextDLC(iPad); }
void HandleDLC(DLCPack* pack) { m_dlcController.handleDLC(pack); } void HandleDLC(DLCPack* pack) { m_dlcController.handleDLC(pack); }
bool DLCInstallPending() { return m_dlcController.dlcInstallPending(); } bool DLCInstallPending() { return m_dlcController.dlcInstallPending(); }
bool DLCInstallProcessCompleted() { return m_dlcController.dlcInstallProcessCompleted(); } bool DLCInstallProcessCompleted() {
return m_dlcController.dlcInstallProcessCompleted();
}
void ClearDLCInstalled() { m_dlcController.clearDLCInstalled(); } void ClearDLCInstalled() { m_dlcController.clearDLCInstalled(); }
static int MarketplaceCountsCallback(void* pParam, static int MarketplaceCountsCallback(
IPlatformStorage::DLC_TMS_DETAILS* details, void* pParam, IPlatformStorage::DLC_TMS_DETAILS* details, int iPad) {
int iPad) {
return DLCController::marketplaceCountsCallback(pParam, details, iPad); return DLCController::marketplaceCountsCallback(pParam, details, iPad);
} }
@ -558,9 +595,7 @@ public:
virtual void StoreLaunchData(); virtual void StoreLaunchData();
virtual void ExitGame(); virtual void ExitGame();
bool isXuidNotch(PlayerUID xuid) { bool isXuidNotch(PlayerUID xuid) { return m_skinManager.isXuidNotch(xuid); }
return m_skinManager.isXuidNotch(xuid);
}
bool isXuidDeadmau5(PlayerUID xuid); bool isXuidDeadmau5(PlayerUID xuid);
void AddMemoryTextureFile(const std::string& wName, std::uint8_t* pbData, void AddMemoryTextureFile(const std::string& wName, std::uint8_t* pbData,
@ -597,9 +632,7 @@ public:
return m_archiveManager.getTPConfigVal(pwchDataFile); return m_archiveManager.getTPConfigVal(pwchDataFile);
} }
bool DefaultCapeExists() { bool DefaultCapeExists() { return m_skinManager.defaultCapeExists(); }
return m_skinManager.defaultCapeExists();
}
// void InstallDefaultCape(); // attempt to install the default cape once // void InstallDefaultCape(); // attempt to install the default cape once
// per game launch // per game launch
@ -607,11 +640,14 @@ public:
void ProcessInvite(std::uint32_t dwUserIndex, void ProcessInvite(std::uint32_t dwUserIndex,
std::uint32_t dwLocalUsersMask, std::uint32_t dwLocalUsersMask,
const INVITE_INFO* pInviteInfo) { const INVITE_INFO* pInviteInfo) {
m_networkController.processInvite(dwUserIndex, dwLocalUsersMask, pInviteInfo); m_networkController.processInvite(dwUserIndex, dwLocalUsersMask,
pInviteInfo);
} }
// Add credits for DLC installed - delegated to DLCController // Add credits for DLC installed - delegated to DLCController
void AddCreditText(const char* lpStr) { m_dlcController.addCreditText(lpStr); } void AddCreditText(const char* lpStr) {
m_dlcController.addCreditText(lpStr);
}
private: private:
std::unordered_map<PlayerUID, std::uint8_t*> m_GTS_Files; std::unordered_map<PlayerUID, std::uint8_t*> m_GTS_Files;
@ -654,14 +690,16 @@ public:
bool m_bTutorialMode; bool m_bTutorialMode;
bool m_bIsAppPaused; bool m_bIsAppPaused;
// m_bChangingSessionType and m_bReallyChangingSessionType moved to NetworkController // m_bChangingSessionType and m_bReallyChangingSessionType moved to
// NetworkController
// trial, and trying to unlock full // trial, and trying to unlock full
// version on an upsell // version on an upsell
void loadMediaArchive() { m_archiveManager.loadMediaArchive(); } void loadMediaArchive() { m_archiveManager.loadMediaArchive(); }
void loadStringTable() { void loadStringTable() {
m_localizationManager.loadStringTable(m_archiveManager.getMediaArchive()); m_localizationManager.loadStringTable(
m_archiveManager.getMediaArchive());
} }
public: public:
@ -676,10 +714,10 @@ public:
} }
private: private:
static int BannedLevelDialogReturned(void* pParam, int iPad, static int BannedLevelDialogReturned(
const IPlatformStorage::EMessageResult); void* pParam, int iPad, const IPlatformStorage::EMessageResult);
static int TexturePackDialogReturned(void* pParam, int iPad, static int TexturePackDialogReturned(
IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return MenuController::texturePackDialogReturned(pParam, iPad, result); return MenuController::texturePackDialogReturned(pParam, iPad, result);
} }
@ -703,7 +741,8 @@ private:
eGameMode m_eGameMode; // single or multiplayer eGameMode m_eGameMode; // single or multiplayer
// GameSettingsA reference alias into GameSettingsManager // GameSettingsA reference alias into GameSettingsManager
GAME_SETTINGS* (&GameSettingsA)[XUSER_MAX_COUNT] = m_gameSettingsManager.GameSettingsA; GAME_SETTINGS* (&GameSettingsA)[XUSER_MAX_COUNT] =
m_gameSettingsManager.GameSettingsA;
// m_uiLastSignInData moved to NetworkController // m_uiLastSignInData moved to NetworkController
@ -728,7 +767,6 @@ public:
} }
private: private:
static int UnlockFullExitReturned(void* pParam, int iPad, static int UnlockFullExitReturned(void* pParam, int iPad,
IPlatformStorage::EMessageResult result) { IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullExitReturned(pParam, iPad, result); return MenuController::unlockFullExitReturned(pParam, iPad, result);
@ -737,8 +775,8 @@ private:
IPlatformStorage::EMessageResult result) { IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullSaveReturned(pParam, iPad, result); return MenuController::unlockFullSaveReturned(pParam, iPad, result);
} }
static int UnlockFullInviteReturned(void* pParam, int iPad, static int UnlockFullInviteReturned(
IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return MenuController::unlockFullInviteReturned(pParam, iPad, result); return MenuController::unlockFullInviteReturned(pParam, iPad, result);
} }
static int TrialOverReturned(void* pParam, int iPad, static int TrialOverReturned(void* pParam, int iPad,
@ -751,21 +789,25 @@ private:
} }
static int ExitAndJoinFromInviteSaveDialogReturned( static int ExitAndJoinFromInviteSaveDialogReturned(
void* pParam, int iPad, IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteSaveDialogReturned(pParam, iPad, result); return NetworkController::exitAndJoinFromInviteSaveDialogReturned(
pParam, iPad, result);
} }
static int ExitAndJoinFromInviteAndSaveReturned( static int ExitAndJoinFromInviteAndSaveReturned(
void* pParam, int iPad, IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteAndSaveReturned(pParam, iPad, result); return NetworkController::exitAndJoinFromInviteAndSaveReturned(
pParam, iPad, result);
} }
static int ExitAndJoinFromInviteDeclineSaveReturned( static int ExitAndJoinFromInviteDeclineSaveReturned(
void* pParam, int iPad, IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::exitAndJoinFromInviteDeclineSaveReturned(pParam, iPad, result); return NetworkController::exitAndJoinFromInviteDeclineSaveReturned(
pParam, iPad, result);
} }
static int FatalErrorDialogReturned(void* pParam, int iPad, static int FatalErrorDialogReturned(
IPlatformStorage::EMessageResult result); void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int WarningTrialTexturePackReturned( static int WarningTrialTexturePackReturned(
void* pParam, int iPad, IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return NetworkController::warningTrialTexturePackReturned(pParam, iPad, result); return NetworkController::warningTrialTexturePackReturned(pParam, iPad,
result);
} }
JoinFromInviteData& m_InviteData = m_networkController.m_InviteData; JoinFromInviteData& m_InviteData = m_networkController.m_InviteData;
@ -794,7 +836,7 @@ public:
return m_localizationManager.getHTMLFontSize(size); return m_localizationManager.getHTMLFontSize(size);
} }
std::string FormatHTMLString(int iPad, const std::string& desc, std::string FormatHTMLString(int iPad, const std::string& desc,
int shadowColour = 0xFFFFFFFF) { int shadowColour = 0xFFFFFFFF) {
return m_localizationManager.formatHTMLString(iPad, desc, shadowColour); return m_localizationManager.formatHTMLString(iPad, desc, shadowColour);
} }
std::string GetActionReplacement(int iPad, unsigned char ucAction) { std::string GetActionReplacement(int iPad, unsigned char ucAction) {
@ -818,7 +860,8 @@ public:
} }
static int ExitGameFromRemoteSaveDialogReturned( static int ExitGameFromRemoteSaveDialogReturned(
void* pParam, int iPad, IPlatformStorage::EMessageResult result) { void* pParam, int iPad, IPlatformStorage::EMessageResult result) {
return MenuController::exitGameFromRemoteSaveDialogReturned(pParam, iPad, result); return MenuController::exitGameFromRemoteSaveDialogReturned(
pParam, iPad, result);
} }
// XML // XML
@ -840,10 +883,11 @@ public:
MOJANG_DATA* GetMojangDataForXuid(PlayerUID xuid); MOJANG_DATA* GetMojangDataForXuid(PlayerUID xuid);
static int32_t RegisterConfigValues(char* pType, int iValue); static int32_t RegisterConfigValues(char* pType, int iValue);
static int32_t RegisterDLCData(char* a, char* b, int c, uint64_t d, uint64_t e, static int32_t RegisterDLCData(char* a, char* b, int c, uint64_t d,
char* f, unsigned int g, int h, uint64_t e, char* f, unsigned int g, int h,
char* pDataFile) { char* pDataFile) {
return DLCController::registerDLCData(a, b, c, d, e, f, g, h, pDataFile); return DLCController::registerDLCData(a, b, c, d, e, f, g, h,
pDataFile);
} }
bool GetDLCFullOfferIDForSkinID(const std::string& FirstSkin, bool GetDLCFullOfferIDForSkinID(const std::string& FirstSkin,
uint64_t* pullVal) { uint64_t* pullVal) {
@ -856,8 +900,12 @@ public:
return m_dlcController.getDLCInfoForFullOfferID(ullOfferID_Full); return m_dlcController.getDLCInfoForFullOfferID(ullOfferID_Full);
} }
unsigned int GetDLCCreditsCount() { return m_dlcController.getDLCCreditsCount(); } unsigned int GetDLCCreditsCount() {
SCreditTextItemDef* GetDLCCredits(int iIndex) { return m_dlcController.getDLCCredits(iIndex); } return m_dlcController.getDLCCreditsCount();
}
SCreditTextItemDef* GetDLCCredits(int iIndex) {
return m_dlcController.getDLCCredits(iIndex);
}
// TMS // TMS
void ReadDLCFileFromTMS(int iPad, eTMSAction action, void ReadDLCFileFromTMS(int iPad, eTMSAction action,
@ -880,11 +928,11 @@ public:
// Sign-in info moved to NetworkController // Sign-in info moved to NetworkController
public: public:
// void OverrideFontRenderer(bool set, bool immediate = true); // void OverrideFontRenderer(bool set, bool immediate = true);
// void ToggleFontRenderer() { // void ToggleFontRenderer() {
// OverrideFontRenderer(!m_bFontRendererOverridden,false); } // OverrideFontRenderer(!m_bFontRendererOverridden,false); }
BANNEDLIST (&BannedListA)[XUSER_MAX_COUNT] = m_bannedListManager.BannedListA; BANNEDLIST (&BannedListA)
[XUSER_MAX_COUNT] = m_bannedListManager.BannedListA;
public: public:
void SetBanListCheck(int iPad, bool bVal) { void SetBanListCheck(int iPad, bool bVal) {
@ -902,7 +950,8 @@ public:
// m_uiOpacityCountDown moved to MenuController // m_uiOpacityCountDown moved to MenuController
// DLC flags moved to DLCController // DLC flags moved to DLCController
// Host options - m_uiGameHostSettings moved to GameSettingsManager // Host options - m_uiGameHostSettings moved to GameSettingsManager
unsigned int& m_uiGameHostSettings = m_gameSettingsManager.m_uiGameHostSettings; unsigned int& m_uiGameHostSettings =
m_gameSettingsManager.m_uiGameHostSettings;
#if defined(_LARGE_WORLDS) #if defined(_LARGE_WORLDS)
unsigned int m_GameNewWorldSize; unsigned int m_GameNewWorldSize;
@ -945,13 +994,17 @@ public:
// World seed from png image - delegated to MenuController // World seed from png image - delegated to MenuController
void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes, void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes,
unsigned char* seedText, unsigned int& uiHostOptions, unsigned char* seedText, unsigned int& uiHostOptions,
bool& bHostOptionsRead, std::uint32_t& uiTexturePack) { bool& bHostOptionsRead,
m_menuController.getImageTextData(imageData, imageBytes, seedText, uiHostOptions, bHostOptionsRead, uiTexturePack); std::uint32_t& uiTexturePack) {
m_menuController.getImageTextData(imageData, imageBytes, seedText,
uiHostOptions, bHostOptionsRead,
uiTexturePack);
} }
unsigned int CreateImageTextData(std::uint8_t* textMetadata, int64_t seed, unsigned int CreateImageTextData(std::uint8_t* textMetadata, int64_t seed,
bool hasSeed, unsigned int uiHostOptions, bool hasSeed, unsigned int uiHostOptions,
unsigned int uiTexturePackId) { unsigned int uiTexturePackId) {
return m_menuController.createImageTextData(textMetadata, seed, hasSeed, uiHostOptions, uiTexturePackId); return m_menuController.createImageTextData(
textMetadata, seed, hasSeed, uiHostOptions, uiTexturePackId);
} }
// Game rules // Game rules
@ -979,7 +1032,8 @@ public:
void UpdatePlayerInfo(std::uint8_t networkSmallId, void UpdatePlayerInfo(std::uint8_t networkSmallId,
int16_t playerColourIndex, int16_t playerColourIndex,
unsigned int playerGamePrivileges) { unsigned int playerGamePrivileges) {
m_networkController.updatePlayerInfo(networkSmallId, playerColourIndex, playerGamePrivileges); m_networkController.updatePlayerInfo(networkSmallId, playerColourIndex,
playerGamePrivileges);
} }
short GetPlayerColour(std::uint8_t networkSmallId) { short GetPlayerColour(std::uint8_t networkSmallId) {
return m_networkController.getPlayerColour(networkSmallId); return m_networkController.getPlayerColour(networkSmallId);
@ -994,7 +1048,9 @@ public:
bool bPromote = false) { bool bPromote = false) {
return m_dlcController.addDLCRequest(eContentType, bPromote); return m_dlcController.addDLCRequest(eContentType, bPromote);
} }
bool RetrieveNextDLCContent() { return m_dlcController.retrieveNextDLCContent(); } bool RetrieveNextDLCContent() {
return m_dlcController.retrieveNextDLCContent();
}
bool CheckTMSDLCCanStop() { return m_dlcController.checkTMSDLCCanStop(); } bool CheckTMSDLCCanStop() { return m_dlcController.checkTMSDLCCanStop(); }
int dlcOffersReturned(int iOfferC, std::uint32_t dwType, int iPad) { int dlcOffersReturned(int iOfferC, std::uint32_t dwType, int iPad) {
return m_dlcController.dlcOffersReturned(iOfferC, dwType, iPad); return m_dlcController.dlcOffersReturned(iOfferC, dwType, iPad);
@ -1010,26 +1066,45 @@ public:
return m_dlcController.dlcContentRetrieved(eType); return m_dlcController.dlcContentRetrieved(eType);
} }
void TickDLCOffersRetrieved() { m_dlcController.tickDLCOffersRetrieved(); } void TickDLCOffersRetrieved() { m_dlcController.tickDLCOffersRetrieved(); }
void ClearAndResetDLCDownloadQueue() { m_dlcController.clearAndResetDLCDownloadQueue(); } void ClearAndResetDLCDownloadQueue() {
bool RetrieveNextTMSPPContent() { return m_dlcController.retrieveNextTMSPPContent(); } m_dlcController.clearAndResetDLCDownloadQueue();
void TickTMSPPFilesRetrieved() { m_dlcController.tickTMSPPFilesRetrieved(); } }
void ClearTMSPPFilesRetrieved() { m_dlcController.clearTMSPPFilesRetrieved(); } bool RetrieveNextTMSPPContent() {
return m_dlcController.retrieveNextTMSPPContent();
}
void TickTMSPPFilesRetrieved() {
m_dlcController.tickTMSPPFilesRetrieved();
}
void ClearTMSPPFilesRetrieved() {
m_dlcController.clearTMSPPFilesRetrieved();
}
unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType,
bool bPromote = false) { bool bPromote = false) {
return m_dlcController.addTMSPPFileTypeRequest(eType, bPromote); return m_dlcController.addTMSPPFileTypeRequest(eType, bPromote);
} }
int GetDLCInfoTexturesOffersCount() { return m_dlcController.getDLCInfoTexturesOffersCount(); } int GetDLCInfoTexturesOffersCount() {
return m_dlcController.getDLCInfoTexturesOffersCount();
}
static int TMSPPFileReturned(void* pParam, int iPad, int iUserData, static int TMSPPFileReturned(void* pParam, int iPad, int iUserData,
IPlatformStorage::PTMSPP_FILEDATA pFileData, IPlatformStorage::PTMSPP_FILEDATA pFileData,
const char* szFilename) { const char* szFilename) {
return DLCController::tmsPPFileReturned(pParam, iPad, iUserData, pFileData, szFilename); return DLCController::tmsPPFileReturned(pParam, iPad, iUserData,
pFileData, szFilename);
}
DLC_INFO* GetDLCInfoTrialOffer(int iIndex) {
return m_dlcController.getDLCInfoTrialOffer(iIndex);
}
DLC_INFO* GetDLCInfoFullOffer(int iIndex) {
return m_dlcController.getDLCInfoFullOffer(iIndex);
} }
DLC_INFO* GetDLCInfoTrialOffer(int iIndex) { return m_dlcController.getDLCInfoTrialOffer(iIndex); }
DLC_INFO* GetDLCInfoFullOffer(int iIndex) { return m_dlcController.getDLCInfoFullOffer(iIndex); }
int GetDLCInfoTrialOffersCount() { return m_dlcController.getDLCInfoTrialOffersCount(); } int GetDLCInfoTrialOffersCount() {
int GetDLCInfoFullOffersCount() { return m_dlcController.getDLCInfoFullOffersCount(); } return m_dlcController.getDLCInfoTrialOffersCount();
}
int GetDLCInfoFullOffersCount() {
return m_dlcController.getDLCInfoFullOffersCount();
}
bool GetDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal) { bool GetDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal) {
return m_dlcController.getDLCFullOfferIDForPackID(iPackID, pullVal); return m_dlcController.getDLCFullOfferIDForPackID(iPackID, pullVal);
} }
@ -1046,8 +1121,10 @@ public:
// Download status members moved to DLCController // Download status members moved to DLCController
bool m_bCorruptSaveDeleted; bool m_bCorruptSaveDeleted;
std::uint8_t*& m_pBannedListFileBuffer = m_bannedListManager.m_pBannedListFileBuffer; std::uint8_t*& m_pBannedListFileBuffer =
unsigned int& m_dwBannedListFileSize = m_bannedListManager.m_dwBannedListFileSize; m_bannedListManager.m_pBannedListFileBuffer;
unsigned int& m_dwBannedListFileSize =
m_bannedListManager.m_dwBannedListFileSize;
public: public:
unsigned int& m_dwDLCFileSize = m_dlcController.m_dwDLCFileSize; unsigned int& m_dwDLCFileSize = m_dlcController.m_dwDLCFileSize;
@ -1094,8 +1171,7 @@ public:
int LoadLocalTMSFile(char* wchTMSFile, int LoadLocalTMSFile(char* wchTMSFile,
eFileExtensionType eExt) override = 0; eFileExtensionType eExt) override = 0;
void FreeLocalTMSFiles(eTMSFileType eType) override = 0; void FreeLocalTMSFiles(eTMSFileType eType) override = 0;
int GetLocalTMSFileIndex(char* wchTMSFile, int GetLocalTMSFileIndex(char* wchTMSFile, bool bFilenameIncludesExtension,
bool bFilenameIncludesExtension,
eFileExtensionType eEXT) override = 0; eFileExtensionType eEXT) override = 0;
virtual bool GetTMSGlobalFileListRead() { return true; } virtual bool GetTMSGlobalFileListRead() { return true; }
@ -1132,7 +1208,9 @@ private:
// 4J-PB - language and locale functions // 4J-PB - language and locale functions
public: public:
void LocaleAndLanguageInit() { m_localizationManager.localeAndLanguageInit(); } void LocaleAndLanguageInit() {
m_localizationManager.localeAndLanguageInit();
}
void getLocale(std::vector<std::string>& vecWstrLocales) { void getLocale(std::vector<std::string>& vecWstrLocales) {
m_localizationManager.getLocale(vecWstrLocales); m_localizationManager.getLocale(vecWstrLocales);
} }
@ -1143,15 +1221,17 @@ public:
return m_localizationManager.get_xcLang(pwchLocale); return m_localizationManager.get_xcLang(pwchLocale);
} }
void SetTickTMSDLCFiles(bool bVal) { m_dlcController.setTickTMSDLCFiles(bVal); } void SetTickTMSDLCFiles(bool bVal) {
m_dlcController.setTickTMSDLCFiles(bVal);
}
std::string getFilePath(std::uint32_t packId, std::string filename, std::string getFilePath(std::uint32_t packId, std::string filename,
bool bAddDataFolder, bool bAddDataFolder,
std::string mountPoint = "TPACK:"); std::string mountPoint = "TPACK:");
private: private:
std::string getRootPath(std::uint32_t packId, bool allowOverride, std::string getRootPath(std::uint32_t packId, bool allowOverride,
bool bAddDataFolder, std::string mountPoint); bool bAddDataFolder, std::string mountPoint);
public: public:
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
@ -1161,6 +1241,5 @@ public:
#endif #endif
}; };
// singleton // singleton
// extern CMinecraftApp app; // extern CMinecraftApp app;

View file

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

View file

@ -40,9 +40,8 @@ public:
int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) override; int iPad, std::shared_ptr<CommandBlockEntity> commandBlock) override;
bool openHopper(int iPad, std::shared_ptr<Inventory> inventory, bool openHopper(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<HopperTileEntity> hopper) override; std::shared_ptr<HopperTileEntity> hopper) override;
bool openHopperMinecart( bool openHopperMinecart(int iPad, std::shared_ptr<Inventory> inventory,
int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<MinecartHopper> hopper) override;
std::shared_ptr<MinecartHopper> hopper) override;
bool openHorse(int iPad, std::shared_ptr<Inventory> inventory, bool openHorse(int iPad, std::shared_ptr<Inventory> inventory,
std::shared_ptr<Container> container, std::shared_ptr<Container> container,
std::shared_ptr<EntityHorse> horse) override; std::shared_ptr<EntityHorse> horse) override;

View file

@ -5,7 +5,6 @@
#include "app/common/GameRules/LevelGeneration/BiomeOverride.h" #include "app/common/GameRules/LevelGeneration/BiomeOverride.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/StartFeature.h" #include "app/common/GameRules/LevelGeneration/StartFeature.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
@ -16,10 +15,11 @@
#include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/NamedAreaRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRule.h" #include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h" #include "minecraft/world/level/GameRules/GameRulesInstance.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"

View file

@ -13,20 +13,20 @@
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h" #include "app/common/DLC/DLCPack.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h" #include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerators.h" #include "app/common/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/GameRules/LevelRules/LevelRules.h" #include "app/common/GameRules/LevelRules/LevelRules.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "minecraft/locale/StringTable.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/File.h" #include "java/File.h"
#include "java/InputOutputStream/ByteArrayInputStream.h" #include "java/InputOutputStream/ByteArrayInputStream.h"
#include "java/InputOutputStream/ByteArrayOutputStream.h" #include "java/InputOutputStream/ByteArrayOutputStream.h"
#include "java/InputOutputStream/DataInputStream.h" #include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/locale/StringTable.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.h" #include "minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "strings.h" #include "strings.h"
const char* GameRuleManager::wchTagNameA[] = { const char* GameRuleManager::wchTagNameA[] = {

View file

@ -8,9 +8,9 @@
#include <unordered_map> #include <unordered_map>
#include "app/common/DLC/DLCGameRulesHeader.h" #include "app/common/DLC/DLCGameRulesHeader.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/LevelGenerators.h" #include "app/common/GameRules/LevelGeneration/LevelGenerators.h"
#include "app/common/GameRules/LevelRules/LevelRules.h" #include "app/common/GameRules/LevelRules/LevelRules.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
class LevelGenerationOptions; class LevelGenerationOptions;
class RootGameRulesDefinition; class RootGameRulesDefinition;

View file

@ -4,16 +4,16 @@
#include <cmath> #include <cmath>
#include "ConsoleSchematicFile.h" #include "ConsoleSchematicFile.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h" #include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h" #include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/chunk/LevelChunk.h" #include "minecraft/world/level/chunk/LevelChunk.h"
#include "minecraft/world/level/dimension/Dimension.h" #include "minecraft/world/level/dimension/Dimension.h"
#include "minecraft/world/phys/AABB.h" #include "minecraft/world/phys/AABB.h"
#include "util/StringHelpers.h"
ApplySchematicRuleDefinition::ApplySchematicRuleDefinition( ApplySchematicRuleDefinition::ApplySchematicRuleDefinition(
LevelGenerationOptions* levelGenOptions) { LevelGenerationOptions* levelGenOptions) {

View file

@ -1,10 +1,10 @@
#include "BiomeOverride.h" #include "BiomeOverride.h"
#include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h" #include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
BiomeOverride::BiomeOverride() { BiomeOverride::BiomeOverride() {
m_tile = 0; m_tile = 0;

View file

@ -4,20 +4,20 @@
#include <algorithm> #include <algorithm>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionGenerateBox.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceContainer.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceSpawner.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/Direction.h" #include "minecraft/Direction.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/dimension/Dimension.h" #include "minecraft/world/level/dimension/Dimension.h"
#include "minecraft/world/level/levelgen/structure/BoundingBox.h" #include "minecraft/world/level/levelgen/structure/BoundingBox.h"
#include "util/StringHelpers.h"
ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0) { ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0) {
m_x = m_y = m_z = 0; m_x = m_y = m_z = 0;
@ -77,8 +77,8 @@ void ConsoleGenerateStructure::writeAttributes(DataOutputStream* dos,
dos->writeUTF(toWString(m_dimension)); dos->writeUTF(toWString(m_dimension));
} }
void ConsoleGenerateStructure::addAttribute( void ConsoleGenerateStructure::addAttribute(const std::string& attributeName,
const std::string& attributeName, const std::string& attributeValue) { const std::string& attributeValue) {
if (attributeName.compare("x") == 0) { if (attributeName.compare("x") == 0) {
int value = fromWString<int>(attributeValue); int value = fromWString<int>(attributeValue);
m_x = value; m_x = value;

View file

@ -9,7 +9,6 @@
#include <vector> #include <vector>
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/Class.h" #include "java/Class.h"
#include "java/InputOutputStream/DataInputStream.h" #include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
@ -21,6 +20,7 @@
#include "minecraft/world/level/LightLayer.h" #include "minecraft/world/level/LightLayer.h"
#include "minecraft/world/level/TilePos.h" #include "minecraft/world/level/TilePos.h"
#include "minecraft/world/level/chunk/LevelChunk.h" #include "minecraft/world/level/chunk/LevelChunk.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/TileEntity.h" #include "minecraft/world/level/tile/entity/TileEntity.h"
#include "minecraft/world/phys/AABB.h" #include "minecraft/world/phys/AABB.h"
@ -749,9 +749,9 @@ void ConsoleSchematicFile::generateSchematicFile(
bool mobCanBeSaved = false; bool mobCanBeSaved = false;
if (bSaveMobs) { if (bSaveMobs) {
if (e->instanceof(eTYPE_MONSTER) || if (e->instanceof (eTYPE_MONSTER) || e->instanceof
e->instanceof(eTYPE_WATERANIMAL) || (eTYPE_WATERANIMAL) || e->instanceof
e->instanceof(eTYPE_ANIMAL) || (e->GetType() == eTYPE_VILLAGER)) (eTYPE_ANIMAL) || (e->GetType() == eTYPE_VILLAGER))
// 4J-JEV: All these are derived from eTYPE_ANIMAL and true // 4J-JEV: All these are derived from eTYPE_ANIMAL and true
// implicitly. // implicitly.
@ -765,8 +765,9 @@ void ConsoleSchematicFile::generateSchematicFile(
// 4J-JEV: Changed to check for instances of minecarts and // 4J-JEV: Changed to check for instances of minecarts and
// hangingEntities instead of just eTYPE_PAINTING, eTYPE_ITEM_FRAME and // hangingEntities instead of just eTYPE_PAINTING, eTYPE_ITEM_FRAME and
// eTYPE_MINECART // eTYPE_MINECART
if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || if (mobCanBeSaved || e->instanceof
e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY)) { (eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof
(eTYPE_HANGING_ENTITY)) {
CompoundTag* eTag = new CompoundTag(); CompoundTag* eTag = new CompoundTag();
if (e->save(eTag)) { if (e->save(eTag)) {
ListTag<DoubleTag>* pos = ListTag<DoubleTag>* pos =
@ -776,7 +777,7 @@ void ConsoleSchematicFile::generateSchematicFile(
pos->get(1)->data -= yStart; pos->get(1)->data -= yStart;
pos->get(2)->data -= zStart; pos->get(2)->data -= zStart;
if (e->instanceof(eTYPE_HANGING_ENTITY)) { if (e->instanceof (eTYPE_HANGING_ENTITY)) {
((IntTag*)eTag->get("TileX"))->data -= xStart; ((IntTag*)eTag->get("TileX"))->data -= xStart;
((IntTag*)eTag->get("TileY"))->data -= yStart; ((IntTag*)eTag->get("TileY"))->data -= yStart;
((IntTag*)eTag->get("TileZ"))->data -= zStart; ((IntTag*)eTag->get("TileZ"))->data -= zStart;

View file

@ -14,7 +14,6 @@
#include <vector> #include <vector>
#include "minecraft/XuiActionPayload.h" #include "minecraft/XuiActionPayload.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h" #include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "minecraft/world/phys/Vec3.h" #include "minecraft/world/phys/Vec3.h"

View file

@ -6,7 +6,6 @@
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
#include "minecraft/GameEnums.h"
#include "app/common/DLC/DLCGameRulesHeader.h" #include "app/common/DLC/DLCGameRulesHeader.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h" #include "app/common/DLC/DLCPack.h"
@ -16,14 +15,15 @@
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructure.h"
#include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h" #include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h"
#include "app/common/GameRules/LevelGeneration/StartFeature.h" #include "app/common/GameRules/LevelGeneration/StartFeature.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/locale/StringTable.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "java/File.h" #include "java/File.h"
#include "java/InputOutputStream/ByteArrayInputStream.h" #include "java/InputOutputStream/ByteArrayInputStream.h"
#include "java/InputOutputStream/DataInputStream.h" #include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/GameEnums.h"
#include "minecraft/Pos.h" #include "minecraft/Pos.h"
#include "minecraft/locale/StringTable.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/chunk/LevelChunk.h" #include "minecraft/world/level/chunk/LevelChunk.h"
#include "minecraft/world/level/dimension/Dimension.h" #include "minecraft/world/level/dimension/Dimension.h"
@ -440,8 +440,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
auto it = m_schematics.find(filename); auto it = m_schematics.find(filename);
if (it != m_schematics.end()) { if (it != m_schematics.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("We have already loaded schematic file %s\n", printf("We have already loaded schematic file %s\n", filename.c_str());
filename.c_str());
#endif #endif
it->second->incrementRefCount(); it->second->incrementRefCount();
return it->second; return it->second;
@ -470,8 +469,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
return schematic; return schematic;
} }
void LevelGenerationOptions::releaseSchematicFile( void LevelGenerationOptions::releaseSchematicFile(const std::string& filename) {
const std::string& filename) {
// 4J Stu - We don't want to delete them when done, but probably want to // 4J Stu - We don't want to delete them when done, but probably want to
// keep a set of active schematics for the current world // keep a set of active schematics for the current world
// auto it = m_schematics.find(filename); // auto it = m_schematics.find(filename);
@ -627,7 +625,8 @@ int LevelGenerationOptions::onPackMounted(int iPad, uint32_t dwErr,
uint8_t* pbData = (uint8_t*)new uint8_t[dwFileSize]; uint8_t* pbData = (uint8_t*)new uint8_t[dwFileSize];
auto readResult = PlatformFilesystem.readFile( auto readResult = PlatformFilesystem.readFile(
save.getPath(), pbData, dwFileSize); save.getPath(), pbData, dwFileSize);
if (readResult.status != IPlatformFilesystem::ReadStatus::Ok) { if (readResult.status !=
IPlatformFilesystem::ReadStatus::Ok) {
app.FatalLoadError(); app.FatalLoadError();
} }

View file

@ -1,10 +1,10 @@
#include "StartFeature.h" #include "StartFeature.h"
#include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h" #include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
StartFeature::StartFeature() { StartFeature::StartFeature() {
m_chunkX = 0; m_chunkX = 0;

View file

@ -1,12 +1,12 @@
#include "XboxStructureActionGenerateBox.h" #include "XboxStructureActionGenerateBox.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/levelgen/structure/StructurePiece.h" #include "minecraft/world/level/levelgen/structure/StructurePiece.h"
#include "util/StringHelpers.h"
XboxStructureActionGenerateBox::XboxStructureActionGenerateBox() { XboxStructureActionGenerateBox::XboxStructureActionGenerateBox() {
m_x0 = m_y0 = m_z0 = m_x1 = m_y1 = m_z1 = m_edgeTile = m_fillTile = 0; m_x0 = m_y0 = m_z0 = m_x1 = m_y1 = m_z1 = m_edgeTile = m_fillTile = 0;

View file

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

View file

@ -1,12 +1,12 @@
#include "XboxStructureActionPlaceBlock.h" #include "XboxStructureActionPlaceBlock.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h" #include "app/common/GameRules/LevelGeneration/ConsoleGenerateStructureAction.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/levelgen/structure/StructurePiece.h" #include "minecraft/world/level/levelgen/structure/StructurePiece.h"
#include "util/StringHelpers.h"
XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock() { XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock() {
m_x = m_y = m_z = m_tile = m_data = 0; m_x = m_y = m_z = m_tile = m_data = 0;

View file

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

View file

@ -4,17 +4,17 @@
#include <memory> #include <memory>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "minecraft/world/Container.h" #include "minecraft/world/Container.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/levelgen/structure/BoundingBox.h" #include "minecraft/world/level/levelgen/structure/BoundingBox.h"
#include "minecraft/world/level/levelgen/structure/StructurePiece.h" #include "minecraft/world/level/levelgen/structure/StructurePiece.h"
#include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/TileEntity.h" #include "minecraft/world/level/tile/entity/TileEntity.h"
#include "util/StringHelpers.h"
XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() { XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() {
m_tile = Tile::chest_Id; m_tile = Tile::chest_Id;

View file

@ -3,8 +3,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "XboxStructureActionPlaceBlock.h" #include "XboxStructureActionPlaceBlock.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
class AddItemRuleDefinition; class AddItemRuleDefinition;
class StructurePiece; class StructurePiece;

View file

@ -4,9 +4,9 @@
#include <memory> #include <memory>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h" #include "app/common/GameRules/LevelGeneration/StructureActions/XboxStructureActionPlaceBlock.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/levelgen/structure/BoundingBox.h" #include "minecraft/world/level/levelgen/structure/BoundingBox.h"
#include "minecraft/world/level/levelgen/structure/StructurePiece.h" #include "minecraft/world/level/levelgen/structure/StructurePiece.h"
@ -33,9 +33,8 @@ void XboxStructureActionPlaceSpawner::addAttribute(
if (attributeName.compare("entity") == 0) { if (attributeName.compare("entity") == 0) {
m_entityId = attributeValue; m_entityId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf( printf("XboxStructureActionPlaceSpawner: Adding parameter entity=%s\n",
"XboxStructureActionPlaceSpawner: Adding parameter entity=%s\n", m_entityId.c_str());
m_entityId.c_str());
#endif #endif
} else { } else {
XboxStructureActionPlaceBlock::addAttribute(attributeName, XboxStructureActionPlaceBlock::addAttribute(attributeName,

View file

@ -2,8 +2,8 @@
#include <string> #include <string>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "XboxStructureActionPlaceBlock.h" #include "XboxStructureActionPlaceBlock.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
class StructurePiece; class StructurePiece;
class Level; class Level;

View file

@ -3,10 +3,7 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/item/EnchantedBookItem.h" #include "minecraft/world/item/EnchantedBookItem.h"
#include "minecraft/world/item/Item.h" #include "minecraft/world/item/Item.h"
@ -14,6 +11,9 @@
#include "minecraft/world/item/enchantment/Enchantment.h" #include "minecraft/world/item/enchantment/Enchantment.h"
#include "minecraft/world/item/enchantment/EnchantmentCategory.h" #include "minecraft/world/item/enchantment/EnchantmentCategory.h"
#include "minecraft/world/item/enchantment/EnchantmentInstance.h" #include "minecraft/world/item/enchantment/EnchantmentInstance.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "util/StringHelpers.h"
AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition() { AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition() {
m_enchantmentId = m_enchantmentLevel = 0; m_enchantmentId = m_enchantmentLevel = 0;

View file

@ -3,8 +3,8 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
class ItemInstance; class ItemInstance;

View file

@ -3,14 +3,14 @@
#include <algorithm> #include <algorithm>
#include "AddEnchantmentRuleDefinition.h" #include "AddEnchantmentRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/Container.h" #include "minecraft/world/Container.h"
#include "minecraft/world/entity/player/Inventory.h" #include "minecraft/world/entity/player/Inventory.h"
#include "minecraft/world/item/Item.h" #include "minecraft/world/item/Item.h"
#include "minecraft/world/item/ItemInstance.h" #include "minecraft/world/item/ItemInstance.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "util/StringHelpers.h"
AddItemRuleDefinition::AddItemRuleDefinition() { AddItemRuleDefinition::AddItemRuleDefinition() {
m_itemId = m_quantity = m_auxValue = m_dataTag = 0; m_itemId = m_quantity = m_auxValue = m_dataTag = 0;

View file

@ -4,8 +4,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
class Container; class Container;
class AddEnchantmentRuleDefinition; class AddEnchantmentRuleDefinition;

View file

@ -1,15 +1,15 @@
#include "CollectItemRuleDefinition.h" #include "CollectItemRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/network/Connection.h" #include "minecraft/network/Connection.h"
#include "minecraft/network/packet/UpdateGameRuleProgressPacket.h" #include "minecraft/network/packet/UpdateGameRuleProgressPacket.h"
#include "minecraft/world/item/ItemInstance.h" #include "minecraft/world/item/ItemInstance.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h"
#include "util/StringHelpers.h"
CollectItemRuleDefinition::CollectItemRuleDefinition() { CollectItemRuleDefinition::CollectItemRuleDefinition() {
m_itemId = 0; m_itemId = 0;
@ -111,8 +111,7 @@ std::string CollectItemRuleDefinition::generateXml(
"\" quantity=\"SET\" descriptionName=\"OPTIONAL\" " "\" quantity=\"SET\" descriptionName=\"OPTIONAL\" "
"promptName=\"OPTIONAL\""; "promptName=\"OPTIONAL\"";
if (item->getAuxValue() != 0) if (item->getAuxValue() != 0)
xml += xml += " auxValue=\"" + toWString<int>(item->getAuxValue()) + "\"";
" auxValue=\"" + toWString<int>(item->getAuxValue()) + "\"";
if (item->get4JData() != 0) if (item->get4JData() != 0)
xml += " dataTag=\"" + toWString<int>(item->get4JData()) + "\""; xml += " dataTag=\"" + toWString<int>(item->get4JData()) + "\"";
xml += "/>\n"; xml += "/>\n";

View file

@ -3,8 +3,8 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h" #include "minecraft/world/level/GameRules/GameRulesInstance.h"
class Pos; class Pos;

View file

@ -5,12 +5,12 @@
#include <utility> #include <utility>
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CompoundGameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRule.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "minecraft/network/Connection.h" #include "minecraft/network/Connection.h"
#include "minecraft/network/packet/UpdateGameRuleProgressPacket.h" #include "minecraft/network/packet/UpdateGameRuleProgressPacket.h"
#include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "util/StringHelpers.h"
void CompleteAllRuleDefinition::getChildren( void CompleteAllRuleDefinition::getChildren(
std::vector<GameRuleDefinition*>* children) { std::vector<GameRuleDefinition*>* children) {

View file

@ -25,8 +25,8 @@ public:
virtual bool onCollectItem(GameRule* rule, virtual bool onCollectItem(GameRule* rule,
std::shared_ptr<ItemInstance> item); std::shared_ptr<ItemInstance> item);
static std::string generateDescriptionString( static std::string generateDescriptionString(const std::string& description,
const std::string& description, void* data, int dataLength); void* data, int dataLength);
private: private:
void updateStatus(GameRule* rule); void updateStatus(GameRule* rule);

View file

@ -7,13 +7,13 @@
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CollectItemRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/UpdatePlayerRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/UseTileRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRule.h" #include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h" #include "minecraft/world/level/GameRules/GameRulesInstance.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"

View file

@ -2,8 +2,8 @@
#include <vector> #include <vector>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h" #include "minecraft/world/level/GameRules/GameRulesInstance.h"
class CompoundGameRuleDefinition : public GameRuleDefinition { class CompoundGameRuleDefinition : public GameRuleDefinition {

View file

@ -8,14 +8,14 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/CompleteAllRuleDefinition.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
#include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRule.h" #include "minecraft/world/level/GameRules/GameRule.h"
#include "minecraft/world/level/GameRules/GameRulesInstance.h" #include "minecraft/world/level/GameRules/GameRulesInstance.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
class Connection; class Connection;
@ -66,7 +66,7 @@ GameRuleDefinition* GameRuleDefinition::addChild(
ConsoleGameRules::EGameRuleType ruleType) { ConsoleGameRules::EGameRuleType ruleType) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("GameRuleDefinition: Attempted to add invalid child rule - %d\n", printf("GameRuleDefinition: Attempted to add invalid child rule - %d\n",
ruleType); ruleType);
#endif #endif
return nullptr; return nullptr;
} }
@ -77,13 +77,13 @@ void GameRuleDefinition::addAttribute(const std::string& attributeName,
m_descriptionId = attributeValue; m_descriptionId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("GameRuleDefinition: Adding parameter descriptionId=%s\n", printf("GameRuleDefinition: Adding parameter descriptionId=%s\n",
m_descriptionId.c_str()); m_descriptionId.c_str());
#endif #endif
} else if (attributeName.compare("promptName") == 0) { } else if (attributeName.compare("promptName") == 0) {
m_promptId = attributeValue; m_promptId = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("GameRuleDefinition: Adding parameter m_promptId=%s\n", printf("GameRuleDefinition: Adding parameter m_promptId=%s\n",
m_promptId.c_str()); m_promptId.c_str());
#endif #endif
} else if (attributeName.compare("dataTag") == 0) { } else if (attributeName.compare("dataTag") == 0) {
m_4JDataValue = fromWString<int>(attributeValue); m_4JDataValue = fromWString<int>(attributeValue);
@ -92,9 +92,8 @@ void GameRuleDefinition::addAttribute(const std::string& attributeName,
m_4JDataValue); m_4JDataValue);
} else { } else {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf( printf("GameRuleDefinition: Attempted to add invalid attribute: %s\n",
"GameRuleDefinition: Attempted to add invalid attribute: %s\n", attributeName.c_str());
attributeName.c_str());
#endif #endif
} }
} }

View file

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

View file

@ -2,11 +2,11 @@
#include <wchar.h> #include <wchar.h>
#include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h" #include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
NamedAreaRuleDefinition::NamedAreaRuleDefinition() { NamedAreaRuleDefinition::NamedAreaRuleDefinition() {
m_name = ""; m_name = "";
@ -41,7 +41,7 @@ void NamedAreaRuleDefinition::addAttribute(const std::string& attributeName,
m_name = attributeValue; m_name = attributeValue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("NamedAreaRuleDefinition: Adding parameter name=%s\n", printf("NamedAreaRuleDefinition: Adding parameter name=%s\n",
m_name.c_str()); m_name.c_str());
#endif #endif
} else if (attributeName.compare("x0") == 0) { } else if (attributeName.compare("x0") == 0) {
m_area.x0 = fromWString<int>(attributeValue); m_area.x0 = fromWString<int>(attributeValue);

View file

@ -2,8 +2,8 @@
#include <string> #include <string>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/phys/AABB.h" #include "minecraft/world/phys/AABB.h"
class NamedAreaRuleDefinition : public GameRuleDefinition { class NamedAreaRuleDefinition : public GameRuleDefinition {

View file

@ -4,16 +4,16 @@
#include <memory> #include <memory>
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/AddItemRuleDefinition.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/Pos.h" #include "minecraft/Pos.h"
#include "minecraft/world/entity/player/Inventory.h" #include "minecraft/world/entity/player/Inventory.h"
#include "minecraft/world/entity/player/Player.h" #include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/food/FoodData.h" #include "minecraft/world/food/FoodData.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "util/StringHelpers.h"
UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() { UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() {
m_bUpdateHealth = m_bUpdateFood = m_bUpdateYRot = false; m_bUpdateHealth = m_bUpdateFood = m_bUpdateYRot = false;

View file

@ -4,8 +4,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
class AddItemRuleDefinition; class AddItemRuleDefinition;
class Pos; class Pos;

View file

@ -1,10 +1,10 @@
#include "UseTileRuleDefinition.h" #include "UseTileRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h" #include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h" #include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "app/linux/LinuxGame.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "java/InputOutputStream/DataOutputStream.h"
UseTileRuleDefinition::UseTileRuleDefinition() { UseTileRuleDefinition::UseTileRuleDefinition() {
m_tileId = -1; m_tileId = -1;

View file

@ -3,9 +3,9 @@
#include <string> #include <string>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/Pos.h" #include "minecraft/Pos.h"
#include "minecraft/world/level/ConsoleGameRulesConstants.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
class UseTileRuleDefinition : public GameRuleDefinition { class UseTileRuleDefinition : public GameRuleDefinition {
private: private:

View file

@ -8,9 +8,9 @@
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
#include "java/InputOutputStream/DataInputStream.h" #include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/DataOutputStream.h" #include "java/InputOutputStream/DataOutputStream.h"
#include "minecraft/world/level/GameRules/GameRuleDefinition.h"
class Connection; class Connection;
class ItemInstance; class ItemInstance;
@ -32,15 +32,14 @@ GameRule::ValueType GameRule::getParameter(const std::string& parameterName) {
if (m_parameters.find(parameterName) == m_parameters.end()) { if (m_parameters.find(parameterName) == m_parameters.end()) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("WARNING: Parameter %s was not set before being fetched\n", printf("WARNING: Parameter %s was not set before being fetched\n",
parameterName.c_str()); parameterName.c_str());
assert(0); assert(0);
#endif #endif
} }
return m_parameters[parameterName]; return m_parameters[parameterName];
} }
void GameRule::setParameter(const std::string& parameterName, void GameRule::setParameter(const std::string& parameterName, ValueType value) {
ValueType value) {
if (m_parameters.find(parameterName) == m_parameters.end()) { if (m_parameters.find(parameterName) == m_parameters.end()) {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Adding parameter %s to GameRule\n", parameterName.c_str()); printf("Adding parameter %s to GameRule\n", parameterName.c_str());

View file

@ -3,8 +3,8 @@
#include <cstdint> #include <cstdint>
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "platform/profile/profile.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/profile/profile.h"
class GameSettingsManager { class GameSettingsManager {
public: public:
@ -14,9 +14,9 @@ public:
static int oldProfileVersionCallback(void* pParam, unsigned char* pucData, static int oldProfileVersionCallback(void* pParam, unsigned char* pucData,
const unsigned short usVersion, const unsigned short usVersion,
const int iPad); const int iPad);
static int defaultOptionsCallback(void* pParam, static int defaultOptionsCallback(
IPlatformProfile::PROFILESETTINGS* pSettings, void* pParam, IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad); const int iPad);
int setDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings, int setDefaultOptions(IPlatformProfile::PROFILESETTINGS* pSettings,
const int iPad); const int iPad);
@ -64,7 +64,8 @@ public:
static void setActionConfirmed(void* param); static void setActionConfirmed(void* param);
// Saving message // Saving message
int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg, int iPad); int displaySavingMessage(const IPlatformStorage::ESavingMessage eMsg,
int iPad);
// Game settings array - public, referenced by Game via alias // Game settings array - public, referenced by Game via alias
GAME_SETTINGS* GameSettingsA[XUSER_MAX_COUNT]; GAME_SETTINGS* GameSettingsA[XUSER_MAX_COUNT];

View file

@ -1,9 +1,8 @@
#include "minecraft/GameTypes.h" #include "app/common/Audio/SoundEngine.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/Game.h" #include "app/common/Game.h"
#include "app/common/GameRules/GameRuleManager.h" #include "app/common/GameRules/GameRuleManager.h"
#include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/Tutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
@ -11,6 +10,7 @@
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "minecraft/GameEnums.h" #include "minecraft/GameEnums.h"
#include "minecraft/GameTypes.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/Options.h" #include "minecraft/client/Options.h"
#include "minecraft/client/ProgressRenderer.h" #include "minecraft/client/ProgressRenderer.h"
@ -25,13 +25,13 @@
#include "minecraft/client/skins/DLCTexturePack.h" #include "minecraft/client/skins/DLCTexturePack.h"
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/server/MinecraftServer.h" #include "minecraft/server/MinecraftServer.h"
#include "minecraft/stats/StatsCounter.h" #include "minecraft/stats/StatsCounter.h"
#include "platform/PlatformTypes.h" #include "platform/PlatformTypes.h"
#include "platform/profile/profile.h" #include "platform/profile/profile.h"
#include "platform/storage/storage.h" #include "platform/storage/storage.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
#include "app/common/Audio/SoundEngine.h"
void Game::HandleXuiActions(void) { void Game::HandleXuiActions(void) {
eXuiAction eAction; eXuiAction eAction;
@ -215,8 +215,8 @@ void Game::HandleXuiActions(void) {
// app.CloseAllPlayersXuiScenes(); // app.CloseAllPlayersXuiScenes();
// Hide the other players scenes // Hide the other players scenes
ui.ShowOtherPlayersBaseScene(PlatformProfile.GetPrimaryPad(), ui.ShowOtherPlayersBaseScene(
false); PlatformProfile.GetPrimaryPad(), false);
// This just allows it to be shown // This just allows it to be shown
if (pMinecraft if (pMinecraft
@ -1148,7 +1148,8 @@ void Game::HandleXuiActions(void) {
} break; } break;
case eAppAction_SetDefaultOptions: case eAppAction_SetDefaultOptions:
SetAction(i, eAppAction_Idle); SetAction(i, eAppAction_Idle);
SetDefaultOptions((IPlatformProfile::PROFILESETTINGS*)param, i); SetDefaultOptions((IPlatformProfile::PROFILESETTINGS*)param,
i);
// if the profile data has been changed, then force a // if the profile data has been changed, then force a
// profile write It seems we're allowed to break the 5 // profile write It seems we're allowed to break the 5
@ -1211,10 +1212,11 @@ void Game::HandleXuiActions(void) {
case eAppAction_FailedToJoinNoPrivileges: { case eAppAction_FailedToJoinNoPrivileges: {
unsigned int uiIDA[1]; unsigned int uiIDA[1];
uiIDA[0] = IDS_CONFIRM_OK; uiIDA[0] = IDS_CONFIRM_OK;
IPlatformStorage::EMessageResult result = ui.RequestErrorMessage( IPlatformStorage::EMessageResult result =
IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, ui.RequestErrorMessage(
IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1, IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
PlatformProfile.GetPrimaryPad()); IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1,
PlatformProfile.GetPrimaryPad());
if (result != IPlatformStorage::EMessage_Busy) if (result != IPlatformStorage::EMessage_Busy)
SetAction(i, eAppAction_Idle); SetAction(i, eAppAction_Idle);
} break; } break;
@ -1282,9 +1284,7 @@ void Game::HandleXuiActions(void) {
} break; } break;
case eAppAction_DebugText: case eAppAction_DebugText:
// launch the xui for text entry // launch the xui for text entry
{ { SetAction(i, eAppAction_Idle); }
SetAction(i, eAppAction_Idle);
}
break; break;
case eAppAction_ReloadTexturePack: { case eAppAction_ReloadTexturePack: {

View file

@ -21,8 +21,7 @@ public:
bool bCallback = false) = 0; bool bCallback = false) = 0;
virtual int LoadLocalTMSFile(char* wchTMSFile) = 0; virtual int LoadLocalTMSFile(char* wchTMSFile) = 0;
virtual int LoadLocalTMSFile(char* wchTMSFile, virtual int LoadLocalTMSFile(char* wchTMSFile, eFileExtensionType eExt) = 0;
eFileExtensionType eExt) = 0;
virtual void FreeLocalTMSFiles(eTMSFileType eType) = 0; virtual void FreeLocalTMSFiles(eTMSFileType eType) = 0;
virtual int GetLocalTMSFileIndex(char* wchTMSFile, virtual int GetLocalTMSFileIndex(char* wchTMSFile,
bool bFilenameIncludesExtension, bool bFilenameIncludesExtension,

View file

@ -166,8 +166,7 @@ public:
unsigned int readCount) = 0; unsigned int readCount) = 0;
virtual bool ReadStats_MyScore(LeaderboardReadListener* callback, virtual bool ReadStats_MyScore(LeaderboardReadListener* callback,
int difficulty, EStatsType type, int difficulty, EStatsType type,
PlayerUID myUID, PlayerUID myUID, unsigned int readCount) = 0;
unsigned int readCount) = 0;
virtual bool ReadStats_TopRank(LeaderboardReadListener* callback, virtual bool ReadStats_TopRank(LeaderboardReadListener* callback,
int difficulty, EStatsType type, int difficulty, EStatsType type,
unsigned int startIndex, unsigned int startIndex,

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "platform/PlatformTypes.h"
#include "LeaderboardManager.h" #include "LeaderboardManager.h"
#include "platform/PlatformTypes.h"
// 4J-JEV: Simple interface for handling ReadStat failures. // 4J-JEV: Simple interface for handling ReadStat failures.
class LeaderboardInterface { class LeaderboardInterface {
@ -23,11 +23,12 @@ public:
~LeaderboardInterface(); ~LeaderboardInterface();
void ReadStats_Friends(LeaderboardReadListener* callback, int difficulty, void ReadStats_Friends(LeaderboardReadListener* callback, int difficulty,
IPlatformLeaderboard::EStatsType type, PlayerUID myUID, IPlatformLeaderboard::EStatsType type,
unsigned int startIndex, unsigned int readCount); PlayerUID myUID, unsigned int startIndex,
void ReadStats_MyScore(LeaderboardReadListener* callback, int difficulty,
IPlatformLeaderboard::EStatsType type, PlayerUID myUID,
unsigned int readCount); unsigned int readCount);
void ReadStats_MyScore(LeaderboardReadListener* callback, int difficulty,
IPlatformLeaderboard::EStatsType type,
PlayerUID myUID, unsigned int readCount);
void ReadStats_TopRank(LeaderboardReadListener* callback, int difficulty, void ReadStats_TopRank(LeaderboardReadListener* callback, int difficulty,
IPlatformLeaderboard::EStatsType type, IPlatformLeaderboard::EStatsType type,
unsigned int startIndex, unsigned int readCount); unsigned int startIndex, unsigned int readCount);

View file

@ -83,8 +83,7 @@ void LeaderboardManager::printStats(ReadView& view) {
for (unsigned int i = 0; i < view.m_numQueries; i++) { for (unsigned int i = 0; i < view.m_numQueries; i++) {
ReadScore score = view.m_queries[i]; ReadScore score = view.m_queries[i];
app.DebugPrintf("\tname='%s'\n", app.DebugPrintf("\tname='%s'\n", score.m_name.c_str());
score.m_name.c_str());
app.DebugPrintf("\trank='%i'\n", score.m_rank); app.DebugPrintf("\trank='%i'\n", score.m_rank);
app.DebugPrintf("\tstatsData=["); app.DebugPrintf("\tstatsData=[");

View file

@ -38,7 +38,7 @@ void StringTable::ProcessStringTableData(void) {
langSizeMap.push_back( langSizeMap.push_back(
std::vector<std::pair<std::string, int> >::value_type(langId, std::vector<std::pair<std::string, int> >::value_type(langId,
langSize)); langSize));
} }
std::vector<std::string> locales; std::vector<std::string> locales;

View file

@ -6,24 +6,23 @@
#include <string> #include <string>
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "minecraft/locale/StringTable.h"
#include "minecraft/client/resources/Colours/ColourTable.h"
#include "app/common/UI/All Platforms/ArchiveFile.h" #include "app/common/UI/All Platforms/ArchiveFile.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "java/Random.h" #include "java/Random.h"
#include "minecraft/GameEnums.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/resources/Colours/ColourTable.h"
#include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h" #include "minecraft/client/skins/TexturePackRepository.h"
#include "minecraft/locale/StringTable.h"
#include "platform/XboxStubs.h"
#include "platform/input/input.h" #include "platform/input/input.h"
#include "platform/renderer/renderer.h" #include "platform/renderer/renderer.h"
#include "platform/XboxStubs.h"
#include "strings.h" #include "strings.h"
#include "util/StringHelpers.h" #include "util/StringHelpers.h"
int LocalizationManager::s_iHTMLFontSizesA[eHTMLSize_COUNT] = { int LocalizationManager::s_iHTMLFontSizesA[eHTMLSize_COUNT] = {20, 13, 20, 26};
20, 13, 20, 26};
TIPSTRUCT LocalizationManager::m_GameTipA[MAX_TIPS_GAMETIP] = { TIPSTRUCT LocalizationManager::m_GameTipA[MAX_TIPS_GAMETIP] = {
{0, IDS_TIPS_GAMETIP_1}, {0, IDS_TIPS_GAMETIP_2}, {0, IDS_TIPS_GAMETIP_1}, {0, IDS_TIPS_GAMETIP_2},
@ -77,8 +76,7 @@ void LocalizationManager::loadStringTable(ArchiveFile* mediaArchive) {
} }
std::string localisationFile = "languages.loc"; std::string localisationFile = "languages.loc";
if (mediaArchive->hasFile(localisationFile)) { if (mediaArchive->hasFile(localisationFile)) {
std::vector<uint8_t> locFile = std::vector<uint8_t> locFile = mediaArchive->getFile(localisationFile);
mediaArchive->getFile(localisationFile);
m_stringTable = new StringTable(locFile.data(), locFile.size()); m_stringTable = new StringTable(locFile.data(), locFile.size());
} else { } else {
m_stringTable = nullptr; m_stringTable = nullptr;
@ -345,8 +343,8 @@ std::string LocalizationManager::formatHTMLString(
return text; return text;
} }
std::string LocalizationManager::getActionReplacement( std::string LocalizationManager::getActionReplacement(int iPad,
int iPad, unsigned char ucAction) { unsigned char ucAction) {
unsigned int input = PlatformInput.GetGameJoypadMaps( unsigned int input = PlatformInput.GetGameJoypadMaps(
PlatformInput.GetJoypadMapVal(iPad), ucAction); PlatformInput.GetJoypadMapVal(iPad), ucAction);
@ -505,8 +503,7 @@ std::string LocalizationManager::getIconReplacement(unsigned int uiIcon) {
return result; return result;
} }
void LocalizationManager::getLocale( void LocalizationManager::getLocale(std::vector<std::string>& vecWstrLocales) {
std::vector<std::string>& vecWstrLocales) {
std::vector<eMCLang> locales; std::vector<eMCLang> locales;
const unsigned int systemLanguage = XGetLanguage(); const unsigned int systemLanguage = XGetLanguage();

View file

@ -5,8 +5,8 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "minecraft/GameEnums.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
class ArchiveFile; class ArchiveFile;
@ -22,7 +22,7 @@ public:
const char* getString(int iID) const; const char* getString(int iID) const;
std::string formatHTMLString(int iPad, const std::string& desc, std::string formatHTMLString(int iPad, const std::string& desc,
int shadowColour = 0xFFFFFFFF); int shadowColour = 0xFFFFFFFF);
std::string getActionReplacement(int iPad, unsigned char ucAction); std::string getActionReplacement(int iPad, unsigned char ucAction);
std::string getVKReplacement(unsigned int uiVKey); std::string getVKReplacement(unsigned int uiVKey);
std::string getIconReplacement(unsigned int uiIcon); std::string getIconReplacement(unsigned int uiIcon);

View file

@ -1,5 +1,10 @@
#include "app/common/MenuController.h" #include "app/common/MenuController.h"
#include <chrono>
#include <cstring>
#include <sstream>
#include <thread>
#include "app/common/Game.h" #include "app/common/Game.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
@ -8,24 +13,19 @@
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/ProgressRenderer.h" #include "minecraft/client/ProgressRenderer.h"
#include "minecraft/client/renderer/GameRenderer.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
#include "minecraft/client/renderer/GameRenderer.h"
#include "minecraft/server/MinecraftServer.h" #include "minecraft/server/MinecraftServer.h"
#include "minecraft/world/Container.h" #include "minecraft/world/Container.h"
#include "minecraft/world/entity/item/MinecartHopper.h" #include "minecraft/world/entity/item/MinecartHopper.h"
#include "minecraft/world/entity/player/Player.h" #include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/item/crafting/Recipy.h" #include "minecraft/world/item/crafting/Recipy.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/tile/Tile.h"
#include "minecraft/world/level/tile/entity/HopperTileEntity.h" #include "minecraft/world/level/tile/entity/HopperTileEntity.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/profile/profile.h" #include "platform/profile/profile.h"
#include "platform/storage/storage.h" #include "platform/storage/storage.h"
#include <cstring>
#include <sstream>
#include <chrono>
#include <thread>
unsigned char MenuController::m_szPNG[8] = {137, 80, 78, 71, 13, 10, 26, 10}; unsigned char MenuController::m_szPNG[8] = {137, 80, 78, 71, 13, 10, 26, 10};
MenuController::MenuController() { MenuController::MenuController() {
@ -273,9 +273,9 @@ bool MenuController::loadContainerMenu(int iPad,
return success; return success;
} }
bool MenuController::loadTrapMenu( bool MenuController::loadTrapMenu(int iPad,
int iPad, std::shared_ptr<Container> inventory, std::shared_ptr<Container> inventory,
std::shared_ptr<DispenserTileEntity> trap) { std::shared_ptr<DispenserTileEntity> trap) {
bool success = true; bool success = true;
TrapScreenInput* initData = new TrapScreenInput(); TrapScreenInput* initData = new TrapScreenInput();
@ -294,8 +294,8 @@ bool MenuController::loadTrapMenu(
return success; return success;
} }
bool MenuController::loadSignEntryMenu( bool MenuController::loadSignEntryMenu(int iPad,
int iPad, std::shared_ptr<SignTileEntity> sign) { std::shared_ptr<SignTileEntity> sign) {
bool success = true; bool success = true;
SignEntryScreenInput* initData = new SignEntryScreenInput(); SignEntryScreenInput* initData = new SignEntryScreenInput();
@ -352,9 +352,9 @@ bool MenuController::loadTradingMenu(int iPad,
return success; return success;
} }
bool MenuController::loadHopperMenu( bool MenuController::loadHopperMenu(int iPad,
int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Inventory> inventory,
std::shared_ptr<HopperTileEntity> hopper) { std::shared_ptr<HopperTileEntity> hopper) {
bool success = true; bool success = true;
HopperScreenInput* initData = new HopperScreenInput(); HopperScreenInput* initData = new HopperScreenInput();
@ -371,9 +371,9 @@ bool MenuController::loadHopperMenu(
return success; return success;
} }
bool MenuController::loadHopperMenu( bool MenuController::loadHopperMenu(int iPad,
int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Inventory> inventory,
std::shared_ptr<MinecartHopper> hopper) { std::shared_ptr<MinecartHopper> hopper) {
bool success = true; bool success = true;
HopperScreenInput* initData = new HopperScreenInput(); HopperScreenInput* initData = new HopperScreenInput();
@ -411,9 +411,9 @@ bool MenuController::loadHorseMenu(int iPad,
return success; return success;
} }
bool MenuController::loadBeaconMenu( bool MenuController::loadBeaconMenu(int iPad,
int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Inventory> inventory,
std::shared_ptr<BeaconTileEntity> beacon) { std::shared_ptr<BeaconTileEntity> beacon) {
bool success = true; bool success = true;
BeaconScreenInput* initData = new BeaconScreenInput(); BeaconScreenInput* initData = new BeaconScreenInput();
@ -633,9 +633,10 @@ void MenuController::getImageTextData(std::uint8_t* imageData,
return; return;
} }
unsigned int MenuController::createImageTextData( unsigned int MenuController::createImageTextData(std::uint8_t* textMetadata,
std::uint8_t* textMetadata, int64_t seed, bool hasSeed, int64_t seed, bool hasSeed,
unsigned int uiHostOptions, unsigned int uiTexturePackId) { unsigned int uiHostOptions,
unsigned int uiTexturePackId) {
int iTextMetadataBytes = 0; int iTextMetadataBytes = 0;
if (hasSeed) { if (hasSeed) {
strcpy((char*)textMetadata, "4J_SEED"); strcpy((char*)textMetadata, "4J_SEED");

View file

@ -6,8 +6,8 @@
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "minecraft/XuiActionPayload.h" #include "minecraft/XuiActionPayload.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h" #include "platform/XboxStubs.h"
#include "platform/storage/storage.h"
class Player; class Player;
class Inventory; class Inventory;
@ -49,8 +49,8 @@ public:
bool loadCrafting2x2Menu(int iPad, std::shared_ptr<LocalPlayer> player); bool loadCrafting2x2Menu(int iPad, std::shared_ptr<LocalPlayer> player);
bool loadCrafting3x3Menu(int iPad, std::shared_ptr<LocalPlayer> player, bool loadCrafting3x3Menu(int iPad, std::shared_ptr<LocalPlayer> player,
int x, int y, int z); int x, int y, int z);
bool loadFireworksMenu(int iPad, std::shared_ptr<LocalPlayer> player, bool loadFireworksMenu(int iPad, std::shared_ptr<LocalPlayer> player, int x,
int x, int y, int z); int y, int z);
bool loadSignEntryMenu(int iPad, std::shared_ptr<SignTileEntity> sign); bool loadSignEntryMenu(int iPad, std::shared_ptr<SignTileEntity> sign);
bool loadRepairingMenu(int iPad, std::shared_ptr<Inventory> inventory, bool loadRepairingMenu(int iPad, std::shared_ptr<Inventory> inventory,
Level* level, int x, int y, int z); Level* level, int x, int y, int z);
@ -97,18 +97,18 @@ public:
eTMSAction getTMSAction(int iPad) { return m_eTMSAction[iPad]; } eTMSAction getTMSAction(int iPad) { return m_eTMSAction[iPad]; }
// Dialog callbacks // Dialog callbacks
static int texturePackDialogReturned(void* pParam, int iPad, static int texturePackDialogReturned(
IPlatformStorage::EMessageResult result); void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int fatalErrorDialogReturned(void* pParam, int iPad, static int fatalErrorDialogReturned(
IPlatformStorage::EMessageResult result); void* pParam, int iPad, IPlatformStorage::EMessageResult result);
static int trialOverReturned(void* pParam, int iPad, static int trialOverReturned(void* pParam, int iPad,
IPlatformStorage::EMessageResult result); IPlatformStorage::EMessageResult result);
static int unlockFullExitReturned(void* pParam, int iPad, static int unlockFullExitReturned(void* pParam, int iPad,
IPlatformStorage::EMessageResult result); IPlatformStorage::EMessageResult result);
static int unlockFullSaveReturned(void* pParam, int iPad, static int unlockFullSaveReturned(void* pParam, int iPad,
IPlatformStorage::EMessageResult result); IPlatformStorage::EMessageResult result);
static int unlockFullInviteReturned(void* pParam, int iPad, static int unlockFullInviteReturned(
IPlatformStorage::EMessageResult result); void* pParam, int iPad, IPlatformStorage::EMessageResult result);
// Remote save // Remote save
static int remoteSaveThreadProc(void* lpParameter); static int remoteSaveThreadProc(void* lpParameter);

View file

@ -9,27 +9,17 @@
#include <thread> #include <thread>
#include <vector> #include <vector>
#include "platform/input/input.h" #include "Socket.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "minecraft/GameEnums.h"
#include "app/common/Game.h" #include "app/common/Game.h"
#include "app/common/GameRules/GameRuleManager.h" #include "app/common/GameRules/GameRuleManager.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/common/Network/PlatformNetworkManagerStub.h" #include "app/common/Network/PlatformNetworkManagerStub.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h" #include "app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
#include "Socket.h"
#include "platform/XboxStubs.h"
#include "util/StringHelpers.h"
#include "platform/fs/fs.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/File.h" #include "java/File.h"
#include "minecraft/GameEnums.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/ProgressRenderer.h" #include "minecraft/client/ProgressRenderer.h"
#include "minecraft/client/User.h" #include "minecraft/client/User.h"
@ -42,16 +32,26 @@
#include "minecraft/network/Connection.h" #include "minecraft/network/Connection.h"
#include "minecraft/network/packet/DisconnectPacket.h" #include "minecraft/network/packet/DisconnectPacket.h"
#include "minecraft/network/packet/PreLoginPacket.h" #include "minecraft/network/packet/PreLoginPacket.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/server/MinecraftServer.h" #include "minecraft/server/MinecraftServer.h"
#include "minecraft/server/PlayerList.h" #include "minecraft/server/PlayerList.h"
#include "minecraft/server/level/ServerPlayer.h" #include "minecraft/server/level/ServerPlayer.h"
#include "minecraft/server/network/PlayerConnection.h" #include "minecraft/server/network/PlayerConnection.h"
#include "minecraft/world/entity/Entity.h" #include "minecraft/world/entity/Entity.h"
#include "minecraft/world/item/crafting/FireworksRecipe.h" #include "minecraft/world/item/crafting/FireworksRecipe.h"
#include "minecraft/world/level/GameRules/LevelGenerationOptions.h"
#include "minecraft/world/level/Level.h" #include "minecraft/world/level/Level.h"
#include "minecraft/world/level/chunk/storage/OldChunkStorage.h" #include "minecraft/world/level/chunk/storage/OldChunkStorage.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/tile/Tile.h"
#include "platform/XboxStubs.h"
#include "platform/fs/fs.h"
#include "platform/input/input.h"
#include "platform/profile/profile.h"
#include "platform/renderer/renderer.h"
#include "platform/storage/storage.h"
#include "strings.h" #include "strings.h"
#include "util/StringHelpers.h"
class FriendSessionInfo; class FriendSessionInfo;
class INVITE_INFO; class INVITE_INFO;
@ -407,8 +407,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
// Open the socket on the server end to accept incoming data // Open the socket on the server end to accept incoming data
Socket::addIncomingSocket(socket); Socket::addIncomingSocket(socket);
connection->send(std::shared_ptr<PreLoginPacket>(new PreLoginPacket( connection->send(std::shared_ptr<PreLoginPacket>(
PlatformProfile.GetGamertag(idx)))); new PreLoginPacket(PlatformProfile.GetGamertag(idx))));
createdConnections.push_back(connection); createdConnections.push_back(connection);
@ -626,8 +626,8 @@ void CGameNetworkManager::SetSessionsUpdatedCallback(
void CGameNetworkManager::GetFullFriendSessionInfo( void CGameNetworkManager::GetFullFriendSessionInfo(
FriendSessionInfo* foundSession, FriendSessionInfo* foundSession,
std::function<void(bool success)> callback) { std::function<void(bool success)> callback) {
s_pPlatformNetworkManager->GetFullFriendSessionInfo( s_pPlatformNetworkManager->GetFullFriendSessionInfo(foundSession,
foundSession, std::move(callback)); std::move(callback));
} }
void CGameNetworkManager::ForceFriendsSessionRefresh() { void CGameNetworkManager::ForceFriendsSessionRefresh() {
@ -723,8 +723,9 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
Minecraft::GetInstance()->clearConnectionFailed(); Minecraft::GetInstance()->clearConnectionFailed();
// change the minecraft player name // change the minecraft player name
Minecraft::GetInstance()->user->name = Minecraft::GetInstance()->user->name =
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()); PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad());
bool success = g_NetworkManager.JoinGameFromInviteInfo( bool success = g_NetworkManager.JoinGameFromInviteInfo(
iPad, // dwUserIndex iPad, // dwUserIndex
@ -824,7 +825,8 @@ int CGameNetworkManager::ServerThreadProc(void* lpParameter) {
} }
} }
C4JThread::setThreadName(static_cast<std::uint32_t>(-1), "Minecraft Server thread"); C4JThread::setThreadName(static_cast<std::uint32_t>(-1),
"Minecraft Server thread");
Compression::UseDefaultThreadStorage(); Compression::UseDefaultThreadStorage();
OldChunkStorage::UseDefaultThreadStorage(); OldChunkStorage::UseDefaultThreadStorage();
Entity::useSmallIds(); Entity::useSmallIds();
@ -1247,7 +1249,7 @@ void CGameNetworkManager::PlayerJoining(INetworkPlayer* pNetworkPlayer) {
void CGameNetworkManager::PlayerLeaving(INetworkPlayer* pNetworkPlayer) { void CGameNetworkManager::PlayerLeaving(INetworkPlayer* pNetworkPlayer) {
if (pNetworkPlayer->IsLocal()) { if (pNetworkPlayer->IsLocal()) {
PlatformProfile.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(), PlatformProfile.SetCurrentGameActivity(pNetworkPlayer->GetUserIndex(),
CONTEXT_PRESENCE_IDLE, false); CONTEXT_PRESENCE_IDLE, false);
} }
} }
@ -1290,8 +1292,9 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
bool bContentRestricted = false; bool bContentRestricted = false;
bool pccAllowed = true; bool pccAllowed = true;
bool pccFriendsAllowed = true; bool pccFriendsAllowed = true;
PlatformProfile.AllowedPlayerCreatedContent( PlatformProfile.AllowedPlayerCreatedContent(PlatformProfile.GetPrimaryPad(),
PlatformProfile.GetPrimaryPad(), false, &pccAllowed, &pccFriendsAllowed); false, &pccAllowed,
&pccFriendsAllowed);
if (!pccAllowed && !pccFriendsAllowed) noUGC = true; if (!pccAllowed && !pccFriendsAllowed) noUGC = true;
if (noUGC) { if (noUGC) {
@ -1307,7 +1310,8 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
// 4J-PB - it's possible there is no primary pad here, when accepting an // 4J-PB - it's possible there is no primary pad here, when accepting an
// invite from the dashboard // invite from the dashboard
// PlatformStorage.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, // PlatformStorage.RequestMessageBox(
// IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE,
// IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, // IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT,
// uiIDA,1,PlatformProfile.GetPrimaryPad(),nullptr,nullptr, // uiIDA,1,PlatformProfile.GetPrimaryPad(),nullptr,nullptr,
// app.GetStringTable()); // app.GetStringTable());
@ -1328,9 +1332,7 @@ void CGameNetworkManager::GameInviteReceived(int userIndex,
// pInviteInfo; // pInviteInfo;
// tell the app to process this // tell the app to process this
{ { app.ProcessInvite(userIndex, localUsersMask, pInviteInfo); }
app.ProcessInvite(userIndex, localUsersMask, pInviteInfo);
}
} }
} }
} }
@ -1385,8 +1387,9 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
g_NetworkManager.SetLocalGame(false); g_NetworkManager.SetLocalGame(false);
// change the minecraft player name // change the minecraft player name
Minecraft::GetInstance()->user->name = Minecraft::GetInstance()->user->name =
PlatformProfile.GetGamertag(PlatformProfile.GetPrimaryPad()); PlatformProfile.GetGamertag(
PlatformProfile.GetPrimaryPad());
bool success = g_NetworkManager.JoinGameFromInviteInfo( bool success = g_NetworkManager.JoinGameFromInviteInfo(
userIndex, localUsersMask, pInviteInfo); userIndex, localUsersMask, pInviteInfo);

View file

@ -7,14 +7,14 @@
#if !defined(__linux__) #if !defined(__linux__)
#include <qnet.h> #include <qnet.h>
#endif #endif
#include "platform/PlatformTypes.h" #include "PlatformNetworkManagerStub.h"
#include "app/common/Network/IPlatformNetwork.h" #include "app/common/Network/IPlatformNetwork.h"
#include "platform/NetTypes.h"
#include "minecraft/network/INetworkService.h" #include "minecraft/network/INetworkService.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h" #include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "PlatformNetworkManagerStub.h"
#include "minecraft/network/platform/SessionInfo.h" #include "minecraft/network/platform/SessionInfo.h"
#include "platform/C4JThread.h" #include "platform/C4JThread.h"
#include "platform/NetTypes.h"
#include "platform/PlatformTypes.h"
class ClientConnection; class ClientConnection;
class Minecraft; class Minecraft;
@ -97,9 +97,8 @@ public:
bool GetGameSessionInfo(int iPad, SessionID sessionId, bool GetGameSessionInfo(int iPad, SessionID sessionId,
FriendSessionInfo* foundSession); FriendSessionInfo* foundSession);
void SetSessionsUpdatedCallback(std::function<void()> callback); void SetSessionsUpdatedCallback(std::function<void()> callback);
void GetFullFriendSessionInfo( void GetFullFriendSessionInfo(FriendSessionInfo* foundSession,
FriendSessionInfo* foundSession, std::function<void(bool success)> callback);
std::function<void(bool success)> callback);
void ForceFriendsSessionRefresh(); void ForceFriendsSessionRefresh();
// Session joining and leaving // Session joining and leaving
@ -167,8 +166,7 @@ public:
private: private:
void StateChange_AnyToHosting(); void StateChange_AnyToHosting();
void StateChange_AnyToJoining(); void StateChange_AnyToJoining();
void StateChange_JoiningToIdle( void StateChange_JoiningToIdle(IPlatformNetwork::eJoinFailedReason reason);
IPlatformNetwork::eJoinFailedReason reason);
void StateChange_AnyToStarting(); void StateChange_AnyToStarting();
void StateChange_AnyToEnding(bool bStateWasPlaying); void StateChange_AnyToEnding(bool bStateWasPlaying);
void StateChange_AnyToIdle(); void StateChange_AnyToIdle();

View file

@ -51,8 +51,7 @@ public:
virtual bool RemoveLocalPlayerByUserIndex(int userIndex) = 0; virtual bool RemoveLocalPlayerByUserIndex(int userIndex) = 0;
[[nodiscard]] virtual INetworkPlayer* GetLocalPlayerByUserIndex( [[nodiscard]] virtual INetworkPlayer* GetLocalPlayerByUserIndex(
int userIndex) = 0; int userIndex) = 0;
[[nodiscard]] virtual INetworkPlayer* GetPlayerByIndex( [[nodiscard]] virtual INetworkPlayer* GetPlayerByIndex(int playerIndex) = 0;
int playerIndex) = 0;
[[nodiscard]] virtual INetworkPlayer* GetPlayerByXuid(PlayerUID xuid) = 0; [[nodiscard]] virtual INetworkPlayer* GetPlayerByXuid(PlayerUID xuid) = 0;
[[nodiscard]] virtual INetworkPlayer* GetPlayerBySmallId( [[nodiscard]] virtual INetworkPlayer* GetPlayerBySmallId(
unsigned char smallId) = 0; unsigned char smallId) = 0;
@ -89,9 +88,8 @@ public:
// Callbacks // Callbacks
virtual void RegisterPlayerChangedCallback( virtual void RegisterPlayerChangedCallback(
int iPad, int iPad, std::function<void(INetworkPlayer* pPlayer, bool leaving)>
std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback) = 0;
callback) = 0;
virtual void UnRegisterPlayerChangedCallback(int iPad) = 0; virtual void UnRegisterPlayerChangedCallback(int iPad) = 0;
virtual void HandleSignInChange() = 0; virtual void HandleSignInChange() = 0;
@ -112,7 +110,7 @@ public:
// System flags // System flags
virtual void SystemFlagSet(INetworkPlayer* pNetworkPlayer, int index) = 0; virtual void SystemFlagSet(INetworkPlayer* pNetworkPlayer, int index) = 0;
[[nodiscard]] virtual bool SystemFlagGet(INetworkPlayer* pNetworkPlayer, [[nodiscard]] virtual bool SystemFlagGet(INetworkPlayer* pNetworkPlayer,
int index) = 0; int index) = 0;
// Stats // Stats
[[nodiscard]] virtual std::string GatherStats() = 0; [[nodiscard]] virtual std::string GatherStats() = 0;
@ -128,8 +126,7 @@ public:
int iPad, int localPlayers, bool partyOnly) = 0; int iPad, int localPlayers, bool partyOnly) = 0;
[[nodiscard]] virtual bool GetGameSessionInfo( [[nodiscard]] virtual bool GetGameSessionInfo(
int iPad, SessionID sessionId, FriendSessionInfo* foundSession) = 0; int iPad, SessionID sessionId, FriendSessionInfo* foundSession) = 0;
virtual void SetSessionsUpdatedCallback( virtual void SetSessionsUpdatedCallback(std::function<void()> callback) = 0;
std::function<void()> callback) = 0;
virtual void GetFullFriendSessionInfo( virtual void GetFullFriendSessionInfo(
FriendSessionInfo* foundSession, FriendSessionInfo* foundSession,
std::function<void(bool success)> callback) = 0; std::function<void(bool success)> callback) = 0;

View file

@ -2,8 +2,8 @@
#include <limits.h> #include <limits.h>
#include "platform/NetTypes.h"
#include "java/System.h" #include "java/System.h"
#include "platform/NetTypes.h"
NetworkPlayerQNet::NetworkPlayerQNet(IQNetPlayer* qnetPlayer) { NetworkPlayerQNet::NetworkPlayerQNet(IQNetPlayer* qnetPlayer) {
m_qnetPlayer = qnetPlayer; m_qnetPlayer = qnetPlayer;

View file

@ -4,8 +4,8 @@
#include <string> #include <string>
#include "platform/PlatformTypes.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h" #include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "platform/PlatformTypes.h"
class IQNetPlayer; class IQNetPlayer;
class Socket; class Socket;

View file

@ -5,11 +5,11 @@
#if !defined(__linux__) #if !defined(__linux__)
#include <qnet.h> #include <qnet.h>
#endif #endif
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h" #include "minecraft/client/model/SkinBox.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h" #include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/network/platform/SessionInfo.h" #include "minecraft/network/platform/SessionInfo.h"
#include "platform/C4JThread.h" #include "platform/C4JThread.h"
#include "platform/NetTypes.h"
class ClientConnection; class ClientConnection;
class Minecraft; class Minecraft;
@ -87,9 +87,8 @@ public:
virtual void ResetLeavingGame() = 0; virtual void ResetLeavingGame() = 0;
virtual void RegisterPlayerChangedCallback( virtual void RegisterPlayerChangedCallback(
int iPad, int iPad, std::function<void(INetworkPlayer* pPlayer, bool leaving)>
std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback) = 0;
callback) = 0;
virtual void UnRegisterPlayerChangedCallback(int iPad) = 0; virtual void UnRegisterPlayerChangedCallback(int iPad) = 0;
virtual void HandleSignInChange() = 0; virtual void HandleSignInChange() = 0;
@ -128,8 +127,7 @@ public:
bool partyOnly) = 0; bool partyOnly) = 0;
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId, virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,
FriendSessionInfo* foundSession) = 0; FriendSessionInfo* foundSession) = 0;
virtual void SetSessionsUpdatedCallback( virtual void SetSessionsUpdatedCallback(std::function<void()> callback) = 0;
std::function<void()> callback) = 0;
virtual void GetFullFriendSessionInfo( virtual void GetFullFriendSessionInfo(
FriendSessionInfo* foundSession, FriendSessionInfo* foundSession,
std::function<void(bool success)> callback) = 0; std::function<void(bool success)> callback) = 0;

View file

@ -5,13 +5,13 @@
#include <compare> #include <compare>
#include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/linux/LinuxGame.h"
#include "platform/NetTypes.h"
#include "NetworkPlayerQNet.h" #include "NetworkPlayerQNet.h"
#include "Socket.h" #include "Socket.h"
#include "app/common/Network/GameNetworkManager.h"
#include "app/linux/LinuxGame.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "platform/C4JThread.h" #include "platform/C4JThread.h"
#include "platform/NetTypes.h"
IPlatformNetworkStub* g_pPlatformNetworkManager; IPlatformNetworkStub* g_pPlatformNetworkManager;
@ -107,8 +107,8 @@ void IPlatformNetworkStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) {
} }
} }
bool IPlatformNetworkStub::Initialise( bool IPlatformNetworkStub::Initialise(CGameNetworkManager* pGameNetworkManager,
CGameNetworkManager* pGameNetworkManager, int flagIndexSize) { int flagIndexSize) {
m_pGameNetworkManager = pGameNetworkManager; m_pGameNetworkManager = pGameNetworkManager;
m_flagIndexSize = flagIndexSize; m_flagIndexSize = flagIndexSize;
g_pPlatformNetworkManager = this; g_pPlatformNetworkManager = this;
@ -152,8 +152,7 @@ int IPlatformNetworkStub::GetJoiningReadyPercentage() { return 100; }
int IPlatformNetworkStub::CorrectErrorIDS(int IDS) { return IDS; } int IPlatformNetworkStub::CorrectErrorIDS(int IDS) { return IDS; }
bool IPlatformNetworkStub::isSystemPrimaryPlayer( bool IPlatformNetworkStub::isSystemPrimaryPlayer(IQNetPlayer* pQNetPlayer) {
IQNetPlayer* pQNetPlayer) {
return true; return true;
} }
@ -165,9 +164,7 @@ int IPlatformNetworkStub::GetPlayerCount() {
return m_pIQNet->GetPlayerCount(); return m_pIQNet->GetPlayerCount();
} }
bool IPlatformNetworkStub::ShouldMessageForFullSession() { bool IPlatformNetworkStub::ShouldMessageForFullSession() { return false; }
return false;
}
int IPlatformNetworkStub::GetOnlinePlayerCount() { return 1; } int IPlatformNetworkStub::GetOnlinePlayerCount() { return 1; }
@ -186,8 +183,7 @@ bool IPlatformNetworkStub::RemoveLocalPlayerByUserIndex(int userIndex) {
bool IPlatformNetworkStub::IsInStatsEnabledSession() { return true; } bool IPlatformNetworkStub::IsInStatsEnabledSession() { return true; }
bool IPlatformNetworkStub::SessionHasSpace( bool IPlatformNetworkStub::SessionHasSpace(unsigned int spaceRequired /*= 1*/) {
unsigned int spaceRequired /*= 1*/) {
return true; return true;
} }
@ -209,8 +205,7 @@ bool IPlatformNetworkStub::LeaveGame(bool bMigrateHost) {
return true; return true;
} }
bool IPlatformNetworkStub::_LeaveGame(bool bMigrateHost, bool IPlatformNetworkStub::_LeaveGame(bool bMigrateHost, bool bLeaveRoom) {
bool bLeaveRoom) {
return true; return true;
} }
@ -242,8 +237,7 @@ void IPlatformNetworkStub::_HostGame(
bool IPlatformNetworkStub::_StartGame() { return true; } bool IPlatformNetworkStub::_StartGame() { return true; }
int IPlatformNetworkStub::JoinGame(FriendSessionInfo* searchResult, int IPlatformNetworkStub::JoinGame(FriendSessionInfo* searchResult,
int localUsersMask, int localUsersMask, int primaryUserIndex) {
int primaryUserIndex) {
return CGameNetworkManager::JOINGAME_SUCCESS; return CGameNetworkManager::JOINGAME_SUCCESS;
} }
@ -319,8 +313,7 @@ void IPlatformNetworkStub::UpdateAndSetGameSessionData(
// app.GetGameHostOption(eGameHostOption_All); // app.GetGameHostOption(eGameHostOption_All);
} }
int IPlatformNetworkStub::RemovePlayerOnSocketClosedThreadProc( int IPlatformNetworkStub::RemovePlayerOnSocketClosedThreadProc(void* lpParam) {
void* lpParam) {
INetworkPlayer* pNetworkPlayer = (INetworkPlayer*)lpParam; INetworkPlayer* pNetworkPlayer = (INetworkPlayer*)lpParam;
Socket* socket = pNetworkPlayer->GetSocket(); Socket* socket = pNetworkPlayer->GetSocket();
@ -338,13 +331,12 @@ int IPlatformNetworkStub::RemovePlayerOnSocketClosedThreadProc(
return g_pPlatformNetworkManager->RemoveLocalPlayer(pNetworkPlayer); return g_pPlatformNetworkManager->RemoveLocalPlayer(pNetworkPlayer);
} }
bool IPlatformNetworkStub::RemoveLocalPlayer( bool IPlatformNetworkStub::RemoveLocalPlayer(INetworkPlayer* pNetworkPlayer) {
INetworkPlayer* pNetworkPlayer) {
return true; return true;
} }
IPlatformNetworkStub::PlayerFlags::PlayerFlags( IPlatformNetworkStub::PlayerFlags::PlayerFlags(INetworkPlayer* pNetworkPlayer,
INetworkPlayer* pNetworkPlayer, unsigned int count) { unsigned int count) {
// 4J Stu - Don't assert, just make it a multiple of 8! This count is // 4J Stu - Don't assert, just make it a multiple of 8! This count is
// calculated from a load of separate values, and makes tweaking // calculated from a load of separate values, and makes tweaking
// world/render sizes a pain if we hit an assert here // world/render sizes a pain if we hit an assert here
@ -359,8 +351,7 @@ IPlatformNetworkStub::PlayerFlags::~PlayerFlags() { delete[] flags; }
// Add a player to the per system flag storage - if we've already got a player // Add a player to the per system flag storage - if we've already got a player
// from that system, copy its flags over // from that system, copy its flags over
void IPlatformNetworkStub::SystemFlagAddPlayer( void IPlatformNetworkStub::SystemFlagAddPlayer(INetworkPlayer* pNetworkPlayer) {
INetworkPlayer* pNetworkPlayer) {
PlayerFlags* newPlayerFlags = PlayerFlags* newPlayerFlags =
new PlayerFlags(pNetworkPlayer, m_flagIndexSize); new PlayerFlags(pNetworkPlayer, m_flagIndexSize);
// If any of our existing players are on the same system, then copy over // If any of our existing players are on the same system, then copy over
@ -399,7 +390,7 @@ void IPlatformNetworkStub::SystemFlagReset() {
// Set a per system flag - this is done by setting the flag on every player that // Set a per system flag - this is done by setting the flag on every player that
// shares that system // shares that system
void IPlatformNetworkStub::SystemFlagSet(INetworkPlayer* pNetworkPlayer, void IPlatformNetworkStub::SystemFlagSet(INetworkPlayer* pNetworkPlayer,
int index) { int index) {
if ((index < 0) || (index >= m_flagIndexSize)) return; if ((index < 0) || (index >= m_flagIndexSize)) return;
if (pNetworkPlayer == nullptr) return; if (pNetworkPlayer == nullptr) return;
@ -414,7 +405,7 @@ void IPlatformNetworkStub::SystemFlagSet(INetworkPlayer* pNetworkPlayer,
// player as anything else sent to that system should also have been duplicated // player as anything else sent to that system should also have been duplicated
// here // here
bool IPlatformNetworkStub::SystemFlagGet(INetworkPlayer* pNetworkPlayer, bool IPlatformNetworkStub::SystemFlagGet(INetworkPlayer* pNetworkPlayer,
int index) { int index) {
if ((index < 0) || (index >= m_flagIndexSize)) return false; if ((index < 0) || (index >= m_flagIndexSize)) return false;
if (pNetworkPlayer == nullptr) { if (pNetworkPlayer == nullptr) {
return false; return false;
@ -505,8 +496,7 @@ INetworkPlayer* IPlatformNetworkStub::addNetworkPlayer(
return pNetworkPlayer; return pNetworkPlayer;
} }
void IPlatformNetworkStub::removeNetworkPlayer( void IPlatformNetworkStub::removeNetworkPlayer(IQNetPlayer* pQNetPlayer) {
IQNetPlayer* pQNetPlayer) {
INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer); INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
for (auto it = currentNetworkPlayers.begin(); for (auto it = currentNetworkPlayers.begin();
it != currentNetworkPlayers.end(); it++) { it != currentNetworkPlayers.end(); it++) {
@ -523,8 +513,7 @@ INetworkPlayer* IPlatformNetworkStub::getNetworkPlayer(
: nullptr; : nullptr;
} }
INetworkPlayer* IPlatformNetworkStub::GetLocalPlayerByUserIndex( INetworkPlayer* IPlatformNetworkStub::GetLocalPlayerByUserIndex(int userIndex) {
int userIndex) {
return getNetworkPlayer(m_pIQNet->GetLocalPlayerByUserIndex(userIndex)); return getNetworkPlayer(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
} }

View file

@ -4,14 +4,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "platform/PlatformTypes.h"
#include "platform/NetTypes.h"
#include "minecraft/client/model/SkinBox.h"
#include "platform/XboxStubs.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/common/Network/IPlatformNetwork.h" #include "app/common/Network/IPlatformNetwork.h"
#include "minecraft/client/model/SkinBox.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/network/platform/SessionInfo.h" #include "minecraft/network/platform/SessionInfo.h"
#include "platform/C4JThread.h" #include "platform/C4JThread.h"
#include "platform/NetTypes.h"
#include "platform/PlatformTypes.h"
#include "platform/XboxStubs.h"
class C4JThread; class C4JThread;
class CGameNetworkManager; class CGameNetworkManager;
@ -67,8 +67,7 @@ public:
virtual void RegisterPlayerChangedCallback( virtual void RegisterPlayerChangedCallback(
int iPad, int iPad,
std::function<void(INetworkPlayer* pPlayer, bool leaving)> std::function<void(INetworkPlayer* pPlayer, bool leaving)> callback);
callback);
virtual void UnRegisterPlayerChangedCallback(int iPad); virtual void UnRegisterPlayerChangedCallback(int iPad);
virtual void HandleSignInChange(); virtual void HandleSignInChange();
@ -184,8 +183,7 @@ public:
bool partyOnly); bool partyOnly);
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId, virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,
FriendSessionInfo* foundSession); FriendSessionInfo* foundSession);
virtual void SetSessionsUpdatedCallback( virtual void SetSessionsUpdatedCallback(std::function<void()> callback);
std::function<void()> callback);
virtual void GetFullFriendSessionInfo( virtual void GetFullFriendSessionInfo(
FriendSessionInfo* foundSession, FriendSessionInfo* foundSession,
std::function<void(bool success)> callback); std::function<void(bool success)> callback);

View file

@ -7,11 +7,11 @@
#include <vector> #include <vector>
// 4jcraft TODO // 4jcraft TODO
#include "platform/ShutdownManager.h"
#include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h" #include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "platform/NetTypes.h"
#include "minecraft/server/network/ServerConnection.h" #include "minecraft/server/network/ServerConnection.h"
#include "platform/NetTypes.h"
#include "platform/ShutdownManager.h"
class SocketAddress {}; class SocketAddress {};

View file

@ -11,10 +11,10 @@
#include <queue> #include <queue>
#include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "platform/C4JThread.h"
#include "java/InputOutputStream/InputStream.h" #include "java/InputOutputStream/InputStream.h"
#include "java/InputOutputStream/OutputStream.h" #include "java/InputOutputStream/OutputStream.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "platform/C4JThread.h"
class INetworkPlayer; class INetworkPlayer;

View file

@ -3,10 +3,10 @@
#include <cstdint> #include <cstdint>
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "platform/NetTypes.h"
#include "platform/storage/storage.h"
#include "platform/XboxStubs.h"
#include "minecraft/network/packet/DisconnectPacket.h" #include "minecraft/network/packet/DisconnectPacket.h"
#include "platform/NetTypes.h"
#include "platform/XboxStubs.h"
#include "platform/storage/storage.h"
struct INVITE_INFO; struct INVITE_INFO;
@ -32,10 +32,10 @@ public:
unsigned int uiSignInData); unsigned int uiSignInData);
static void clearSignInChangeUsersMask(); static void clearSignInChangeUsersMask();
static int signoutExitWorldThreadProc(void* lpParameter); static int signoutExitWorldThreadProc(void* lpParameter);
static int primaryPlayerSignedOutReturned(void* pParam, int iPad, static int primaryPlayerSignedOutReturned(
const IPlatformStorage::EMessageResult); void* pParam, int iPad, const IPlatformStorage::EMessageResult);
static int ethernetDisconnectReturned(void* pParam, int iPad, static int ethernetDisconnectReturned(
const IPlatformStorage::EMessageResult); void* pParam, int iPad, const IPlatformStorage::EMessageResult);
static void profileReadErrorCallback(void* pParam); static void profileReadErrorCallback(void* pParam);
// Notifications // Notifications

View file

@ -1,17 +1,16 @@
#include "app/linux/LinuxGame.h"
#include "app/common/SaveManager.h" #include "app/common/SaveManager.h"
#include <chrono> #include <chrono>
#include "app/common/Game.h" #include "app/common/Game.h"
#include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/GameNetworkManager.h"
#include "app/linux/LinuxGame.h"
#include "minecraft/server/MinecraftServer.h" #include "minecraft/server/MinecraftServer.h"
#include "platform/profile/profile.h" #include "platform/profile/profile.h"
void SaveManager::setAutosaveTimerTime(int settingValue) { void SaveManager::setAutosaveTimerTime(int settingValue) {
m_uiAutosaveTimer = m_uiAutosaveTimer =
time_util::clock::now() + time_util::clock::now() + std::chrono::minutes(settingValue * 15);
std::chrono::minutes(settingValue * 15);
} }
bool SaveManager::autosaveDue() const { bool SaveManager::autosaveDue() const {

View file

@ -1,21 +1,22 @@
#include "app/common/SkinManager.h" #include "app/common/SkinManager.h"
#include <wchar.h>
#include <mutex> #include <mutex>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <wchar.h>
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCPack.h" #include "app/common/DLC/DLCPack.h"
#include "app/common/DLC/DLCSkinFile.h" #include "app/common/DLC/DLCSkinFile.h"
#include "minecraft/Minecraft_Macros.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/Minecraft_Macros.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/model/geom/Model.h" #include "minecraft/client/model/geom/Model.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
#include "minecraft/client/renderer/entity/EntityRenderer.h"
#include "minecraft/client/renderer/entity/EntityRenderDispatcher.h" #include "minecraft/client/renderer/entity/EntityRenderDispatcher.h"
#include "minecraft/client/renderer/entity/EntityRenderer.h"
#include "minecraft/world/entity/player/Player.h" #include "minecraft/world/entity/player/Player.h"
#include "platform/profile/profile.h" #include "platform/profile/profile.h"
@ -44,7 +45,7 @@ void SkinManager::setPlayerSkin(int iPad, std::uint32_t dwSkinId,
} }
std::string SkinManager::getPlayerSkinName(int iPad, std::string SkinManager::getPlayerSkinName(int iPad,
GAME_SETTINGS** gameSettingsA) { GAME_SETTINGS** gameSettingsA) {
return getSkinPathFromId(gameSettingsA[iPad]->dwSelectedSkin); return getSkinPathFromId(gameSettingsA[iPad]->dwSelectedSkin);
} }
@ -104,7 +105,7 @@ void SkinManager::setPlayerCape(int iPad, std::uint32_t dwCapeId,
} }
std::string SkinManager::getPlayerCapeName(int iPad, std::string SkinManager::getPlayerCapeName(int iPad,
GAME_SETTINGS** gameSettingsA) { GAME_SETTINGS** gameSettingsA) {
return Player::getCapePathFromId(gameSettingsA[iPad]->dwSelectedCape); return Player::getCapePathFromId(gameSettingsA[iPad]->dwSelectedCape);
} }
@ -122,8 +123,8 @@ void SkinManager::setPlayerFavoriteSkin(int iPad, int iIndex,
gameSettingsA[iPad]->bSettingsChanged = true; gameSettingsA[iPad]->bSettingsChanged = true;
} }
unsigned int SkinManager::getPlayerFavoriteSkin( unsigned int SkinManager::getPlayerFavoriteSkin(int iPad, int iIndex,
int iPad, int iIndex, GAME_SETTINGS** gameSettingsA) { GAME_SETTINGS** gameSettingsA) {
return gameSettingsA[iPad]->uiFavoriteSkinA[iIndex]; return gameSettingsA[iPad]->uiFavoriteSkinA[iIndex];
} }
@ -151,8 +152,7 @@ unsigned int SkinManager::getPlayerFavoriteSkinsCount(
return uiCount; return uiCount;
} }
void SkinManager::validateFavoriteSkins(int iPad, void SkinManager::validateFavoriteSkins(int iPad, GAME_SETTINGS** gameSettingsA,
GAME_SETTINGS** gameSettingsA,
DLCManager& dlcManager) { DLCManager& dlcManager) {
unsigned int uiCount = getPlayerFavoriteSkinsCount(iPad, gameSettingsA); unsigned int uiCount = getPlayerFavoriteSkinsCount(iPad, gameSettingsA);
@ -203,7 +203,7 @@ void SkinManager::addMemoryTextureFile(const std::string& wName,
if (it != m_MEM_Files.end()) { if (it != m_MEM_Files.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Incrementing the memory texture file count for %s\n", printf("Incrementing the memory texture file count for %s\n",
wName.c_str()); wName.c_str());
#endif #endif
pData = (*it).second; pData = (*it).second;
@ -233,14 +233,14 @@ void SkinManager::removeMemoryTextureFile(const std::string& wName) {
if (it != m_MEM_Files.end()) { if (it != m_MEM_Files.end()) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Decrementing the memory texture file count for %s\n", printf("Decrementing the memory texture file count for %s\n",
wName.c_str()); wName.c_str());
#endif #endif
PMEMDATA pData = (*it).second; PMEMDATA pData = (*it).second;
--pData->ucRefCount; --pData->ucRefCount;
if (pData->ucRefCount <= 0) { if (pData->ucRefCount <= 0) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Erasing the memory texture file data for %s\n", printf("Erasing the memory texture file data for %s\n",
wName.c_str()); wName.c_str());
#endif #endif
delete pData; delete pData;
m_MEM_Files.erase(wName); m_MEM_Files.erase(wName);

View file

@ -38,13 +38,13 @@ public:
void setPlayerFavoriteSkin(int iPad, int iIndex, unsigned int uiSkinID, void setPlayerFavoriteSkin(int iPad, int iIndex, unsigned int uiSkinID,
GAME_SETTINGS** gameSettingsA); GAME_SETTINGS** gameSettingsA);
unsigned int getPlayerFavoriteSkin(int iPad, int iIndex, unsigned int getPlayerFavoriteSkin(int iPad, int iIndex,
GAME_SETTINGS** gameSettingsA); GAME_SETTINGS** gameSettingsA);
unsigned char getPlayerFavoriteSkinsPos(int iPad, unsigned char getPlayerFavoriteSkinsPos(int iPad,
GAME_SETTINGS** gameSettingsA); GAME_SETTINGS** gameSettingsA);
void setPlayerFavoriteSkinsPos(int iPad, int iPos, void setPlayerFavoriteSkinsPos(int iPad, int iPos,
GAME_SETTINGS** gameSettingsA); GAME_SETTINGS** gameSettingsA);
unsigned int getPlayerFavoriteSkinsCount(int iPad, unsigned int getPlayerFavoriteSkinsCount(int iPad,
GAME_SETTINGS** gameSettingsA); GAME_SETTINGS** gameSettingsA);
void validateFavoriteSkins(int iPad, GAME_SETTINGS** gameSettingsA, void validateFavoriteSkins(int iPad, GAME_SETTINGS** gameSettingsA,
DLCManager& dlcManager); DLCManager& dlcManager);

View file

@ -2,8 +2,8 @@
#include <vector> #include <vector>
#include "minecraft/GameEnums.h"
#include "app/common/App_structs.h" #include "app/common/App_structs.h"
#include "minecraft/GameEnums.h"
class TerrainFeatureManager { class TerrainFeatureManager {
public: public:

View file

@ -2,7 +2,6 @@
#include <memory> #include <memory>
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "app/common/Tutorial/Constraints/TutorialConstraint.h" #include "app/common/Tutorial/Constraints/TutorialConstraint.h"
#include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h" #include "app/common/Tutorial/TutorialEnum.h"
@ -10,6 +9,7 @@
#include "minecraft/client/multiplayer/ClientConnection.h" #include "minecraft/client/multiplayer/ClientConnection.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
#include "minecraft/network/packet/PlayerInfoPacket.h" #include "minecraft/network/packet/PlayerInfoPacket.h"
#include "minecraft/network/platform/NetworkPlayerInterface.h"
#include "minecraft/world/entity/player/Abilities.h" #include "minecraft/world/entity/player/Abilities.h"
#include "minecraft/world/entity/player/Player.h" #include "minecraft/world/entity/player/Player.h"
#include "minecraft/world/level/LevelSettings.h" #include "minecraft/world/level/LevelSettings.h"

View file

@ -2,8 +2,8 @@
#include <cstddef> #include <cstddef>
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialConstraint.h" #include "TutorialConstraint.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "minecraft/world/phys/AABB.h" #include "minecraft/world/phys/AABB.h"
class AABB; class AABB;

View file

@ -290,8 +290,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
IDS_TUTORIAL_TASK_CREATE_TORCH)); IDS_TUTORIAL_TASK_CREATE_TORCH));
if (app.getGameRuleDefinitions() != nullptr) { if (app.getGameRuleDefinitions() != nullptr) {
AABB* area = AABB* area = app.getGameRuleDefinitions()->getNamedArea("tutorialArea");
app.getGameRuleDefinitions()->getNamedArea("tutorialArea");
if (area != nullptr) { if (area != nullptr) {
std::vector<TutorialConstraint*>* areaConstraints = std::vector<TutorialConstraint*>* areaConstraints =
new std::vector<TutorialConstraint*>(); new std::vector<TutorialConstraint*>();
@ -506,8 +505,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
* *
*/ */
if (app.getGameRuleDefinitions() != nullptr) { if (app.getGameRuleDefinitions() != nullptr) {
AABB* area = AABB* area = app.getGameRuleDefinitions()->getNamedArea("minecartArea");
app.getGameRuleDefinitions()->getNamedArea("minecartArea");
if (area != nullptr) { if (area != nullptr) {
addHint(e_Tutorial_State_Gameplay, addHint(e_Tutorial_State_Gameplay,
new AreaHint(e_Tutorial_Hint_Always_On, this, new AreaHint(e_Tutorial_Hint_Always_On, this,
@ -680,8 +678,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
* *
*/ */
if (app.getGameRuleDefinitions() != nullptr) { if (app.getGameRuleDefinitions() != nullptr) {
AABB* area = AABB* area = app.getGameRuleDefinitions()->getNamedArea("creativeArea");
app.getGameRuleDefinitions()->getNamedArea("creativeArea");
if (area != nullptr) { if (area != nullptr) {
eTutorial_State creativeStates[] = {e_Tutorial_State_Gameplay}; eTutorial_State creativeStates[] = {e_Tutorial_State_Gameplay};
AddGlobalConstraint(new ChangeStateConstraint( AddGlobalConstraint(new ChangeStateConstraint(
@ -1195,8 +1192,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
* *
*/ */
if (app.getGameRuleDefinitions() != nullptr) { if (app.getGameRuleDefinitions() != nullptr) {
AABB* area = AABB* area = app.getGameRuleDefinitions()->getNamedArea("breedingArea");
app.getGameRuleDefinitions()->getNamedArea("breedingArea");
if (area != nullptr) { if (area != nullptr) {
eTutorial_State breedingStates[] = {e_Tutorial_State_Gameplay}; eTutorial_State breedingStates[] = {e_Tutorial_State_Gameplay};
AddGlobalConstraint(new ChangeStateConstraint( AddGlobalConstraint(new ChangeStateConstraint(

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "app/common/Tutorial/TutorialEnum.h"
#include "Tutorial.h" #include "Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#define FULL_TUTORIAL_PROGRESS_2_X_2_Crafting 1 #define FULL_TUTORIAL_PROGRESS_2_X_2_Crafting 1
#define FULL_TUTORIAL_PROGRESS_3_X_3_Crafting 2 #define FULL_TUTORIAL_PROGRESS_3_X_3_Crafting 2

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialHint.h" #include "TutorialHint.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "minecraft/world/phys/AABB.h" #include "minecraft/world/phys/AABB.h"
class AABB; class AABB;

View file

@ -57,7 +57,7 @@ int DiggerItemHint::attack(std::shared_ptr<ItemInstance> item,
if (itemFound) { if (itemFound) {
// It's also possible that we could hit TileEntities (eg falling // It's also possible that we could hit TileEntities (eg falling
// sand) so don't want to give this hint then // sand) so don't want to give this hint then
if (entity->instanceof(eTYPE_MOB)) { if (entity->instanceof (eTYPE_MOB)) {
return IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL; return IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL;
} else { } else {
return -1; return -1;

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialHint.h" #include "TutorialHint.h"
#include "app/common/Tutorial/TutorialEnum.h"
class DiggerItem; class DiggerItem;
class Level; class Level;

View file

@ -1,8 +1,8 @@
#pragma once #pragma once
// using namespace std; // using namespace std;
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialHint.h" #include "TutorialHint.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "java/Class.h" #include "java/Class.h"
class ItemInstance; class ItemInstance;
@ -17,7 +17,7 @@ public:
LookAtEntityHint(eTutorial_Hint id, Tutorial* tutorial, int descriptionId, LookAtEntityHint(eTutorial_Hint id, Tutorial* tutorial, int descriptionId,
int titleId, eINSTANCEOF type); int titleId, eINSTANCEOF type);
// TODO: 4jcraft added, this was not implemented // TODO: 4jcraft added, this was not implemented
~LookAtEntityHint() {}; ~LookAtEntityHint(){};
virtual bool onLookAtEntity(eINSTANCEOF type); virtual bool onLookAtEntity(eINSTANCEOF type);
}; };

View file

@ -1,8 +1,8 @@
#pragma once #pragma once
// using namespace std; // using namespace std;
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialHint.h" #include "TutorialHint.h"
#include "app/common/Tutorial/TutorialEnum.h"
class ItemInstance; class ItemInstance;
class Tutorial; class Tutorial;
@ -20,7 +20,7 @@ public:
unsigned int tilesLength, int iconOverride = -1, unsigned int tilesLength, int iconOverride = -1,
int iData = -1, int iDataOverride = -1); int iData = -1, int iDataOverride = -1);
// TODO: 4jcraft, added, destructor was never implemented // TODO: 4jcraft, added, destructor was never implemented
~LookAtTileHint() {}; ~LookAtTileHint(){};
virtual bool onLookAt(int id, int iData = 0); virtual bool onLookAt(int id, int iData = 0);
}; };

View file

@ -1,8 +1,8 @@
#pragma once #pragma once
// using namespace std; // using namespace std;
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialHint.h" #include "TutorialHint.h"
#include "app/common/Tutorial/TutorialEnum.h"
class ItemInstance; class ItemInstance;
class Tutorial; class Tutorial;
@ -16,7 +16,7 @@ public:
TakeItemHint(eTutorial_Hint id, Tutorial* tutorial, int items[], TakeItemHint(eTutorial_Hint id, Tutorial* tutorial, int items[],
unsigned int itemsLength); unsigned int itemsLength);
// TODO: 4jcraft, added, it was never implemented // TODO: 4jcraft, added, it was never implemented
virtual ~TakeItemHint() {}; virtual ~TakeItemHint(){};
virtual bool onTake(std::shared_ptr<ItemInstance> item); virtual bool onTake(std::shared_ptr<ItemInstance> item);
}; };

View file

@ -4,8 +4,8 @@
#include <format> #include <format>
#include <vector> #include <vector>
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialTask.h" #include "TutorialTask.h"
#include "app/common/Tutorial/TutorialEnum.h"
class Tutorial; class Tutorial;
class TutorialConstraint; class TutorialConstraint;

View file

@ -3,7 +3,6 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "platform/input/input.h"
#include "app/common/Tutorial/Constraints/InputConstraint.h" #include "app/common/Tutorial/Constraints/InputConstraint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h" #include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/Tutorial.h"
@ -12,6 +11,7 @@
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
#include "minecraft/world/level/material/Material.h" #include "minecraft/world/level/material/Material.h"
#include "platform/input/input.h"
ChoiceTask::ChoiceTask( ChoiceTask::ChoiceTask(
Tutorial* tutorial, int descriptionId, int promptId /*= -1*/, Tutorial* tutorial, int descriptionId, int promptId /*= -1*/,
@ -55,12 +55,12 @@ bool ChoiceTask::isCompleted() {
if (!m_bConfirmMappingComplete && if (!m_bConfirmMappingComplete &&
PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
m_iConfirmMapping) > 0) { m_iConfirmMapping) > 0) {
m_bConfirmMappingComplete = true; m_bConfirmMappingComplete = true;
} }
if (!m_bCancelMappingComplete && if (!m_bCancelMappingComplete &&
PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
m_iCancelMapping) > 0) { m_iCancelMapping) > 0) {
m_bCancelMappingComplete = true; m_bCancelMappingComplete = true;
} }
} }

View file

@ -1,8 +1,8 @@
#pragma once #pragma once
// using namespace std; // using namespace std;
#include "app/common/Tutorial/TutorialEnum.h"
#include "TutorialTask.h" #include "TutorialTask.h"
#include "app/common/Tutorial/TutorialEnum.h"
class Tutorial; class Tutorial;

View file

@ -6,13 +6,13 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "platform/input/input.h"
#include "minecraft/GameEnums.h"
#include "app/common/Tutorial/Constraints/InputConstraint.h" #include "app/common/Tutorial/Constraints/InputConstraint.h"
#include "app/common/Tutorial/Tasks/TutorialTask.h" #include "app/common/Tutorial/Tasks/TutorialTask.h"
#include "app/linux/LinuxGame.h" #include "app/linux/LinuxGame.h"
#include "minecraft/GameEnums.h"
#include "minecraft/client/Minecraft.h" #include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h" #include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
#include "platform/input/input.h"
class Tutorial; class Tutorial;
@ -82,7 +82,7 @@ bool ControllerTask::isCompleted() {
it != southpawCompletedMappings.end(); ++it) { it != southpawCompletedMappings.end(); ++it) {
if (!it->second) { if (!it->second) {
if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
it->first) > 0) { it->first) > 0) {
it->second = true; it->second = true;
m_uiCompletionMask |= 1 << iCurrent; m_uiCompletionMask |= 1 << iCurrent;
} else { } else {
@ -96,7 +96,7 @@ bool ControllerTask::isCompleted() {
++it) { ++it) {
if (!it->second) { if (!it->second) {
if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(),
it->first) > 0) { it->first) > 0) {
it->second = true; it->second = true;
m_uiCompletionMask |= 1 << iCurrent; m_uiCompletionMask |= 1 << iCurrent;
} else { } else {

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