Merge pull request #71 from 4jcraft/refactor/no-std-wildcard

refactor: remove `using namespace std`
This commit is contained in:
Tropical 2026-03-08 10:09:33 -05:00 committed by GitHub
commit 43a28fc490
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1972 changed files with 11580 additions and 11580 deletions

View file

@ -51,7 +51,7 @@ void C_4JProfile::SetPrimaryPad(int iPad) {}
static char s_gamertag[64] = "Player"; static char s_gamertag[64] = "Player";
char* C_4JProfile::GetGamertag(int iPad) { return s_gamertag; } char* C_4JProfile::GetGamertag(int iPad) { return s_gamertag; }
wstring C_4JProfile::GetDisplayName(int iPad) { return L"Player"; } std::wstring C_4JProfile::GetDisplayName(int iPad) { return L"Player"; }
bool C_4JProfile::IsFullVersion() { return true; } bool C_4JProfile::IsFullVersion() { return true; }
void C_4JProfile::SetSignInChangeCallback(void(*Func)(LPVOID, bool, unsigned int), LPVOID lpParam) {} void C_4JProfile::SetSignInChangeCallback(void(*Func)(LPVOID, bool, unsigned int), LPVOID lpParam) {}
void C_4JProfile::SetNotificationsCallback(void(*Func)(LPVOID, DWORD, unsigned int), LPVOID lpParam) {} void C_4JProfile::SetNotificationsCallback(void(*Func)(LPVOID, DWORD, unsigned int), LPVOID lpParam) {}

View file

@ -76,7 +76,7 @@ public:
int GetPrimaryPad(); int GetPrimaryPad();
void SetPrimaryPad(int iPad); void SetPrimaryPad(int iPad);
char* GetGamertag(int iPad); char* GetGamertag(int iPad);
wstring GetDisplayName(int iPad); std::wstring GetDisplayName(int iPad);
bool IsFullVersion(); bool IsFullVersion();
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);

View file

@ -322,7 +322,7 @@ public:
C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0);
// C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0);
// C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0);
// bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename);
// unsigned int CRC(unsigned char *buf, int len); // unsigned int CRC(unsigned char *buf, int len);
// enum eXBLWS // enum eXBLWS

View file

@ -164,8 +164,8 @@ typedef struct
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
wstring wsProductId; std::wstring wsProductId;
wstring wsDisplayName; std::wstring wsDisplayName;
// add a store for the local DLC image // add a store for the local DLC image
PBYTE pbImageData; PBYTE pbImageData;
@ -224,4 +224,4 @@ typedef struct _TMSPPRequest
} }
TMSPPRequest; TMSPPRequest;
typedef pair<EUIScene, HXUIOBJ> SceneStackPair; typedef std::pair<EUIScene, HXUIOBJ> SceneStackPair;

View file

@ -46,19 +46,19 @@ class ConsoleSoundEngine
public: public:
ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){}; ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){};
virtual void tick(shared_ptr<Mob> *players, float a) =0; virtual void tick(std::shared_ptr<Mob> *players, float a) =0;
virtual void destroy()=0; virtual void destroy()=0;
virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0; virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0;
virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0; virtual void playStreaming(const std::wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0;
virtual void playUI(int iSound, float volume, float pitch) =0; virtual void playUI(int iSound, float volume, float pitch) =0;
virtual void updateMusicVolume(float fVal) =0; virtual void updateMusicVolume(float fVal) =0;
virtual void updateSystemMusicPlaying(bool isPlaying) = 0; virtual void updateSystemMusicPlaying(bool isPlaying) = 0;
virtual void updateSoundEffectVolume(float fVal) =0; virtual void updateSoundEffectVolume(float fVal) =0;
virtual void init(Options *) =0 ; virtual void init(Options *) =0 ;
virtual void add(const wstring& name, File *file) =0; virtual void add(const std::wstring& name, File *file) =0;
virtual void addMusic(const wstring& name, File *file) =0; virtual void addMusic(const std::wstring& name, File *file) =0;
virtual void addStreaming(const wstring& name, File *file) =0; virtual void addStreaming(const std::wstring& name, File *file) =0;
virtual char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) =0; virtual char *ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces) =0;
virtual void playMusicTick() =0; virtual void playMusicTick() =0;
virtual bool GetIsPlayingStreamingCDMusic() ; virtual bool GetIsPlayingStreamingCDMusic() ;

View file

@ -32,7 +32,7 @@ void SoundEngine::init(Options *pOptions)
{ {
} }
void SoundEngine::tick(shared_ptr<Mob> *players, float a) void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
{ {
} }
void SoundEngine::destroy() {} void SoundEngine::destroy() {}
@ -40,16 +40,16 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
{ {
app.DebugPrintf("PlaySound - %d\n",iSound); app.DebugPrintf("PlaySound - %d\n",iSound);
} }
void SoundEngine::playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay) {} void SoundEngine::playStreaming(const std::wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay) {}
void SoundEngine::playUI(int iSound, float volume, float pitch) {} void SoundEngine::playUI(int iSound, float volume, float pitch) {}
void SoundEngine::updateMusicVolume(float fVal) {} void SoundEngine::updateMusicVolume(float fVal) {}
void SoundEngine::updateSoundEffectVolume(float fVal) {} void SoundEngine::updateSoundEffectVolume(float fVal) {}
void SoundEngine::add(const wstring& name, File *file) {} void SoundEngine::add(const std::wstring& name, File *file) {}
void SoundEngine::addMusic(const wstring& name, File *file) {} void SoundEngine::addMusic(const std::wstring& name, File *file) {}
void SoundEngine::addStreaming(const wstring& name, File *file) {} void SoundEngine::addStreaming(const std::wstring& name, File *file) {}
char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) { return NULL; } char *SoundEngine::ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces) { return NULL; }
bool SoundEngine::isStreamingWavebankReady() { return true; } bool SoundEngine::isStreamingWavebankReady() { return true; }
void SoundEngine::playMusicTick() {}; void SoundEngine::playMusicTick() {};
void SoundEngine::SetStreamingSounds(int, int, int, int, int, int, int) {} void SoundEngine::SetStreamingSounds(int, int, int, int, int, int, int) {}
@ -631,7 +631,7 @@ static float fVal=0.0f;
static S32 running = AIL_ms_count(); static S32 running = AIL_ms_count();
#endif #endif
void SoundEngine::tick(shared_ptr<Mob> *players, float a) void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
{ {
#ifdef __DISABLE_MILES__ #ifdef __DISABLE_MILES__
return; return;
@ -749,7 +749,7 @@ void SoundEngine::destroy() {}
void SoundEngine::GetSoundName(char *szSoundName,int iSound) void SoundEngine::GetSoundName(char *szSoundName,int iSound)
{ {
strcpy((char *)szSoundName,"Minecraft/"); strcpy((char *)szSoundName,"Minecraft/");
wstring name = wchSoundNames[iSound]; std::wstring name = wchSoundNames[iSound];
char *SoundName = (char *)ConvertSoundPathToName(name); char *SoundName = (char *)ConvertSoundPathToName(name);
strcat((char *)szSoundName,SoundName); strcat((char *)szSoundName,SoundName);
} }
@ -774,7 +774,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
/* // if we are already playing loads of this sounds ignore this one /* // if we are already playing loads of this sounds ignore this one
if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING) if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING)
{ {
// wstring name = wchSoundNames[iSound]; // std::wstring name = wchSoundNames[iSound];
// char *SoundName = (char *)ConvertSoundPathToName(name); // char *SoundName = (char *)ConvertSoundPathToName(name);
// app.DebugPrintf("Too many %s sounds playing!\n",SoundName); // app.DebugPrintf("Too many %s sounds playing!\n",SoundName);
return; return;
@ -786,9 +786,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
strcpy((char *)szSoundName,"Minecraft/"); strcpy((char *)szSoundName,"Minecraft/");
#ifdef DISTORTION_TEST #ifdef DISTORTION_TEST
wstring name = wchSoundNames[eSoundType_MOB_ENDERDRAGON_GROWL]; std::wstring name = wchSoundNames[eSoundType_MOB_ENDERDRAGON_GROWL];
#else #else
wstring name = wchSoundNames[iSound]; std::wstring name = wchSoundNames[iSound];
#endif #endif
char *SoundName = (char *)ConvertSoundPathToName(name); char *SoundName = (char *)ConvertSoundPathToName(name);
@ -822,7 +822,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
void SoundEngine::playUI(int iSound, float volume, float pitch) void SoundEngine::playUI(int iSound, float volume, float pitch)
{ {
U8 szSoundName[256]; U8 szSoundName[256];
wstring name; std::wstring name;
// we have some game sounds played as UI sounds... // we have some game sounds played as UI sounds...
// Not the best way to do this, but it seems to only be the portal sounds // Not the best way to do this, but it seems to only be the portal sounds
@ -881,7 +881,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
// playStreaming // playStreaming
// //
///////////////////////////////////////////// /////////////////////////////////////////////
void SoundEngine::playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay) void SoundEngine::playStreaming(const std::wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay)
{ {
// This function doesn't actually play a streaming sound, just sets states and an id for the music tick to play it // This function doesn't actually play a streaming sound, just sets states and an id for the music tick to play it
// Level audio will be played when a play with an empty name comes in // Level audio will be played when a play with an empty name comes in
@ -1059,7 +1059,7 @@ int SoundEngine::getMusicID(int iDomain)
// //
///////////////////////////////////////////// /////////////////////////////////////////////
// check what the CD is // check what the CD is
int SoundEngine::getMusicID(const wstring& name) int SoundEngine::getMusicID(const std::wstring& name)
{ {
int iCD=0; int iCD=0;
char *SoundName = (char *)ConvertSoundPathToName(name,true); char *SoundName = (char *)ConvertSoundPathToName(name,true);
@ -1126,9 +1126,9 @@ void SoundEngine::updateSoundEffectVolume(float fVal)
//AIL_set_variable_float(0,"UserEffectVol",fVal); //AIL_set_variable_float(0,"UserEffectVol",fVal);
} }
void SoundEngine::add(const wstring& name, File *file) {} void SoundEngine::add(const std::wstring& name, File *file) {}
void SoundEngine::addMusic(const wstring& name, File *file) {} void SoundEngine::addMusic(const std::wstring& name, File *file) {}
void SoundEngine::addStreaming(const wstring& name, File *file) {} void SoundEngine::addStreaming(const std::wstring& name, File *file) {}
bool SoundEngine::isStreamingWavebankReady() { return true; } bool SoundEngine::isStreamingWavebankReady() { return true; }
int SoundEngine::OpenStreamThreadProc( void* lpParameter ) int SoundEngine::OpenStreamThreadProc( void* lpParameter )
@ -1225,16 +1225,16 @@ void SoundEngine::playMusicUpdate()
m_StreamingAudioInfo.bIs3D=false; m_StreamingAudioInfo.bIs3D=false;
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID); std::wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
wstring wstrFile=L"TPACK:\\Data\\" + wstrSoundName +L".binka"; std::wstring wstrFile=L"TPACK:\\Data\\" + wstrSoundName +L".binka";
std::wstring mountedPath = StorageManager.GetMountedPath(wstrFile); std::wstring mountedPath = StorageManager.GetMountedPath(wstrFile);
wcstombs(m_szStreamName,mountedPath.c_str(),255); wcstombs(m_szStreamName,mountedPath.c_str(),255);
#else #else
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID); std::wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
char szName[255]; char szName[255];
wcstombs(szName,wstrSoundName.c_str(),255); wcstombs(szName,wstrSoundName.c_str(),255);
string strFile="TPACK:\\Data\\" + string(szName) + ".binka"; std::string strFile="TPACK:\\Data\\" + string(szName) + ".binka";
std::string mountedPath = StorageManager.GetMountedPath(strFile); std::string mountedPath = StorageManager.GetMountedPath(strFile);
strcpy(m_szStreamName,mountedPath.c_str()); strcpy(m_szStreamName,mountedPath.c_str());
#endif #endif
@ -1323,7 +1323,7 @@ void SoundEngine::playMusicUpdate()
#endif #endif
} }
// wstring name = m_szStreamFileA[m_musicID]; // std::wstring name = m_szStreamFileA[m_musicID];
// char *SoundName = (char *)ConvertSoundPathToName(name); // char *SoundName = (char *)ConvertSoundPathToName(name);
// strcat((char *)szStreamName,SoundName); // strcat((char *)szStreamName,SoundName);
@ -1632,7 +1632,7 @@ void SoundEngine::playMusicUpdate()
// ConvertSoundPathToName // ConvertSoundPathToName
// //
///////////////////////////////////////////// /////////////////////////////////////////////
char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) char *SoundEngine::ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces)
{ {
static char buf[256]; static char buf[256];
assert(name.length()<256); assert(name.length()<256);

View file

@ -1,7 +1,7 @@
#pragma once #pragma once
class Mob; class Mob;
class Options; class Options;
using namespace std; //using namespace std;
#include "../../../../Minecraft.World/Util/SoundTypes.h" #include "../../../../Minecraft.World/Util/SoundTypes.h"
enum eMUSICFILES enum eMUSICFILES
@ -96,21 +96,21 @@ public:
void GetSoundName(char *szSoundName,int iSound); void GetSoundName(char *szSoundName,int iSound);
#endif #endif
virtual void play(int iSound, float x, float y, float z, float volume, float pitch); virtual void play(int iSound, float x, float y, float z, float volume, float pitch);
virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true); virtual void playStreaming(const std::wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true);
virtual void playUI(int iSound, float volume, float pitch); virtual void playUI(int iSound, float volume, float pitch);
virtual void playMusicTick(); virtual void playMusicTick();
virtual void updateMusicVolume(float fVal); virtual void updateMusicVolume(float fVal);
virtual void updateSystemMusicPlaying(bool isPlaying); virtual void updateSystemMusicPlaying(bool isPlaying);
virtual void updateSoundEffectVolume(float fVal); virtual void updateSoundEffectVolume(float fVal);
virtual void init(Options *); virtual void init(Options *);
virtual void tick(shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one virtual void tick(std::shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one
virtual void add(const wstring& name, File *file); virtual void add(const std::wstring& name, File *file);
virtual void addMusic(const wstring& name, File *file); virtual void addMusic(const std::wstring& name, File *file);
virtual void addStreaming(const wstring& name, File *file); virtual void addStreaming(const std::wstring& name, File *file);
virtual char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces=false); virtual char *ConvertSoundPathToName(const std::wstring& name, bool bConvertSpaces=false);
bool isStreamingWavebankReady(); // 4J Added bool isStreamingWavebankReady(); // 4J Added
int getMusicID(int iDomain); int getMusicID(int iDomain);
int getMusicID(const wstring& name); int getMusicID(const std::wstring& name);
void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1); void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1);
void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback
void playMusicUpdate(); void playMusicUpdate();
@ -145,7 +145,7 @@ private:
int m_StreamState; int m_StreamState;
int m_MusicType; int m_MusicType;
AUDIO_INFO m_StreamingAudioInfo; AUDIO_INFO m_StreamingAudioInfo;
wstring m_CDMusic; std::wstring m_CDMusic;
BOOL m_bSystemMusicPlaying; BOOL m_bSystemMusicPlaying;
float m_MasterMusicVolume; float m_MasterMusicVolume;
float m_MasterEffectsVolume; float m_MasterEffectsVolume;

View file

@ -91,7 +91,7 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
L"ambient.cave.cave2", // eSoundType_CAVE_CAVE2 - removed the two sounds that were at 192k in the first ambient cave event L"ambient.cave.cave2", // eSoundType_CAVE_CAVE2 - removed the two sounds that were at 192k in the first ambient cave event
#endif #endif
L"portal.portal", // eSoundType_PORTAL_PORTAL, L"portal.portal", // eSoundType_PORTAL_PORTAL,
// 4J-PB - added a couple that were still using wstring // 4J-PB - added a couple that were still using std::wstring
L"portal.trigger", // eSoundType_PORTAL_TRIGGER L"portal.trigger", // eSoundType_PORTAL_TRIGGER
L"portal.travel", // eSoundType_PORTAL_TRAVEL L"portal.travel", // eSoundType_PORTAL_TRAVEL

View file

@ -2,7 +2,7 @@
#include "ColourTable.h" #include "ColourTable.h"
#include "../../../../Minecraft.World/Util/StringHelpers.h" #include "../../../../Minecraft.World/Util/StringHelpers.h"
unordered_map<wstring,eMinecraftColour> ColourTable::s_colourNamesMap; std::unordered_map<std::wstring,eMinecraftColour> ColourTable::s_colourNamesMap;
const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
{ {
@ -310,7 +310,7 @@ void ColourTable::staticCtor()
{ {
for(unsigned int i = eMinecraftColour_NOT_SET; i < eMinecraftColour_COUNT; ++i) for(unsigned int i = eMinecraftColour_NOT_SET; i < eMinecraftColour_COUNT; ++i)
{ {
s_colourNamesMap.insert( unordered_map<wstring,eMinecraftColour>::value_type( ColourTableElements[i], (eMinecraftColour)i) ); s_colourNamesMap.insert( std::unordered_map<std::wstring,eMinecraftColour>::value_type( ColourTableElements[i], (eMinecraftColour)i) );
} }
} }
@ -337,7 +337,7 @@ void ColourTable::loadColoursFromData(PBYTE pbData, DWORD dwLength)
for(int i = 0; i < coloursCount; ++i) for(int i = 0; i < coloursCount; ++i)
{ {
wstring colourId = dis.readUTF(); std::wstring colourId = dis.readUTF();
int colourValue = dis.readInt(); int colourValue = dis.readInt();
setColour(colourId, colourValue); setColour(colourId, colourValue);
AUTO_VAR(it,s_colourNamesMap.find(colourId)); AUTO_VAR(it,s_colourNamesMap.find(colourId));
@ -346,7 +346,7 @@ void ColourTable::loadColoursFromData(PBYTE pbData, DWORD dwLength)
bais.reset(); bais.reset();
} }
void ColourTable::setColour(const wstring &colourName, int value) void ColourTable::setColour(const std::wstring &colourName, int value)
{ {
AUTO_VAR(it,s_colourNamesMap.find(colourName)); AUTO_VAR(it,s_colourNamesMap.find(colourName));
if(it != s_colourNamesMap.end()) if(it != s_colourNamesMap.end())
@ -355,7 +355,7 @@ void ColourTable::setColour(const wstring &colourName, int value)
} }
} }
void ColourTable::setColour(const wstring &colourName, const wstring &value) void ColourTable::setColour(const std::wstring &colourName, const std::wstring &value)
{ {
setColour(colourName, _fromHEXString<int>(value)); setColour(colourName, _fromHEXString<int>(value));
} }

View file

@ -6,7 +6,7 @@ private:
unsigned int m_colourValues[eMinecraftColour_COUNT]; unsigned int m_colourValues[eMinecraftColour_COUNT];
static const wchar_t *ColourTableElements[eMinecraftColour_COUNT]; static const wchar_t *ColourTableElements[eMinecraftColour_COUNT];
static unordered_map<wstring,eMinecraftColour> s_colourNamesMap; static std::unordered_map<std::wstring,eMinecraftColour> s_colourNamesMap;
public: public:
static void staticCtor(); static void staticCtor();
@ -18,6 +18,6 @@ public:
unsigned int getColor(eMinecraftColour id) { return getColour(id); } unsigned int getColor(eMinecraftColour id) { return getColour(id); }
void loadColoursFromData(PBYTE pbData, DWORD dwLength); void loadColoursFromData(PBYTE pbData, DWORD dwLength);
void setColour(const wstring &colourName, int value); void setColour(const std::wstring &colourName, int value);
void setColour(const wstring &colourName, const wstring &value); void setColour(const std::wstring &colourName, const std::wstring &value);
}; };

View file

@ -213,7 +213,7 @@ CMinecraftApp::CMinecraftApp()
for(int i=0;i<XUSER_MAX_COUNT;i++) for(int i=0;i<XUSER_MAX_COUNT;i++)
{ {
m_vBannedListA[i] = new vector<PBANNEDLISTDATA>; m_vBannedListA[i] = new std::vector<PBANNEDLISTDATA>;
} }
LocaleAndLanguageInit(); LocaleAndLanguageInit();
@ -316,7 +316,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad)
// ProfileManager.WriteToProfile(iPad,true); // ProfileManager.WriteToProfile(iPad,true);
} }
bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack) bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack)
{ {
bool success = true; bool success = true;
@ -339,7 +339,7 @@ bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bo
return success; return success;
} }
bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack) bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack)
{ {
bool success = true; bool success = true;
@ -362,7 +362,7 @@ bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,boo
return success; return success;
} }
bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player) bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player)
{ {
bool success = true; bool success = true;
@ -388,7 +388,7 @@ bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player)
return success; return success;
} }
bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z) bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z)
{ {
bool success = true; bool success = true;
@ -414,7 +414,7 @@ bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player,
return success; return success;
} }
bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level) bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level)
{ {
bool success = true; bool success = true;
@ -440,7 +440,7 @@ bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory,
return success; return success;
} }
bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace) bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace)
{ {
bool success = true; bool success = true;
@ -465,7 +465,7 @@ bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, sh
return success; return success;
} }
bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand) bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand)
{ {
bool success = true; bool success = true;
@ -491,7 +491,7 @@ bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventor
} }
bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container) bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container)
{ {
bool success = true; bool success = true;
@ -525,7 +525,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr<Container> inventory,
return success; return success;
} }
bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap) bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap)
{ {
bool success = true; bool success = true;
@ -550,7 +550,7 @@ bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr<Container> inventory, share
return success; return success;
} }
bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign) bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign)
{ {
bool success = true; bool success = true;
@ -566,7 +566,7 @@ bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign)
return success; return success;
} }
bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z) bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z)
{ {
bool success = true; bool success = true;
@ -585,7 +585,7 @@ bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory,
return success; return success;
} }
bool CMinecraftApp::LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level) bool CMinecraftApp::LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level)
{ {
bool success = true; bool success = true;
@ -1223,7 +1223,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); PlayerList *players = MinecraftServer::getInstance()->getPlayerList();
for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3)
{ {
shared_ptr<ServerPlayer> decorationPlayer = *it3; std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false); decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false);
} }
} }
@ -1328,7 +1328,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
} }
} }
void CMinecraftApp::SetPlayerSkin(int iPad,const wstring &name) void CMinecraftApp::SetPlayerSkin(int iPad,const std::wstring &name)
{ {
DWORD skinId = app.getSkinIdFromPath(name); DWORD skinId = app.getSkinIdFromPath(name);
@ -1348,7 +1348,7 @@ void CMinecraftApp::SetPlayerSkin(int iPad,DWORD dwSkinId)
} }
wstring CMinecraftApp::GetPlayerSkinName(int iPad) std::wstring CMinecraftApp::GetPlayerSkinName(int iPad)
{ {
return app.getSkinPathFromId(GameSettingsA[iPad]->dwSelectedSkin); return app.getSkinPathFromId(GameSettingsA[iPad]->dwSelectedSkin);
} }
@ -1396,7 +1396,7 @@ DWORD CMinecraftApp::GetPlayerSkinId(int iPad)
} }
void CMinecraftApp::SetPlayerCape(int iPad,const wstring &name) void CMinecraftApp::SetPlayerCape(int iPad,const std::wstring &name)
{ {
DWORD capeId = Player::getCapeIdFromPath(name); DWORD capeId = Player::getCapeIdFromPath(name);
@ -1415,7 +1415,7 @@ void CMinecraftApp::SetPlayerCape(int iPad,DWORD dwCapeId)
if(Minecraft::GetInstance()->localplayers[iPad]!=NULL) Minecraft::GetInstance()->localplayers[iPad]->setAndBroadcastCustomCape(dwCapeId); if(Minecraft::GetInstance()->localplayers[iPad]!=NULL) Minecraft::GetInstance()->localplayers[iPad]->setAndBroadcastCustomCape(dwCapeId);
} }
wstring CMinecraftApp::GetPlayerCapeName(int iPad) std::wstring CMinecraftApp::GetPlayerCapeName(int iPad)
{ {
return Player::getCapePathFromId(GameSettingsA[iPad]->dwSelectedCape); return Player::getCapePathFromId(GameSettingsA[iPad]->dwSelectedCape);
} }
@ -2191,7 +2191,7 @@ unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlay
} }
if(iPad < 0) iPad = 0; if(iPad < 0) iPad = 0;
shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad]; std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
if(bOverridePlayer || player==NULL) if(bOverridePlayer || player==NULL)
{ {
@ -2211,7 +2211,7 @@ void CMinecraftApp::SetGameSettingsDebugMask(int iPad, unsigned int uiVal)
GameSettingsA[iPad]->uiDebugBitmask=uiVal; GameSettingsA[iPad]->uiDebugBitmask=uiVal;
// update the value so the network server can use it // update the value so the network server can use it
shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad]; std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
if(player) if(player)
{ {
@ -2378,7 +2378,7 @@ void CMinecraftApp::HandleXuiActions(void)
eTMSAction eTMS; eTMSAction eTMS;
LPVOID param; LPVOID param;
Minecraft *pMinecraft=Minecraft::GetInstance(); Minecraft *pMinecraft=Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player; std::shared_ptr<MultiplayerLocalPlayer> player;
// are there any global actions to deal with? // are there any global actions to deal with?
eAction = app.GetGlobalXuiAction(); eAction = app.GetGlobalXuiAction();
@ -4032,7 +4032,7 @@ int CMinecraftApp::BannedLevelDialogReturned(void *pParam,int iPad,const C4JStor
void CMinecraftApp::loadMediaArchive() void CMinecraftApp::loadMediaArchive()
{ {
wstring mediapath = L""; std::wstring mediapath = L"";
#ifdef __PS3__ #ifdef __PS3__
mediapath = L"Common\\Media\\MediaPS3.arc"; mediapath = L"Common\\Media\\MediaPS3.arc";
@ -4053,7 +4053,7 @@ void CMinecraftApp::loadMediaArchive()
m_mediaArchive = new ArchiveFile( File(mediapath) ); m_mediaArchive = new ArchiveFile( File(mediapath) );
} }
#if 0 #if 0
string path = "Common\\media.arc"; std::string path = "Common\\media.arc";
HANDLE hFile = CreateFile( path.c_str(), HANDLE hFile = CreateFile( path.c_str(),
GENERIC_READ, GENERIC_READ,
FILE_SHARE_READ, FILE_SHARE_READ,
@ -4102,7 +4102,7 @@ void CMinecraftApp::loadStringTable()
// we need to unload the current string table, this is a reload // we need to unload the current string table, this is a reload
delete m_stringTable; delete m_stringTable;
} }
wstring localisationFile = L"languages.loc"; std::wstring localisationFile = L"languages.loc";
if (m_mediaArchive->hasFile(localisationFile)) if (m_mediaArchive->hasFile(localisationFile))
{ {
byteArray locFile = m_mediaArchive->getFile(localisationFile); byteArray locFile = m_mediaArchive->getFile(localisationFile);
@ -5146,7 +5146,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d
// // we only attempt to install the cape once per launch of the game // // we only attempt to install the cape once per launch of the game
// m_bDefaultCapeInstallAttempted=true; // m_bDefaultCapeInstallAttempted=true;
// //
// wstring wTemp=L"Default_Cape.png"; // std::wstring wTemp=L"Default_Cape.png";
// bool bRes=app.IsFileInMemoryTextures(wTemp); // bool bRes=app.IsFileInMemoryTextures(wTemp);
// // if the file is not already in the memory textures, then read it from TMS // // if the file is not already in the memory textures, then read it from TMS
// if(!bRes) // if(!bRes)
@ -5210,7 +5210,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d
DWORD dwPackID=m_dlcManager.retrievePackIDFromDLCDataFile(szFullFilename,pack); DWORD dwPackID=m_dlcManager.retrievePackIDFromDLCDataFile(szFullFilename,pack);
// Do we need to override the TexturePack.pck with an updated version in a TU? // Do we need to override the TexturePack.pck with an updated version in a TU?
wstring wsTemp=getFilePath(dwPackID, wstring(L"TexturePack.pck"),false ); std::wstring wsTemp=getFilePath(dwPackID, std::wstring(L"TexturePack.pck"),false );
File texturePCKPath(wsTemp ); File texturePCKPath(wsTemp );
if(texturePCKPath.exists()) if(texturePCKPath.exists())
{ {
@ -5314,7 +5314,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid)
return false; return false;
} }
void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName,PBYTE pbData,DWORD dwBytes)
{ {
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
// check it's not already in // check it's not already in
@ -5360,7 +5360,7 @@ void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD
LeaveCriticalSection(&csMemFilesLock); LeaveCriticalSection(&csMemFilesLock);
} }
void CMinecraftApp::RemoveMemoryTextureFile(const wstring &wName) void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring &wName)
{ {
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
@ -5386,7 +5386,7 @@ void CMinecraftApp::RemoveMemoryTextureFile(const wstring &wName)
bool CMinecraftApp::DefaultCapeExists() bool CMinecraftApp::DefaultCapeExists()
{ {
wstring wTex=L"Special_Cape.png"; std::wstring wTex=L"Special_Cape.png";
bool val = false; bool val = false;
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
@ -5397,7 +5397,7 @@ bool CMinecraftApp::DefaultCapeExists()
return val; return val;
} }
bool CMinecraftApp::IsFileInMemoryTextures(const wstring &wName) bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring &wName)
{ {
bool val = false; bool val = false;
@ -5409,7 +5409,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const wstring &wName)
return val; return val;
} }
void CMinecraftApp::GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD *pdwBytes) void CMinecraftApp::GetMemFileDetails(const std::wstring &wName,PBYTE *ppbData,DWORD *pdwBytes)
{ {
EnterCriticalSection(&csMemFilesLock); EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName)); AUTO_VAR(it, m_MEM_Files.find(wName));
@ -5525,7 +5525,7 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes)
} }
// bool CMinecraftApp::UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, wstring *wsFile ) // bool CMinecraftApp::UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile )
// { // {
// bool bRes=false; // bool bRes=false;
// #ifndef _CONTENT_PACKAGE // #ifndef _CONTENT_PACKAGE
@ -5971,9 +5971,9 @@ int CMinecraftApp::GetHTMLFontSize(EHTMLFontSize size)
return s_iHTMLFontSizesA[size]; return s_iHTMLFontSizesA[size];
} }
wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shadowColour /*= 0xFFFFFFFF*/) std::wstring CMinecraftApp::FormatHTMLString(int iPad, const std::wstring &desc, int shadowColour /*= 0xFFFFFFFF*/)
{ {
wstring text(desc); std::wstring text(desc);
wchar_t replacements[64]; wchar_t replacements[64];
// We will also insert line breaks here as couldn't figure out how to get them to come through from strings.resx ! // We will also insert line breaks here as couldn't figure out how to get them to come through from strings.resx !
@ -6071,7 +6071,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
#endif #endif
#ifdef _XBOX #ifdef _XBOX
wstring imageRoot = L""; std::wstring imageRoot = L"";
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
imageRoot = pMinecraft->skins->getSelected()->getXuiRootPath(); imageRoot = pMinecraft->skins->getSelected()->getXuiRootPath();
@ -6093,7 +6093,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
return text; return text;
} }
wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction) std::wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
{ {
unsigned int input = InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad) ,ucAction); unsigned int input = InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad) ,ucAction);
@ -6145,7 +6145,7 @@ wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
}; };
return L""; return L"";
#else #else
wstring replacement = L""; std::wstring replacement = L"";
// 4J Stu - Some of our actions can be mapped to multiple physical buttons, so replaces the switch that was here // 4J Stu - Some of our actions can be mapped to multiple physical buttons, so replaces the switch that was here
if (input & _360_JOY_BUTTON_A) replacement = L"ButtonA"; if (input & _360_JOY_BUTTON_A) replacement = L"ButtonA";
@ -6200,7 +6200,7 @@ wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
#endif #endif
} }
wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey) std::wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
{ {
#ifdef _XBOX #ifdef _XBOX
switch(uiVKey) switch(uiVKey)
@ -6244,7 +6244,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
} }
return NULL; return NULL;
#else #else
wstring replacement = L""; std::wstring replacement = L"";
switch(uiVKey) switch(uiVKey)
{ {
case VK_PAD_A: case VK_PAD_A:
@ -6329,7 +6329,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
#endif #endif
} }
wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon) std::wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
{ {
#ifdef _XBOX #ifdef _XBOX
switch(uiIcon) switch(uiIcon)
@ -6355,7 +6355,7 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
#endif #endif
swprintf(string,128,L"<img src=\"Icon_Shank\" align=\"middle\" height=\"%d\" width=\"%d\"/>", size, size); swprintf(string,128,L"<img src=\"Icon_Shank\" align=\"middle\" height=\"%d\" width=\"%d\"/>", size, size);
wstring result = L""; std::wstring result = L"";
switch(uiIcon) switch(uiIcon)
{ {
case XZP_ICON_SHANK_01: case XZP_ICON_SHANK_01:
@ -6372,22 +6372,22 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
} }
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData; std::unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData;
unordered_map<int, char * > CMinecraftApp::DLCTextures_PackID; std::unordered_map<int, char * > CMinecraftApp::DLCTextures_PackID;
unordered_map<string, DLC_INFO * > CMinecraftApp::DLCInfo; std::unordered_map<string, DLC_INFO * > CMinecraftApp::DLCInfo;
unordered_map<wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName; std::unordered_map<std::wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName;
#elif defined(_DURANGO) #elif defined(_DURANGO)
unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > CMinecraftApp::MojangData; std::unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > CMinecraftApp::MojangData;
unordered_map<int, wstring > CMinecraftApp::DLCTextures_PackID; // for mash-up packs & texture packs std::unordered_map<int, std::wstring > CMinecraftApp::DLCTextures_PackID; // for mash-up packs & texture packs
//unordered_map<ULONGLONG,DLC_INFO * > CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info //std::unordered_map<ULONGLONG,DLC_INFO * > CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info
unordered_map<wstring,DLC_INFO * > CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info std::unordered_map<std::wstring,DLC_INFO * > CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info
unordered_map<wstring, wstring > CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id std::unordered_map<std::wstring, std::wstring > CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id
#else #else
unordered_map<PlayerUID, MOJANG_DATA *> CMinecraftApp::MojangData; std::unordered_map<PlayerUID, MOJANG_DATA *> CMinecraftApp::MojangData;
unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID; std::unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID;
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Trial; std::unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Trial;
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Full; std::unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Full;
unordered_map<wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName; std::unordered_map<std::wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName;
#endif #endif
@ -6530,7 +6530,7 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGe
} }
#elif defined _XBOX_ONE #elif defined _XBOX_ONE
unordered_map<wstring,DLC_INFO * > *CMinecraftApp::GetDLCInfo() std::unordered_map<std::wstring,DLC_INFO * > *CMinecraftApp::GetDLCInfo()
{ {
return &DLCInfo_Full; return &DLCInfo_Full;
} }
@ -6549,7 +6549,7 @@ HRESULT CMinecraftApp::RegisterDLCData(eDLCContentType eType, WCHAR *pwchBannerN
} }
// check if we already have this info from the local DLC file // check if we already have this info from the local DLC file
wstring wsTemp=wchUppercaseProductID; std::wstring wsTemp=wchUppercaseProductID;
AUTO_VAR(it, DLCInfo_Full.find(wsTemp)); AUTO_VAR(it, DLCInfo_Full.find(wsTemp));
if( it == DLCInfo_Full.end() ) if( it == DLCInfo_Full.end() )
@ -6662,7 +6662,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal) bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,ULONGLONG *pullVal)
{ {
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
if( it == DLCInfo_SkinName.end() ) if( it == DLCInfo_SkinName.end() )
@ -6691,7 +6691,7 @@ bool CMinecraftApp::GetDLCNameForPackID(const int iPackID,char **ppchKeyID)
} }
DLC_INFO *CMinecraftApp::GetDLCInfo(char *pchDLCName) DLC_INFO *CMinecraftApp::GetDLCInfo(char *pchDLCName)
{ {
string tempString=pchDLCName; std::string tempString=pchDLCName;
if(DLCInfo.size()>0) if(DLCInfo.size()>0)
{ {
@ -6712,7 +6712,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfo(char *pchDLCName)
DLC_INFO *CMinecraftApp::GetDLCInfoFromTPackID(int iTPID) DLC_INFO *CMinecraftApp::GetDLCInfoFromTPackID(int iTPID)
{ {
unordered_map<string, DLC_INFO *>::iterator it= DLCInfo.begin(); std::unordered_map<string, DLC_INFO *>::iterator it= DLCInfo.begin();
for(int i=0;i<DLCInfo.size();i++) for(int i=0;i<DLCInfo.size();i++)
{ {
@ -6727,7 +6727,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoFromTPackID(int iTPID)
DLC_INFO *CMinecraftApp::GetDLCInfo(int iIndex) DLC_INFO *CMinecraftApp::GetDLCInfo(int iIndex)
{ {
unordered_map<string, DLC_INFO *>::iterator it= DLCInfo.begin(); std::unordered_map<string, DLC_INFO *>::iterator it= DLCInfo.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6739,7 +6739,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfo(int iIndex)
char *CMinecraftApp::GetDLCInfoTextures(int iIndex) char *CMinecraftApp::GetDLCInfoTextures(int iIndex)
{ {
unordered_map<int, char * >::iterator it= DLCTextures_PackID.begin(); std::unordered_map<int, char * >::iterator it= DLCTextures_PackID.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6750,7 +6750,7 @@ char *CMinecraftApp::GetDLCInfoTextures(int iIndex)
} }
#elif defined _XBOX_ONE #elif defined _XBOX_ONE
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring &ProductId) bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,std::wstring &ProductId)
{ {
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
if( it == DLCInfo_SkinName.end() ) if( it == DLCInfo_SkinName.end() )
@ -6763,7 +6763,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring
return true; return true;
} }
} }
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,wstring &ProductId) bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,std::wstring &ProductId)
{ {
AUTO_VAR(it, DLCTextures_PackID.find(iPackID)); AUTO_VAR(it, DLCTextures_PackID.find(iPackID));
if( it == DLCTextures_PackID.end() ) if( it == DLCTextures_PackID.end() )
@ -6776,7 +6776,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,wstring &Produc
return true; return true;
} }
} }
// DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(wstring &ProductId) // DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(std::wstring &ProductId)
// { // {
// return NULL; // return NULL;
// } // }
@ -6787,7 +6787,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoTrialOffer(int iIndex)
} }
DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex) DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex)
{ {
unordered_map<wstring, DLC_INFO *>::iterator it= DLCInfo_Full.begin(); std::unordered_map<std::wstring, DLC_INFO *>::iterator it= DLCInfo_Full.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6796,9 +6796,9 @@ DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex)
return it->second; return it->second;
} }
wstring CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) std::wstring CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex)
{ {
unordered_map<int, wstring >::iterator it= DLCTextures_PackID.begin(); std::unordered_map<int, std::wstring >::iterator it= DLCTextures_PackID.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6808,7 +6808,7 @@ wstring CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex)
return it->second; return it->second;
} }
#else #else
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal) bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,ULONGLONG *pullVal)
{ {
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
if( it == DLCInfo_SkinName.end() ) if( it == DLCInfo_SkinName.end() )
@ -6857,7 +6857,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial)
DLC_INFO *CMinecraftApp::GetDLCInfoTrialOffer(int iIndex) DLC_INFO *CMinecraftApp::GetDLCInfoTrialOffer(int iIndex)
{ {
unordered_map<ULONGLONG, DLC_INFO *>::iterator it= DLCInfo_Trial.begin(); std::unordered_map<ULONGLONG, DLC_INFO *>::iterator it= DLCInfo_Trial.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6868,7 +6868,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoTrialOffer(int iIndex)
} }
DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex) DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex)
{ {
unordered_map<ULONGLONG, DLC_INFO *>::iterator it= DLCInfo_Full.begin(); std::unordered_map<ULONGLONG, DLC_INFO *>::iterator it= DLCInfo_Full.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6879,7 +6879,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoFullOffer(int iIndex)
} }
ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex)
{ {
unordered_map<int, ULONGLONG >::iterator it= DLCTextures_PackID.begin(); std::unordered_map<int, ULONGLONG >::iterator it= DLCTextures_PackID.begin();
for(int i=0;i<iIndex;i++) for(int i=0;i<iIndex;i++)
{ {
@ -6894,7 +6894,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex)
DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID) DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID)
{ {
wstring wsTemp = pwchProductID; std::wstring wsTemp = pwchProductID;
if(DLCInfo_Full.size()>0) if(DLCInfo_Full.size()>0)
{ {
AUTO_VAR(it, DLCInfo_Full.find(wsTemp)); AUTO_VAR(it, DLCInfo_Full.find(wsTemp));
@ -6913,8 +6913,8 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID)
} }
DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName) DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName)
{ {
unordered_map<wstring, DLC_INFO *>::iterator it= DLCInfo_Full.begin(); std::unordered_map<std::wstring, DLC_INFO *>::iterator it= DLCInfo_Full.begin();
wstring wsProductName=pwchProductName; std::wstring wsProductName=pwchProductName;
for(int i=0;i<DLCInfo_Full.size();i++) for(int i=0;i<DLCInfo_Full.size();i++)
{ {
@ -7250,12 +7250,12 @@ void CMinecraftApp::AddCreditText(LPCWSTR lpStr)
vDLCCredits.push_back(pCreditStruct); vDLCCredits.push_back(pCreditStruct);
} }
bool CMinecraftApp::AlreadySeenCreditText(const wstring &wstemp) bool CMinecraftApp::AlreadySeenCreditText(const std::wstring &wstemp)
{ {
for(unsigned int i=0;i<m_vCreditText.size();i++) for(unsigned int i=0;i<m_vCreditText.size();i++)
{ {
wstring temp=m_vCreditText.at(i); std::wstring temp=m_vCreditText.at(i);
// if they are the same, break out of the case // if they are the same, break out of the case
if(temp.compare(wstemp)==0) if(temp.compare(wstemp)==0)
@ -7601,7 +7601,7 @@ void CMinecraftApp::setLevelGenerationOptions(LevelGenerationOptions *levelGen)
m_gameRules.setLevelGenerationOptions(levelGen); m_gameRules.setLevelGenerationOptions(levelGen);
} }
LPCWSTR CMinecraftApp::GetGameRulesString(const wstring &key) LPCWSTR CMinecraftApp::GetGameRulesString(const std::wstring &key)
{ {
return m_gameRules.GetGameRulesString(key); return m_gameRules.GetGameRulesString(key);
} }
@ -7858,7 +7858,7 @@ unsigned int CMinecraftApp::GetPlayerPrivileges(BYTE networkSmallId)
return privileges; return privileges;
} }
wstring CMinecraftApp::getEntityName(eINSTANCEOF type) std::wstring CMinecraftApp::getEntityName(eINSTANCEOF type)
{ {
switch(type) switch(type)
{ {
@ -8598,8 +8598,8 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D
{ {
EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER); EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER);
Model *pModel = renderer->getModel(); Model *pModel = renderer->getModel();
vector<ModelPart *> *pvModelPart = new vector<ModelPart *>; std::vector<ModelPart *> *pvModelPart = new std::vector<ModelPart *>;
vector<SKIN_BOX *> *pvSkinBoxes = new vector<SKIN_BOX *>; std::vector<SKIN_BOX *> *pvSkinBoxes = new std::vector<SKIN_BOX *>;
EnterCriticalSection( &csAdditionalModelParts ); EnterCriticalSection( &csAdditionalModelParts );
EnterCriticalSection( &csAdditionalSkinBoxes ); EnterCriticalSection( &csAdditionalSkinBoxes );
@ -8618,19 +8618,19 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D
} }
m_AdditionalModelParts.insert( std::pair<DWORD, vector<ModelPart *> *>(dwSkinID, pvModelPart) ); m_AdditionalModelParts.insert( std::pair<DWORD, std::vector<ModelPart *> *>(dwSkinID, pvModelPart) );
m_AdditionalSkinBoxes.insert( std::pair<DWORD, vector<SKIN_BOX *> *>(dwSkinID, pvSkinBoxes) ); m_AdditionalSkinBoxes.insert( std::pair<DWORD, std::vector<SKIN_BOX *> *>(dwSkinID, pvSkinBoxes) );
LeaveCriticalSection( &csAdditionalSkinBoxes ); LeaveCriticalSection( &csAdditionalSkinBoxes );
LeaveCriticalSection( &csAdditionalModelParts ); LeaveCriticalSection( &csAdditionalModelParts );
} }
vector<ModelPart *> * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA) std::vector<ModelPart *> * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, std::vector<SKIN_BOX *> *pvSkinBoxA)
{ {
EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER); EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER);
Model *pModel = renderer->getModel(); Model *pModel = renderer->getModel();
vector<ModelPart *> *pvModelPart = new vector<ModelPart *>; std::vector<ModelPart *> *pvModelPart = new std::vector<ModelPart *>;
EnterCriticalSection( &csAdditionalModelParts ); EnterCriticalSection( &csAdditionalModelParts );
EnterCriticalSection( &csAdditionalSkinBoxes ); EnterCriticalSection( &csAdditionalSkinBoxes );
@ -8646,8 +8646,8 @@ vector<ModelPart *> * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect
} }
} }
m_AdditionalModelParts.insert( std::pair<DWORD, vector<ModelPart *> *>(dwSkinID, pvModelPart) ); m_AdditionalModelParts.insert( std::pair<DWORD, std::vector<ModelPart *> *>(dwSkinID, pvModelPart) );
m_AdditionalSkinBoxes.insert( std::pair<DWORD, vector<SKIN_BOX *> *>(dwSkinID, pvSkinBoxA) ); m_AdditionalSkinBoxes.insert( std::pair<DWORD, std::vector<SKIN_BOX *> *>(dwSkinID, pvSkinBoxA) );
LeaveCriticalSection( &csAdditionalSkinBoxes ); LeaveCriticalSection( &csAdditionalSkinBoxes );
LeaveCriticalSection( &csAdditionalModelParts ); LeaveCriticalSection( &csAdditionalModelParts );
@ -8655,10 +8655,10 @@ vector<ModelPart *> * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect
} }
vector<ModelPart *> *CMinecraftApp::GetAdditionalModelParts(DWORD dwSkinID) std::vector<ModelPart *> *CMinecraftApp::GetAdditionalModelParts(DWORD dwSkinID)
{ {
EnterCriticalSection( &csAdditionalModelParts ); EnterCriticalSection( &csAdditionalModelParts );
vector<ModelPart *> *pvModelParts=NULL; std::vector<ModelPart *> *pvModelParts=NULL;
if(m_AdditionalModelParts.size()>0) if(m_AdditionalModelParts.size()>0)
{ {
AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID)); AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID));
@ -8672,10 +8672,10 @@ vector<ModelPart *> *CMinecraftApp::GetAdditionalModelParts(DWORD dwSkinID)
return pvModelParts; return pvModelParts;
} }
vector<SKIN_BOX *> *CMinecraftApp::GetAdditionalSkinBoxes(DWORD dwSkinID) std::vector<SKIN_BOX *> *CMinecraftApp::GetAdditionalSkinBoxes(DWORD dwSkinID)
{ {
EnterCriticalSection( &csAdditionalSkinBoxes ); EnterCriticalSection( &csAdditionalSkinBoxes );
vector<SKIN_BOX *> *pvSkinBoxes=NULL; std::vector<SKIN_BOX *> *pvSkinBoxes=NULL;
if(m_AdditionalSkinBoxes.size()>0) if(m_AdditionalSkinBoxes.size()>0)
{ {
AUTO_VAR(it,m_AdditionalSkinBoxes.find(dwSkinID)); AUTO_VAR(it,m_AdditionalSkinBoxes.find(dwSkinID));
@ -8725,7 +8725,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOve
LeaveCriticalSection( &csAnimOverrideBitmask ); LeaveCriticalSection( &csAnimOverrideBitmask );
} }
DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin) DWORD CMinecraftApp::getSkinIdFromPath(const std::wstring &skin)
{ {
bool dlcSkin = false; bool dlcSkin = false;
unsigned int skinId = 0; unsigned int skinId = 0;
@ -8734,7 +8734,7 @@ DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin)
{ {
dlcSkin = skin.substr(0,3).compare(L"dlc") == 0; dlcSkin = skin.substr(0,3).compare(L"dlc") == 0;
wstring skinValue = skin.substr(7,skin.size()); std::wstring skinValue = skin.substr(7,skin.size());
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
std::wstringstream ss; std::wstringstream ss;
@ -8751,7 +8751,7 @@ DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin)
return skinId; return skinId;
} }
wstring CMinecraftApp::getSkinPathFromId(DWORD skinId) std::wstring CMinecraftApp::getSkinPathFromId(DWORD skinId)
{ {
// 4J Stu - This function maps the encoded DWORD we store in the player profile // 4J Stu - This function maps the encoded DWORD we store in the player profile
// to a filename that is stored as a memory texture and shared between systems in game // to a filename that is stored as a memory texture and shared between systems in game
@ -8810,7 +8810,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E
return 0; return 0;
} }
int CMinecraftApp::getArchiveFileSize(const wstring &filename) int CMinecraftApp::getArchiveFileSize(const std::wstring &filename)
{ {
TexturePack *tPack = NULL; TexturePack *tPack = NULL;
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
@ -8822,7 +8822,7 @@ int CMinecraftApp::getArchiveFileSize(const wstring &filename)
else return m_mediaArchive->getFileSize(filename); else return m_mediaArchive->getFileSize(filename);
} }
bool CMinecraftApp::hasArchiveFile(const wstring &filename) bool CMinecraftApp::hasArchiveFile(const std::wstring &filename)
{ {
TexturePack *tPack = NULL; TexturePack *tPack = NULL;
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
@ -8831,7 +8831,7 @@ bool CMinecraftApp::hasArchiveFile(const wstring &filename)
else return m_mediaArchive->hasFile(filename); else return m_mediaArchive->hasFile(filename);
} }
byteArray CMinecraftApp::getArchiveFile(const wstring &filename) byteArray CMinecraftApp::getArchiveFile(const std::wstring &filename)
{ {
TexturePack *tPack = NULL; TexturePack *tPack = NULL;
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
@ -8945,9 +8945,9 @@ bool CMinecraftApp::IsLocalMultiplayerAvailable()
// 4J-PB - language and locale function // 4J-PB - language and locale function
void CMinecraftApp::getLocale(vector<wstring> &vecWstrLocales) void CMinecraftApp::getLocale(std::vector<std::wstring> &vecWstrLocales)
{ {
vector<eMCLang> locales; std::vector<eMCLang> locales;
DWORD dwSystemLanguage = XGetLanguage( ); DWORD dwSystemLanguage = XGetLanguage( );
@ -9391,10 +9391,10 @@ void CMinecraftApp::SetTickTMSDLCFiles(bool bVal)
m_bTickTMSDLCFiles=bVal; m_bTickTMSDLCFiles=bVal;
} }
wstring CMinecraftApp::getFilePath(DWORD packId, wstring filename, bool bAddDataFolder) std::wstring CMinecraftApp::getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder)
{ {
#ifdef _XBOX #ifdef _XBOX
wstring path = getRootPath(packId, true, bAddDataFolder) + filename; std::wstring path = getRootPath(packId, true, bAddDataFolder) + filename;
File f(path); File f(path);
if(f.exists()) if(f.exists())
{ {
@ -9421,15 +9421,15 @@ enum ETitleUpdateTexturePacks
}; };
#ifdef _TU_BUILD #ifdef _TU_BUILD
wstring titleUpdateTexturePackRoot = L"UPDATE:\\res\\DLC\\"; std::wstring titleUpdateTexturePackRoot = L"UPDATE:\\res\\DLC\\";
#else #else
wstring titleUpdateTexturePackRoot = L"GAME:\\res\\TitleUpdate\\DLC\\"; std::wstring titleUpdateTexturePackRoot = L"GAME:\\res\\TitleUpdate\\DLC\\";
#endif #endif
#endif #endif
wstring CMinecraftApp::getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder) std::wstring CMinecraftApp::getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder)
{ {
wstring path = L"TPACK:"; std::wstring path = L"TPACK:";
#ifdef _XBOX #ifdef _XBOX
if(allowOverride) if(allowOverride)
{ {

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "Audio/Consoles_SoundEngine.h" #include "Audio/Consoles_SoundEngine.h"
#ifndef __linux__ #ifndef __linux__
@ -73,11 +73,11 @@ public:
typedef std::vector <PNOTIFICATION> VNOTIFICATIONS; typedef std::vector <PNOTIFICATION> VNOTIFICATIONS;
// storing skin files // storing skin files
std::vector <wstring > vSkinNames; std::vector <std::wstring > vSkinNames;
DLCManager m_dlcManager; DLCManager m_dlcManager;
// storing credits text from the DLC // storing credits text from the DLC
std::vector <wstring > m_vCreditText; // hold the credit text lines so we can avoid duplicating them std::vector <std::wstring > m_vCreditText; // hold the credit text lines so we can avoid duplicating them
// In builds prior to TU5, the size of the GAME_SETTINGS struct was 204 bytes. We added a few new values to the internal struct in TU5, and even though we // In builds prior to TU5, the size of the GAME_SETTINGS struct was 204 bytes. We added a few new values to the internal struct in TU5, and even though we
@ -128,18 +128,18 @@ public:
bool GetGameStarted() {return m_bGameStarted;} bool GetGameStarted() {return m_bGameStarted;}
void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;} void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;}
int GetLocalPlayerCount(void); int GetLocalPlayerCount(void);
bool LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player, bool bNavigateBack=false); bool LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player, bool bNavigateBack=false);
bool LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack=false); bool LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack=false);
bool LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level); bool LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level);
bool LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace); bool LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace);
bool LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand); bool LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand);
bool LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container); bool LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container);
bool LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap); bool LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap);
bool LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player); bool LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player);
bool LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z); bool LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z);
bool LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign); bool LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign);
bool LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z); bool LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
bool LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level); bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level);
bool GetTutorialMode() { return m_bTutorialMode;} bool GetTutorialMode() { return m_bTutorialMode;}
void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;} void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;}
@ -231,9 +231,9 @@ public:
void SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucVal); void SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucVal);
unsigned char GetGameSettings(int iPad,eGameSetting eVal); unsigned char GetGameSettings(int iPad,eGameSetting eVal);
unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad
void SetPlayerSkin(int iPad,const wstring &name); void SetPlayerSkin(int iPad,const std::wstring &name);
void SetPlayerSkin(int iPad,DWORD dwSkinId); void SetPlayerSkin(int iPad,DWORD dwSkinId);
void SetPlayerCape(int iPad,const wstring &name); void SetPlayerCape(int iPad,const std::wstring &name);
void SetPlayerCape(int iPad,DWORD dwCapeId); void SetPlayerCape(int iPad,DWORD dwCapeId);
void SetPlayerFavoriteSkin(int iPad, int iIndex,unsigned int uiSkinID); void SetPlayerFavoriteSkin(int iPad, int iIndex,unsigned int uiSkinID);
unsigned int GetPlayerFavoriteSkin(int iPad,int iIndex); unsigned int GetPlayerFavoriteSkin(int iPad,int iIndex);
@ -258,9 +258,9 @@ public:
void TickOpacityTimer(int iPad) { if(m_uiOpacityCountDown[iPad]>0) m_uiOpacityCountDown[iPad]--;} void TickOpacityTimer(int iPad) { if(m_uiOpacityCountDown[iPad]>0) m_uiOpacityCountDown[iPad]--;}
public: public:
wstring GetPlayerSkinName(int iPad); std::wstring GetPlayerSkinName(int iPad);
DWORD GetPlayerSkinId(int iPad); DWORD GetPlayerSkinId(int iPad);
wstring GetPlayerCapeName(int iPad); std::wstring GetPlayerCapeName(int iPad);
DWORD GetPlayerCapeId(int iPad); DWORD GetPlayerCapeId(int iPad);
DWORD GetAdditionalModelParts(int iPad); DWORD GetAdditionalModelParts(int iPad);
void CheckGameSettingsChanged(bool bOverride5MinuteTimer=false, int iPad=XUSER_INDEX_ANY); void CheckGameSettingsChanged(bool bOverride5MinuteTimer=false, int iPad=XUSER_INDEX_ANY);
@ -310,7 +310,7 @@ public:
#endif #endif
void SetDebugSequence(const char *pchSeq); void SetDebugSequence(const char *pchSeq);
static int DebugInputCallback(LPVOID pParam); static int DebugInputCallback(LPVOID pParam);
//bool UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, wstring *wsFile ); //bool UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, std::wstring *wsFile );
// Installed DLC // Installed DLC
bool StartInstallDLCProcess(int iPad); bool StartInstallDLCProcess(int iPad);
@ -325,7 +325,7 @@ public:
void ClearDLCInstalled() { m_bDLCInstallProcessCompleted=false;} void ClearDLCInstalled() { m_bDLCInstallProcessCompleted=false;}
static int MarketplaceCountsCallback(LPVOID pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad); static int MarketplaceCountsCallback(LPVOID pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad);
bool AlreadySeenCreditText(const wstring &wstemp); bool AlreadySeenCreditText(const std::wstring &wstemp);
void ClearNewDLCAvailable(void) { m_bNewDLCAvailable=false; m_bSeenNewDLCTip=true;} void ClearNewDLCAvailable(void) { m_bNewDLCAvailable=false; m_bSeenNewDLCTip=true;}
bool GetNewDLCAvailable() { return m_bNewDLCAvailable;} bool GetNewDLCAvailable() { return m_bNewDLCAvailable;}
@ -339,10 +339,10 @@ public:
bool isXuidNotch(PlayerUID xuid); bool isXuidNotch(PlayerUID xuid);
bool isXuidDeadmau5(PlayerUID xuid); bool isXuidDeadmau5(PlayerUID xuid);
void AddMemoryTextureFile(const wstring &wName, PBYTE pbData, DWORD dwBytes); void AddMemoryTextureFile(const std::wstring &wName, PBYTE pbData, DWORD dwBytes);
void RemoveMemoryTextureFile(const wstring &wName); void RemoveMemoryTextureFile(const std::wstring &wName);
void GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD *pdwBytes); void GetMemFileDetails(const std::wstring &wName,PBYTE *ppbData,DWORD *pdwBytes);
bool IsFileInMemoryTextures(const wstring &wName); bool IsFileInMemoryTextures(const std::wstring &wName);
// Texture Pack Data files (icon, banner, comparison shot & text) // Texture Pack Data files (icon, banner, comparison shot & text)
void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes); void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes);
@ -367,15 +367,15 @@ public:
private: private:
PlayerUID m_xuidNotch; PlayerUID m_xuidNotch;
#ifdef _DURANGO #ifdef _DURANGO
unordered_map<PlayerUID, PBYTE, PlayerUID::Hash> m_GTS_Files; std::unordered_map<PlayerUID, PBYTE, PlayerUID::Hash> m_GTS_Files;
#else #else
unordered_map<PlayerUID, PBYTE> m_GTS_Files; std::unordered_map<PlayerUID, PBYTE> m_GTS_Files;
#endif #endif
// for storing memory textures - player skin // for storing memory textures - player skin
unordered_map<wstring, PMEMDATA> m_MEM_Files; std::unordered_map<std::wstring, PMEMDATA> m_MEM_Files;
// for storing texture pack data files // for storing texture pack data files
unordered_map<int, PMEMDATA> m_MEM_TPD; std::unordered_map<int, PMEMDATA> m_MEM_TPD;
CRITICAL_SECTION csMemFilesLock; // For locking access to the above map CRITICAL_SECTION csMemFilesLock; // For locking access to the above map
CRITICAL_SECTION csMemTPDLock; // For locking access to the above map CRITICAL_SECTION csMemTPDLock; // For locking access to the above map
@ -422,9 +422,9 @@ protected:
StringTable *m_stringTable; StringTable *m_stringTable;
public: public:
int getArchiveFileSize(const wstring &filename); int getArchiveFileSize(const std::wstring &filename);
bool hasArchiveFile(const wstring &filename); bool hasArchiveFile(const std::wstring &filename);
byteArray getArchiveFile(const wstring &filename); byteArray getArchiveFile(const std::wstring &filename);
private: private:
@ -551,10 +551,10 @@ public:
int GetHTMLColour(eMinecraftColour colour); int GetHTMLColour(eMinecraftColour colour);
int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); } int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); }
int GetHTMLFontSize(EHTMLFontSize size); int GetHTMLFontSize(EHTMLFontSize size);
wstring FormatHTMLString(int iPad, const wstring &desc, int shadowColour = 0xFFFFFFFF); std::wstring FormatHTMLString(int iPad, const std::wstring &desc, int shadowColour = 0xFFFFFFFF);
wstring GetActionReplacement(int iPad, unsigned char ucAction); std::wstring GetActionReplacement(int iPad, unsigned char ucAction);
wstring GetVKReplacement(unsigned int uiVKey); std::wstring GetVKReplacement(unsigned int uiVKey);
wstring GetIconReplacement(unsigned int uiIcon); std::wstring GetIconReplacement(unsigned int uiIcon);
float getAppTime() { return m_Time.fAppTime; } float getAppTime() { return m_Time.fAppTime; }
void UpdateTrialPausedTimer() { mfTrialPausedTime+= m_Time.fElapsedTime;} void UpdateTrialPausedTimer() { mfTrialPausedTime+= m_Time.fElapsedTime;}
@ -583,18 +583,18 @@ public:
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL); HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL);
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); bool GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,ULONGLONG *pullVal);
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
#elif defined(_XBOX_ONE) #elif defined(_XBOX_ONE)
static HRESULT RegisterDLCData(eDLCContentType, WCHAR *, WCHAR *, WCHAR *, WCHAR *, int, unsigned int); static HRESULT RegisterDLCData(eDLCContentType, WCHAR *, WCHAR *, WCHAR *, WCHAR *, int, unsigned int);
//bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,WCHAR *pwchProductId); //bool GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,WCHAR *pwchProductId);
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring &wsProductId); bool GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,std::wstring &wsProductId);
DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId); DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId);
DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName); DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName);
#else #else
static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile); static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile);
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); bool GetDLCFullOfferIDForSkinID(const std::wstring &FirstSkin,ULONGLONG *pullVal);
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
#endif #endif
@ -619,22 +619,22 @@ private:
std::vector <SCreditTextItemDef *> vDLCCredits; std::vector <SCreditTextItemDef *> vDLCCredits;
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData; static std::unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs static std::unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<string,DLC_INFO * > DLCInfo; static std::unordered_map<string,DLC_INFO * > DLCInfo;
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id static std::unordered_map<std::wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
#elif defined(_DURANGO) #elif defined(_DURANGO)
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData; static std::unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, wstring > DLCTextures_PackID; // for mash-up packs & texture packs static std::unordered_map<int, std::wstring > DLCTextures_PackID; // for mash-up packs & texture packs
//static unordered_map<wstring,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info //static std::unordered_map<std::wstring,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<wstring,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info static std::unordered_map<std::wstring,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id static std::unordered_map<std::wstring, std::wstring > DLCInfo_SkinName; // skin name, full offer id
#else #else
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData; static std::unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs static std::unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info static std::unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info static std::unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id static std::unordered_map<std::wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
#endif #endif
// bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file // bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file
// bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file // bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file
@ -713,11 +713,11 @@ public:
void processSchematics(LevelChunk *levelChunk); void processSchematics(LevelChunk *levelChunk);
void processSchematicsLighting(LevelChunk *levelChunk); void processSchematicsLighting(LevelChunk *levelChunk);
void loadDefaultGameRules(); void loadDefaultGameRules();
vector<LevelGenerationOptions *> *getLevelGenerators() { return m_gameRules.getLevelGenerators(); } std::vector<LevelGenerationOptions *> *getLevelGenerators() { return m_gameRules.getLevelGenerators(); }
void setLevelGenerationOptions(LevelGenerationOptions *levelGen); void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); } LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); }
LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); } LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); }
LPCWSTR GetGameRulesString(const wstring &key); LPCWSTR GetGameRulesString(const std::wstring &key);
private: private:
BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's
@ -728,7 +728,7 @@ public:
short GetPlayerColour(BYTE networkSmallId); short GetPlayerColour(BYTE networkSmallId);
unsigned int GetPlayerPrivileges(BYTE networkSmallId); unsigned int GetPlayerPrivileges(BYTE networkSmallId);
wstring getEntityName(eINSTANCEOF type); std::wstring getEntityName(eINSTANCEOF type);
@ -758,7 +758,7 @@ public:
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,LPVOID, WCHAR *wchFilename); static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,LPVOID, WCHAR *wchFilename);
unordered_map<wstring,DLC_INFO * > *GetDLCInfo(); std::unordered_map<std::wstring,DLC_INFO * > *GetDLCInfo();
#else #else
static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename);
#endif #endif
@ -768,8 +768,8 @@ public:
int GetDLCInfoTrialOffersCount(); int GetDLCInfoTrialOffersCount();
int GetDLCInfoFullOffersCount(); int GetDLCInfoFullOffersCount();
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
bool GetDLCFullOfferIDForPackID(const int iPackID,wstring &wsProductId); bool GetDLCFullOfferIDForPackID(const int iPackID,std::wstring &wsProductId);
wstring GetDLCInfoTexturesFullOffer(int iIndex); std::wstring GetDLCInfoTexturesFullOffer(int iIndex);
#else #else
bool GetDLCFullOfferIDForPackID(const int iPackID,ULONGLONG *pullVal); bool GetDLCFullOfferIDForPackID(const int iPackID,ULONGLONG *pullVal);
@ -788,8 +788,8 @@ private:
// Download Status // Download Status
//Request current_download; //Request current_download;
vector<DLCRequest *> m_DLCDownloadQueue; std::vector<DLCRequest *> m_DLCDownloadQueue;
vector<TMSPPRequest *> m_TMSPPDownloadQueue; std::vector<TMSPPRequest *> m_TMSPPDownloadQueue;
static DWORD m_dwContentTypeA[e_Marketplace_MAX]; static DWORD m_dwContentTypeA[e_Marketplace_MAX];
int m_iDLCOfferC; int m_iDLCOfferC;
bool m_bAllDLCContentRetrieved; bool m_bAllDLCContentRetrieved;
@ -817,14 +817,14 @@ public:
// Storing additional model parts per skin texture // Storing additional model parts per skin texture
void SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC); void SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC);
vector<ModelPart *> * SetAdditionalSkinBoxes(DWORD dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA); std::vector<ModelPart *> * SetAdditionalSkinBoxes(DWORD dwSkinID, std::vector<SKIN_BOX *> *pvSkinBoxA);
vector<ModelPart *> *GetAdditionalModelParts(DWORD dwSkinID); std::vector<ModelPart *> *GetAdditionalModelParts(DWORD dwSkinID);
vector<SKIN_BOX *> *GetAdditionalSkinBoxes(DWORD dwSkinID); std::vector<SKIN_BOX *> *GetAdditionalSkinBoxes(DWORD dwSkinID);
void SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOverrideBitmask); void SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOverrideBitmask);
unsigned int GetAnimOverrideBitmask(DWORD dwSkinID); unsigned int GetAnimOverrideBitmask(DWORD dwSkinID);
static DWORD getSkinIdFromPath(const wstring &skin); static DWORD getSkinIdFromPath(const std::wstring &skin);
static wstring getSkinPathFromId(DWORD skinId); static std::wstring getSkinPathFromId(DWORD skinId);
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile)=0; virtual int LoadLocalTMSFile(WCHAR *wchTMSFile)=0;
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)=0; virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)=0;
@ -848,15 +848,15 @@ public:
private: private:
// vector of additional skin model parts, indexed by the skin texture id // vector of additional skin model parts, indexed by the skin texture id
unordered_map<DWORD, vector<ModelPart *> *> m_AdditionalModelParts; std::unordered_map<DWORD, std::vector<ModelPart *> *> m_AdditionalModelParts;
unordered_map<DWORD, vector<SKIN_BOX *> *> m_AdditionalSkinBoxes; std::unordered_map<DWORD, std::vector<SKIN_BOX *> *> m_AdditionalSkinBoxes;
unordered_map<DWORD, unsigned int> m_AnimOverrides; std::unordered_map<DWORD, unsigned int> m_AnimOverrides;
bool m_bResetNether; bool m_bResetNether;
DWORD m_dwRequiredTexturePackID; DWORD m_dwRequiredTexturePackID;
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
vector <PBYTE> m_vTMSPPData; std::vector <PBYTE> m_vTMSPPData;
#endif #endif
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
@ -872,19 +872,19 @@ private:
public: public:
void LocaleAndLanguageInit(); void LocaleAndLanguageInit();
void getLocale(vector<wstring> &vecWstrLocales); void getLocale(std::vector<std::wstring> &vecWstrLocales);
DWORD get_eMCLang(WCHAR *pwchLocale); DWORD get_eMCLang(WCHAR *pwchLocale);
DWORD get_xcLang(WCHAR *pwchLocale); DWORD get_xcLang(WCHAR *pwchLocale);
void SetTickTMSDLCFiles(bool bVal); void SetTickTMSDLCFiles(bool bVal);
wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder); std::wstring getFilePath(DWORD packId, std::wstring filename, bool bAddDataFolder);
private: private:
unordered_map<int, wstring>m_localeA; std::unordered_map<int, std::wstring>m_localeA;
unordered_map<wstring, int>m_eMCLangA; std::unordered_map<std::wstring, int>m_eMCLangA;
unordered_map<wstring, int>m_xcLangA; std::unordered_map<std::wstring, int>m_xcLangA;
wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder); std::wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder);
public: public:
#ifdef _XBOX #ifdef _XBOX

View file

@ -6,7 +6,7 @@
#include "../../../Platform/Xbox/XML/xmlFilesCallback.h" #include "../../../Platform/Xbox/XML/xmlFilesCallback.h"
#endif #endif
DLCAudioFile::DLCAudioFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Audio,path) DLCAudioFile::DLCAudioFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_Audio,path)
{ {
m_pbData = NULL; m_pbData = NULL;
m_dwBytes = 0; m_dwBytes = 0;
@ -32,7 +32,7 @@ const WCHAR *DLCAudioFile::wchTypeNamesA[]=
L"CREDIT", L"CREDIT",
}; };
DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring &paramName) DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const std::wstring &paramName)
{ {
EAudioParameterType type = e_AudioParamType_Invalid; EAudioParameterType type = e_AudioParamType_Invalid;
@ -48,7 +48,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring &
return type; return type;
} }
void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, const wstring &value) void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, const std::wstring &value)
{ {
switch(ptype) switch(ptype)
{ {
@ -79,7 +79,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
maximumChars = 35; maximumChars = 35;
break; break;
} }
wstring creditValue = value; std::wstring creditValue = value;
while (creditValue.length() > maximumChars) while (creditValue.length() > maximumChars)
{ {
unsigned int i = 1; unsigned int i = 1;
@ -122,7 +122,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
{ {
unordered_map<int, EAudioParameterType> parameterMapping; std::unordered_map<int, EAudioParameterType> parameterMapping;
unsigned int uiCurrentByte=0; unsigned int uiCurrentByte=0;
// File format defined in the AudioPacker // File format defined in the AudioPacker
@ -145,7 +145,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiParameterTypeCount;i++) for(unsigned int i=0;i<uiParameterTypeCount;i++)
{ {
// Map DLC strings to application strings, then store the DLC index mapping to application index // Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData); std::wstring parameterName((WCHAR *)pParams->wchData);
EAudioParameterType type = getParameterType(parameterName); EAudioParameterType type = getParameterType(parameterName);
if( type != e_AudioParamType_Invalid ) if( type != e_AudioParamType_Invalid )
{ {
@ -204,7 +204,7 @@ int DLCAudioFile::GetCountofType(DLCAudioFile::EAudioType eType)
} }
wstring &DLCAudioFile::GetSoundName(int iIndex) std::wstring &DLCAudioFile::GetSoundName(int iIndex)
{ {
int iWorldType=e_AudioType_Overworld; int iWorldType=e_AudioType_Overworld;
while(iIndex>=m_parameters[iWorldType].size()) while(iIndex>=m_parameters[iWorldType].size())

View file

@ -30,14 +30,14 @@ public:
}; };
static const WCHAR *wchTypeNamesA[e_AudioParamType_Max]; static const WCHAR *wchTypeNamesA[e_AudioParamType_Max];
DLCAudioFile(const wstring &path); DLCAudioFile(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
virtual PBYTE getData(DWORD &dwBytes); virtual PBYTE getData(DWORD &dwBytes);
bool processDLCDataFile(PBYTE pbData, DWORD dwLength); bool processDLCDataFile(PBYTE pbData, DWORD dwLength);
int GetCountofType(DLCAudioFile::EAudioType ptype); int GetCountofType(DLCAudioFile::EAudioType ptype);
wstring &GetSoundName(int iIndex); std::wstring &GetSoundName(int iIndex);
private: private:
using DLCFile::addParameter; using DLCFile::addParameter;
@ -45,10 +45,10 @@ private:
PBYTE m_pbData; PBYTE m_pbData;
DWORD m_dwBytes; DWORD m_dwBytes;
static const int CURRENT_AUDIO_VERSION_NUM=1; static const int CURRENT_AUDIO_VERSION_NUM=1;
//unordered_map<int, wstring> m_parameters; //std::unordered_map<int, std::wstring> m_parameters;
vector<wstring> m_parameters[e_AudioType_Max]; std::vector<std::wstring> m_parameters[e_AudioType_Max];
// use the EAudioType to order these // use the EAudioType to order these
void addParameter(DLCAudioFile::EAudioType type, DLCAudioFile::EAudioParameterType ptype, const wstring &value); void addParameter(DLCAudioFile::EAudioType type, DLCAudioFile::EAudioParameterType ptype, const std::wstring &value);
DLCAudioFile::EAudioParameterType getParameterType(const wstring &paramName); DLCAudioFile::EAudioParameterType getParameterType(const std::wstring &paramName);
}; };

View file

@ -2,7 +2,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "DLCCapeFile.h" #include "DLCCapeFile.h"
DLCCapeFile::DLCCapeFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Cape,path) DLCCapeFile::DLCCapeFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_Cape,path)
{ {
} }

View file

@ -4,7 +4,7 @@
class DLCCapeFile : public DLCFile class DLCCapeFile : public DLCFile
{ {
public: public:
DLCCapeFile(const wstring &path); DLCCapeFile(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
}; };

View file

@ -5,7 +5,7 @@
#include "../../../Textures/Packs/TexturePackRepository.h" #include "../../../Textures/Packs/TexturePackRepository.h"
#include "../../../Textures/Packs/TexturePack.h" #include "../../../Textures/Packs/TexturePack.h"
DLCColourTableFile::DLCColourTableFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_ColourTable,path) DLCColourTableFile::DLCColourTableFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_ColourTable,path)
{ {
m_colourTable = NULL; m_colourTable = NULL;
} }

View file

@ -9,7 +9,7 @@ private:
ColourTable *m_colourTable; ColourTable *m_colourTable;
public: public:
DLCColourTableFile(const wstring &path); DLCColourTableFile(const std::wstring &path);
~DLCColourTableFile(); ~DLCColourTableFile();
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);

View file

@ -1,7 +1,7 @@
#include "../../../../Minecraft.World/Build/stdafx.h" #include "../../../../Minecraft.World/Build/stdafx.h"
#include "DLCFile.h" #include "DLCFile.h"
DLCFile::DLCFile(DLCManager::EDLCType type, const wstring &path) DLCFile::DLCFile(DLCManager::EDLCType type, const std::wstring &path)
{ {
m_type = type; m_type = type;
m_path = path; m_path = path;
@ -11,7 +11,7 @@ DLCFile::DLCFile(DLCManager::EDLCType type, const wstring &path)
if(dlcSkin) if(dlcSkin)
{ {
wstring skinValue = path.substr(7,path.size()); std::wstring skinValue = path.substr(7,path.size());
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
std::wstringstream ss; std::wstringstream ss;
ss << std::dec << skinValue.c_str(); ss << std::dec << skinValue.c_str();

View file

@ -5,21 +5,21 @@ class DLCFile
{ {
protected: protected:
DLCManager::EDLCType m_type; DLCManager::EDLCType m_type;
wstring m_path; std::wstring m_path;
DWORD m_dwSkinId; DWORD m_dwSkinId;
public: public:
DLCFile(DLCManager::EDLCType type, const wstring &path); DLCFile(DLCManager::EDLCType type, const std::wstring &path);
virtual ~DLCFile() {} virtual ~DLCFile() {}
DLCManager::EDLCType getType() { return m_type; } DLCManager::EDLCType getType() { return m_type; }
wstring getPath() { return m_path; } std::wstring getPath() { return m_path; }
DWORD getSkinID() { return m_dwSkinId; } DWORD getSkinID() { return m_dwSkinId; }
virtual void addData(PBYTE pbData, DWORD dwBytes) {} virtual void addData(PBYTE pbData, DWORD dwBytes) {}
virtual PBYTE getData(DWORD &dwBytes) { dwBytes = 0; return NULL; } virtual PBYTE getData(DWORD &dwBytes) { dwBytes = 0; return NULL; }
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value) {} virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value) {}
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; } virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; }
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type) { return false;} virtual bool getParameterAsBool(DLCManager::EDLCParameterType type) { return false;}
}; };

View file

@ -6,5 +6,5 @@
class DLCGameRules : public DLCFile class DLCGameRules : public DLCFile
{ {
public: public:
DLCGameRules(DLCManager::EDLCType type, const wstring &path) : DLCFile(type,path) {} DLCGameRules(DLCManager::EDLCType type, const std::wstring &path) : DLCFile(type,path) {}
}; };

View file

@ -2,7 +2,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "DLCGameRulesFile.h" #include "DLCGameRulesFile.h"
DLCGameRulesFile::DLCGameRulesFile(const wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRules,path) DLCGameRulesFile::DLCGameRulesFile(const std::wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRules,path)
{ {
m_pbData = NULL; m_pbData = NULL;
m_dwBytes = 0; m_dwBytes = 0;

View file

@ -8,7 +8,7 @@ private:
DWORD m_dwBytes; DWORD m_dwBytes;
public: public:
DLCGameRulesFile(const wstring &path); DLCGameRulesFile(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
virtual PBYTE getData(DWORD &dwBytes); virtual PBYTE getData(DWORD &dwBytes);

View file

@ -9,7 +9,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "DLCGameRulesHeader.h" #include "DLCGameRulesHeader.h"
DLCGameRulesHeader::DLCGameRulesHeader(const wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRulesHeader,path) DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRulesHeader,path)
{ {
m_pbData = NULL; m_pbData = NULL;
m_dwBytes = 0; m_dwBytes = 0;
@ -35,7 +35,7 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes)
// Init values. // Init values.
int version_number; int version_number;
byte compression_type; byte compression_type;
wstring texturepackid; std::wstring texturepackid;
// Read Datastream. // Read Datastream.
version_number = dis.readInt(); version_number = dis.readInt();

View file

@ -16,22 +16,22 @@ private:
public: public:
virtual bool requiresTexturePack() {return m_bRequiresTexturePack;} virtual bool requiresTexturePack() {return m_bRequiresTexturePack;}
virtual UINT getRequiredTexturePackId() {return m_requiredTexturePackId;} virtual UINT getRequiredTexturePackId() {return m_requiredTexturePackId;}
virtual wstring getDefaultSaveName() {return m_defaultSaveName;} virtual std::wstring getDefaultSaveName() {return m_defaultSaveName;}
virtual LPCWSTR getWorldName() {return m_worldName.c_str();} virtual LPCWSTR getWorldName() {return m_worldName.c_str();}
virtual LPCWSTR getDisplayName() {return m_displayName.c_str();} virtual LPCWSTR getDisplayName() {return m_displayName.c_str();}
virtual wstring getGrfPath() {return L"GameRules.grf";} virtual std::wstring getGrfPath() {return L"GameRules.grf";}
virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;} virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
virtual void setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;} virtual void setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;}
virtual void setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;} virtual void setDefaultSaveName(const std::wstring &x) {m_defaultSaveName = x;}
virtual void setWorldName(const wstring & x) {m_worldName = x;} virtual void setWorldName(const std::wstring & x) {m_worldName = x;}
virtual void setDisplayName(const wstring & x) {m_displayName = x;} virtual void setDisplayName(const std::wstring & x) {m_displayName = x;}
virtual void setGrfPath(const wstring & x) {m_grfPath = x;} virtual void setGrfPath(const std::wstring & x) {m_grfPath = x;}
LevelGenerationOptions *lgo; LevelGenerationOptions *lgo;
public: public:
DLCGameRulesHeader(const wstring &path); DLCGameRulesHeader(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
virtual PBYTE getData(DWORD &dwBytes); virtual PBYTE getData(DWORD &dwBytes);

View file

@ -3,7 +3,7 @@
#include "DLCLocalisationFile.h" #include "DLCLocalisationFile.h"
#include "../../../Utils/StringTable.h" #include "../../../Utils/StringTable.h"
DLCLocalisationFile::DLCLocalisationFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_LocalisationData,path) DLCLocalisationFile::DLCLocalisationFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_LocalisationData,path)
{ {
m_strings = NULL; m_strings = NULL;
} }

View file

@ -9,7 +9,7 @@ private:
StringTable *m_strings; StringTable *m_strings;
public: public:
DLCLocalisationFile(const wstring &path); DLCLocalisationFile(const std::wstring &path);
DLCLocalisationFile(PBYTE pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++ DLCLocalisationFile(PBYTE pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);

View file

@ -10,10 +10,10 @@
#ifdef __linux__ #ifdef __linux__
#include <stdint.h> #include <stdint.h>
static const size_t DLC_WCHAR_BINARY = 2; static const size_t DLC_WCHAR_BINARY = 2;
static wstring dlc_read_wstring(const void *data) static std::wstring dlc_read_wstring(const void *data)
{ {
const uint16_t *p = (const uint16_t *)data; const uint16_t *p = (const uint16_t *)data;
wstring s; std::wstring s;
while (*p) s += (wchar_t)*p++; while (*p) s += (wchar_t)*p++;
return s; return s;
} }
@ -21,7 +21,7 @@ static wstring dlc_read_wstring(const void *data)
#define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + (n) * DLC_WCHAR_BINARY) #define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + (n) * DLC_WCHAR_BINARY)
#define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + (n) * DLC_WCHAR_BINARY) #define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + (n) * DLC_WCHAR_BINARY)
#else #else
#define DLC_WSTRING(ptr) wstring((WCHAR *)(ptr)) #define DLC_WSTRING(ptr) std::wstring((WCHAR *)(ptr))
#define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + sizeof(WCHAR) * (n)) #define DLC_PARAM_ADV(n) (sizeof(C4JStorage::DLC_FILE_PARAM) + sizeof(WCHAR) * (n))
#define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + sizeof(WCHAR) * (n)) #define DLC_DETAIL_ADV(n) (sizeof(C4JStorage::DLC_FILE_DETAILS) + sizeof(WCHAR) * (n))
#endif #endif
@ -58,7 +58,7 @@ DLCManager::~DLCManager()
} }
} }
DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring &paramName) DLCManager::EDLCParameterType DLCManager::getParameterType(const std::wstring &paramName)
{ {
EDLCParameterType type = e_DLCParamType_Invalid; EDLCParameterType type = e_DLCParamType_Invalid;
@ -110,7 +110,7 @@ void DLCManager::removePack(DLCPack *pack)
} }
} }
DLCPack *DLCManager::getPack(const wstring &name) DLCPack *DLCManager::getPack(const std::wstring &name)
{ {
DLCPack *pack = NULL; DLCPack *pack = NULL;
//DWORD currentIndex = 0; //DWORD currentIndex = 0;
@ -118,7 +118,7 @@ DLCPack *DLCManager::getPack(const wstring &name)
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
{ {
currentPack = *it; currentPack = *it;
wstring wsName=currentPack->getName(); std::wstring wsName=currentPack->getName();
if(wsName.compare(name) == 0) if(wsName.compare(name) == 0)
{ {
@ -130,7 +130,7 @@ DLCPack *DLCManager::getPack(const wstring &name)
} }
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
DLCPack *DLCManager::getPackFromProductID(const wstring &productID) DLCPack *DLCManager::getPackFromProductID(const std::wstring &productID)
{ {
DLCPack *pack = NULL; DLCPack *pack = NULL;
//DWORD currentIndex = 0; //DWORD currentIndex = 0;
@ -138,7 +138,7 @@ DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
{ {
currentPack = *it; currentPack = *it;
wstring wsName=currentPack->getPurchaseOfferId(); std::wstring wsName=currentPack->getPurchaseOfferId();
if(wsName.compare(productID) == 0) if(wsName.compare(productID) == 0)
{ {
@ -230,7 +230,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
return foundIndex; return foundIndex;
} }
DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found) DWORD DLCManager::getPackIndexContainingSkin(const std::wstring &path, bool &found)
{ {
DWORD foundIndex = 0; DWORD foundIndex = 0;
found = false; found = false;
@ -252,7 +252,7 @@ DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found)
return foundIndex; return foundIndex;
} }
DLCPack *DLCManager::getPackContainingSkin(const wstring &path) DLCPack *DLCManager::getPackContainingSkin(const std::wstring &path)
{ {
DLCPack *foundPack = NULL; DLCPack *foundPack = NULL;
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
@ -270,7 +270,7 @@ DLCPack *DLCManager::getPackContainingSkin(const wstring &path)
return foundPack; return foundPack;
} }
DLCSkinFile *DLCManager::getSkinFile(const wstring &path) DLCSkinFile *DLCManager::getSkinFile(const std::wstring &path)
{ {
DLCSkinFile *foundSkinfile = NULL; DLCSkinFile *foundSkinfile = NULL;
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
@ -326,15 +326,15 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
return corruptDLCCount; return corruptDLCCount;
} }
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive) bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::wstring &path, DLCPack *pack, bool fromArchive)
{ {
return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive); return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive);
} }
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive) bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &path, DLCPack *pack, bool fromArchive)
{ {
wstring wPath = convStringToWstring(path); std::wstring wPath = convStringToWstring(path);
if (fromArchive && app.getArchiveFileSize(wPath) >= 0) if (fromArchive && app.getArchiveFileSize(wPath) >= 0)
{ {
byteArray bytes = app.getArchiveFile(wPath); byteArray bytes = app.getArchiveFile(wPath);
@ -343,11 +343,11 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
else if (fromArchive) return false; else if (fromArchive) return false;
#ifdef _WINDOWS64 #ifdef _WINDOWS64
string finalPath = StorageManager.GetMountedPath(path.c_str()); std::string finalPath = StorageManager.GetMountedPath(path.c_str());
if(finalPath.size() == 0) finalPath = path; if(finalPath.size() == 0) finalPath = path;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#elif defined(_DURANGO) #elif defined(_DURANGO)
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str()); std::wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
if(finalPath.size() == 0) finalPath = wPath; if(finalPath.size() == 0) finalPath = wPath;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else #else
@ -387,7 +387,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack) bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack)
{ {
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping; std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte=0; unsigned int uiCurrentByte=0;
// File format defined in the DLC_Creator // File format defined in the DLC_Creator
@ -418,7 +418,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
for(unsigned int i=0;i<uiParameterCount;i++) for(unsigned int i=0;i<uiParameterCount;i++)
{ {
// Map DLC strings to application strings, then store the DLC index mapping to application index // Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName = DLC_WSTRING(pParams->wchData); std::wstring parameterName = DLC_WSTRING(pParams->wchData);
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName); DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
if( type != DLCManager::e_DLCParamType_Invalid ) if( type != DLCManager::e_DLCParamType_Invalid )
{ {
@ -544,17 +544,17 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
return true; return true;
} }
DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack) DWORD DLCManager::retrievePackIDFromDLCDataFile(const std::string &path, DLCPack *pack)
{ {
DWORD packId = 0; DWORD packId = 0;
wstring wPath = convStringToWstring(path); std::wstring wPath = convStringToWstring(path);
#ifdef _WINDOWS64 #ifdef _WINDOWS64
string finalPath = StorageManager.GetMountedPath(path.c_str()); std::string finalPath = StorageManager.GetMountedPath(path.c_str());
if(finalPath.size() == 0) finalPath = path; if(finalPath.size() == 0) finalPath = path;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#elif defined(_DURANGO) #elif defined(_DURANGO)
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str()); std::wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
if(finalPath.size() == 0) finalPath = wPath; if(finalPath.size() == 0) finalPath = wPath;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else #else
@ -594,7 +594,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
{ {
DWORD packId=0; DWORD packId=0;
bool bPackIDSet=false; bool bPackIDSet=false;
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping; std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte=0; unsigned int uiCurrentByte=0;
// File format defined in the DLC_Creator // File format defined in the DLC_Creator
@ -623,7 +623,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
for(unsigned int i=0;i<uiParameterCount;i++) for(unsigned int i=0;i<uiParameterCount;i++)
{ {
// Map DLC strings to application strings, then store the DLC index mapping to application index // Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName = DLC_WSTRING(pParams->wchData); std::wstring parameterName = DLC_WSTRING(pParams->wchData);
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName); DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
if( type != DLCManager::e_DLCParamType_Invalid ) if( type != DLCManager::e_DLCParamType_Invalid )
{ {
@ -664,7 +664,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
{ {
if(it->second==e_DLCParamType_PackId) if(it->second==e_DLCParamType_PackId)
{ {
wstring wsTemp = DLC_WSTRING(pParams->wchData); std::wstring wsTemp = DLC_WSTRING(pParams->wchData);
std::wstringstream ss; std::wstringstream ss;
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually // 4J Stu - numbered using decimal to make it easier for artists/people to number manually
ss << std::dec << wsTemp.c_str(); ss << std::dec << wsTemp.c_str();

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
class DLCPack; class DLCPack;
class DLCSkinFile; class DLCSkinFile;
@ -51,7 +51,7 @@ public:
const static WCHAR *wchTypeNamesA[e_DLCParamType_Max]; const static WCHAR *wchTypeNamesA[e_DLCParamType_Max];
private: private:
vector<DLCPack *> m_packs; std::vector<DLCPack *> m_packs;
//bool m_bNeedsUpdated; //bool m_bNeedsUpdated;
bool m_bNeedsCorruptCheck; bool m_bNeedsCorruptCheck;
DWORD m_dwUnnamedCorruptDLCCount; DWORD m_dwUnnamedCorruptDLCCount;
@ -59,7 +59,7 @@ public:
DLCManager(); DLCManager();
~DLCManager(); ~DLCManager();
static EDLCParameterType getParameterType(const wstring &paramName); static EDLCParameterType getParameterType(const std::wstring &paramName);
DWORD getPackCount(EDLCType type = e_DLCType_All); DWORD getPackCount(EDLCType type = e_DLCType_All);
@ -75,22 +75,22 @@ public:
void addPack(DLCPack *pack); void addPack(DLCPack *pack);
void removePack(DLCPack *pack); void removePack(DLCPack *pack);
DLCPack *getPack(const wstring &name); DLCPack *getPack(const std::wstring &name);
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
DLCPack *DLCManager::getPackFromProductID(const wstring &productID); DLCPack *DLCManager::getPackFromProductID(const std::wstring &productID);
#endif #endif
DLCPack *getPack(DWORD index, EDLCType type = e_DLCType_All); DLCPack *getPack(DWORD index, EDLCType type = e_DLCType_All);
DWORD getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All); DWORD getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All);
DLCSkinFile *getSkinFile(const wstring &path); // Will hunt all packs of type skin to find the right skinfile DLCSkinFile *getSkinFile(const std::wstring &path); // Will hunt all packs of type skin to find the right skinfile
DLCPack *getPackContainingSkin(const wstring &path); DLCPack *getPackContainingSkin(const std::wstring &path);
DWORD getPackIndexContainingSkin(const wstring &path, bool &found); DWORD getPackIndexContainingSkin(const std::wstring &path, bool &found);
DWORD checkForCorruptDLCAndAlert(bool showMessage = true); DWORD checkForCorruptDLCAndAlert(bool showMessage = true);
bool readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false); bool readDLCDataFile(DWORD &dwFilesProcessed, const std::wstring &path, DLCPack *pack, bool fromArchive = false);
bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false); bool readDLCDataFile(DWORD &dwFilesProcessed, const std::string &path, DLCPack *pack, bool fromArchive = false);
DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack); DWORD retrievePackIDFromDLCDataFile(const std::string &path, DLCPack *pack);
private: private:
bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack); bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack);

View file

@ -11,7 +11,7 @@
#include "DLCColourTableFile.h" #include "DLCColourTableFile.h"
#include "../../../../Minecraft.World/Util/StringHelpers.h" #include "../../../../Minecraft.World/Util/StringHelpers.h"
DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask) DLCPack::DLCPack(const std::wstring &name,DWORD dwLicenseMask)
{ {
m_dataPath = L""; m_dataPath = L"";
m_packName = name; m_packName = name;
@ -35,7 +35,7 @@ DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask)
} }
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
DLCPack::DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask) DLCPack::DLCPack(const std::wstring &name,const std::wstring &productID,DWORD dwLicenseMask)
{ {
m_dataPath = L""; m_dataPath = L"";
m_packName = name; m_packName = name;
@ -119,7 +119,7 @@ void DLCPack::setParentPack(DLCPack *parentPack)
m_parentPack = parentPack; m_parentPack = parentPack;
} }
void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &value) void DLCPack::addParameter(DLCManager::EDLCParameterType type, const std::wstring &value)
{ {
switch(type) switch(type)
{ {
@ -183,7 +183,7 @@ bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned in
return false; return false;
} }
DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path) DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const std::wstring &path)
{ {
DLCFile *newFile = NULL; DLCFile *newFile = NULL;
@ -192,7 +192,7 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
case DLCManager::e_DLCType_Skin: case DLCManager::e_DLCType_Skin:
{ {
std::vector<std::wstring> splitPath = stringSplit(path,L'/'); std::vector<std::wstring> splitPath = stringSplit(path,L'/');
wstring strippedPath = splitPath.back(); std::wstring strippedPath = splitPath.back();
newFile = new DLCSkinFile(strippedPath); newFile = new DLCSkinFile(strippedPath);
@ -212,7 +212,7 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
case DLCManager::e_DLCType_Cape: case DLCManager::e_DLCType_Cape:
{ {
std::vector<std::wstring> splitPath = stringSplit(path,L'/'); std::vector<std::wstring> splitPath = stringSplit(path,L'/');
wstring strippedPath = splitPath.back(); std::wstring strippedPath = splitPath.back();
newFile = new DLCCapeFile(strippedPath); newFile = new DLCCapeFile(strippedPath);
} }
break; break;
@ -248,13 +248,13 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
} }
// MGH - added this comp func, as the embedded func in find_if was confusing the PS3 compiler // MGH - added this comp func, as the embedded func in find_if was confusing the PS3 compiler
static const wstring *g_pathCmpString = NULL; static const std::wstring *g_pathCmpString = NULL;
static bool pathCmp(DLCFile *val) static bool pathCmp(DLCFile *val)
{ {
return (g_pathCmpString->compare(val->getPath()) == 0); return (g_pathCmpString->compare(val->getPath()) == 0);
} }
bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const wstring &path) bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path)
{ {
bool hasFile = false; bool hasFile = false;
if(type == DLCManager::e_DLCType_All) if(type == DLCManager::e_DLCType_All)
@ -268,7 +268,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const wstring &path
else else
{ {
g_pathCmpString = &path; g_pathCmpString = &path;
AUTO_VAR(it, find_if( m_files[type].begin(), m_files[type].end(), pathCmp )); AUTO_VAR(it, std::find_if( m_files[type].begin(), m_files[type].end(), pathCmp ));
hasFile = it != m_files[type].end(); hasFile = it != m_files[type].end();
if(!hasFile && m_parentPack ) if(!hasFile && m_parentPack )
{ {
@ -300,7 +300,7 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index)
return file; return file;
} }
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const wstring &path) DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const std::wstring &path)
{ {
DLCFile *file = NULL; DLCFile *file = NULL;
if(type == DLCManager::e_DLCType_All) if(type == DLCManager::e_DLCType_All)
@ -314,7 +314,7 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const wstring &path)
else else
{ {
g_pathCmpString = &path; g_pathCmpString = &path;
AUTO_VAR(it, find_if( m_files[type].begin(), m_files[type].end(), pathCmp )); AUTO_VAR(it, std::find_if( m_files[type].begin(), m_files[type].end(), pathCmp ));
if(it == m_files[type].end()) if(it == m_files[type].end())
{ {
@ -352,7 +352,7 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT
return count; return count;
}; };
DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found) DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found)
{ {
if(type == DLCManager::e_DLCType_All) if(type == DLCManager::e_DLCType_All)
{ {
@ -380,7 +380,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
return foundIndex; return foundIndex;
} }
bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path) bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path)
{ {
if(type == DLCManager::e_DLCType_All) if(type == DLCManager::e_DLCType_All)
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "DLCManager.h" #include "DLCManager.h"
class DLCFile; class DLCFile;
@ -8,19 +8,19 @@ class DLCSkinFile;
class DLCPack class DLCPack
{ {
private: private:
vector<DLCFile *> m_files[DLCManager::e_DLCType_Max]; std::vector<DLCFile *> m_files[DLCManager::e_DLCType_Max];
vector<DLCPack *> m_childPacks; std::vector<DLCPack *> m_childPacks;
DLCPack *m_parentPack; DLCPack *m_parentPack;
unordered_map<int, wstring> m_parameters; std::unordered_map<int, std::wstring> m_parameters;
wstring m_packName; std::wstring m_packName;
wstring m_dataPath; std::wstring m_dataPath;
DWORD m_dwLicenseMask; DWORD m_dwLicenseMask;
int m_dlcMountIndex; int m_dlcMountIndex;
XCONTENTDEVICEID m_dlcDeviceID; XCONTENTDEVICEID m_dlcDeviceID;
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
wstring m_wsProductId; std::wstring m_wsProductId;
#else #else
ULONGLONG m_ullFullOfferId; ULONGLONG m_ullFullOfferId;
#endif #endif
@ -31,13 +31,13 @@ private:
PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children.
public: public:
DLCPack(const wstring &name,DWORD dwLicenseMask); DLCPack(const std::wstring &name,DWORD dwLicenseMask);
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask); DLCPack(const std::wstring &name,const std::wstring &productID,DWORD dwLicenseMask);
#endif #endif
~DLCPack(); ~DLCPack();
wstring getFullDataPath() { return m_dataPath; } std::wstring getFullDataPath() { return m_dataPath; }
void SetDataPointer(PBYTE pbData) { m_data = pbData; } void SetDataPointer(PBYTE pbData) { m_data = pbData; }
@ -61,33 +61,33 @@ public:
void addChildPack(DLCPack *childPack); void addChildPack(DLCPack *childPack);
void setParentPack(DLCPack *parentPack); void setParentPack(DLCPack *parentPack);
void addParameter(DLCManager::EDLCParameterType type, const wstring &value); void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int &param); bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int &param);
void updateLicenseMask( DWORD dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; } void updateLicenseMask( DWORD dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; }
DWORD getLicenseMask( ) { return m_dwLicenseMask; } DWORD getLicenseMask( ) { return m_dwLicenseMask; }
wstring getName() { return m_packName; } std::wstring getName() { return m_packName; }
#ifdef _XBOX_ONE #ifdef _XBOX_ONE
wstring getPurchaseOfferId() { return m_wsProductId; } std::wstring getPurchaseOfferId() { return m_wsProductId; }
#else #else
ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; } ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; }
#endif #endif
DLCFile *addFile(DLCManager::EDLCType type, const wstring &path); DLCFile *addFile(DLCManager::EDLCType type, const std::wstring &path);
DLCFile *getFile(DLCManager::EDLCType type, DWORD index); DLCFile *getFile(DLCManager::EDLCType type, DWORD index);
DLCFile *getFile(DLCManager::EDLCType type, const wstring &path); DLCFile *getFile(DLCManager::EDLCType type, const std::wstring &path);
DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All); DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
DWORD getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found); DWORD getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found);
bool doesPackContainFile(DLCManager::EDLCType type, const wstring &path); bool doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path);
DWORD GetPackID() {return m_packId;} DWORD GetPackID() {return m_packId;}
DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); } DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
DWORD getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); } DWORD getSkinIndexAt(const std::wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); } DLCSkinFile *getSkinFile(const std::wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); } DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); } bool doesPackContainSkin(const std::wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path); bool hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path);
}; };

View file

@ -7,7 +7,7 @@
#include "../../../../Minecraft.World/Player/Player.h" #include "../../../../Minecraft.World/Player/Player.h"
#include "../../../../Minecraft.World/Util/StringHelpers.h" #include "../../../../Minecraft.World/Util/StringHelpers.h"
DLCSkinFile::DLCSkinFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Skin,path) DLCSkinFile::DLCSkinFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_Skin,path)
{ {
m_displayName = L""; m_displayName = L"";
m_themeName = L""; m_themeName = L"";
@ -21,7 +21,7 @@ void DLCSkinFile::addData(PBYTE pbData, DWORD dwBytes)
app.AddMemoryTextureFile(m_path,pbData,dwBytes); app.AddMemoryTextureFile(m_path,pbData,dwBytes);
} }
void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring &value) void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const std::wstring &value)
{ {
switch(type) switch(type)
{ {
@ -71,7 +71,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
maximumChars = 35; maximumChars = 35;
break; break;
} }
wstring creditValue = value; std::wstring creditValue = value;
while (creditValue.length() > maximumChars) while (creditValue.length() > maximumChars)
{ {
unsigned int i = 1; unsigned int i = 1;
@ -163,7 +163,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
} }
} }
// vector<ModelPart *> *DLCSkinFile::getAdditionalModelParts() // std::vector<ModelPart *> *DLCSkinFile::getAdditionalModelParts()
// { // {
// return &m_AdditionalModelParts; // return &m_AdditionalModelParts;
// } // }
@ -172,12 +172,12 @@ int DLCSkinFile::getAdditionalBoxesCount()
{ {
return (int)m_AdditionalBoxes.size(); return (int)m_AdditionalBoxes.size();
} }
vector<SKIN_BOX *> *DLCSkinFile::getAdditionalBoxes() std::vector<SKIN_BOX *> *DLCSkinFile::getAdditionalBoxes()
{ {
return &m_AdditionalBoxes; return &m_AdditionalBoxes;
} }
wstring DLCSkinFile::getParameterAsString(DLCManager::EDLCParameterType type) std::wstring DLCSkinFile::getParameterAsString(DLCManager::EDLCParameterType type)
{ {
switch(type) switch(type)
{ {

View file

@ -6,23 +6,23 @@ class DLCSkinFile : public DLCFile
{ {
private: private:
wstring m_displayName; std::wstring m_displayName;
wstring m_themeName; std::wstring m_themeName;
wstring m_cape; std::wstring m_cape;
unsigned int m_uiAnimOverrideBitmask; unsigned int m_uiAnimOverrideBitmask;
bool m_bIsFree; bool m_bIsFree;
vector<SKIN_BOX *> m_AdditionalBoxes; std::vector<SKIN_BOX *> m_AdditionalBoxes;
public: public:
DLCSkinFile(const wstring &path); DLCSkinFile(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type); virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type);
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type); virtual bool getParameterAsBool(DLCManager::EDLCParameterType type);
vector<SKIN_BOX *> *getAdditionalBoxes(); std::vector<SKIN_BOX *> *getAdditionalBoxes();
int getAdditionalBoxesCount(); int getAdditionalBoxesCount();
unsigned int getAnimOverrideBitmask() { return m_uiAnimOverrideBitmask;} unsigned int getAnimOverrideBitmask() { return m_uiAnimOverrideBitmask;}
bool isFree() {return m_bIsFree;} bool isFree() {return m_bIsFree;}

View file

@ -2,7 +2,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "DLCTextureFile.h" #include "DLCTextureFile.h"
DLCTextureFile::DLCTextureFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Texture,path) DLCTextureFile::DLCTextureFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_Texture,path)
{ {
m_bIsAnim = false; m_bIsAnim = false;
m_animString = L""; m_animString = L"";
@ -24,7 +24,7 @@ PBYTE DLCTextureFile::getData(DWORD &dwBytes)
return m_pbData; return m_pbData;
} }
void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, const wstring &value) void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, const std::wstring &value)
{ {
switch(type) switch(type)
{ {
@ -36,7 +36,7 @@ void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, const wstr
} }
} }
wstring DLCTextureFile::getParameterAsString(DLCManager::EDLCParameterType type) std::wstring DLCTextureFile::getParameterAsString(DLCManager::EDLCParameterType type)
{ {
switch(type) switch(type)
{ {

View file

@ -6,19 +6,19 @@ class DLCTextureFile : public DLCFile
private: private:
bool m_bIsAnim; bool m_bIsAnim;
wstring m_animString; std::wstring m_animString;
PBYTE m_pbData; PBYTE m_pbData;
DWORD m_dwBytes; DWORD m_dwBytes;
public: public:
DLCTextureFile(const wstring &path); DLCTextureFile(const std::wstring &path);
virtual void addData(PBYTE pbData, DWORD dwBytes); virtual void addData(PBYTE pbData, DWORD dwBytes);
virtual PBYTE getData(DWORD &dwBytes); virtual PBYTE getData(DWORD &dwBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type); virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type);
virtual bool getParameterAsBool(DLCManager::EDLCParameterType type); virtual bool getParameterAsBool(DLCManager::EDLCParameterType type);
}; };

View file

@ -2,7 +2,7 @@
#include "DLCManager.h" #include "DLCManager.h"
#include "DLCUIDataFile.h" #include "DLCUIDataFile.h"
DLCUIDataFile::DLCUIDataFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_UIData,path) DLCUIDataFile::DLCUIDataFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_UIData,path)
{ {
m_pbData = NULL; m_pbData = NULL;
m_dwBytes = 0; m_dwBytes = 0;

View file

@ -9,7 +9,7 @@ private:
bool m_canDeleteData; bool m_canDeleteData;
public: public:
DLCUIDataFile(const wstring &path); DLCUIDataFile(const std::wstring &path);
~DLCUIDataFile(); ~DLCUIDataFile();
using DLCFile::addData; using DLCFile::addData;

View file

@ -20,7 +20,7 @@ void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream *dos, UINT n
dos->writeUTF( _toString( m_enchantmentLevel ) ); dos->writeUTF( _toString( m_enchantmentLevel ) );
} }
void AddEnchantmentRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void AddEnchantmentRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"enchantmentId") == 0) if(attributeName.compare(L"enchantmentId") == 0)
{ {
@ -43,7 +43,7 @@ void AddEnchantmentRuleDefinition::addAttribute(const wstring &attributeName, co
} }
} }
bool AddEnchantmentRuleDefinition::enchantItem(shared_ptr<ItemInstance> item) bool AddEnchantmentRuleDefinition::enchantItem(std::shared_ptr<ItemInstance> item)
{ {
bool enchanted = false; bool enchanted = false;
if (item != NULL) if (item != NULL)
@ -60,7 +60,7 @@ bool AddEnchantmentRuleDefinition::enchantItem(shared_ptr<ItemInstance> item)
if(e != NULL && e->category->canEnchant(item->getItem())) if(e != NULL && e->category->canEnchant(item->getItem()))
{ {
int level = min(e->getMaxLevel(), m_enchantmentLevel); int level = std::min(e->getMaxLevel(), m_enchantmentLevel);
item->enchant(e, m_enchantmentLevel); item->enchant(e, m_enchantmentLevel);
enchanted = true; enchanted = true;
} }

View file

@ -17,7 +17,7 @@ public:
virtual void writeAttributes(DataOutputStream *, UINT numAttrs); virtual void writeAttributes(DataOutputStream *, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool enchantItem(shared_ptr<ItemInstance> item); bool enchantItem(std::shared_ptr<ItemInstance> item);
}; };

View file

@ -32,7 +32,7 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs
dos->writeUTF( _toString( m_slot ) ); dos->writeUTF( _toString( m_slot ) );
} }
void AddItemRuleDefinition::getChildren(vector<GameRuleDefinition *> *children) void AddItemRuleDefinition::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
GameRuleDefinition::getChildren( children ); GameRuleDefinition::getChildren( children );
for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); it++) for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); it++)
@ -56,7 +56,7 @@ GameRuleDefinition *AddItemRuleDefinition::addChild(ConsoleGameRules::EGameRuleT
return rule; return rule;
} }
void AddItemRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void AddItemRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"itemId") == 0) if(attributeName.compare(L"itemId") == 0)
{ {
@ -94,13 +94,13 @@ void AddItemRuleDefinition::addAttribute(const wstring &attributeName, const wst
} }
} }
bool AddItemRuleDefinition::addItemToContainer(shared_ptr<Container> container, int slotId) bool AddItemRuleDefinition::addItemToContainer(std::shared_ptr<Container> container, int slotId)
{ {
bool added = false; bool added = false;
if(Item::items[m_itemId] != NULL) if(Item::items[m_itemId] != NULL)
{ {
int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize()); int quantity = std::min(m_quantity, Item::items[m_itemId]->getMaxStackSize());
shared_ptr<ItemInstance> newItem = shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) ); std::shared_ptr<ItemInstance> newItem = std::shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) );
newItem->set4JData(m_dataTag); newItem->set4JData(m_dataTag);
for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it) for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it)
@ -118,9 +118,9 @@ bool AddItemRuleDefinition::addItemToContainer(shared_ptr<Container> container,
container->setItem( slotId, newItem ); container->setItem( slotId, newItem );
added = true; added = true;
} }
else if(dynamic_pointer_cast<Inventory>(container) != NULL) else if(std::dynamic_pointer_cast<Inventory>(container) != NULL)
{ {
added = dynamic_pointer_cast<Inventory>(container)->add(newItem); added = std::dynamic_pointer_cast<Inventory>(container)->add(newItem);
} }
} }
return added; return added;

View file

@ -13,18 +13,18 @@ private:
int m_auxValue; int m_auxValue;
int m_dataTag; int m_dataTag;
int m_slot; int m_slot;
vector<AddEnchantmentRuleDefinition *> m_enchantments; std::vector<AddEnchantmentRuleDefinition *> m_enchantments;
public: public:
AddItemRuleDefinition(); AddItemRuleDefinition();
virtual void writeAttributes(DataOutputStream *, UINT numAttributes); virtual void writeAttributes(DataOutputStream *, UINT numAttributes);
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; }
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool addItemToContainer(shared_ptr<Container> container, int slotId); bool addItemToContainer(std::shared_ptr<Container> container, int slotId);
}; };

View file

@ -53,7 +53,7 @@ void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream *dos, UINT n
} }
} }
void ApplySchematicRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void ApplySchematicRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"filename") == 0) if(attributeName.compare(L"filename") == 0)
{ {
@ -167,7 +167,7 @@ void ApplySchematicRuleDefinition::processSchematic(AABB *chunkBox, LevelChunk *
if(m_locationBox == NULL) updateLocationBox(); if(m_locationBox == NULL) updateLocationBox();
if(chunkBox->intersects( m_locationBox )) if(chunkBox->intersects( m_locationBox ))
{ {
m_locationBox->y1 = min((double)Level::maxBuildHeight, m_locationBox->y1 ); m_locationBox->y1 = std::min((double)Level::maxBuildHeight, m_locationBox->y1 );
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n",m_schematicName.c_str(),chunk->x, chunk->z); app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n",m_schematicName.c_str(),chunk->x, chunk->z);
@ -206,7 +206,7 @@ void ApplySchematicRuleDefinition::processSchematicLighting(AABB *chunkBox, Leve
if(m_locationBox == NULL) updateLocationBox(); if(m_locationBox == NULL) updateLocationBox();
if(chunkBox->intersects( m_locationBox )) if(chunkBox->intersects( m_locationBox ))
{ {
m_locationBox->y1 = min((double)Level::maxBuildHeight, m_locationBox->y1 ); m_locationBox->y1 = std::min((double)Level::maxBuildHeight, m_locationBox->y1 );
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n",m_schematicName.c_str(),chunk->x, chunk->z); app.DebugPrintf("Applying schematic %ls to chunk (%d,%d)\n",m_schematicName.c_str(),chunk->x, chunk->z);

View file

@ -12,7 +12,7 @@ class ApplySchematicRuleDefinition : public GameRuleDefinition
{ {
private: private:
LevelGenerationOptions *m_levelGenOptions; LevelGenerationOptions *m_levelGenOptions;
wstring m_schematicName; std::wstring m_schematicName;
ConsoleSchematicFile *m_schematic; ConsoleSchematicFile *m_schematic;
Vec3 *m_location; Vec3 *m_location;
AABB *m_locationBox; AABB *m_locationBox;
@ -31,7 +31,7 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
void processSchematic(AABB *chunkBox, LevelChunk *chunk); void processSchematic(AABB *chunkBox, LevelChunk *chunk);
void processSchematicLighting(AABB *chunkBox, LevelChunk *chunk); void processSchematicLighting(AABB *chunkBox, LevelChunk *chunk);
@ -41,7 +41,7 @@ public:
bool isComplete() { return m_completed; } bool isComplete() { return m_completed; }
wstring getSchematicName() { return m_schematicName; } std::wstring getSchematicName() { return m_schematicName; }
/** 4J-JEV: /** 4J-JEV:
* This GameRuleDefinition contains limited game state. * This GameRuleDefinition contains limited game state.

View file

@ -21,7 +21,7 @@ void BiomeOverride::writeAttributes(DataOutputStream *dos, UINT numAttrs)
dos->writeUTF(_toString(m_topTile)); dos->writeUTF(_toString(m_topTile));
} }
void BiomeOverride::addAttribute(const wstring &attributeName, const wstring &attributeValue) void BiomeOverride::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"tileId") == 0) if(attributeName.compare(L"tileId") == 0)
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "GameRuleDefinition.h" #include "GameRuleDefinition.h"
@ -16,7 +16,7 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_BiomeOverride; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_BiomeOverride; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool isBiome(int id); bool isBiome(int id);
void getTileValues(BYTE &tile, BYTE &topTile); void getTileValues(BYTE &tile, BYTE &topTile);

View file

@ -31,7 +31,7 @@ void CollectItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numA
dos->writeUTF( _toString( m_quantity ) ); dos->writeUTF( _toString( m_quantity ) );
} }
void CollectItemRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void CollectItemRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"itemId") == 0) if(attributeName.compare(L"itemId") == 0)
{ {
@ -74,7 +74,7 @@ void CollectItemRuleDefinition::populateGameRule(GameRulesInstance::EGameRulesIn
GameRuleDefinition::populateGameRule(type, rule); GameRuleDefinition::populateGameRule(type, rule);
} }
bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
{ {
bool statusChanged = false; bool statusChanged = false;
if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue) if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue)
@ -94,7 +94,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemIns
if(rule->getConnection() != NULL) if(rule->getConnection() != NULL)
{ {
rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0))); rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0)));
} }
} }
} }
@ -102,10 +102,10 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemIns
return statusChanged; return statusChanged;
} }
wstring CollectItemRuleDefinition::generateXml(shared_ptr<ItemInstance> item) std::wstring CollectItemRuleDefinition::generateXml(std::shared_ptr<ItemInstance> item)
{ {
// 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd // 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd
wstring xml = L""; std::wstring xml = L"";
if(item != NULL) if(item != NULL)
{ {
xml = L"<CollectItemRule itemId=\"" + _toString<int>(item->id) + L"\" quantity=\"SET\" descriptionName=\"OPTIONAL\" promptName=\"OPTIONAL\""; xml = L"<CollectItemRule itemId=\"" + _toString<int>(item->id) + L"\" quantity=\"SET\" descriptionName=\"OPTIONAL\" promptName=\"OPTIONAL\"";

View file

@ -21,7 +21,7 @@ public:
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CollectItemRule; } ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CollectItemRule; }
virtual void writeAttributes(DataOutputStream *, UINT numAttributes); virtual void writeAttributes(DataOutputStream *, UINT numAttributes);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
virtual int getGoal(); virtual int getGoal();
virtual int getProgress(GameRule *rule); virtual int getProgress(GameRule *rule);
@ -31,10 +31,10 @@ public:
void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item); bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
static wstring generateXml(shared_ptr<ItemInstance> item); static std::wstring generateXml(std::shared_ptr<ItemInstance> item);
private: private:
//static wstring generateXml(CollectItemRuleDefinition *ruleDef); //static std::wstring generateXml(CollectItemRuleDefinition *ruleDef);
}; };

View file

@ -5,7 +5,7 @@
#include "../../../../Minecraft.World/Network/Connection.h" #include "../../../../Minecraft.World/Network/Connection.h"
#include "../../../../Minecraft.World/Headers/net.minecraft.network.packet.h" #include "../../../../Minecraft.World/Headers/net.minecraft.network.packet.h"
void CompleteAllRuleDefinition::getChildren(vector<GameRuleDefinition *> *children) void CompleteAllRuleDefinition::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
CompoundGameRuleDefinition::getChildren(children); CompoundGameRuleDefinition::getChildren(children);
} }
@ -17,7 +17,7 @@ bool CompleteAllRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, int
return statusChanged; return statusChanged;
} }
bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
{ {
bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item); bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item);
if(statusChanged) updateStatus(rule); if(statusChanged) updateStatus(rule);
@ -51,15 +51,15 @@ void CompleteAllRuleDefinition::updateStatus(GameRule *rule)
auxValue = m_lastRuleStatusChanged->getAuxValue(); auxValue = m_lastRuleStatusChanged->getAuxValue();
m_lastRuleStatusChanged = NULL; m_lastRuleStatusChanged = NULL;
} }
rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData)))); rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData))));
} }
app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal); app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal);
} }
wstring CompleteAllRuleDefinition::generateDescriptionString(const wstring &description, void *data, int dataLength) std::wstring CompleteAllRuleDefinition::generateDescriptionString(const std::wstring &description, void *data, int dataLength)
{ {
PacketData *values = (PacketData *)data; PacketData *values = (PacketData *)data;
wstring newDesc = description; std::wstring newDesc = description;
newDesc = replaceAll(newDesc,L"{*progress*}",_toString<int>(values->progress)); newDesc = replaceAll(newDesc,L"{*progress*}",_toString<int>(values->progress));
newDesc = replaceAll(newDesc,L"{*goal*}",_toString<int>(values->goal)); newDesc = replaceAll(newDesc,L"{*goal*}",_toString<int>(values->goal));
return newDesc; return newDesc;

View file

@ -14,12 +14,12 @@ private:
public: public:
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CompleteAllRule; } ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CompleteAllRule; }
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item); virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
static wstring generateDescriptionString(const wstring &description, void *data, int dataLength); static std::wstring generateDescriptionString(const std::wstring &description, void *data, int dataLength);
private: private:
void updateStatus(GameRule *rule); void updateStatus(GameRule *rule);

View file

@ -17,7 +17,7 @@ CompoundGameRuleDefinition::~CompoundGameRuleDefinition()
} }
} }
void CompoundGameRuleDefinition::getChildren(vector<GameRuleDefinition *> *children) void CompoundGameRuleDefinition::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); it++) for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); it++)
@ -91,7 +91,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, in
return statusChanged; return statusChanged;
} }
bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
{ {
bool statusChanged = false; bool statusChanged = false;
for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it) for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it)
@ -109,7 +109,7 @@ bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemIn
return statusChanged; return statusChanged;
} }
void CompoundGameRuleDefinition::postProcessPlayer(shared_ptr<Player> player) void CompoundGameRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player)
{ {
for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it)
{ {

View file

@ -5,19 +5,19 @@
class CompoundGameRuleDefinition : public GameRuleDefinition class CompoundGameRuleDefinition : public GameRuleDefinition
{ {
protected: protected:
vector<GameRuleDefinition *> m_children; std::vector<GameRuleDefinition *> m_children;
protected: protected:
GameRuleDefinition *m_lastRuleStatusChanged; GameRuleDefinition *m_lastRuleStatusChanged;
public: public:
CompoundGameRuleDefinition(); CompoundGameRuleDefinition();
virtual ~CompoundGameRuleDefinition(); virtual ~CompoundGameRuleDefinition();
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item); virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
virtual void postProcessPlayer(shared_ptr<Player> player); virtual void postProcessPlayer(std::shared_ptr<Player> player);
}; };

View file

@ -15,7 +15,7 @@ ConsoleGenerateStructure::ConsoleGenerateStructure() : StructurePiece(0)
m_dimension = 0; m_dimension = 0;
} }
void ConsoleGenerateStructure::getChildren(vector<GameRuleDefinition *> *children) void ConsoleGenerateStructure::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
@ -72,7 +72,7 @@ void ConsoleGenerateStructure::writeAttributes(DataOutputStream *dos, UINT numAt
dos->writeUTF(_toString(m_dimension)); dos->writeUTF(_toString(m_dimension));
} }
void ConsoleGenerateStructure::addAttribute(const wstring &attributeName, const wstring &attributeValue) void ConsoleGenerateStructure::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"x") == 0) if(attributeName.compare(L"x") == 0)
{ {
@ -120,9 +120,9 @@ BoundingBox* ConsoleGenerateStructure::getBoundingBox()
for(AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it) for(AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it)
{ {
ConsoleGenerateStructureAction *action = *it; ConsoleGenerateStructureAction *action = *it;
maxX = max(maxX,action->getEndX()); maxX = std::max(maxX,action->getEndX());
maxY = max(maxY,action->getEndY()); maxY = std::max(maxY,action->getEndY());
maxZ = max(maxZ,action->getEndZ()); maxZ = std::max(maxZ,action->getEndZ());
} }
boundingBox = new BoundingBox(m_x, m_y, m_z, m_x + maxX, m_y + maxY, m_z + maxZ); boundingBox = new BoundingBox(m_x, m_y, m_z, m_x + maxX, m_y + maxY, m_z + maxZ);

View file

@ -13,18 +13,18 @@ class ConsoleGenerateStructure : public GameRuleDefinition, public StructurePiec
{ {
private: private:
int m_x, m_y, m_z; int m_x, m_y, m_z;
vector<ConsoleGenerateStructureAction *> m_actions; std::vector<ConsoleGenerateStructureAction *> m_actions;
int m_dimension; int m_dimension;
public: public:
ConsoleGenerateStructure(); ConsoleGenerateStructure();
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_GenerateStructure; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_GenerateStructure; }
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
// StructurePiece // StructurePiece
virtual BoundingBox *getBoundingBox(); virtual BoundingBox *getBoundingBox();

View file

@ -116,7 +116,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
for (int i = 0; i < tileEntityTags->size(); i++) for (int i = 0; i < tileEntityTags->size(); i++)
{ {
CompoundTag *teTag = tileEntityTags->get(i); CompoundTag *teTag = tileEntityTags->get(i);
shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag); std::shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
if(te == NULL) if(te == NULL)
{ {
@ -153,7 +153,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
#ifdef _DEBUG #ifdef _DEBUG
//app.DebugPrintf(1,"Loaded entity type %d at (%f,%f,%f)\n",(int)type,x,y,z); //app.DebugPrintf(1,"Loaded entity type %d at (%f,%f,%f)\n",(int)type,x,y,z);
#endif #endif
m_entities.push_back( pair<Vec3 *, CompoundTag *>(Vec3::newPermanent(x,y,z),(CompoundTag *)eTag->copy())); m_entities.push_back( std::pair<Vec3 *, CompoundTag *>(Vec3::newPermanent(x,y,z),(CompoundTag *)eTag->copy()));
} }
} }
delete tag; delete tag;
@ -186,15 +186,15 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
{ {
int xStart = max(destinationBox->x0, (double)chunk->x*16); int xStart = std::max(destinationBox->x0, (double)chunk->x*16);
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); int xEnd = std::min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
int yStart = destinationBox->y0; int yStart = destinationBox->y0;
int yEnd = destinationBox->y1; int yEnd = destinationBox->y1;
if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight; if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight;
int zStart = max(destinationBox->z0, (double)chunk->z*16); int zStart = std::max(destinationBox->z0, (double)chunk->z*16);
int zEnd = min(destinationBox->z1, (double)((zStart>>4)<<4) + 16); int zEnd = std::min(destinationBox->z1, (double)((zStart>>4)<<4) + 16);
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Range is (%d,%d,%d) to (%d,%d,%d)\n",xStart,yStart,zStart,xEnd-1,yEnd-1,zEnd-1); app.DebugPrintf("Range is (%d,%d,%d) to (%d,%d,%d)\n",xStart,yStart,zStart,xEnd-1,yEnd-1,zEnd-1);
@ -325,15 +325,15 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
// we can do the sort of lighting that might propagate out of the chunk. // we can do the sort of lighting that might propagate out of the chunk.
__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) __int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
{ {
int xStart = max(destinationBox->x0, (double)chunk->x*16); int xStart = std::max(destinationBox->x0, (double)chunk->x*16);
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); int xEnd = std::min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
int yStart = destinationBox->y0; int yStart = destinationBox->y0;
int yEnd = destinationBox->y1; int yEnd = destinationBox->y1;
if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight; if(yEnd > Level::maxBuildHeight) yEnd = Level::maxBuildHeight;
int zStart = max(destinationBox->z0, (double)chunk->z*16); int zStart = std::max(destinationBox->z0, (double)chunk->z*16);
int zEnd = min(destinationBox->z1, (double)((zStart>>4)<<4) + 16); int zEnd = std::min(destinationBox->z1, (double)((zStart>>4)<<4) + 16);
int rowBlocksIncluded = (yEnd-yStart)*(zEnd-zStart); int rowBlocksIncluded = (yEnd-yStart)*(zEnd-zStart);
int blocksIncluded = (xEnd-xStart)*rowBlocksIncluded; int blocksIncluded = (xEnd-xStart)*rowBlocksIncluded;
@ -433,7 +433,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
{ {
for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it) for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it)
{ {
shared_ptr<TileEntity> te = *it; std::shared_ptr<TileEntity> te = *it;
double targetX = te->x; double targetX = te->x;
double targetY = te->y + destinationBox->y0; double targetY = te->y + destinationBox->y0;
@ -444,7 +444,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ); Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ);
if( chunkBox->containsIncludingLowerBound(pos) ) if( chunkBox->containsIncludingLowerBound(pos) )
{ {
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); std::shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
if ( teCopy != NULL ) if ( teCopy != NULL )
{ {
@ -495,11 +495,11 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
} }
CompoundTag *eTag = it->second; CompoundTag *eTag = it->second;
shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL); std::shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
if( e->GetType() == eTYPE_PAINTING ) if( e->GetType() == eTYPE_PAINTING )
{ {
shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e); std::shared_ptr<Painting> painting = std::dynamic_pointer_cast<Painting>(e);
double tileX = painting->xTile; double tileX = painting->xTile;
double tileZ = painting->zTile; double tileZ = painting->zTile;
@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
} }
else if( e->GetType() == eTYPE_ITEM_FRAME ) else if( e->GetType() == eTYPE_ITEM_FRAME )
{ {
shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e); std::shared_ptr<ItemFrame> frame = std::dynamic_pointer_cast<ItemFrame>(e);
double tileX = frame->xTile; double tileX = frame->xTile;
double tileZ = frame->zTile; double tileZ = frame->zTile;
@ -678,12 +678,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
{ {
for (int zc = zc0; zc <= zc1; zc++) for (int zc = zc0; zc <= zc1; zc++)
{ {
vector<shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize); std::vector<std::shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it) for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it)
{ {
shared_ptr<TileEntity> te = *it; std::shared_ptr<TileEntity> te = *it;
CompoundTag *teTag = new CompoundTag(); CompoundTag *teTag = new CompoundTag();
shared_ptr<TileEntity> teCopy = te->clone(); std::shared_ptr<TileEntity> teCopy = te->clone();
// Adjust the tileEntity position to schematic coords from world co-ords // Adjust the tileEntity position to schematic coords from world co-ords
teCopy->x -= xStart; teCopy->x -= xStart;
@ -698,12 +698,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
tag.put(L"TileEntities", tileEntitiesTag); tag.put(L"TileEntities", tileEntitiesTag);
AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd); AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd);
vector<shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb); std::vector<std::shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities"); ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities");
for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it)
{ {
shared_ptr<Entity> e = *it; std::shared_ptr<Entity> e = *it;
bool mobCanBeSaved = false; bool mobCanBeSaved = false;
if(bSaveMobs) if(bSaveMobs)
@ -778,12 +778,12 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk *chunk, byteArray *data,
if(y0 < Level::COMPRESSED_CHUNK_SECTION_HEIGHT) if(y0 < Level::COMPRESSED_CHUNK_SECTION_HEIGHT)
{ {
lowerY0 = y0; lowerY0 = y0;
lowerY1 = min(y1, compressedHeight); lowerY1 = std::min(y1, compressedHeight);
bHasLower = true; bHasLower = true;
} }
if(y1 >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT) if(y1 >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT)
{ {
upperY0 = max(y0, compressedHeight) - Level::COMPRESSED_CHUNK_SECTION_HEIGHT; upperY0 = std::max(y0, compressedHeight) - Level::COMPRESSED_CHUNK_SECTION_HEIGHT;
upperY1 = y1 - Level::COMPRESSED_CHUNK_SECTION_HEIGHT; upperY1 = y1 - Level::COMPRESSED_CHUNK_SECTION_HEIGHT;
bHasUpper = true; bHasUpper = true;
} }
@ -900,12 +900,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa
if(y0 < Level::COMPRESSED_CHUNK_SECTION_HEIGHT) if(y0 < Level::COMPRESSED_CHUNK_SECTION_HEIGHT)
{ {
lowerY0 = y0; lowerY0 = y0;
lowerY1 = min(y1, compressedHeight); lowerY1 = std::min(y1, compressedHeight);
bHasLower = true; bHasLower = true;
} }
if(y1 >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT) if(y1 >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT)
{ {
upperY0 = max(y0, compressedHeight) - Level::COMPRESSED_CHUNK_SECTION_HEIGHT; upperY0 = std::max(y0, compressedHeight) - Level::COMPRESSED_CHUNK_SECTION_HEIGHT;
upperY1 = y1 - Level::COMPRESSED_CHUNK_SECTION_HEIGHT; upperY1 = y1 - Level::COMPRESSED_CHUNK_SECTION_HEIGHT;
bHasUpper = true; bHasUpper = true;
} }
@ -1005,12 +1005,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa
} }
} }
vector<shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1) std::vector<std::shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
{ {
vector<shared_ptr<TileEntity> > *result = new vector<shared_ptr<TileEntity> >; std::vector<std::shared_ptr<TileEntity> > *result = new std::vector<std::shared_ptr<TileEntity> >;
for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it) for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it)
{ {
shared_ptr<TileEntity> te = it->second; std::shared_ptr<TileEntity> te = it->second;
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1) if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1)
{ {
result->push_back(te); result->push_back(te);

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#define XBOX_SCHEMATIC_ORIGINAL_VERSION 1 #define XBOX_SCHEMATIC_ORIGINAL_VERSION 1
#define XBOX_SCHEMATIC_CURRENT_VERSION 2 #define XBOX_SCHEMATIC_CURRENT_VERSION 2
@ -55,8 +55,8 @@ public:
} XboxSchematicInitParam; } XboxSchematicInitParam;
private: private:
int m_xSize, m_ySize, m_zSize; int m_xSize, m_ySize, m_zSize;
vector<shared_ptr<TileEntity> > m_tileEntities; std::vector<std::shared_ptr<TileEntity> > m_tileEntities;
vector< pair<Vec3 *, CompoundTag *> > m_entities; std::vector< std::pair<Vec3 *, CompoundTag *> > m_entities;
public: public:
byteArray m_data; byteArray m_data;
@ -83,7 +83,7 @@ private:
void load_tags(DataInputStream *dis); void load_tags(DataInputStream *dis);
static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP); static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP);
static vector<shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1); static std::vector<std::shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1);
void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ); void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ);
void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ); void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ);

View file

@ -18,7 +18,7 @@ GameRule::~GameRule()
} }
} }
GameRule::ValueType GameRule::getParameter(const wstring &parameterName) GameRule::ValueType GameRule::getParameter(const std::wstring &parameterName)
{ {
if(m_parameters.find(parameterName) == m_parameters.end()) if(m_parameters.find(parameterName) == m_parameters.end())
{ {
@ -30,7 +30,7 @@ GameRule::ValueType GameRule::getParameter(const wstring &parameterName)
return m_parameters[parameterName]; return m_parameters[parameterName];
} }
void GameRule::setParameter(const wstring &parameterName,ValueType value) void GameRule::setParameter(const std::wstring &parameterName,ValueType value)
{ {
if(m_parameters.find(parameterName) == m_parameters.end()) if(m_parameters.find(parameterName) == m_parameters.end())
{ {
@ -53,7 +53,7 @@ GameRuleDefinition *GameRule::getGameRuleDefinition()
} }
void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); } void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); }
void GameRule::onCollectItem(shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); } void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); }
void GameRule::write(DataOutputStream *dos) void GameRule::write(DataOutputStream *dos)
{ {
@ -61,7 +61,7 @@ void GameRule::write(DataOutputStream *dos)
dos->writeInt(m_parameters.size()); dos->writeInt(m_parameters.size());
for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); it++) for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); it++)
{ {
wstring pName = (*it).first; std::wstring pName = (*it).first;
ValueType vType = (*it).second; ValueType vType = (*it).second;
dos->writeUTF( (*it).first ); dos->writeUTF( (*it).first );
@ -79,7 +79,7 @@ void GameRule::read(DataInputStream *dis)
int savedParams = dis->readInt(); int savedParams = dis->readInt();
for (int i = 0; i < savedParams; i++) for (int i = 0; i < savedParams; i++)
{ {
wstring pNames = dis->readUTF(); std::wstring pNames = dis->readUTF();
ValueType vType = getParameter(pNames); ValueType vType = getParameter(pNames);

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <unordered_map> #include <unordered_map>
@ -36,7 +36,7 @@ private:
Connection *m_connection; Connection *m_connection;
public: public:
typedef unordered_map<wstring,ValueType> stringValueMapType; typedef std::unordered_map<std::wstring,ValueType> stringValueMapType;
stringValueMapType m_parameters; // These are the members of this rule that maintain it's state stringValueMapType m_parameters; // These are the members of this rule that maintain it's state
public: public:
@ -45,17 +45,17 @@ public:
Connection *getConnection() { return m_connection; } Connection *getConnection() { return m_connection; }
ValueType getParameter(const wstring &parameterName); ValueType getParameter(const std::wstring &parameterName);
void setParameter(const wstring &parameterName,ValueType value); void setParameter(const std::wstring &parameterName,ValueType value);
GameRuleDefinition *getGameRuleDefinition(); GameRuleDefinition *getGameRuleDefinition();
// All the hooks go here // All the hooks go here
void onUseTile(int tileId, int x, int y, int z); void onUseTile(int tileId, int x, int y, int z);
void onCollectItem(shared_ptr<ItemInstance> item); void onCollectItem(std::shared_ptr<ItemInstance> item);
// 4J-JEV: For saving. // 4J-JEV: For saving.
//CompoundTag *toTags(unordered_map<GameRuleDefinition *, int> *map); //CompoundTag *toTags(std::unordered_map<GameRuleDefinition *, int> *map);
//static GameRule *fromTags(Connection *c, CompoundTag *cTag, vector<GameRuleDefinition *> *grds); //static GameRule *fromTags(Connection *c, CompoundTag *cTag, std::vector<GameRuleDefinition *> *grds);
void write(DataOutputStream *dos); void write(DataOutputStream *dos);
void read(DataInputStream *dos); void read(DataInputStream *dos);

View file

@ -20,7 +20,7 @@ void GameRuleDefinition::write(DataOutputStream *dos)
writeAttributes(dos, 0); writeAttributes(dos, 0);
// 4J-JEV: Get children. // 4J-JEV: Get children.
vector<GameRuleDefinition *> *children = new vector<GameRuleDefinition *>(); std::vector<GameRuleDefinition *> *children = new std::vector<GameRuleDefinition *>();
getChildren( children ); getChildren( children );
// Write children. // Write children.
@ -43,7 +43,7 @@ void GameRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttribut
dos->writeUTF(_toString(m_4JDataValue)); dos->writeUTF(_toString(m_4JDataValue));
} }
void GameRuleDefinition::getChildren(vector<GameRuleDefinition *> *children) {} void GameRuleDefinition::getChildren(std::vector<GameRuleDefinition *> *children) {}
GameRuleDefinition *GameRuleDefinition::addChild(ConsoleGameRules::EGameRuleType ruleType) GameRuleDefinition *GameRuleDefinition::addChild(ConsoleGameRules::EGameRuleType ruleType)
{ {
@ -53,7 +53,7 @@ GameRuleDefinition *GameRuleDefinition::addChild(ConsoleGameRules::EGameRuleType
return NULL; return NULL;
} }
void GameRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void GameRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"descriptionName") == 0) if(attributeName.compare(L"descriptionName") == 0)
{ {
@ -104,25 +104,25 @@ void GameRuleDefinition::setComplete(GameRule *rule, bool val)
rule->setParameter(L"bComplete",value); rule->setParameter(L"bComplete",value);
} }
vector<GameRuleDefinition *> *GameRuleDefinition::enumerate() std::vector<GameRuleDefinition *> *GameRuleDefinition::enumerate()
{ {
// Get Vector. // Get Vector.
vector<GameRuleDefinition *> *gRules; std::vector<GameRuleDefinition *> *gRules;
gRules = new vector<GameRuleDefinition *>(); gRules = new std::vector<GameRuleDefinition *>();
gRules->push_back(this); gRules->push_back(this);
getChildren(gRules); getChildren(gRules);
return gRules; return gRules;
} }
unordered_map<GameRuleDefinition *, int> *GameRuleDefinition::enumerateMap() std::unordered_map<GameRuleDefinition *, int> *GameRuleDefinition::enumerateMap()
{ {
unordered_map<GameRuleDefinition *, int> *out std::unordered_map<GameRuleDefinition *, int> *out
= new unordered_map<GameRuleDefinition *, int>(); = new std::unordered_map<GameRuleDefinition *, int>();
int i = 0; int i = 0;
vector<GameRuleDefinition *> *gRules = enumerate(); std::vector<GameRuleDefinition *> *gRules = enumerate();
for (AUTO_VAR(it, gRules->begin()); it != gRules->end(); it++) for (AUTO_VAR(it, gRules->begin()); it != gRules->end(); it++)
out->insert( pair<GameRuleDefinition *, int>( *it, i++ ) ); out->insert( std::pair<GameRuleDefinition *, int>( *it, i++ ) );
return out; return out;
} }
@ -136,9 +136,9 @@ GameRulesInstance *GameRuleDefinition::generateNewGameRulesInstance(GameRulesIns
return manager; return manager;
} }
wstring GameRuleDefinition::generateDescriptionString(ConsoleGameRules::EGameRuleType defType, const wstring &description, void *data, int dataLength) std::wstring GameRuleDefinition::generateDescriptionString(ConsoleGameRules::EGameRuleType defType, const std::wstring &description, void *data, int dataLength)
{ {
wstring formatted = description; std::wstring formatted = description;
switch(defType) switch(defType)
{ {
case ConsoleGameRules::eGameRuleType_CompleteAllRule: case ConsoleGameRules::eGameRuleType_CompleteAllRule:

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <unordered_map> #include <unordered_map>
#include <string> #include <string>
@ -21,8 +21,8 @@ private:
protected: protected:
// These attributes should map to those in the XSD GameRuleType // These attributes should map to those in the XSD GameRuleType
wstring m_descriptionId; std::wstring m_descriptionId;
wstring m_promptId; std::wstring m_promptId;
int m_4JDataValue; int m_4JDataValue;
public: public:
@ -35,10 +35,10 @@ public:
virtual void write(DataOutputStream *); virtual void write(DataOutputStream *);
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void getChildren(vector<GameRuleDefinition *> *); virtual void getChildren(std::vector<GameRuleDefinition *> *);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
@ -53,14 +53,14 @@ public:
// Here we should have functions for all the hooks, with a GameRule* as the first parameter // Here we should have functions for all the hooks, with a GameRule* as the first parameter
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; } virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; }
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) { return false; } virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) { return false; }
virtual void postProcessPlayer(shared_ptr<Player> player) { } virtual void postProcessPlayer(std::shared_ptr<Player> player) { }
vector<GameRuleDefinition *> *enumerate(); std::vector<GameRuleDefinition *> *enumerate();
unordered_map<GameRuleDefinition *, int> *enumerateMap(); std::unordered_map<GameRuleDefinition *, int> *enumerateMap();
// Static functions // Static functions
static GameRulesInstance *generateNewGameRulesInstance(GameRulesInstance::EGameRulesInstanceType type, LevelRuleset *rules, Connection *connection); static GameRulesInstance *generateNewGameRulesInstance(GameRulesInstance::EGameRulesInstanceType type, LevelRuleset *rules, Connection *connection);
static wstring generateDescriptionString(ConsoleGameRules::EGameRuleType defType, const wstring &description, void *data = NULL, int dataLength = 0); static std::wstring generateDescriptionString(ConsoleGameRules::EGameRuleType defType, const std::wstring &description, void *data = NULL, int dataLength = 0);
}; };

View file

@ -347,12 +347,12 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos)
for (int i = 0; i < ConsoleGameRules::eGameRuleAttr_Count; i++) dos->writeUTF( wchAttrNameA[i] ); for (int i = 0; i < ConsoleGameRules::eGameRuleAttr_Count; i++) dos->writeUTF( wchAttrNameA[i] );
// Write schematic files. // Write schematic files.
unordered_map<wstring, ConsoleSchematicFile *> *files; std::unordered_map<std::wstring, ConsoleSchematicFile *> *files;
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles(); files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
dos->writeInt( files->size() ); dos->writeInt( files->size() );
for (AUTO_VAR(it, files->begin()); it != files->end(); it++) for (AUTO_VAR(it, files->begin()); it != files->end(); it++)
{ {
wstring filename = it->first; std::wstring filename = it->first;
ConsoleSchematicFile *file = it->second; ConsoleSchematicFile *file = it->second;
ByteArrayOutputStream fileBaos; ByteArrayOutputStream fileBaos;
@ -470,18 +470,18 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UI
// string lookup. // string lookup.
UINT numStrings = contentDis->readInt(); UINT numStrings = contentDis->readInt();
vector<wstring> tagsAndAtts; std::vector<std::wstring> tagsAndAtts;
for (UINT i = 0; i < numStrings; i++) for (UINT i = 0; i < numStrings; i++)
tagsAndAtts.push_back( contentDis->readUTF() ); tagsAndAtts.push_back( contentDis->readUTF() );
unordered_map<int, ConsoleGameRules::EGameRuleType> tagIdMap; std::unordered_map<int, ConsoleGameRules::EGameRuleType> tagIdMap;
for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type) for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type)
{ {
for(UINT i = 0; i < numStrings; ++i) for(UINT i = 0; i < numStrings; ++i)
{ {
if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0) if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0)
{ {
tagIdMap.insert( unordered_map<int, ConsoleGameRules::EGameRuleType>::value_type(i, (ConsoleGameRules::EGameRuleType)type) ); tagIdMap.insert( std::unordered_map<int, ConsoleGameRules::EGameRuleType>::value_type(i, (ConsoleGameRules::EGameRuleType)type) );
break; break;
} }
} }
@ -489,14 +489,14 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UI
// 4J-JEV: TODO: As yet unused. // 4J-JEV: TODO: As yet unused.
/* /*
unordered_map<int, ConsoleGameRules::EGameRuleAttr> attrIdMap; std::unordered_map<int, ConsoleGameRules::EGameRuleAttr> attrIdMap;
for(int attr = (int)ConsoleGameRules::eGameRuleAttr_descriptionName; attr < (int)ConsoleGameRules::eGameRuleAttr_Count; ++attr) for(int attr = (int)ConsoleGameRules::eGameRuleAttr_descriptionName; attr < (int)ConsoleGameRules::eGameRuleAttr_Count; ++attr)
{ {
for (UINT i = 0; i < numStrings; i++) for (UINT i = 0; i < numStrings; i++)
{ {
if (tagsAndAtts[i].compare(wchAttrNameA[attr]) == 0) if (tagsAndAtts[i].compare(wchAttrNameA[attr]) == 0)
{ {
tagIdMap.insert( unordered_map<int, ConsoleGameRules::EGameRuleAttr>::value_type(i , (ConsoleGameRules::EGameRuleAttr)attr) ); tagIdMap.insert( std::unordered_map<int, ConsoleGameRules::EGameRuleAttr>::value_type(i , (ConsoleGameRules::EGameRuleAttr)attr) );
break; break;
} }
} }
@ -506,7 +506,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UI
UINT numFiles = contentDis->readInt(); UINT numFiles = contentDis->readInt();
for (UINT i = 0; i < numFiles; i++) for (UINT i = 0; i < numFiles; i++)
{ {
wstring sFilename = contentDis->readUTF(); std::wstring sFilename = contentDis->readUTF();
int length = contentDis->readInt(); int length = contentDis->readInt();
byteArray ba( length ); byteArray ba( length );
@ -581,19 +581,19 @@ LevelGenerationOptions *GameRuleManager::readHeader(DLCGameRulesHeader *grh)
return out; return out;
} }
void GameRuleManager::readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule) void GameRuleManager::readAttributes(DataInputStream *dis, std::vector<std::wstring> *tagsAndAtts, GameRuleDefinition *rule)
{ {
int numAttrs = dis->readInt(); int numAttrs = dis->readInt();
for (UINT att = 0; att < numAttrs; ++att) for (UINT att = 0; att < numAttrs; ++att)
{ {
int attID = dis->readInt(); int attID = dis->readInt();
wstring value = dis->readUTF(); std::wstring value = dis->readUTF();
if(rule != NULL) rule->addAttribute(tagsAndAtts->at(attID),value); if(rule != NULL) rule->addAttribute(tagsAndAtts->at(attID),value);
} }
} }
void GameRuleManager::readChildren(DataInputStream *dis, vector<wstring> *tagsAndAtts, unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule) void GameRuleManager::readChildren(DataInputStream *dis, std::vector<std::wstring> *tagsAndAtts, std::unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule)
{ {
int numChildren = dis->readInt(); int numChildren = dis->readInt();
for(UINT child = 0; child < numChildren; ++child) for(UINT child = 0; child < numChildren; ++child)
@ -633,9 +633,9 @@ void GameRuleManager::loadDefaultGameRules()
{ {
#ifdef _XBOX #ifdef _XBOX
#ifdef _TU_BUILD #ifdef _TU_BUILD
wstring fileRoot = L"UPDATE:\\res\\GameRules\\Tutorial.pck"; std::wstring fileRoot = L"UPDATE:\\res\\GameRules\\Tutorial.pck";
#else #else
wstring fileRoot = L"GAME:\\res\\TitleUpdate\\GameRules\\Tutorial.pck"; std::wstring fileRoot = L"GAME:\\res\\TitleUpdate\\GameRules\\Tutorial.pck";
#endif #endif
File packedTutorialFile(fileRoot); File packedTutorialFile(fileRoot);
if(loadGameRulesPack(&packedTutorialFile)) if(loadGameRulesPack(&packedTutorialFile))
@ -648,7 +648,7 @@ void GameRuleManager::loadDefaultGameRules()
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
// 4J Stu - Remove these just now // 4J Stu - Remove these just now
//File testRulesPath(L"GAME:\\GameRules"); //File testRulesPath(L"GAME:\\GameRules");
//vector<File *> *packFiles = testRulesPath.listFiles(); //std::vector<File *> *packFiles = testRulesPath.listFiles();
//for(AUTO_VAR(it,packFiles->begin()); it != packFiles->end(); ++it) //for(AUTO_VAR(it,packFiles->begin()); it != packFiles->end(); ++it)
//{ //{
@ -659,7 +659,7 @@ void GameRuleManager::loadDefaultGameRules()
#else // _XBOX #else // _XBOX
wstring fpTutorial = L"Tutorial.pck"; std::wstring fpTutorial = L"Tutorial.pck";
if(app.getArchiveFileSize(fpTutorial) >= 0) if(app.getArchiveFileSize(fpTutorial) >= 0)
{ {
DLCPack *pack = new DLCPack(L"",0xffffffff); DLCPack *pack = new DLCPack(L"",0xffffffff);
@ -749,7 +749,7 @@ void GameRuleManager::setLevelGenerationOptions(LevelGenerationOptions *levelGen
m_currentLevelGenerationOptions->reset_start(); m_currentLevelGenerationOptions->reset_start();
} }
LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key) LPCWSTR GameRuleManager::GetGameRulesString(const std::wstring &key)
{ {
if(m_currentGameRuleDefinitions != NULL && !key.empty() ) if(m_currentGameRuleDefinitions != NULL && !key.empty() )
{ {
@ -763,7 +763,7 @@ LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key)
LEVEL_GEN_ID GameRuleManager::addLevelGenerationOptions(LevelGenerationOptions *lgo) LEVEL_GEN_ID GameRuleManager::addLevelGenerationOptions(LevelGenerationOptions *lgo)
{ {
vector<LevelGenerationOptions *> *lgs = m_levelGenerators.getLevelGenerators(); std::vector<LevelGenerationOptions *> *lgs = m_levelGenerators.getLevelGenerators();
for (int i = 0; i<lgs->size(); i++) for (int i = 0; i<lgs->size(); i++)
if (lgs->at(i) == lgo) if (lgs->at(i) == lgo)

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; ////using namespace std;
#include "LevelGenerators.h" #include "LevelGenerators.h"
#include "LevelRules.h" #include "LevelRules.h"
@ -54,8 +54,8 @@ public:
bool readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings); bool readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings);
private: private:
void readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule); void readAttributes(DataInputStream *dis, std::vector<std::wstring> *tagsAndAtts, GameRuleDefinition *rule);
void readChildren(DataInputStream *dis, vector<wstring> *tagsAndAtts, unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule); void readChildren(DataInputStream *dis, std::vector<std::wstring> *tagsAndAtts, std::unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule);
public: public:
void processSchematics(LevelChunk *levelChunk); void processSchematics(LevelChunk *levelChunk);
@ -68,11 +68,11 @@ private:
LEVEL_GEN_ID addLevelGenerationOptions(LevelGenerationOptions *); LEVEL_GEN_ID addLevelGenerationOptions(LevelGenerationOptions *);
public: public:
vector<LevelGenerationOptions *> *getLevelGenerators() { return m_levelGenerators.getLevelGenerators(); } std::vector<LevelGenerationOptions *> *getLevelGenerators() { return m_levelGenerators.getLevelGenerators(); }
void setLevelGenerationOptions(LevelGenerationOptions *levelGen); void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; } LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; }
LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; } LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; }
LPCWSTR GetGameRulesString(const wstring &key); LPCWSTR GetGameRulesString(const std::wstring &key);
// 4J-JEV: // 4J-JEV:
// Properly cleans-up and unloads the current set of gameRules. // Properly cleans-up and unloads the current set of gameRules.

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
#include "GameRule.h" #include "GameRule.h"

View file

@ -24,20 +24,20 @@ JustGrSource::JustGrSource()
bool JustGrSource::requiresTexturePack() {return m_bRequiresTexturePack;} bool JustGrSource::requiresTexturePack() {return m_bRequiresTexturePack;}
UINT JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;} UINT JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;}
wstring JustGrSource::getDefaultSaveName() {return m_defaultSaveName;} std::wstring JustGrSource::getDefaultSaveName() {return m_defaultSaveName;}
LPCWSTR JustGrSource::getWorldName() {return m_worldName.c_str();} LPCWSTR JustGrSource::getWorldName() {return m_worldName.c_str();}
LPCWSTR JustGrSource::getDisplayName() {return m_displayName.c_str();} LPCWSTR JustGrSource::getDisplayName() {return m_displayName.c_str();}
wstring JustGrSource::getGrfPath() {return m_grfPath;} std::wstring JustGrSource::getGrfPath() {return m_grfPath;}
bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; }; bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; };
wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; }; std::wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; };
void JustGrSource::setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;} void JustGrSource::setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
void JustGrSource::setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;} void JustGrSource::setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;}
void JustGrSource::setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;} void JustGrSource::setDefaultSaveName(const std::wstring &x) {m_defaultSaveName = x;}
void JustGrSource::setWorldName(const wstring &x) {m_worldName = x;} void JustGrSource::setWorldName(const std::wstring &x) {m_worldName = x;}
void JustGrSource::setDisplayName(const wstring &x) {m_displayName = x;} void JustGrSource::setDisplayName(const std::wstring &x) {m_displayName = x;}
void JustGrSource::setGrfPath(const wstring &x) {m_grfPath = x;} void JustGrSource::setGrfPath(const std::wstring &x) {m_grfPath = x;}
void JustGrSource::setBaseSavePath(const wstring &x) { m_baseSavePath = x; m_bRequiresBaseSave = true; } void JustGrSource::setBaseSavePath(const std::wstring &x) { m_baseSavePath = x; m_bRequiresBaseSave = true; }
bool JustGrSource::ready() { return true; } bool JustGrSource::ready() { return true; }
@ -107,11 +107,11 @@ void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttr
dos->writeUTF(_toString(m_useFlatWorld)); dos->writeUTF(_toString(m_useFlatWorld));
} }
void LevelGenerationOptions::getChildren(vector<GameRuleDefinition *> *children) void LevelGenerationOptions::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
vector<ApplySchematicRuleDefinition *> used_schematics; std::vector<ApplySchematicRuleDefinition *> used_schematics;
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); it++) for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); it++)
if ( !(*it)->isComplete() ) if ( !(*it)->isComplete() )
used_schematics.push_back( *it ); used_schematics.push_back( *it );
@ -158,7 +158,7 @@ GameRuleDefinition *LevelGenerationOptions::addChild(ConsoleGameRules::EGameRule
return rule; return rule;
} }
void LevelGenerationOptions::addAttribute(const wstring &attributeName, const wstring &attributeValue) void LevelGenerationOptions::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"seed") == 0) if(attributeName.compare(L"seed") == 0)
{ {
@ -193,21 +193,21 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
} }
else if(attributeName.compare(L"saveName") == 0) else if(attributeName.compare(L"saveName") == 0)
{ {
wstring string(getString(attributeValue)); std::wstring string(getString(attributeValue));
if(!string.empty()) setDefaultSaveName( string ); if(!string.empty()) setDefaultSaveName( string );
else setDefaultSaveName( attributeValue ); else setDefaultSaveName( attributeValue );
app.DebugPrintf("LevelGenerationOptions: Adding parameter saveName=%ls\n", getDefaultSaveName().c_str()); app.DebugPrintf("LevelGenerationOptions: Adding parameter saveName=%ls\n", getDefaultSaveName().c_str());
} }
else if(attributeName.compare(L"worldName") == 0) else if(attributeName.compare(L"worldName") == 0)
{ {
wstring string(getString(attributeValue)); std::wstring string(getString(attributeValue));
if(!string.empty()) setWorldName( string ); if(!string.empty()) setWorldName( string );
else setWorldName( attributeValue ); else setWorldName( attributeValue );
app.DebugPrintf("LevelGenerationOptions: Adding parameter worldName=%ls\n", getWorldName()); app.DebugPrintf("LevelGenerationOptions: Adding parameter worldName=%ls\n", getWorldName());
} }
else if(attributeName.compare(L"displayName") == 0) else if(attributeName.compare(L"displayName") == 0)
{ {
wstring string(getString(attributeValue)); std::wstring string(getString(attributeValue));
if(!string.empty()) setDisplayName( string ); if(!string.empty()) setDisplayName( string );
else setDisplayName( attributeValue ); else setDisplayName( attributeValue );
app.DebugPrintf("LevelGenerationOptions: Adding parameter displayName=%ls\n", getDisplayName()); app.DebugPrintf("LevelGenerationOptions: Adding parameter displayName=%ls\n", getDisplayName());
@ -331,7 +331,7 @@ void LevelGenerationOptions::clearSchematics()
m_schematics.clear(); m_schematics.clear();
} }
ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen) ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const std::wstring &filename, PBYTE pbData, DWORD dwLen)
{ {
// If we have already loaded this, just return // If we have already loaded this, just return
AUTO_VAR(it, m_schematics.find(filename)); AUTO_VAR(it, m_schematics.find(filename));
@ -355,7 +355,7 @@ ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &f
return schematic; return schematic;
} }
ConsoleSchematicFile *LevelGenerationOptions::getSchematicFile(const wstring &filename) ConsoleSchematicFile *LevelGenerationOptions::getSchematicFile(const std::wstring &filename)
{ {
ConsoleSchematicFile *schematic = NULL; ConsoleSchematicFile *schematic = NULL;
// If we have already loaded this, just return // If we have already loaded this, just return
@ -367,7 +367,7 @@ ConsoleSchematicFile *LevelGenerationOptions::getSchematicFile(const wstring &fi
return schematic; return schematic;
} }
void LevelGenerationOptions::releaseSchematicFile(const wstring &filename) void LevelGenerationOptions::releaseSchematicFile(const std::wstring &filename)
{ {
// 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 // 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
//AUTO_VAR(it, m_schematics.find(filename)); //AUTO_VAR(it, m_schematics.find(filename));
@ -388,7 +388,7 @@ void LevelGenerationOptions::loadStringTable(StringTable *table)
m_stringTable = table; m_stringTable = table;
} }
LPCWSTR LevelGenerationOptions::getString(const wstring &key) LPCWSTR LevelGenerationOptions::getString(const std::wstring &key)
{ {
if(m_stringTable == NULL) if(m_stringTable == NULL)
{ {
@ -429,19 +429,19 @@ bool LevelGenerationOptions::isFeatureChunk(int chunkX, int chunkZ, StructureFea
return isFeature; return isFeature;
} }
unordered_map<wstring, ConsoleSchematicFile *> *LevelGenerationOptions::getUnfinishedSchematicFiles() std::unordered_map<std::wstring, ConsoleSchematicFile *> *LevelGenerationOptions::getUnfinishedSchematicFiles()
{ {
// Clean schematic rules. // Clean schematic rules.
unordered_set<wstring> usedFiles = unordered_set<wstring>(); std::unordered_set<std::wstring> usedFiles = std::unordered_set<std::wstring>();
for (AUTO_VAR(it, m_schematicRules.begin()); it!=m_schematicRules.end(); it++) for (AUTO_VAR(it, m_schematicRules.begin()); it!=m_schematicRules.end(); it++)
if ( !(*it)->isComplete() ) if ( !(*it)->isComplete() )
usedFiles.insert( (*it)->getSchematicName() ); usedFiles.insert( (*it)->getSchematicName() );
// Clean schematic files. // Clean schematic files.
unordered_map<wstring, ConsoleSchematicFile *> *out std::unordered_map<std::wstring, ConsoleSchematicFile *> *out
= new unordered_map<wstring, ConsoleSchematicFile *>(); = new std::unordered_map<std::wstring, ConsoleSchematicFile *>();
for (AUTO_VAR(it, usedFiles.begin()); it!=usedFiles.end(); it++) for (AUTO_VAR(it, usedFiles.begin()); it!=usedFiles.end(); it++)
out->insert( pair<wstring, ConsoleSchematicFile *>(*it, getSchematicFile(*it)) ); out->insert( std::pair<std::wstring, ConsoleSchematicFile *>(*it, getSchematicFile(*it)) );
return out; return out;
} }
@ -478,22 +478,22 @@ bool LevelGenerationOptions::isFromDLC() { return getSrc() == eSrc_fromDLC; }
bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); } bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); }
UINT LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); } UINT LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); }
wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); } std::wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); }
LPCWSTR LevelGenerationOptions::getWorldName() { return info()->getWorldName(); } LPCWSTR LevelGenerationOptions::getWorldName() { return info()->getWorldName(); }
LPCWSTR LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); } LPCWSTR LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); }
wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); } std::wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); }
bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); } bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); }
wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); } std::wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); }
void LevelGenerationOptions::setGrSource(GrSource *grs) { m_pSrc = grs; } void LevelGenerationOptions::setGrSource(GrSource *grs) { m_pSrc = grs; }
void LevelGenerationOptions::setRequiresTexturePack(bool x) { info()->setRequiresTexturePack(x); } void LevelGenerationOptions::setRequiresTexturePack(bool x) { info()->setRequiresTexturePack(x); }
void LevelGenerationOptions::setRequiredTexturePackId(UINT x) { info()->setRequiredTexturePackId(x); } void LevelGenerationOptions::setRequiredTexturePackId(UINT x) { info()->setRequiredTexturePackId(x); }
void LevelGenerationOptions::setDefaultSaveName(const wstring &x) { info()->setDefaultSaveName(x); } void LevelGenerationOptions::setDefaultSaveName(const std::wstring &x) { info()->setDefaultSaveName(x); }
void LevelGenerationOptions::setWorldName(const wstring &x) { info()->setWorldName(x); } void LevelGenerationOptions::setWorldName(const std::wstring &x) { info()->setWorldName(x); }
void LevelGenerationOptions::setDisplayName(const wstring &x) { info()->setDisplayName(x); } void LevelGenerationOptions::setDisplayName(const std::wstring &x) { info()->setDisplayName(x); }
void LevelGenerationOptions::setGrfPath(const wstring &x) { info()->setGrfPath(x); } void LevelGenerationOptions::setGrfPath(const std::wstring &x) { info()->setGrfPath(x); }
void LevelGenerationOptions::setBaseSavePath(const wstring &x) { info()->setBaseSavePath(x); } void LevelGenerationOptions::setBaseSavePath(const std::wstring &x) { info()->setBaseSavePath(x); }
bool LevelGenerationOptions::ready() { return info()->ready(); } bool LevelGenerationOptions::ready() { return info()->ready(); }

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
// #pragma message("LevelGenerationOptions.h ") // #pragma message("LevelGenerationOptions.h ")
@ -24,20 +24,20 @@ public:
virtual bool requiresTexturePack()=0; virtual bool requiresTexturePack()=0;
virtual UINT getRequiredTexturePackId()=0; virtual UINT getRequiredTexturePackId()=0;
virtual wstring getDefaultSaveName()=0; virtual std::wstring getDefaultSaveName()=0;
virtual LPCWSTR getWorldName()=0; virtual LPCWSTR getWorldName()=0;
virtual LPCWSTR getDisplayName()=0; virtual LPCWSTR getDisplayName()=0;
virtual wstring getGrfPath()=0; virtual std::wstring getGrfPath()=0;
virtual bool requiresBaseSave() = 0; virtual bool requiresBaseSave() = 0;
virtual wstring getBaseSavePath() = 0; virtual std::wstring getBaseSavePath() = 0;
virtual void setRequiresTexturePack(bool)=0; virtual void setRequiresTexturePack(bool)=0;
virtual void setRequiredTexturePackId(UINT)=0; virtual void setRequiredTexturePackId(UINT)=0;
virtual void setDefaultSaveName(const wstring &)=0; virtual void setDefaultSaveName(const std::wstring &)=0;
virtual void setWorldName(const wstring &)=0; virtual void setWorldName(const std::wstring &)=0;
virtual void setDisplayName(const wstring &)=0; virtual void setDisplayName(const std::wstring &)=0;
virtual void setGrfPath(const wstring &)=0; virtual void setGrfPath(const std::wstring &)=0;
virtual void setBaseSavePath(const wstring &)=0; virtual void setBaseSavePath(const std::wstring &)=0;
virtual bool ready()=0; virtual bool ready()=0;
@ -47,32 +47,32 @@ public:
class JustGrSource : public GrSource class JustGrSource : public GrSource
{ {
protected: protected:
wstring m_worldName; std::wstring m_worldName;
wstring m_displayName; std::wstring m_displayName;
wstring m_defaultSaveName; std::wstring m_defaultSaveName;
bool m_bRequiresTexturePack; bool m_bRequiresTexturePack;
int m_requiredTexturePackId; int m_requiredTexturePackId;
wstring m_grfPath; std::wstring m_grfPath;
wstring m_baseSavePath; std::wstring m_baseSavePath;
bool m_bRequiresBaseSave; bool m_bRequiresBaseSave;
public: public:
virtual bool requiresTexturePack(); virtual bool requiresTexturePack();
virtual UINT getRequiredTexturePackId(); virtual UINT getRequiredTexturePackId();
virtual wstring getDefaultSaveName(); virtual std::wstring getDefaultSaveName();
virtual LPCWSTR getWorldName(); virtual LPCWSTR getWorldName();
virtual LPCWSTR getDisplayName(); virtual LPCWSTR getDisplayName();
virtual wstring getGrfPath(); virtual std::wstring getGrfPath();
virtual bool requiresBaseSave(); virtual bool requiresBaseSave();
virtual wstring getBaseSavePath(); virtual std::wstring getBaseSavePath();
virtual void setRequiresTexturePack(bool x); virtual void setRequiresTexturePack(bool x);
virtual void setRequiredTexturePackId(UINT x); virtual void setRequiredTexturePackId(UINT x);
virtual void setDefaultSaveName(const wstring &x); virtual void setDefaultSaveName(const std::wstring &x);
virtual void setWorldName(const wstring &x); virtual void setWorldName(const std::wstring &x);
virtual void setDisplayName(const wstring &x); virtual void setDisplayName(const std::wstring &x);
virtual void setGrfPath(const wstring &x); virtual void setGrfPath(const std::wstring &x);
virtual void setBaseSavePath(const wstring &x); virtual void setBaseSavePath(const std::wstring &x);
virtual bool ready(); virtual bool ready();
@ -117,22 +117,22 @@ public:
bool requiresTexturePack(); bool requiresTexturePack();
UINT getRequiredTexturePackId(); UINT getRequiredTexturePackId();
wstring getDefaultSaveName(); std::wstring getDefaultSaveName();
LPCWSTR getWorldName(); LPCWSTR getWorldName();
LPCWSTR getDisplayName(); LPCWSTR getDisplayName();
wstring getGrfPath(); std::wstring getGrfPath();
bool requiresBaseSave(); bool requiresBaseSave();
wstring getBaseSavePath(); std::wstring getBaseSavePath();
void setGrSource(GrSource *grs); void setGrSource(GrSource *grs);
void setRequiresTexturePack(bool x); void setRequiresTexturePack(bool x);
void setRequiredTexturePackId(UINT x); void setRequiredTexturePackId(UINT x);
void setDefaultSaveName(const wstring &x); void setDefaultSaveName(const std::wstring &x);
void setWorldName(const wstring &x); void setWorldName(const std::wstring &x);
void setDisplayName(const wstring &x); void setDisplayName(const std::wstring &x);
void setGrfPath(const wstring &x); void setGrfPath(const std::wstring &x);
void setBaseSavePath(const wstring &x); void setBaseSavePath(const std::wstring &x);
bool ready(); bool ready();
@ -149,13 +149,13 @@ private:
__int64 m_seed; __int64 m_seed;
bool m_useFlatWorld; bool m_useFlatWorld;
Pos *m_spawnPos; Pos *m_spawnPos;
vector<ApplySchematicRuleDefinition *> m_schematicRules; std::vector<ApplySchematicRuleDefinition *> m_schematicRules;
vector<ConsoleGenerateStructure *> m_structureRules; std::vector<ConsoleGenerateStructure *> m_structureRules;
bool m_bHaveMinY; bool m_bHaveMinY;
int m_minY; int m_minY;
unordered_map<wstring, ConsoleSchematicFile *> m_schematics; std::unordered_map<std::wstring, ConsoleSchematicFile *> m_schematics;
vector<BiomeOverride *> m_biomeOverrides; std::vector<BiomeOverride *> m_biomeOverrides;
vector<StartFeature *> m_features; std::vector<StartFeature *> m_features;
bool m_bRequiresGameRules; bool m_bRequiresGameRules;
LevelRuleset *m_requiredGameRules; LevelRuleset *m_requiredGameRules;
@ -169,9 +169,9 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType(); virtual ConsoleGameRules::EGameRuleType getActionType();
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
__int64 getLevelSeed(); __int64 getLevelSeed();
Pos *getSpawnPos(); Pos *getSpawnPos();
@ -186,11 +186,11 @@ private:
void clearSchematics(); void clearSchematics();
public: public:
ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen); ConsoleSchematicFile *loadSchematicFile(const std::wstring &filename, PBYTE pbData, DWORD dwLen);
public: public:
ConsoleSchematicFile *getSchematicFile(const wstring &filename); ConsoleSchematicFile *getSchematicFile(const std::wstring &filename);
void releaseSchematicFile(const wstring &filename); void releaseSchematicFile(const std::wstring &filename);
bool requiresGameRules(); bool requiresGameRules();
void setRequiredGameRules(LevelRuleset *rules); void setRequiredGameRules(LevelRuleset *rules);
@ -200,9 +200,9 @@ public:
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature); bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
void loadStringTable(StringTable *table); void loadStringTable(StringTable *table);
LPCWSTR getString(const wstring &key); LPCWSTR getString(const std::wstring &key);
unordered_map<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles(); std::unordered_map<std::wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();
// 4J-JEV: // 4J-JEV:
// ApplySchematicRules contain limited state // ApplySchematicRules contain limited state

View file

@ -7,7 +7,7 @@ LevelGenerators::LevelGenerators()
{ {
} }
void LevelGenerators::addLevelGenerator(const wstring &displayName, LevelGenerationOptions *generator) void LevelGenerators::addLevelGenerator(const std::wstring &displayName, LevelGenerationOptions *generator)
{ {
if(!displayName.empty()) generator->setDisplayName(displayName); if(!displayName.empty()) generator->setDisplayName(displayName);
m_levelGenerators.push_back(generator); m_levelGenerators.push_back(generator);
@ -15,7 +15,7 @@ void LevelGenerators::addLevelGenerator(const wstring &displayName, LevelGenerat
void LevelGenerators::removeLevelGenerator(LevelGenerationOptions *generator) void LevelGenerators::removeLevelGenerator(LevelGenerationOptions *generator)
{ {
vector<LevelGenerationOptions *>::iterator it; std::vector<LevelGenerationOptions *>::iterator it;
while ( (it = find( m_levelGenerators.begin(), while ( (it = find( m_levelGenerators.begin(),
m_levelGenerators.end(), m_levelGenerators.end(),
generator ) ) generator ) )

View file

@ -1,19 +1,19 @@
#pragma once #pragma once
using namespace std; //using namespace std;
class LevelGenerationOptions; class LevelGenerationOptions;
class LevelGenerators class LevelGenerators
{ {
private: private:
vector<LevelGenerationOptions *> m_levelGenerators; std::vector<LevelGenerationOptions *> m_levelGenerators;
public: public:
LevelGenerators(); LevelGenerators();
void addLevelGenerator(const wstring &displayName, LevelGenerationOptions *generator); void addLevelGenerator(const std::wstring &displayName, LevelGenerationOptions *generator);
void removeLevelGenerator(LevelGenerationOptions *generator); void removeLevelGenerator(LevelGenerationOptions *generator);
vector<LevelGenerationOptions *> *getLevelGenerators() { return &m_levelGenerators; } std::vector<LevelGenerationOptions *> *getLevelGenerators() { return &m_levelGenerators; }
}; };

View file

@ -6,11 +6,11 @@ LevelRules::LevelRules()
{ {
} }
void LevelRules::addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen) void LevelRules::addLevelRule(const std::wstring &displayName, PBYTE pbData, DWORD dwLen)
{ {
} }
void LevelRules::addLevelRule(const wstring &displayName, LevelRuleset *rootRule) void LevelRules::addLevelRule(const std::wstring &displayName, LevelRuleset *rootRule)
{ {
} }

View file

@ -7,8 +7,8 @@ class LevelRules
public: public:
LevelRules(); LevelRules();
void addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen); void addLevelRule(const std::wstring &displayName, PBYTE pbData, DWORD dwLen);
void addLevelRule(const wstring &displayName, LevelRuleset *rootRule); void addLevelRule(const std::wstring &displayName, LevelRuleset *rootRule);
void removeLevelRule(LevelRuleset *removing); void removeLevelRule(LevelRuleset *removing);
}; };

View file

@ -17,7 +17,7 @@ LevelRuleset::~LevelRuleset()
} }
} }
void LevelRuleset::getChildren(vector<GameRuleDefinition *> *children) void LevelRuleset::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
CompoundGameRuleDefinition::getChildren(children); CompoundGameRuleDefinition::getChildren(children);
for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); it++) for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); it++)
@ -44,7 +44,7 @@ void LevelRuleset::loadStringTable(StringTable *table)
m_stringTable = table; m_stringTable = table;
} }
LPCWSTR LevelRuleset::getString(const wstring &key) LPCWSTR LevelRuleset::getString(const std::wstring &key)
{ {
if(m_stringTable == NULL) if(m_stringTable == NULL)
{ {
@ -56,7 +56,7 @@ LPCWSTR LevelRuleset::getString(const wstring &key)
} }
} }
AABB *LevelRuleset::getNamedArea(const wstring &areaName) AABB *LevelRuleset::getNamedArea(const std::wstring &areaName)
{ {
AABB *area = NULL; AABB *area = NULL;
for(AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it) for(AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it)

View file

@ -7,21 +7,21 @@ class NamedAreaRuleDefinition;
class LevelRuleset : public CompoundGameRuleDefinition class LevelRuleset : public CompoundGameRuleDefinition
{ {
private: private:
vector<NamedAreaRuleDefinition *> m_areas; std::vector<NamedAreaRuleDefinition *> m_areas;
StringTable *m_stringTable; StringTable *m_stringTable;
public: public:
LevelRuleset(); LevelRuleset();
~LevelRuleset(); ~LevelRuleset();
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; }
void loadStringTable(StringTable *table); void loadStringTable(StringTable *table);
LPCWSTR getString(const wstring &key); LPCWSTR getString(const std::wstring &key);
AABB *getNamedArea(const wstring &areaName); AABB *getNamedArea(const std::wstring &areaName);
StringTable *getStringTable() { return m_stringTable; } StringTable *getStringTable() { return m_stringTable; }
}; };

View file

@ -36,7 +36,7 @@ void NamedAreaRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAtt
dos->writeUTF(_toString(m_area->z1)); dos->writeUTF(_toString(m_area->z1));
} }
void NamedAreaRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void NamedAreaRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"name") == 0) if(attributeName.compare(L"name") == 0)
{ {

View file

@ -5,7 +5,7 @@
class NamedAreaRuleDefinition : public GameRuleDefinition class NamedAreaRuleDefinition : public GameRuleDefinition
{ {
private: private:
wstring m_name; std::wstring m_name;
AABB *m_area; AABB *m_area;
public: public:
@ -16,8 +16,8 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_NamedArea; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_NamedArea; }
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
AABB *getArea() { return m_area; } AABB *getArea() { return m_area; }
wstring getName() { return m_name; } std::wstring getName() { return m_name; }
}; };

View file

@ -21,7 +21,7 @@ void StartFeature::writeAttributes(DataOutputStream *dos, UINT numAttrs)
dos->writeUTF(_toString((int)m_feature)); dos->writeUTF(_toString((int)m_feature));
} }
void StartFeature::addAttribute(const wstring &attributeName, const wstring &attributeValue) void StartFeature::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"chunkX") == 0) if(attributeName.compare(L"chunkX") == 0)
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "GameRuleDefinition.h" #include "GameRuleDefinition.h"
#include "../../../../Minecraft.World/WorldGen/Features/StructureFeature.h" #include "../../../../Minecraft.World/WorldGen/Features/StructureFeature.h"
@ -16,7 +16,7 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_StartFeature; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_StartFeature; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature); bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
}; };

View file

@ -56,7 +56,7 @@ void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream *dos, UINT num
} }
} }
void UpdatePlayerRuleDefinition::getChildren(vector<GameRuleDefinition *> *children) void UpdatePlayerRuleDefinition::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
GameRuleDefinition::getChildren(children); GameRuleDefinition::getChildren(children);
for(AUTO_VAR(it, m_items.begin()); it!=m_items.end(); it++) for(AUTO_VAR(it, m_items.begin()); it!=m_items.end(); it++)
@ -80,7 +80,7 @@ GameRuleDefinition *UpdatePlayerRuleDefinition::addChild(ConsoleGameRules::EGame
return rule; return rule;
} }
void UpdatePlayerRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void UpdatePlayerRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"spawnX") == 0) if(attributeName.compare(L"spawnX") == 0)
{ {
@ -130,7 +130,7 @@ void UpdatePlayerRuleDefinition::addAttribute(const wstring &attributeName, cons
} }
} }
void UpdatePlayerRuleDefinition::postProcessPlayer(shared_ptr<Player> player) void UpdatePlayerRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player)
{ {
if(m_bUpdateHealth) if(m_bUpdateHealth)
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "GameRuleDefinition.h" #include "GameRuleDefinition.h"
@ -9,7 +9,7 @@ class Pos;
class UpdatePlayerRuleDefinition : public GameRuleDefinition class UpdatePlayerRuleDefinition : public GameRuleDefinition
{ {
private: private:
vector<AddItemRuleDefinition *> m_items; std::vector<AddItemRuleDefinition *> m_items;
bool m_bUpdateHealth, m_bUpdateFood, m_bUpdateYRot, m_bUpdateInventory; bool m_bUpdateHealth, m_bUpdateFood, m_bUpdateYRot, m_bUpdateInventory;
int m_health; int m_health;
@ -23,11 +23,11 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UpdatePlayerRule; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UpdatePlayerRule; }
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
virtual void postProcessPlayer(shared_ptr<Player> player); virtual void postProcessPlayer(std::shared_ptr<Player> player);
}; };

View file

@ -28,7 +28,7 @@ void UseTileRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttri
dos->writeUTF(_toString(m_coordinates.z)); dos->writeUTF(_toString(m_coordinates.z));
} }
void UseTileRuleDefinition::addAttribute(const wstring &attributeName, const wstring &attributeValue) void UseTileRuleDefinition::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"tileId") == 0) if(attributeName.compare(L"tileId") == 0)
{ {

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "GameRuleDefinition.h" #include "GameRuleDefinition.h"
#include "../../../../Minecraft.World/Util/Pos.h" #include "../../../../Minecraft.World/Util/Pos.h"
@ -18,7 +18,7 @@ public:
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UseTileRule; } ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UseTileRule; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
}; };

View file

@ -35,7 +35,7 @@ void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream *dos, UINT
dos->writeUTF(_toString(m_skipAir)); dos->writeUTF(_toString(m_skipAir));
} }
void XboxStructureActionGenerateBox::addAttribute(const wstring &attributeName, const wstring &attributeValue) void XboxStructureActionGenerateBox::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"x0") == 0) if(attributeName.compare(L"x0") == 0)
{ {

View file

@ -20,7 +20,7 @@ public:
virtual int getEndZ() { return m_z1; } virtual int getEndZ() { return m_z1; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool generateBoxInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); bool generateBoxInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
}; };

View file

@ -26,7 +26,7 @@ void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream *dos, UINT
} }
void XboxStructureActionPlaceBlock::addAttribute(const wstring &attributeName, const wstring &attributeValue) void XboxStructureActionPlaceBlock::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"x") == 0) if(attributeName.compare(L"x") == 0)
{ {

View file

@ -19,7 +19,7 @@ public:
virtual int getEndZ() { return m_z; } virtual int getEndZ() { return m_z; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool placeBlockInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); bool placeBlockInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
}; };

View file

@ -24,7 +24,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer()
//void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, UINT numAttrs) //void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, UINT numAttrs)
void XboxStructureActionPlaceContainer::getChildren(vector<GameRuleDefinition *> *children) void XboxStructureActionPlaceContainer::getChildren(std::vector<GameRuleDefinition *> *children)
{ {
XboxStructureActionPlaceBlock::getChildren(children); XboxStructureActionPlaceBlock::getChildren(children);
for(AUTO_VAR(it, m_items.begin()); it!=m_items.end(); it++) for(AUTO_VAR(it, m_items.begin()); it!=m_items.end(); it++)
@ -48,7 +48,7 @@ GameRuleDefinition *XboxStructureActionPlaceContainer::addChild(ConsoleGameRules
return rule; return rule;
} }
void XboxStructureActionPlaceContainer::addAttribute(const wstring &attributeName, const wstring &attributeValue) void XboxStructureActionPlaceContainer::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"facing") == 0) if(attributeName.compare(L"facing") == 0)
{ {
@ -78,7 +78,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st
} }
level->setTile( worldX, worldY, worldZ, m_tile ); level->setTile( worldX, worldY, worldZ, m_tile );
shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ )); std::shared_ptr<Container> container = std::dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ ));
app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ); app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ);
if ( container != NULL ) if ( container != NULL )

View file

@ -10,20 +10,20 @@ class BoundingBox;
class XboxStructureActionPlaceContainer : public XboxStructureActionPlaceBlock class XboxStructureActionPlaceContainer : public XboxStructureActionPlaceBlock
{ {
private: private:
vector<AddItemRuleDefinition *> m_items; std::vector<AddItemRuleDefinition *> m_items;
public: public:
XboxStructureActionPlaceContainer(); XboxStructureActionPlaceContainer();
~XboxStructureActionPlaceContainer(); ~XboxStructureActionPlaceContainer();
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceContainer; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceContainer; }
virtual void getChildren(vector<GameRuleDefinition *> *children); virtual void getChildren(std::vector<GameRuleDefinition *> *children);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
// 4J-JEV: Super class handles attr-facing fine. // 4J-JEV: Super class handles attr-facing fine.
//virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); //virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool placeContainerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); bool placeContainerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
}; };

View file

@ -23,7 +23,7 @@ void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream *dos, UIN
dos->writeUTF(m_entityId); dos->writeUTF(m_entityId);
} }
void XboxStructureActionPlaceSpawner::addAttribute(const wstring &attributeName, const wstring &attributeValue) void XboxStructureActionPlaceSpawner::addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue)
{ {
if(attributeName.compare(L"entity") == 0) if(attributeName.compare(L"entity") == 0)
{ {
@ -54,7 +54,7 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct
} }
level->setTile( worldX, worldY, worldZ, m_tile ); level->setTile( worldX, worldY, worldZ, m_tile );
shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ )); std::shared_ptr<MobSpawnerTileEntity> entity = std::dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ); wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ);

View file

@ -10,7 +10,7 @@ class GRFObject;
class XboxStructureActionPlaceSpawner : public XboxStructureActionPlaceBlock class XboxStructureActionPlaceSpawner : public XboxStructureActionPlaceBlock
{ {
private: private:
wstring m_entityId; std::wstring m_entityId;
public: public:
XboxStructureActionPlaceSpawner(); XboxStructureActionPlaceSpawner();
~XboxStructureActionPlaceSpawner(); ~XboxStructureActionPlaceSpawner();
@ -18,7 +18,7 @@ public:
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceSpawner; } virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceSpawner; }
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void addAttribute(const std::wstring &attributeName, const std::wstring &attributeValue);
bool placeSpawnerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); bool placeSpawnerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
}; };

View file

@ -4,7 +4,7 @@
#include "LeaderboardManager.h" #include "LeaderboardManager.h"
const wstring LeaderboardManager::filterNames[eNumFilterModes] = const std::wstring LeaderboardManager::filterNames[eNumFilterModes] =
{ {
L"Friends", L"MyScore", L"TopRank" L"Friends", L"MyScore", L"TopRank"
}; };
@ -85,7 +85,7 @@ void LeaderboardManager::printStats(ReadView &view)
{ {
ReadScore score = view.m_queries[i]; ReadScore score = view.m_queries[i];
app.DebugPrintf( "\tname='%s'\n", wstringtofilename(wstring(score.m_name)) ); app.DebugPrintf( "\tname='%s'\n", wstringtofilename(std::wstring(score.m_name)) );
app.DebugPrintf( "\trank='%i'\n", score.m_rank ); app.DebugPrintf( "\trank='%i'\n", score.m_rank );
app.DebugPrintf( "\tstatsData=[" ); app.DebugPrintf( "\tstatsData=[" );

View file

@ -84,7 +84,7 @@ public:
eFM_UNDEFINED eFM_UNDEFINED
}; };
static const wstring filterNames[eNumFilterModes]; static const std::wstring filterNames[eNumFilterModes];
typedef struct KillsRecord typedef struct KillsRecord
{ {
@ -167,7 +167,7 @@ public:
PlayerUID m_uid; // Player's unique identifier. PlayerUID m_uid; // Player's unique identifier.
unsigned long m_rank; // Rank of the player on this scoreboard. unsigned long m_rank; // Rank of the player on this scoreboard.
wstring m_name; // Player's display name. std::wstring m_name; // Player's display name.
unsigned long m_totalScore; // Sum of all the player's scores on this leaderboard. unsigned long m_totalScore; // Sum of all the player's scores on this leaderboard.

View file

@ -284,7 +284,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
// PRIMARY PLAYER // PRIMARY PLAYER
app.DebugPrintf("[NET] Creating ClientConnection (IsHost=%d)...\n", g_NetworkManager.IsHost()); app.DebugPrintf("[NET] Creating ClientConnection (IsHost=%d)...\n", g_NetworkManager.IsHost());
vector<ClientConnection *> createdConnections; std::vector<ClientConnection *> createdConnections;
ClientConnection *connection; ClientConnection *connection;
if( g_NetworkManager.IsHost() ) if( g_NetworkManager.IsHost() )
@ -327,7 +327,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
} }
app.DebugPrintf("[NET] Sending PreLoginPacket...\n"); app.DebugPrintf("[NET] Sending PreLoginPacket...\n");
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) ); connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
app.DebugPrintf("[NET] PreLoginPacket sent. Entering connection tick loop...\n"); app.DebugPrintf("[NET] PreLoginPacket sent. Entering connection tick loop...\n");
// Tick connection until we're ready to go. The stages involved in this are: // Tick connection until we're ready to go. The stages involved in this are:
@ -415,7 +415,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
// 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( shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) ); connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
createdConnections.push_back( connection ); createdConnections.push_back( connection );
@ -540,7 +540,7 @@ INetworkPlayer *CGameNetworkManager::GetPlayerBySmallId(unsigned char smallId)
} }
#ifdef _DURANGO #ifdef _DURANGO
wstring CGameNetworkManager::GetDisplayNameByGamertag(wstring gamertag) std::wstring CGameNetworkManager::GetDisplayNameByGamertag(std::wstring gamertag)
{ {
return s_pPlatformNetworkManager->GetDisplayNameByGamertag(gamertag); return s_pPlatformNetworkManager->GetDisplayNameByGamertag(gamertag);
} }
@ -634,7 +634,7 @@ bool CGameNetworkManager::SessionHasSpace(unsigned int spaceRequired)
return s_pPlatformNetworkManager->SessionHasSpace( spaceRequired ); return s_pPlatformNetworkManager->SessionHasSpace( spaceRequired );
} }
vector<FriendSessionInfo *> *CGameNetworkManager::GetSessionList(int iPad, int localPlayers, bool partyOnly) std::vector<FriendSessionInfo *> *CGameNetworkManager::GetSessionList(int iPad, int localPlayers, bool partyOnly)
{ {
return s_pPlatformNetworkManager->GetSessionList( iPad, localPlayers, partyOnly ); return s_pPlatformNetworkManager->GetSessionList( iPad, localPlayers, partyOnly );
} }
@ -1146,7 +1146,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
PlayerList *players = pServer->getPlayers(); PlayerList *players = pServer->getPlayers();
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
{ {
shared_ptr<ServerPlayer> servPlayer = *it; std::shared_ptr<ServerPlayer> servPlayer = *it;
if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() ) if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() )
{ {
servPlayer->connection->connection->getSocket()->setPlayer(NULL); servPlayer->connection->connection->getSocket()->setPlayer(NULL);
@ -1214,7 +1214,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
PlayerList *players = pServer->getPlayers(); PlayerList *players = pServer->getPlayers();
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
{ {
shared_ptr<ServerPlayer> servPlayer = *it; std::shared_ptr<ServerPlayer> servPlayer = *it;
if( servPlayer->getXuid() == localPlayerXuid ) if( servPlayer->getXuid() == localPlayerXuid )
{ {
servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) ); servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) );
@ -1271,7 +1271,7 @@ bool CGameNetworkManager::SystemFlagGet(INetworkPlayer *pNetworkPlayer, int inde
return s_pPlatformNetworkManager->SystemFlagGet( pNetworkPlayer, index ); return s_pPlatformNetworkManager->SystemFlagGet( pNetworkPlayer, index );
} }
wstring CGameNetworkManager::GatherStats() std::wstring CGameNetworkManager::GatherStats()
{ {
return s_pPlatformNetworkManager->GatherStats(); return s_pPlatformNetworkManager->GatherStats();
} }
@ -1289,7 +1289,7 @@ void CGameNetworkManager::renderQueueMeter()
#endif #endif
} }
wstring CGameNetworkManager::GatherRTTStats() std::wstring CGameNetworkManager::GatherRTTStats()
{ {
return s_pPlatformNetworkManager->GatherRTTStats(); return s_pPlatformNetworkManager->GatherRTTStats();
} }
@ -1403,7 +1403,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
Socket *socket = NULL; Socket *socket = NULL;
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()]; std::shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL) if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
{ {
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change // If we already have a MultiplayerLocalPlayer here then we are doing a session type change
@ -1440,7 +1440,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
if( connection->createdOk ) if( connection->createdOk )
{ {
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) ); connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) );
pMinecraft->addPendingLocalConnection(idx, connection); pMinecraft->addPendingLocalConnection(idx, connection);
} }
else else

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
#ifndef __linux__ #ifndef __linux__
#include <qnet.h> #include <qnet.h>
@ -69,7 +69,7 @@ public:
INetworkPlayer *GetPlayerByIndex(int playerIndex); INetworkPlayer *GetPlayerByIndex(int playerIndex);
INetworkPlayer *GetPlayerByXuid(PlayerUID xuid); INetworkPlayer *GetPlayerByXuid(PlayerUID xuid);
INetworkPlayer *GetPlayerBySmallId(unsigned char smallId); INetworkPlayer *GetPlayerBySmallId(unsigned char smallId);
wstring GetDisplayNameByGamertag(wstring gamertag); std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
INetworkPlayer *GetHostPlayer(); INetworkPlayer *GetHostPlayer();
void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam); void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
@ -96,7 +96,7 @@ public:
// Client session discovery // Client session discovery
bool SessionHasSpace(unsigned int spaceRequired = 1); bool SessionHasSpace(unsigned int spaceRequired = 1);
vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly); std::vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
@ -157,9 +157,9 @@ public:
#endif #endif
// Debug output // Debug output
wstring GatherStats(); std::wstring GatherStats();
void renderQueueMeter(); void renderQueueMeter();
wstring GatherRTTStats(); std::wstring GatherRTTStats();
// GUI debug output // GUI debug output

View file

@ -26,6 +26,6 @@ public:
virtual void SetSocket(Socket *pSocket) = 0; virtual void SetSocket(Socket *pSocket) = 0;
virtual Socket *GetSocket() = 0; virtual Socket *GetSocket() = 0;
virtual const wchar_t *GetOnlineName() = 0; virtual const wchar_t *GetOnlineName() = 0;
virtual wstring GetDisplayName() = 0; virtual std::wstring GetDisplayName() = 0;
virtual PlayerUID GetUID() = 0; virtual PlayerUID GetUID() = 0;
}; };

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
#ifndef __linux__ #ifndef __linux__
#include <qnet.h> #include <qnet.h>
@ -103,8 +103,8 @@ public:
virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index) = 0; virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index) = 0;
virtual bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index) = 0; virtual bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index) = 0;
virtual wstring GatherStats() = 0; virtual std::wstring GatherStats() = 0;
virtual wstring GatherRTTStats() = 0; virtual std::wstring GatherRTTStats() = 0;
private: private:
virtual void SetSessionTexturePackParentId( int id ) = 0; virtual void SetSessionTexturePackParentId( int id ) = 0;
@ -112,7 +112,7 @@ private:
virtual void Notify(int ID, ULONG_PTR Param) = 0; virtual void Notify(int ID, ULONG_PTR Param) = 0;
public: public:
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly) = 0; virtual std::vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly) = 0;
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession) = 0; virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession) = 0;
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) = 0; virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) = 0;
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) = 0; virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) = 0;
@ -123,6 +123,6 @@ public:
#endif #endif
#ifdef _DURANGO #ifdef _DURANGO
virtual wstring GetDisplayNameByGamertag(wstring gamertag) = 0; virtual std::wstring GetDisplayNameByGamertag(std::wstring gamertag) = 0;
#endif #endif
}; };

View file

@ -476,14 +476,14 @@ bool CPlatformNetworkManagerStub::SystemFlagGet(INetworkPlayer *pNetworkPlayer,
return false; return false;
} }
wstring CPlatformNetworkManagerStub::GatherStats() std::wstring CPlatformNetworkManagerStub::GatherStats()
{ {
return L""; return L"";
} }
wstring CPlatformNetworkManagerStub::GatherRTTStats() std::wstring CPlatformNetworkManagerStub::GatherRTTStats()
{ {
wstring stats(L"Rtt: "); std::wstring stats(L"Rtt: ");
wchar_t stat[32]; wchar_t stat[32];
@ -520,9 +520,9 @@ void CPlatformNetworkManagerStub::SetSearchResultsReady(int resultCount)
m_searchResultsCount[m_lastSearchPad] = resultCount; m_searchResultsCount[m_lastSearchPad] = resultCount;
} }
vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPad, int localPlayers, bool partyOnly) std::vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPad, int localPlayers, bool partyOnly)
{ {
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();; std::vector<FriendSessionInfo *> *filteredList = new std::vector<FriendSessionInfo *>();;
return filteredList; return filteredList;
} }

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
#include "../../../../Minecraft.World/Util/C4JThread.h" #include "../../../../Minecraft.World/Util/C4JThread.h"
#include "NetworkPlayerInterface.h" #include "NetworkPlayerInterface.h"
@ -66,7 +66,7 @@ private:
HANDLE m_notificationListener; HANDLE m_notificationListener;
vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system std::vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system
bool m_bLeavingGame; bool m_bLeavingGame;
bool m_bLeaveGameOnTick; bool m_bLeaveGameOnTick;
@ -101,7 +101,7 @@ private:
PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count); PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count);
~PlayerFlags(); ~PlayerFlags();
}; };
vector<PlayerFlags *> m_playerFlags; std::vector<PlayerFlags *> m_playerFlags;
void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer); void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer);
void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer); void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer);
void SystemFlagReset(); void SystemFlagReset();
@ -114,11 +114,11 @@ private:
float m_lastPlayerEventTimeStart; float m_lastPlayerEventTimeStart;
public: public:
wstring GatherStats(); std::wstring GatherStats();
wstring GatherRTTStats(); std::wstring GatherRTTStats();
private: private:
vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT]; std::vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT];
int m_searchResultsCount[XUSER_MAX_COUNT]; int m_searchResultsCount[XUSER_MAX_COUNT];
int m_lastSearchStartTime[XUSER_MAX_COUNT]; int m_lastSearchStartTime[XUSER_MAX_COUNT];
@ -145,7 +145,7 @@ private:
void SetSearchResultsReady(int resultCount = 0); void SetSearchResultsReady(int resultCount = 0);
vector<INetworkPlayer *>currentNetworkPlayers; std::vector<INetworkPlayer *>currentNetworkPlayers;
INetworkPlayer *addNetworkPlayer(IQNetPlayer *pQNetPlayer); INetworkPlayer *addNetworkPlayer(IQNetPlayer *pQNetPlayer);
void removeNetworkPlayer(IQNetPlayer *pQNetPlayer); void removeNetworkPlayer(IQNetPlayer *pQNetPlayer);
static INetworkPlayer *getNetworkPlayer(IQNetPlayer *pQNetPlayer); static INetworkPlayer *getNetworkPlayer(IQNetPlayer *pQNetPlayer);
@ -155,7 +155,7 @@ private:
virtual void Notify(int ID, ULONG_PTR Param); virtual void Notify(int ID, ULONG_PTR Param);
public: public:
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual std::vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );

View file

@ -98,7 +98,7 @@ const wchar_t *NetworkPlayerSony::GetOnlineName()
return m_sqrPlayer->GetName(); return m_sqrPlayer->GetName();
} }
wstring NetworkPlayerSony::GetDisplayName() std::wstring NetworkPlayerSony::GetDisplayName()
{ {
return m_sqrPlayer->GetName(); return m_sqrPlayer->GetName();
} }

View file

@ -28,7 +28,7 @@ public:
virtual void SetSocket(Socket *pSocket); virtual void SetSocket(Socket *pSocket);
virtual Socket *GetSocket(); virtual Socket *GetSocket();
virtual const wchar_t *GetOnlineName(); virtual const wchar_t *GetOnlineName();
virtual wstring GetDisplayName(); virtual std::wstring GetDisplayName();
virtual PlayerUID GetUID(); virtual PlayerUID GetUID();
void SetUID(PlayerUID UID); void SetUID(PlayerUID UID);

View file

@ -1064,7 +1064,7 @@ bool CPlatformNetworkManagerSony::SystemFlagGet(INetworkPlayer *pNetworkPlayer,
return false; return false;
} }
wstring CPlatformNetworkManagerSony::GatherStats() std::wstring CPlatformNetworkManagerSony::GatherStats()
{ {
#if 0 #if 0
return L"Queue messages: " + _toString(((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_MESSAGES ) ) return L"Queue messages: " + _toString(((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_MESSAGES ) )
@ -1074,10 +1074,10 @@ wstring CPlatformNetworkManagerSony::GatherStats()
#endif #endif
} }
wstring CPlatformNetworkManagerSony::GatherRTTStats() std::wstring CPlatformNetworkManagerSony::GatherRTTStats()
{ {
#if 0 #if 0
wstring stats(L"Rtt: "); std::wstring stats(L"Rtt: ");
wchar_t stat[32]; wchar_t stat[32];
@ -1141,9 +1141,9 @@ void CPlatformNetworkManagerSony::TickSearch()
} }
} }
vector<FriendSessionInfo *> *CPlatformNetworkManagerSony::GetSessionList(int iPad, int localPlayers, bool partyOnly) std::vector<FriendSessionInfo *> *CPlatformNetworkManagerSony::GetSessionList(int iPad, int localPlayers, bool partyOnly)
{ {
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>(); std::vector<FriendSessionInfo *> *filteredList = new std::vector<FriendSessionInfo *>();
for( int i = 0; i < m_searchResultsCount; i++ ) for( int i = 0; i < m_searchResultsCount; i++ )
{ {
if( m_pSearchResults[i].m_extData ) if( m_pSearchResults[i].m_extData )
@ -1219,7 +1219,7 @@ bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID session
{ {
sessionInfo->data = *(GameSessionData *)pxnqi->pbData; sessionInfo->data = *(GameSessionData *)pxnqi->pbData;
wstring gamerName = convStringToWstring(sessionInfo->data.hostName); std::wstring gamerName = convStringToWstring(sessionInfo->data.hostName);
swprintf(sessionInfo->displayLabel,app.GetString(IDS_GAME_HOST_NAME),L"MWWWWWWWWWWWWWWM");// gamerName.c_str() ); swprintf(sessionInfo->displayLabel,app.GetString(IDS_GAME_HOST_NAME),L"MWWWWWWWWWWWWWWM");// gamerName.c_str() );
} }
else else

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include <vector> #include <vector>
#include "../../../../../Minecraft.World/Util/C4JThread.h" #include "../../../../../Minecraft.World/Util/C4JThread.h"
#include "../NetworkPlayerInterface.h" #include "../NetworkPlayerInterface.h"
@ -86,7 +86,7 @@ private:
HANDLE m_notificationListener; HANDLE m_notificationListener;
vector<SQRNetworkPlayer *> m_machineSQRPrimaryPlayers; // collection of players that we deem to be the main one for that system std::vector<SQRNetworkPlayer *> m_machineSQRPrimaryPlayers; // collection of players that we deem to be the main one for that system
bool m_bLeavingGame; bool m_bLeavingGame;
bool m_bLeaveGameOnTick; bool m_bLeaveGameOnTick;
@ -122,7 +122,7 @@ private:
PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count); PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count);
~PlayerFlags(); ~PlayerFlags();
}; };
vector<PlayerFlags *> m_playerFlags; std::vector<PlayerFlags *> m_playerFlags;
void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer); void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer);
void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer); void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer);
void SystemFlagReset(); void SystemFlagReset();
@ -135,11 +135,11 @@ private:
float m_lastPlayerEventTimeStart; float m_lastPlayerEventTimeStart;
public: public:
wstring GatherStats(); std::wstring GatherStats();
wstring GatherRTTStats(); std::wstring GatherRTTStats();
private: private:
vector<FriendSessionInfo *> friendsSessions; std::vector<FriendSessionInfo *> friendsSessions;
int m_lastSearchStartTime; int m_lastSearchStartTime;
@ -156,7 +156,7 @@ private:
void TickSearch(); void TickSearch();
vector<INetworkPlayer *>currentNetworkPlayers; std::vector<INetworkPlayer *>currentNetworkPlayers;
INetworkPlayer *addNetworkPlayer(SQRNetworkPlayer *pSQRPlayer); INetworkPlayer *addNetworkPlayer(SQRNetworkPlayer *pSQRPlayer);
void removeNetworkPlayer(SQRNetworkPlayer *pSQRPlayer); void removeNetworkPlayer(SQRNetworkPlayer *pSQRPlayer);
static INetworkPlayer *getNetworkPlayer(SQRNetworkPlayer *pSQRPlayer); static INetworkPlayer *getNetworkPlayer(SQRNetworkPlayer *pSQRPlayer);
@ -166,7 +166,7 @@ private:
virtual void Notify(int ID, ULONG_PTR Param); virtual void Notify(int ID, ULONG_PTR Param);
public: public:
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual std::vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );

View file

@ -2,7 +2,7 @@
#include "Tutorial.h" #include "Tutorial.h"
#include "AreaTask.h" #include "AreaTask.h"
AreaTask::AreaTask(eTutorial_State state, Tutorial *tutorial, vector<TutorialConstraint *> *inConstraints, int descriptionId, EAreaTaskCompletionStates completionState) AreaTask::AreaTask(eTutorial_State state, Tutorial *tutorial, std::vector<TutorialConstraint *> *inConstraints, int descriptionId, EAreaTaskCompletionStates completionState)
: TutorialTask( tutorial, descriptionId, false, inConstraints, false, false, false ) : TutorialTask( tutorial, descriptionId, false, inConstraints, false, false, false )
{ {
m_tutorialState = state; m_tutorialState = state;

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
using namespace std; //using namespace std;
#include "TutorialTask.h" #include "TutorialTask.h"
@ -16,7 +16,7 @@ private:
EAreaTaskCompletionStates m_completionState; EAreaTaskCompletionStates m_completionState;
eTutorial_State m_tutorialState; eTutorial_State m_tutorialState;
public: public:
AreaTask(eTutorial_State state, Tutorial *tutorial, vector<TutorialConstraint *> *inConstraints, int descriptionId = -1, EAreaTaskCompletionStates completionState = eAreaTaskCompletion_CompleteOnActivation); AreaTask(eTutorial_State state, Tutorial *tutorial, std::vector<TutorialConstraint *> *inConstraints, int descriptionId = -1, EAreaTaskCompletionStates completionState = eAreaTaskCompletion_CompleteOnActivation);
virtual bool isCompleted(); virtual bool isCompleted();
virtual void setAsCurrentTask(bool active = true); virtual void setAsCurrentTask(bool active = true);
virtual void onStateChange(eTutorial_State newState); virtual void onStateChange(eTutorial_State newState);

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