refactor: unglob std::wstring

This commit is contained in:
Tropical 2026-03-06 11:50:22 -06:00
parent 41db813a6d
commit cdc08700e4
581 changed files with 2156 additions and 2154 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/
# ----- Build output directories ----- # ----- Build output directories -----
build/ build/
builddir/ builddir/

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

@ -500,7 +500,7 @@ void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); }
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; } char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
#else #else
char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; } char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; }
wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; } std::wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; }
#endif #endif
bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; }
void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {} void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {}

View file

@ -229,7 +229,7 @@ class ZipFile
public: public:
ZipFile(File *file) {} ZipFile(File *file) {}
InputStream *getInputStream(ZipEntry *entry) { return NULL; } InputStream *getInputStream(ZipEntry *entry) { return NULL; }
ZipEntry *getEntry(const wstring& name) {return NULL;} ZipEntry *getEntry(const std::wstring& name) {return NULL;}
void close() {} void close() {}
}; };
@ -245,7 +245,7 @@ public:
static void create() {} static void create() {}
static void destroy() {} static void destroy() {}
static bool isKeyDown(int) {return false;} static bool isKeyDown(int) {return false;}
static wstring getKeyName(int) { return L"KEYNAME"; } static std::wstring getKeyName(int) { return L"KEYNAME"; }
static void enableRepeatEvents(bool) {} static void enableRepeatEvents(bool) {}
static const int KEY_A = 0; static const int KEY_A = 0;
static const int KEY_B = 1; static const int KEY_B = 1;

View file

@ -1,4 +1,4 @@
#include "Build/stdafx.h" #include "Build/stdafx.h"
#include "ClientConstants.h" #include "ClientConstants.h"
const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft Xbox ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING; const std::wstring ClientConstants::VERSION_STRING = std::wstring(L"Minecraft Xbox ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING;

View file

@ -12,7 +12,7 @@ class ClientConstants
// INTERNAL DEVELOPMENT SETTINGS // INTERNAL DEVELOPMENT SETTINGS
public: public:
static const wstring VERSION_STRING; static const std::wstring VERSION_STRING;
static const bool DEADMAU5_CAMERA_CHEATS = false; static const bool DEADMAU5_CAMERA_CHEATS = false;
static const bool IS_DEMO_VERSION = false; static const bool IS_DEMO_VERSION = false;

View file

@ -32,7 +32,7 @@ void DemoMode::tick()
else if (day == 1) else if (day == 1)
{ {
Options *options = minecraft->options; Options *options = minecraft->options;
wstring message; std::wstring message;
if (time == 100) { if (time == 100) {
minecraft.gui.addMessage("Seed: " + minecraft.level.getSeed()); minecraft.gui.addMessage("Seed: " + minecraft.level.getSeed());

View file

@ -60,7 +60,7 @@ const Options::Option *Options::Option::getItem(int id)
return &options[id]; return &options[id];
} }
Options::Option::Option(const wstring& captionId, bool hasProgress, bool isBoolean) : _isProgress(hasProgress), _isBoolean(isBoolean), captionId(captionId) Options::Option::Option(const std::wstring& captionId, bool hasProgress, bool isBoolean) : _isProgress(hasProgress), _isBoolean(isBoolean), captionId(captionId)
{ {
} }
@ -79,29 +79,29 @@ int Options::Option::getId() const
return (int)(this-options); return (int)(this-options);
} }
wstring Options::Option::getCaptionId() const std::wstring Options::Option::getCaptionId() const
{ {
return captionId; return captionId;
} }
const wstring Options::RENDER_DISTANCE_NAMES[] = const std::wstring Options::RENDER_DISTANCE_NAMES[] =
{ {
L"options.renderDistance.far", L"options.renderDistance.normal", L"options.renderDistance.short", L"options.renderDistance.tiny" L"options.renderDistance.far", L"options.renderDistance.normal", L"options.renderDistance.short", L"options.renderDistance.tiny"
}; };
const wstring Options::DIFFICULTY_NAMES[] = const std::wstring Options::DIFFICULTY_NAMES[] =
{ {
L"options.difficulty.peaceful", L"options.difficulty.easy", L"options.difficulty.normal", L"options.difficulty.hard" L"options.difficulty.peaceful", L"options.difficulty.easy", L"options.difficulty.normal", L"options.difficulty.hard"
}; };
const wstring Options::GUI_SCALE[] = const std::wstring Options::GUI_SCALE[] =
{ {
L"options.guiScale.auto", L"options.guiScale.small", L"options.guiScale.normal", L"options.guiScale.large" L"options.guiScale.auto", L"options.guiScale.small", L"options.guiScale.normal", L"options.guiScale.large"
}; };
const wstring Options::FRAMERATE_LIMITS[] = const std::wstring Options::FRAMERATE_LIMITS[] =
{ {
L"performance.max", L"performance.balanced", L"performance.powersaver" L"performance.max", L"performance.balanced", L"performance.powersaver"
}; };
const wstring Options::PARTICLES[] = { const std::wstring Options::PARTICLES[] = {
L"options.particles.all", L"options.particles.decreased", L"options.particles.minimal" L"options.particles.all", L"options.particles.decreased", L"options.particles.minimal"
}; };
@ -184,13 +184,13 @@ Options::Options()
init(); init();
} }
wstring Options::getKeyDescription(int i) std::wstring Options::getKeyDescription(int i)
{ {
Language *language = Language::getInstance(); Language *language = Language::getInstance();
return language->getElement(keyMappings[i]->name); return language->getElement(keyMappings[i]->name);
} }
wstring Options::getKeyMessage(int i) std::wstring Options::getKeyMessage(int i)
{ {
int key = keyMappings[i]->key; int key = keyMappings[i]->key;
if (key < 0) { if (key < 0) {
@ -307,12 +307,12 @@ bool Options::getBooleanValue(const Options::Option *item)
return false; return false;
} }
wstring Options::getMessage(const Options::Option *item) std::wstring Options::getMessage(const Options::Option *item)
{ {
// 4J TODO, should these wstrings append rather than add? // 4J TODO, should these std::wstrings append rather than add?
Language *language = Language::getInstance(); Language *language = Language::getInstance();
wstring caption = language->getElement(item->getCaptionId()) + L": "; std::wstring caption = language->getElement(item->getCaptionId()) + L": ";
if (item->isProgress()) if (item->isProgress())
{ {
@ -411,14 +411,14 @@ void Options::load()
// 4J - was new BufferedReader(new FileReader(optionsFile)); // 4J - was new BufferedReader(new FileReader(optionsFile));
BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( optionsFile ) ) ); BufferedReader *br = new BufferedReader(new InputStreamReader( new FileInputStream( optionsFile ) ) );
wstring line = L""; std::wstring line = L"";
while ((line = br->readLine()) != L"") // 4J - was check against NULL - do we need to distinguish between empty lines and a fail here? while ((line = br->readLine()) != L"") // 4J - was check against NULL - do we need to distinguish between empty lines and a fail here?
{ {
// 4J - removed try/catch // 4J - removed try/catch
// try { // try {
wstring cmds[2]; std::wstring cmds[2];
int splitpos = (int)line.find(L":"); int splitpos = (int)line.find(L":");
if( splitpos == wstring::npos ) if( splitpos == std::wstring::npos )
{ {
cmds[0] = line; cmds[0] = line;
cmds[1] = L""; cmds[1] = L"";
@ -469,7 +469,7 @@ void Options::load()
} }
float Options::readFloat(wstring string) float Options::readFloat(std::wstring string)
{ {
if (string == L"true") return 1; if (string == L"true") return 1;
if (string == L"false") return 0; if (string == L"false") return 0;
@ -488,20 +488,20 @@ void Options::save()
dos.writeChars(L"music:" + _toString<float>(music) + L"\n"); dos.writeChars(L"music:" + _toString<float>(music) + L"\n");
dos.writeChars(L"sound:" + _toString<float>(sound) + L"\n"); dos.writeChars(L"sound:" + _toString<float>(sound) + L"\n");
dos.writeChars(L"invertYMouse:" + wstring(invertYMouse ? L"true" : L"false") + L"\n"); dos.writeChars(L"invertYMouse:" + std::wstring(invertYMouse ? L"true" : L"false") + L"\n");
dos.writeChars(L"mouseSensitivity:" + _toString<float>(sensitivity)); dos.writeChars(L"mouseSensitivity:" + _toString<float>(sensitivity));
dos.writeChars(L"fov:" + _toString<float>(fov)); dos.writeChars(L"fov:" + _toString<float>(fov));
dos.writeChars(L"gamma:" + _toString<float>(gamma)); dos.writeChars(L"gamma:" + _toString<float>(gamma));
dos.writeChars(L"viewDistance:" + _toString<int>(viewDistance)); dos.writeChars(L"viewDistance:" + _toString<int>(viewDistance));
dos.writeChars(L"guiScale:" + _toString<int>(guiScale)); dos.writeChars(L"guiScale:" + _toString<int>(guiScale));
dos.writeChars(L"particles:" + _toString<int>(particles)); dos.writeChars(L"particles:" + _toString<int>(particles));
dos.writeChars(L"bobView:" + wstring(bobView ? L"true" : L"false")); dos.writeChars(L"bobView:" + std::wstring(bobView ? L"true" : L"false"));
dos.writeChars(L"anaglyph3d:" + wstring(anaglyph3d ? L"true" : L"false")); dos.writeChars(L"anaglyph3d:" + std::wstring(anaglyph3d ? L"true" : L"false"));
dos.writeChars(L"advancedOpengl:" + wstring(advancedOpengl ? L"true" : L"false")); dos.writeChars(L"advancedOpengl:" + std::wstring(advancedOpengl ? L"true" : L"false"));
dos.writeChars(L"fpsLimit:" + _toString<int>(framerateLimit)); dos.writeChars(L"fpsLimit:" + _toString<int>(framerateLimit));
dos.writeChars(L"difficulty:" + _toString<int>(difficulty)); dos.writeChars(L"difficulty:" + _toString<int>(difficulty));
dos.writeChars(L"fancyGraphics:" + wstring(fancyGraphics ? L"true" : L"false")); dos.writeChars(L"fancyGraphics:" + std::wstring(fancyGraphics ? L"true" : L"false"));
dos.writeChars(L"ao:" + wstring(ambientOcclusion ? L"true" : L"false")); dos.writeChars(L"ao:" + std::wstring(ambientOcclusion ? L"true" : L"false"));
dos.writeChars(L"clouds:" + _toString<bool>(renderClouds)); dos.writeChars(L"clouds:" + _toString<bool>(renderClouds));
dos.writeChars(L"skin:" + skin); dos.writeChars(L"skin:" + skin);
dos.writeChars(L"lastServer:" + lastMpIp); dos.writeChars(L"lastServer:" + lastMpIp);

View file

@ -37,24 +37,24 @@ public:
private: private:
const bool _isProgress; const bool _isProgress;
const bool _isBoolean; const bool _isBoolean;
const wstring captionId; const std::wstring captionId;
public: public:
static const Option *getItem(int id); static const Option *getItem(int id);
Option(const wstring& captionId, bool hasProgress, bool isBoolean); Option(const std::wstring& captionId, bool hasProgress, bool isBoolean);
bool isProgress() const; bool isProgress() const;
bool isBoolean() const; bool isBoolean() const;
int getId() const; int getId() const;
wstring getCaptionId() const; std::wstring getCaptionId() const;
}; };
private: private:
static const wstring RENDER_DISTANCE_NAMES[]; static const std::wstring RENDER_DISTANCE_NAMES[];
static const wstring DIFFICULTY_NAMES[]; static const std::wstring DIFFICULTY_NAMES[];
static const wstring GUI_SCALE[]; static const std::wstring GUI_SCALE[];
static const wstring FRAMERATE_LIMITS[]; static const std::wstring FRAMERATE_LIMITS[];
static const wstring PARTICLES[]; static const std::wstring PARTICLES[];
public: public:
float music; float music;
@ -69,7 +69,7 @@ public:
bool fancyGraphics; bool fancyGraphics;
bool ambientOcclusion; bool ambientOcclusion;
bool renderClouds; bool renderClouds;
wstring skin; std::wstring skin;
KeyMapping *keyUp; KeyMapping *keyUp;
KeyMapping *keyLeft; KeyMapping *keyLeft;
@ -99,7 +99,7 @@ public:
bool hideGui; bool hideGui;
bool thirdPersonView; bool thirdPersonView;
bool renderDebug; bool renderDebug;
wstring lastMpIp; std::wstring lastMpIp;
bool isFlying; bool isFlying;
bool smoothCamera; bool smoothCamera;
@ -114,17 +114,17 @@ public:
void init(); // 4J added void init(); // 4J added
Options(Minecraft *minecraft, File workingDirectory); Options(Minecraft *minecraft, File workingDirectory);
Options(); Options();
wstring getKeyDescription(int i); std::wstring getKeyDescription(int i);
wstring getKeyMessage(int i); std::wstring getKeyMessage(int i);
void setKey(int i, int key); void setKey(int i, int key);
void set(const Options::Option *item, float value); void set(const Options::Option *item, float value);
void toggle(const Options::Option *option, int dir); void toggle(const Options::Option *option, int dir);
float getProgressValue(const Options::Option *item); float getProgressValue(const Options::Option *item);
bool getBooleanValue(const Options::Option *item); bool getBooleanValue(const Options::Option *item);
wstring getMessage(const Options::Option *item); std::wstring getMessage(const Options::Option *item);
void load(); void load();
private: private:
float readFloat(wstring string); float readFloat(std::wstring string);
public: public:
void save(); void save();

View file

@ -15,7 +15,7 @@ void Settings::saveProperties()
{ {
} }
wstring Settings::getString(const wstring& key, const wstring& defaultValue) std::wstring Settings::getString(const std::wstring& key, const std::wstring& defaultValue)
{ {
if(properties.find(key) == properties.end()) if(properties.find(key) == properties.end())
{ {
@ -25,7 +25,7 @@ wstring Settings::getString(const wstring& key, const wstring& defaultValue)
return properties[key]; return properties[key];
} }
int Settings::getInt(const wstring& key, int defaultValue) int Settings::getInt(const std::wstring& key, int defaultValue)
{ {
if(properties.find(key) == properties.end()) if(properties.find(key) == properties.end())
{ {
@ -35,7 +35,7 @@ int Settings::getInt(const wstring& key, int defaultValue)
return _fromString<int>(properties[key]); return _fromString<int>(properties[key]);
} }
bool Settings::getBoolean(const wstring& key, bool defaultValue) bool Settings::getBoolean(const std::wstring& key, bool defaultValue)
{ {
if(properties.find(key) == properties.end()) if(properties.find(key) == properties.end())
{ {
@ -48,7 +48,7 @@ bool Settings::getBoolean(const wstring& key, bool defaultValue)
return retval; return retval;
} }
void Settings::setBooleanAndSave(const wstring& key, bool value) void Settings::setBooleanAndSave(const std::wstring& key, bool value)
{ {
properties[key] = _toString<bool>(value); properties[key] = _toString<bool>(value);
saveProperties(); saveProperties();

View file

@ -7,15 +7,15 @@ class Settings
// public static Logger logger = Logger.getLogger("Minecraft"); // public static Logger logger = Logger.getLogger("Minecraft");
// private Properties properties = new Properties(); // private Properties properties = new Properties();
private: private:
std::unordered_map<wstring,wstring> properties; // 4J - TODO was Properties type, will need to implement something we can serialise/deserialise too std::unordered_map<std::wstring,std::wstring> properties; // 4J - TODO was Properties type, will need to implement something we can serialise/deserialise too
//File *file; //File *file;
public: public:
Settings(File *file); Settings(File *file);
void generateNewProperties(); void generateNewProperties();
void saveProperties(); void saveProperties();
wstring getString(const wstring& key, const wstring& defaultValue); std::wstring getString(const std::wstring& key, const std::wstring& defaultValue);
int getInt(const wstring& key, int defaultValue); int getInt(const std::wstring& key, int defaultValue);
bool getBoolean(const wstring& key, bool defaultValue); bool getBoolean(const std::wstring& key, bool defaultValue);
void setBooleanAndSave(const wstring& key, bool value); void setBooleanAndSave(const std::wstring& key, bool value);
}; };

View file

@ -28,7 +28,7 @@ private:
public: public:
StatsSyncher(User *user, StatsCounter *statsCounter, File *dir); StatsSyncher(User *user, StatsCounter *statsCounter, File *dir);
private: private:
void attemptRename(File *dir, const wstring& name, File *to); void attemptRename(File *dir, const std::wstring& name, File *to);
std::unordered_map<Stat *, int> *loadStatsFromDisk(File *file, File *tmp, File *old); std::unordered_map<Stat *, int> *loadStatsFromDisk(File *file, File *tmp, File *old);
std::unordered_map<Stat *, int> *loadStatsFromDisk(File *file); std::unordered_map<Stat *, int> *loadStatsFromDisk(File *file);
void doSend(std::unordered_map<Stat *, int> *stats); void doSend(std::unordered_map<Stat *, int> *stats);

View file

@ -1,7 +1,7 @@
#include "../Build/stdafx.h" #include "../Build/stdafx.h"
#include "ConsoleInput.h" #include "ConsoleInput.h"
ConsoleInput::ConsoleInput(const wstring& msg, ConsoleInputSource *source) ConsoleInput::ConsoleInput(const std::wstring& msg, ConsoleInputSource *source)
{ {
this->msg = msg; this->msg = msg;
this->source = source; this->source = source;

View file

@ -5,8 +5,8 @@ using namespace std;
class ConsoleInput class ConsoleInput
{ {
public: public:
wstring msg; std::wstring msg;
ConsoleInputSource *source; ConsoleInputSource *source;
ConsoleInput(const wstring& msg, ConsoleInputSource *source); ConsoleInput(const std::wstring& msg, ConsoleInputSource *source);
}; };

View file

@ -3,7 +3,7 @@
class ConsoleInputSource class ConsoleInputSource
{ {
public: public:
virtual void info(const wstring& string) = 0; virtual void info(const std::wstring& string) = 0;
virtual void warn(const wstring& string) = 0; virtual void warn(const std::wstring& string) = 0;
virtual wstring getConsoleName() = 0; virtual std::wstring getConsoleName() = 0;
}; };

View file

@ -1,7 +1,7 @@
#include "../Build/stdafx.h" #include "../Build/stdafx.h"
#include "KeyMapping.h" #include "KeyMapping.h"
KeyMapping::KeyMapping(const wstring& name, int key) KeyMapping::KeyMapping(const std::wstring& name, int key)
{ {
this->name = name; this->name = name;
this->key = key; this->key = key;

View file

@ -4,7 +4,7 @@ using namespace std;
class KeyMapping class KeyMapping
{ {
public: public:
wstring name; std::wstring name;
int key; int key;
KeyMapping(const wstring& name, int key); KeyMapping(const std::wstring& name, int key);
}; };

View file

@ -11,7 +11,7 @@ LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings(
1.0 1.0
); );
DemoLevel::DemoLevel(std::shared_ptr<LevelStorage> levelStorage, const wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS) DemoLevel::DemoLevel(std::shared_ptr<LevelStorage> levelStorage, const std::wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS)
{ {
} }

View file

@ -10,7 +10,7 @@ private:
static const int DEMO_SPAWN_Z = -731; static const int DEMO_SPAWN_Z = -731;
static LevelSettings DEMO_LEVEL_SETTINGS; static LevelSettings DEMO_LEVEL_SETTINGS;
public: public:
DemoLevel(std::shared_ptr<LevelStorage> levelStorage, const wstring& levelName); DemoLevel(std::shared_ptr<LevelStorage> levelStorage, const std::wstring& levelName);
DemoLevel(Level *level, Dimension *dimension); DemoLevel(Level *level, Dimension *dimension);
protected: protected:
virtual void setInitialSpawn(); virtual void setInitialSpawn();

View file

@ -3,7 +3,7 @@
#include "../../Minecraft.World/Level/Storage/SavedDataStorage.h" #include "../../Minecraft.World/Level/Storage/SavedDataStorage.h"
#include "../../Minecraft.World/Level/DerivedLevelData.h" #include "../../Minecraft.World/Level/DerivedLevelData.h"
DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage> levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped) DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage> levelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped)
: ServerLevel(server, levelStorage, levelName, dimension, levelSettings) : ServerLevel(server, levelStorage, levelName, dimension, levelSettings)
{ {
// 4J-PB - we're going to override the savedDataStorage, so we need to delete the current one // 4J-PB - we're going to override the savedDataStorage, so we need to delete the current one

View file

@ -4,7 +4,7 @@
class DerivedServerLevel : public ServerLevel class DerivedServerLevel : public ServerLevel
{ {
public: public:
DerivedServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped); DerivedServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped);
~DerivedServerLevel(); ~DerivedServerLevel();
protected: protected:

View file

@ -91,7 +91,7 @@ void ServerLevel::staticCtor()
}; };
ServerLevel::ServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) ServerLevel::ServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false)
{ {
InitializeCriticalSection(&m_limiterCS); InitializeCriticalSection(&m_limiterCS);
InitializeCriticalSection(&m_tickNextTickCS); InitializeCriticalSection(&m_tickNextTickCS);

View file

@ -41,7 +41,7 @@ private:
int activeTileEventsList; int activeTileEventsList;
public: public:
static void staticCtor(); static void staticCtor();
ServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings); ServerLevel(MinecraftServer *server, std::shared_ptr<LevelStorage>levelStorage, const std::wstring& levelName, int dimension, LevelSettings *levelSettings);
~ServerLevel(); ~ServerLevel();
void tick(); void tick();
Biome::MobSpawnerData *getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z); Biome::MobSpawnerData *getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z);

View file

@ -20,7 +20,7 @@ ServerLevelListener::ServerLevelListener(MinecraftServer *server, ServerLevel *l
// 4J removed - // 4J removed -
/* /*
void ServerLevelListener::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) void ServerLevelListener::addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za)
{ {
} }
*/ */
@ -98,7 +98,7 @@ void ServerLevelListener::tileLightChanged(int x, int y, int z)
{ {
} }
void ServerLevelListener::playStreamingMusic(const wstring& name, int x, int y, int z) void ServerLevelListener::playStreamingMusic(const std::wstring& name, int x, int y, int z)
{ {
} }

View file

@ -15,7 +15,7 @@ private:
public: public:
ServerLevelListener(MinecraftServer *server, ServerLevel *level); ServerLevelListener(MinecraftServer *server, ServerLevel *level);
// 4J removed - virtual void addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za); // 4J removed - virtual void addParticle(const std::wstring& name, double x, double y, double z, double xa, double ya, double za);
virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za); // 4J added virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za); // 4J added
virtual void allChanged(); virtual void allChanged();
virtual void entityAdded(std::shared_ptr<Entity> entity); virtual void entityAdded(std::shared_ptr<Entity> entity);
@ -27,7 +27,7 @@ public:
virtual void skyColorChanged(); virtual void skyColorChanged();
virtual void tileChanged(int x, int y, int z); virtual void tileChanged(int x, int y, int z);
virtual void tileLightChanged(int x, int y, int z); virtual void tileLightChanged(int x, int y, int z);
virtual void playStreamingMusic(const wstring& name, int x, int y, int z); virtual void playStreamingMusic(const std::wstring& name, int x, int y, int z);
virtual void levelEvent(std::shared_ptr<Player> source, int type, int x, int y, int z, int data); virtual void levelEvent(std::shared_ptr<Player> source, int type, int x, int y, int z, int data);
virtual void destroyTileProgress(int id, int x, int y, int z, int progress); virtual void destroyTileProgress(int id, int x, int y, int z, int progress);
}; };

View file

@ -236,7 +236,7 @@ void Minecraft::clearConnectionFailed()
app.SetDisconnectReason(DisconnectPacket::eDisconnect_None); app.SetDisconnectReason(DisconnectPacket::eDisconnect_None);
} }
void Minecraft::connectTo(const wstring& server, int port) void Minecraft::connectTo(const std::wstring& server, int port)
{ {
connectToIp = server; connectToIp = server;
connectToPort = port; connectToPort = port;
@ -489,7 +489,7 @@ File Minecraft::getWorkingDirectory()
return workDir; return workDir;
} }
File Minecraft::getWorkingDirectory(const wstring& applicationName) File Minecraft::getWorkingDirectory(const std::wstring& applicationName)
{ {
#if 0 #if 0
// 4J - original version // 4J - original version
@ -514,7 +514,7 @@ File Minecraft::getWorkingDirectory(const wstring& applicationName)
if (!workingDirectory.exists()) if (!workingDirectory.mkdirs()) throw new RuntimeException("The working directory could not be created: " + workingDirectory); if (!workingDirectory.exists()) if (!workingDirectory.mkdirs()) throw new RuntimeException("The working directory could not be created: " + workingDirectory);
return workingDirectory; return workingDirectory;
#else #else
wstring userHome = L"home"; // 4J - TODO std::wstring userHome = L"home"; // 4J - TODO
File workingDirectory(userHome, applicationName); File workingDirectory(userHome, applicationName);
// 4J Removed // 4J Removed
//if (!workingDirectory.exists()) //if (!workingDirectory.exists())
@ -620,7 +620,7 @@ void Minecraft::setScreen(Screen *screen)
}*/ }*/
} }
void Minecraft::checkGlError(const wstring& string) void Minecraft::checkGlError(const std::wstring& string)
{ {
// 4J - TODO // 4J - TODO
} }
@ -1025,7 +1025,7 @@ void Minecraft::addPendingLocalConnection(int idx, ClientConnection *connection)
m_pendingLocalConnections[idx] = connection; m_pendingLocalConnections[idx] = connection;
} }
std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin) std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int idx, const std::wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin)
{ {
if( clientConnection == NULL) return nullptr; if( clientConnection == NULL) return nullptr;
@ -1037,7 +1037,7 @@ std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int id
// A temp player displaying a connecting screen // A temp player displaying a connecting screen
tempScreenSection = localplayers[idx]->m_iScreenSection; tempScreenSection = localplayers[idx]->m_iScreenSection;
} }
wstring prevname = user->name; std::wstring prevname = user->name;
user->name = name; user->name = name;
// Don't need this any more // Don't need this any more
@ -3439,7 +3439,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
#endif #endif
if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) ) if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) )
{ {
wstring itemName = L""; std::wstring itemName = L"";
std::shared_ptr<ItemInstance> selectedItem = player->getSelectedItem(); std::shared_ptr<ItemInstance> selectedItem = player->getSelectedItem();
// Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item // Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item
int iCount=0; int iCount=0;
@ -3782,16 +3782,16 @@ bool Minecraft::isClientSide()
return level != NULL && level->isClientSide; return level != NULL && level->isClientSide;
} }
void Minecraft::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, const wstring& levelName, LevelSettings *levelSettings) void Minecraft::selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, const std::wstring& levelName, LevelSettings *levelSettings)
{ {
} }
bool Minecraft::saveSlot(int slot, const wstring& name) bool Minecraft::saveSlot(int slot, const std::wstring& name)
{ {
return false; return false;
} }
bool Minecraft::loadSlot(const wstring& userName, int slot) bool Minecraft::loadSlot(const std::wstring& userName, int slot)
{ {
return false; return false;
} }
@ -3835,7 +3835,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension)
// Also causing ambiguous call for some reason // Also causing ambiguous call for some reason
// as it is matching std::shared_ptr<Player> from the func below with bool from this one // as it is matching std::shared_ptr<Player> from the func below with bool from this one
//void Minecraft::setLevel(Level *level, const wstring& message, bool doForceStatsSave /*= true*/) //void Minecraft::setLevel(Level *level, const std::wstring& message, bool doForceStatsSave /*= true*/)
//{ //{
// setLevel(level, message, NULL, doForceStatsSave); // setLevel(level, message, NULL, doForceStatsSave);
//} //}
@ -4106,11 +4106,11 @@ void Minecraft::prepareLevel(int title)
} }
} }
void Minecraft::fileDownloaded(const wstring& name, File *file) void Minecraft::fileDownloaded(const std::wstring& name, File *file)
{ {
int p = (int)name.find(L"/"); int p = (int)name.find(L"/");
wstring category = name.substr(0, p); std::wstring category = name.substr(0, p);
wstring name2 = name.substr(p + 1); std::wstring name2 = name.substr(p + 1);
toLower(category); toLower(category);
if (category==L"sound") if (category==L"sound")
{ {
@ -4134,25 +4134,25 @@ void Minecraft::fileDownloaded(const wstring& name, File *file)
} }
} }
wstring Minecraft::gatherStats1() std::wstring Minecraft::gatherStats1()
{ {
//return levelRenderer->gatherStats1(); //return levelRenderer->gatherStats1();
return L"Time to autosave: " + _toString<unsigned int>( app.SecondsToAutosave() ) + L"s"; return L"Time to autosave: " + _toString<unsigned int>( app.SecondsToAutosave() ) + L"s";
} }
wstring Minecraft::gatherStats2() std::wstring Minecraft::gatherStats2()
{ {
return g_NetworkManager.GatherStats(); return g_NetworkManager.GatherStats();
//return levelRenderer->gatherStats2(); //return levelRenderer->gatherStats2();
} }
wstring Minecraft::gatherStats3() std::wstring Minecraft::gatherStats3()
{ {
return g_NetworkManager.GatherRTTStats(); return g_NetworkManager.GatherRTTStats();
//return L"P: " + particleEngine->countParticles() + L". T: " + level->gatherStats(); //return L"P: " + particleEngine->countParticles() + L". T: " + level->gatherStats();
} }
wstring Minecraft::gatherStats4() std::wstring Minecraft::gatherStats4()
{ {
return level->gatherChunkSourceStats(); return level->gatherChunkSourceStats();
} }
@ -4260,15 +4260,15 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId)
gameRenderer->EnableUpdateThread(); gameRenderer->EnableUpdateThread();
} }
void Minecraft::start(const wstring& name, const wstring& sid) void Minecraft::start(const std::wstring& name, const std::wstring& sid)
{ {
startAndConnectTo(name, sid, L""); startAndConnectTo(name, sid, L"");
} }
void Minecraft::startAndConnectTo(const wstring& name, const wstring& sid, const wstring& url) void Minecraft::startAndConnectTo(const std::wstring& name, const std::wstring& sid, const std::wstring& url)
{ {
bool fullScreen = false; bool fullScreen = false;
wstring userName = name; std::wstring userName = name;
/* 4J - removed window handling things here /* 4J - removed window handling things here
final Frame frame = new Frame("Minecraft"); final Frame frame = new Frame("Minecraft");
@ -4367,8 +4367,8 @@ int g_iMainThreadId;
void Minecraft::main() void Minecraft::main()
{ {
wstring name; std::wstring name;
wstring sessionId; std::wstring sessionId;
//g_iMainThreadId = GetCurrentThreadId(); //g_iMainThreadId = GetCurrentThreadId();
@ -4452,7 +4452,7 @@ bool Minecraft::renderDebug()
return (m_instance != NULL && m_instance->options->renderDebug); return (m_instance != NULL && m_instance->options->renderDebug);
} }
bool Minecraft::handleClientSideCommand(const wstring& chatMessage) bool Minecraft::handleClientSideCommand(const std::wstring& chatMessage)
{ {
/* 4J - TODO /* 4J - TODO
if (chatMessage.startsWith("/")) { if (chatMessage.startsWith("/")) {
@ -4841,7 +4841,7 @@ void Minecraft::tickAllConnections()
setLocalPlayerIdx(oldIdx); setLocalPlayerIdx(oldIdx);
} }
bool Minecraft::addPendingClientTextureRequest(const wstring &textureName) bool Minecraft::addPendingClientTextureRequest(const std::wstring &textureName)
{ {
AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName));
if( it == m_pendingTextureRequests.end() ) if( it == m_pendingTextureRequests.end() )
@ -4852,7 +4852,7 @@ bool Minecraft::addPendingClientTextureRequest(const wstring &textureName)
return false; return false;
} }
void Minecraft::handleClientTextureReceived(const wstring &textureName) void Minecraft::handleClientTextureReceived(const std::wstring &textureName)
{ {
AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName));
if( it != m_pendingTextureRequests.end() ) if( it != m_pendingTextureRequests.end() )

View file

@ -56,7 +56,7 @@ private:
}; };
public: public:
static const wstring VERSION_STRING; static const std::wstring VERSION_STRING;
Minecraft(Component *mouseComponent, Canvas *parent, MinecraftApplet *minecraftApplet, int width, int height, bool fullscreen); Minecraft(Component *mouseComponent, Canvas *parent, MinecraftApplet *minecraftApplet, int width, int height, bool fullscreen);
void init(); void init();
@ -114,7 +114,7 @@ public:
void addPendingLocalConnection(int idx, ClientConnection *connection); void addPendingLocalConnection(int idx, ClientConnection *connection);
void connectionDisconnected(int idx, DisconnectPacket::eDisconnectReason reason) { m_connectionFailed[idx] = true; m_connectionFailedReason[idx] = reason; } void connectionDisconnected(int idx, DisconnectPacket::eDisconnectReason reason) { m_connectionFailed[idx] = true; m_connectionFailedReason[idx] = reason; }
std::shared_ptr<MultiplayerLocalPlayer> createExtraLocalPlayer(int idx, const wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL); std::shared_ptr<MultiplayerLocalPlayer> createExtraLocalPlayer(int idx, const std::wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL);
void createPrimaryLocalPlayer(int iPad); void createPrimaryLocalPlayer(int iPad);
bool setLocalPlayerIdx(int idx); bool setLocalPlayerIdx(int idx);
int getLocalPlayerIdx(); int getLocalPlayerIdx();
@ -126,7 +126,7 @@ public:
std::shared_ptr<Mob> cameraTargetPlayer; std::shared_ptr<Mob> cameraTargetPlayer;
ParticleEngine *particleEngine; ParticleEngine *particleEngine;
User *user; User *user;
wstring serverDomain; std::wstring serverDomain;
Canvas *parent; Canvas *parent;
bool appletMode; bool appletMode;
@ -181,12 +181,12 @@ public:
StatsCounter* stats[4]; StatsCounter* stats[4];
private: private:
wstring connectToIp; std::wstring connectToIp;
int connectToPort; int connectToPort;
public: public:
void clearConnectionFailed(); void clearConnectionFailed();
void connectTo(const wstring& server, int port); void connectTo(const std::wstring& server, int port);
private: private:
void renderLoadingScreen(); void renderLoadingScreen();
@ -199,14 +199,14 @@ private:
public: public:
static File getWorkingDirectory(); static File getWorkingDirectory();
static File getWorkingDirectory(const wstring& applicationName); static File getWorkingDirectory(const std::wstring& applicationName);
private: private:
static OS getPlatform(); static OS getPlatform();
public: public:
LevelStorageSource *getLevelSource(); LevelStorageSource *getLevelSource();
void setScreen(Screen *screen); void setScreen(Screen *screen);
private: private:
void checkGlError(const wstring& string); void checkGlError(const std::wstring& string);
#ifdef __ORBIS__ #ifdef __ORBIS__
PsPlusUpsellWrapper *m_pPsPlusUpsell; PsPlusUpsellWrapper *m_pPsPlusUpsell;
@ -215,7 +215,7 @@ private:
public: public:
void destroy(); void destroy();
volatile bool running; volatile bool running;
wstring fpsString; std::wstring fpsString;
void run(); void run();
// 4J-PB - split the run into 3 parts so we can run it from our xbox game loop // 4J-PB - split the run into 3 parts so we can run it from our xbox game loop
static Minecraft *GetInstance(); static Minecraft *GetInstance();
@ -269,36 +269,36 @@ private:
void reloadSound(); void reloadSound();
public: public:
bool isClientSide(); bool isClientSide();
void selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, const wstring& levelName, LevelSettings *levelSettings); void selectLevel(ConsoleSaveFile *saveFile, const std::wstring& levelId, const std::wstring& levelName, LevelSettings *levelSettings);
//void toggleDimension(int targetDimension); //void toggleDimension(int targetDimension);
bool saveSlot(int slot, const wstring& name); bool saveSlot(int slot, const std::wstring& name);
bool loadSlot(const wstring& userName, int slot); bool loadSlot(const std::wstring& userName, int slot);
void releaseLevel(int message); void releaseLevel(int message);
// 4J Stu - Added the doForceStatsSave param // 4J Stu - Added the doForceStatsSave param
//void setLevel(Level *level, bool doForceStatsSave = true); //void setLevel(Level *level, bool doForceStatsSave = true);
//void setLevel(Level *level, const wstring& message, bool doForceStatsSave = true); //void setLevel(Level *level, const std::wstring& message, bool doForceStatsSave = true);
void setLevel(MultiPlayerLevel *level, int message = -1, std::shared_ptr<Player> forceInsertPlayer = nullptr, bool doForceStatsSave = true,bool bPrimaryPlayerSignedOut=false); void setLevel(MultiPlayerLevel *level, int message = -1, std::shared_ptr<Player> forceInsertPlayer = nullptr, bool doForceStatsSave = true,bool bPrimaryPlayerSignedOut=false);
// 4J-PB - added to force in the 'other' level when the main player creates the level at game load time // 4J-PB - added to force in the 'other' level when the main player creates the level at game load time
void forceaddLevel(MultiPlayerLevel *level); void forceaddLevel(MultiPlayerLevel *level);
void prepareLevel(int title); // 4J - changed to public void prepareLevel(int title); // 4J - changed to public
void fileDownloaded(const wstring& name, File *file); void fileDownloaded(const std::wstring& name, File *file);
// OpenGLCapabilities getOpenGLCapabilities(); // 4J - removed // OpenGLCapabilities getOpenGLCapabilities(); // 4J - removed
wstring gatherStats1(); std::wstring gatherStats1();
wstring gatherStats2(); std::wstring gatherStats2();
wstring gatherStats3(); std::wstring gatherStats3();
wstring gatherStats4(); std::wstring gatherStats4();
void respawnPlayer(int iPad,int dimension,int newEntityId); void respawnPlayer(int iPad,int dimension,int newEntityId);
static void start(const wstring& name, const wstring& sid); static void start(const std::wstring& name, const std::wstring& sid);
static void startAndConnectTo(const wstring& name, const wstring& sid, const wstring& url); static void startAndConnectTo(const std::wstring& name, const std::wstring& sid, const std::wstring& url);
ClientConnection *getConnection(int iPad); // 4J Stu added iPad param ClientConnection *getConnection(int iPad); // 4J Stu added iPad param
static void main(); static void main();
static bool renderNames(); static bool renderNames();
static bool useFancyGraphics(); static bool useFancyGraphics();
static bool useAmbientOcclusion(); static bool useAmbientOcclusion();
static bool renderDebug(); static bool renderDebug();
bool handleClientSideCommand(const wstring& chatMessage); bool handleClientSideCommand(const std::wstring& chatMessage);
static int maxSupportedTextureSize(); static int maxSupportedTextureSize();
void delayTextureReload(); void delayTextureReload();
@ -331,15 +331,15 @@ public:
Level *animateTickLevel; // 4J added Level *animateTickLevel; // 4J added
// 4J - When a client requests a texture, it should add it to here while we are waiting for it // 4J - When a client requests a texture, it should add it to here while we are waiting for it
vector<wstring> m_pendingTextureRequests; vector<std::wstring> m_pendingTextureRequests;
vector<wstring> m_pendingGeometryRequests; // additional skin box geometry vector<std::wstring> m_pendingGeometryRequests; // additional skin box geometry
// 4J Added // 4J Added
bool addPendingClientTextureRequest(const wstring &textureName); bool addPendingClientTextureRequest(const std::wstring &textureName);
void handleClientTextureReceived(const wstring &textureName); void handleClientTextureReceived(const std::wstring &textureName);
void clearPendingClientTextureRequests() { m_pendingTextureRequests.clear(); } void clearPendingClientTextureRequests() { m_pendingTextureRequests.clear(); }
bool addPendingClientGeometryRequest(const wstring &textureName); bool addPendingClientGeometryRequest(const std::wstring &textureName);
void handleClientGeometryReceived(const wstring &textureName); void handleClientGeometryReceived(const std::wstring &textureName);
void clearPendingClientGeometryRequests() { m_pendingGeometryRequests.clear(); } void clearPendingClientGeometryRequests() { m_pendingGeometryRequests.clear(); }
unsigned int getCurrentTexturePackId(); unsigned int getCurrentTexturePackId();

View file

@ -64,7 +64,7 @@ int MinecraftServer::s_slowQueuePlayerIndex = 0;
int MinecraftServer::s_slowQueueLastTime = 0; int MinecraftServer::s_slowQueueLastTime = 0;
bool MinecraftServer::s_slowQueuePacketSent = false; bool MinecraftServer::s_slowQueuePacketSent = false;
std::unordered_map<wstring, int> MinecraftServer::ironTimers; std::unordered_map<std::wstring, int> MinecraftServer::ironTimers;
MinecraftServer::MinecraftServer() MinecraftServer::MinecraftServer()
{ {
@ -77,7 +77,7 @@ MinecraftServer::MinecraftServer()
m_bLoaded = false; m_bLoaded = false;
stopped = false; stopped = false;
tickCount = 0; tickCount = 0;
wstring progressStatus; std::wstring progressStatus;
progress = 0; progress = 0;
motd = L""; motd = L"";
@ -203,8 +203,8 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
__int64 levelNanoTime = System::nanoTime(); __int64 levelNanoTime = System::nanoTime();
wstring levelName = settings->getString(L"level-name", L"world"); std::wstring levelName = settings->getString(L"level-name", L"world");
wstring levelTypeString; std::wstring levelTypeString;
bool gameRuleUseFlatWorld = false; bool gameRuleUseFlatWorld = false;
if(app.getLevelGenerationOptions() != NULL) if(app.getLevelGenerationOptions() != NULL)
@ -244,7 +244,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
//settings->setProperty(L"max-build-height", maxBuildHeight); //settings->setProperty(L"max-build-height", maxBuildHeight);
#if 0 #if 0
wstring levelSeedString = settings->getString(L"level-seed", L""); std::wstring levelSeedString = settings->getString(L"level-seed", L"");
__int64 levelSeed = (new Random())->nextLong(); __int64 levelSeed = (new Random())->nextLong();
if (levelSeedString.length() > 0) if (levelSeedString.length() > 0)
{ {
@ -378,7 +378,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress)
DeleteCriticalSection(&m_postProcessCS); DeleteCriticalSection(&m_postProcessCS);
} }
bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const std::wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData)
{ {
// 4J - TODO - do with new save stuff // 4J - TODO - do with new save stuff
// if (storageSource->requiresConversion(name)) // if (storageSource->requiresConversion(name))
@ -750,7 +750,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
return true; return true;
} }
void MinecraftServer::setProgress(const wstring& status, int progress) void MinecraftServer::setProgress(const std::wstring& status, int progress)
{ {
progressStatus = status; progressStatus = status;
this->progress = progress; this->progress = progress;
@ -1347,7 +1347,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
wchar_t filename[128]; wchar_t filename[128];
swprintf(filename,128,L"%ls%dx%dx%d.sch",initData->name,(initData->endX - initData->startX + 1), (initData->endY - initData->startY + 1), (initData->endZ - initData->startZ + 1)); swprintf(filename,128,L"%ls%dx%dx%d.sch",initData->name,(initData->endX - initData->startX + 1), (initData->endY - initData->startY + 1), (initData->endZ - initData->startZ + 1));
File dataFile = File( targetFileDir, wstring(filename) ); File dataFile = File( targetFileDir, std::wstring(filename) );
if(dataFile.exists()) dataFile._delete(); if(dataFile.exists()) dataFile._delete();
FileOutputStream fos = FileOutputStream(dataFile); FileOutputStream fos = FileOutputStream(dataFile);
DataOutputStream dos = DataOutputStream(&fos); DataOutputStream dos = DataOutputStream(&fos);
@ -1440,7 +1440,7 @@ void MinecraftServer::broadcastStopSavingPacket()
void MinecraftServer::tick() void MinecraftServer::tick()
{ {
vector<wstring> toRemove; vector<std::wstring> toRemove;
for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++ ) for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++ )
{ {
int t = it->second; int t = it->second;
@ -1561,7 +1561,7 @@ void MinecraftServer::tick()
// } // }
} }
void MinecraftServer::handleConsoleInput(const wstring& msg, ConsoleInputSource *source) void MinecraftServer::handleConsoleInput(const std::wstring& msg, ConsoleInputSource *source)
{ {
consoleInput.push_back(new ConsoleInput(msg, source)); consoleInput.push_back(new ConsoleInput(msg, source));
} }
@ -1599,20 +1599,20 @@ void MinecraftServer::HaltServer(bool bPrimaryPlayerSignedOut)
} }
} }
File *MinecraftServer::getFile(const wstring& name) File *MinecraftServer::getFile(const std::wstring& name)
{ {
return new File(name); return new File(name);
} }
void MinecraftServer::info(const wstring& string) void MinecraftServer::info(const std::wstring& string)
{ {
} }
void MinecraftServer::warn(const wstring& string) void MinecraftServer::warn(const std::wstring& string)
{ {
} }
wstring MinecraftServer::getConsoleName() std::wstring MinecraftServer::getConsoleName()
{ {
return L"CONSOLE"; return L"CONSOLE";
} }

View file

@ -24,8 +24,8 @@ typedef struct _LoadSaveDataThreadParam
{ {
LPVOID data; LPVOID data;
__int64 fileSize; __int64 fileSize;
const wstring saveName; const std::wstring saveName;
_LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const std::wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {}
} LoadSaveDataThreadParam; } LoadSaveDataThreadParam;
typedef struct _NetworkGameInitData typedef struct _NetworkGameInitData
@ -60,18 +60,18 @@ using namespace std;
class MinecraftServer : public ConsoleInputSource class MinecraftServer : public ConsoleInputSource
{ {
public: public:
static const wstring VERSION; static const std::wstring VERSION;
static const int TICK_STATS_SPAN = SharedConstants::TICKS_PER_SECOND * 5; static const int TICK_STATS_SPAN = SharedConstants::TICKS_PER_SECOND * 5;
// static Logger logger = Logger.getLogger("Minecraft"); // static Logger logger = Logger.getLogger("Minecraft");
static std::unordered_map<wstring, int> ironTimers; static std::unordered_map<std::wstring, int> ironTimers;
private: private:
static const int DEFAULT_MINECRAFT_PORT = 25565; static const int DEFAULT_MINECRAFT_PORT = 25565;
static const int MS_PER_TICK = 1000 / SharedConstants::TICKS_PER_SECOND; static const int MS_PER_TICK = 1000 / SharedConstants::TICKS_PER_SECOND;
// 4J Stu - Added 1.0.1, Not needed // 4J Stu - Added 1.0.1, Not needed
//wstring localIp; //std::wstring localIp;
//int port; //int port;
public: public:
ServerConnection *connection; ServerConnection *connection;
@ -93,7 +93,7 @@ public:
int tickCount; int tickCount;
public: public:
wstring progressStatus; std::wstring progressStatus;
int progress; int progress;
private: private:
// vector<Tickable *> tickables = new ArrayList<Tickable>(); // 4J - removed // vector<Tickable *> tickables = new ArrayList<Tickable>(); // 4J - removed
@ -105,7 +105,7 @@ public:
bool npcs; bool npcs;
bool pvp; bool pvp;
bool allowFlight; bool allowFlight;
wstring motd; std::wstring motd;
int maxBuildHeight; int maxBuildHeight;
private: private:
@ -127,8 +127,8 @@ private:
// 4J Added - LoadSaveDataThreadParam // 4J Added - LoadSaveDataThreadParam
bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed);
void postProcessTerminate(ProgressRenderer *mcprogress); void postProcessTerminate(ProgressRenderer *mcprogress);
bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); bool loadLevel(LevelStorageSource *storageSource, const std::wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData);
void setProgress(const wstring& status, int progress); void setProgress(const std::wstring& status, int progress);
void endProgress(); void endProgress();
void saveAllChunks(); void saveAllChunks();
void saveGameRules(); void saveGameRules();
@ -162,16 +162,16 @@ public:
private: private:
void tick(); void tick();
public: public:
void handleConsoleInput(const wstring& msg, ConsoleInputSource *source); void handleConsoleInput(const std::wstring& msg, ConsoleInputSource *source);
void handleConsoleInputs(); void handleConsoleInputs();
// void addTickable(Tickable tickable); // 4J removed // void addTickable(Tickable tickable); // 4J removed
static void main(__int64 seed, void *lpParameter); static void main(__int64 seed, void *lpParameter);
static void HaltServer(bool bPrimaryPlayerSignedOut=false); static void HaltServer(bool bPrimaryPlayerSignedOut=false);
File *getFile(const wstring& name); File *getFile(const std::wstring& name);
void info(const wstring& string); void info(const std::wstring& string);
void warn(const wstring& string); void warn(const std::wstring& string);
wstring getConsoleName(); std::wstring getConsoleName();
ServerLevel *getLevel(int dimension); ServerLevel *getLevel(int dimension);
void setLevel(int dimension, ServerLevel *level); // 4J added void setLevel(int dimension, ServerLevel *level); // 4J added
static MinecraftServer *getInstance() { return server; } // 4J added static MinecraftServer *getInstance() { return server; } // 4J added

View file

@ -57,7 +57,7 @@
#include "../../Minecraft.World/Stats/GenericStats.h" #include "../../Minecraft.World/Stats/GenericStats.h"
#endif #endif
ClientConnection::ClientConnection(Minecraft *minecraft, const wstring& ip, int port) ClientConnection::ClientConnection(Minecraft *minecraft, const std::wstring& ip, int port)
{ {
// 4J Stu - No longer used as we use the socket version below. // 4J Stu - No longer used as we use the socket version below.
assert(FALSE); assert(FALSE);
@ -207,7 +207,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet)
// a skin? // a skin?
if(pMojangData->wchSkin[0]!=0L) if(pMojangData->wchSkin[0]!=0L)
{ {
wstring wstr=pMojangData->wchSkin; std::wstring wstr=pMojangData->wchSkin;
// check the file is not already in // check the file is not already in
bRes=app.IsFileInMemoryTextures(wstr); bRes=app.IsFileInMemoryTextures(wstr);
if(!bRes) if(!bRes)
@ -229,7 +229,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet)
// a cloak? // a cloak?
if(pMojangData->wchCape[0]!=0L) if(pMojangData->wchCape[0]!=0L)
{ {
wstring wstr=pMojangData->wchCape; std::wstring wstr=pMojangData->wchCape;
// check the file is not already in // check the file is not already in
bRes=app.IsFileInMemoryTextures(wstr); bRes=app.IsFileInMemoryTextures(wstr);
if(!bRes) if(!bRes)
@ -1277,12 +1277,12 @@ void ClientConnection::handleTakeItemEntity(std::shared_ptr<TakeItemEntityPacket
void ClientConnection::handleChat(std::shared_ptr<ChatPacket> packet) void ClientConnection::handleChat(std::shared_ptr<ChatPacket> packet)
{ {
wstring message; std::wstring message;
int iPos; int iPos;
bool displayOnGui = true; bool displayOnGui = true;
wstring playerDisplayName = L""; std::wstring playerDisplayName = L"";
wstring sourceDisplayName = L""; std::wstring sourceDisplayName = L"";
// On platforms other than Xbox One this just sets display name to gamertag // On platforms other than Xbox One this just sets display name to gamertag
if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]); if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
@ -3053,7 +3053,7 @@ void ClientConnection::displayPrivilegeChanges(std::shared_ptr<MultiplayerLocalP
if( Player::getPlayerGamePrivilege(newPrivileges,priv) != Player::getPlayerGamePrivilege(oldPrivileges,priv)) if( Player::getPlayerGamePrivilege(newPrivileges,priv) != Player::getPlayerGamePrivilege(oldPrivileges,priv))
{ {
privOn = Player::getPlayerGamePrivilege(newPrivileges,priv); privOn = Player::getPlayerGamePrivilege(newPrivileges,priv);
wstring message = L""; std::wstring message = L"";
if(app.GetGameHostOption(eGameHostOption_TrustPlayers) == 0) if(app.GetGameHostOption(eGameHostOption_TrustPlayers) == 0)
{ {
switch(priv) switch(priv)
@ -3246,7 +3246,7 @@ void ClientConnection::handleUpdateGameRuleProgressPacket(std::shared_ptr<Update
LPCWSTR string = app.GetGameRulesString(packet->m_messageId); LPCWSTR string = app.GetGameRulesString(packet->m_messageId);
if(string != NULL) if(string != NULL)
{ {
wstring message(string); std::wstring message(string);
message = GameRuleDefinition::generateDescriptionString(packet->m_definitionType,message,packet->m_data.data,packet->m_data.length); message = GameRuleDefinition::generateDescriptionString(packet->m_definitionType,message,packet->m_data.data,packet->m_data.length);
if(minecraft->localgameModes[m_userIndex]!=NULL) if(minecraft->localgameModes[m_userIndex]!=NULL)
{ {
@ -3348,10 +3348,10 @@ int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::
} }
// //
wstring ClientConnection::GetDisplayNameByGamertag(wstring gamertag) std::wstring ClientConnection::GetDisplayNameByGamertag(std::wstring gamertag)
{ {
#ifdef _DURANGO #ifdef _DURANGO
wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag); std::wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag);
return displayName; return displayName;
#else #else
return gamertag; return gamertag;

View file

@ -21,7 +21,7 @@ private:
bool done; bool done;
Connection *connection; Connection *connection;
public: public:
wstring message; std::wstring message;
bool createdOk; // 4J added bool createdOk; // 4J added
private: private:
Minecraft *minecraft; Minecraft *minecraft;
@ -44,7 +44,7 @@ private:
DWORD m_userIndex; // 4J Added DWORD m_userIndex; // 4J Added
public: public:
SavedDataStorage *savedDataStorage; SavedDataStorage *savedDataStorage;
ClientConnection(Minecraft *minecraft, const wstring& ip, int port); ClientConnection(Minecraft *minecraft, const std::wstring& ip, int port);
ClientConnection(Minecraft *minecraft, Socket *socket, int iUserIndex = -1); ClientConnection(Minecraft *minecraft, Socket *socket, int iUserIndex = -1);
~ClientConnection(); ~ClientConnection();
void tick(); void tick();
@ -90,7 +90,7 @@ public:
virtual void handleEntityEvent(std::shared_ptr<EntityEventPacket> packet); virtual void handleEntityEvent(std::shared_ptr<EntityEventPacket> packet);
private: private:
std::shared_ptr<Entity> getEntity(int entityId); std::shared_ptr<Entity> getEntity(int entityId);
wstring GetDisplayNameByGamertag(wstring gamertag); std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
public: public:
virtual void handleSetHealth(std::shared_ptr<SetHealthPacket> packet); virtual void handleSetHealth(std::shared_ptr<SetHealthPacket> packet);
virtual void handleSetExperience(std::shared_ptr<SetExperiencePacket> packet); virtual void handleSetExperience(std::shared_ptr<SetExperiencePacket> packet);

View file

@ -280,12 +280,12 @@ vector<Biome::MobSpawnerData *> *MultiPlayerChunkCache::getMobsAt(MobCategory *m
return NULL; return NULL;
} }
TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z) TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z)
{ {
return NULL; return NULL;
} }
wstring MultiPlayerChunkCache::gatherStats() std::wstring MultiPlayerChunkCache::gatherStats()
{ {
EnterCriticalSection(&m_csLoadCreate); EnterCriticalSection(&m_csLoadCreate);
int size = (int)loadedChunkList.size(); int size = (int)loadedChunkList.size();

View file

@ -38,9 +38,9 @@ public:
virtual bool tick(); virtual bool tick();
virtual bool shouldSave(); virtual bool shouldSave();
virtual void postProcess(ChunkSource *parent, int x, int z); virtual void postProcess(ChunkSource *parent, int x, int z);
virtual wstring gatherStats(); virtual std::wstring gatherStats();
virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z); virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z);
virtual TilePos *findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z); virtual TilePos *findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z);
virtual void dataReceived(int x, int z); // 4J added virtual void dataReceived(int x, int z); // 4J added
virtual LevelChunk **getCache() { return cache; } // 4J added virtual LevelChunk **getCache() { return cache; } // 4J added

View file

@ -20,7 +20,7 @@
Random *PendingConnection::random = new Random(); Random *PendingConnection::random = new Random();
PendingConnection::PendingConnection(MinecraftServer *server, Socket *socket, const wstring& id) PendingConnection::PendingConnection(MinecraftServer *server, Socket *socket, const std::wstring& id)
{ {
// 4J - added initialisers // 4J - added initialisers
done = false; done = false;
@ -257,7 +257,7 @@ void PendingConnection::send(std::shared_ptr<Packet> packet)
connection->send(packet); connection->send(packet);
} }
wstring PendingConnection::getName() std::wstring PendingConnection::getName()
{ {
return L"Unimplemented"; return L"Unimplemented";
// if (name != null) return name + " [" + connection.getRemoteAddress().toString() + "]"; // if (name != null) return name + " [" + connection.getRemoteAddress().toString() + "]";

View file

@ -23,12 +23,12 @@ public:
private: private:
MinecraftServer *server; MinecraftServer *server;
int _tick; int _tick;
wstring name; std::wstring name;
std::shared_ptr<LoginPacket> acceptedLogin; std::shared_ptr<LoginPacket> acceptedLogin;
wstring loginKey; std::wstring loginKey;
public: public:
PendingConnection(MinecraftServer *server, Socket *socket, const wstring& id); PendingConnection(MinecraftServer *server, Socket *socket, const std::wstring& id);
~PendingConnection(); ~PendingConnection();
void tick(); void tick();
void disconnect(DisconnectPacket::eDisconnectReason reason); void disconnect(DisconnectPacket::eDisconnectReason reason);
@ -40,7 +40,7 @@ public:
virtual void handleKeepAlive(std::shared_ptr<KeepAlivePacket> packet); virtual void handleKeepAlive(std::shared_ptr<KeepAlivePacket> packet);
virtual void onUnhandledPacket(std::shared_ptr<Packet> packet); virtual void onUnhandledPacket(std::shared_ptr<Packet> packet);
void send(std::shared_ptr<Packet> packet); void send(std::shared_ptr<Packet> packet);
wstring getName(); std::wstring getName();
virtual bool isServerPacketListener(); virtual bool isServerPacketListener();
private: private:

View file

@ -638,7 +638,7 @@ void PlayerConnection::handleChat(std::shared_ptr<ChatPacket> packet)
{ {
// 4J - TODO // 4J - TODO
#if 0 #if 0
wstring message = packet->message; std::wstring message = packet->message;
if (message.length() > SharedConstants::maxChatLength) if (message.length() > SharedConstants::maxChatLength)
{ {
disconnect(L"Chat message too long"); disconnect(L"Chat message too long");
@ -670,7 +670,7 @@ void PlayerConnection::handleChat(std::shared_ptr<ChatPacket> packet)
#endif #endif
} }
void PlayerConnection::handleCommand(const wstring& message) void PlayerConnection::handleCommand(const std::wstring& message)
{ {
// 4J - TODO // 4J - TODO
#if 0 #if 0
@ -737,19 +737,19 @@ int PlayerConnection::countDelayedPackets()
return connection->countDelayedPackets(); return connection->countDelayedPackets();
} }
void PlayerConnection::info(const wstring& string) void PlayerConnection::info(const std::wstring& string)
{ {
// 4J-PB - removed, since it needs to be localised in the language the client is in // 4J-PB - removed, since it needs to be localised in the language the client is in
//send( std::shared_ptr<ChatPacket>( new ChatPacket(L"§7" + string) ) ); //send( std::shared_ptr<ChatPacket>( new ChatPacket(L"§7" + string) ) );
} }
void PlayerConnection::warn(const wstring& string) void PlayerConnection::warn(const std::wstring& string)
{ {
// 4J-PB - removed, since it needs to be localised in the language the client is in // 4J-PB - removed, since it needs to be localised in the language the client is in
//send( std::shared_ptr<ChatPacket>( new ChatPacket(L"§9" + string) ) ); //send( std::shared_ptr<ChatPacket>( new ChatPacket(L"§9" + string) ) );
} }
wstring PlayerConnection::getConsoleName() std::wstring PlayerConnection::getConsoleName()
{ {
return player->name; return player->name;
} }
@ -894,7 +894,7 @@ void PlayerConnection::handleTextureAndGeometry(std::shared_ptr<TextureAndGeomet
} }
} }
void PlayerConnection::handleTextureReceived(const wstring &textureName) void PlayerConnection::handleTextureReceived(const std::wstring &textureName)
{ {
// This sends the server received texture out to any other players waiting for the data // This sends the server received texture out to any other players waiting for the data
AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName )); AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName ));
@ -912,7 +912,7 @@ void PlayerConnection::handleTextureReceived(const wstring &textureName)
} }
} }
void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureName) void PlayerConnection::handleTextureAndGeometryReceived(const std::wstring &textureName)
{ {
// This sends the server received texture out to any other players waiting for the data // This sends the server received texture out to any other players waiting for the data
AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName )); AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName ));
@ -1194,7 +1194,7 @@ void PlayerConnection::handleSetCreativeModeSlot(std::shared_ptr<SetCreativeMode
// when a new one is created // when a new one is created
wchar_t buf[64]; wchar_t buf[64];
swprintf(buf,64,L"map_%d", item->getAuxValue()); swprintf(buf,64,L"map_%d", item->getAuxValue());
std::wstring id = wstring(buf); std::wstring id = std::wstring(buf);
if( data == NULL ) if( data == NULL )
{ {
data = std::shared_ptr<MapItemSavedData>( new MapItemSavedData(id) ); data = std::shared_ptr<MapItemSavedData>( new MapItemSavedData(id) );
@ -1292,7 +1292,7 @@ void PlayerConnection::handleSignUpdate(std::shared_ptr<SignUpdatePacket> packet
std::shared_ptr<SignTileEntity> ste = dynamic_pointer_cast<SignTileEntity>(te); std::shared_ptr<SignTileEntity> ste = dynamic_pointer_cast<SignTileEntity>(te);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
wstring lineText = packet->lines[i].substr(0,15); std::wstring lineText = packet->lines[i].substr(0,15);
ste->SetMessage( i, lineText ); ste->SetMessage( i, lineText );
} }
ste->SetVerified(false); ste->SetVerified(false);
@ -1498,7 +1498,7 @@ void PlayerConnection::handleCustomPayload(std::shared_ptr<CustomPayloadPacket>
{ {
ByteArrayInputStream bais(customPayloadPacket->data); ByteArrayInputStream bais(customPayloadPacket->data);
DataInputStream dis(&bais); DataInputStream dis(&bais);
wstring name = dis.readUTF(); std::wstring name = dis.readUTF();
if (name.length() <= 30) if (name.length() <= 30)
{ {
menu->setItemName(name); menu->setItemName(name);

View file

@ -62,15 +62,15 @@ public:
virtual void handleSetCarriedItem(std::shared_ptr<SetCarriedItemPacket> packet); virtual void handleSetCarriedItem(std::shared_ptr<SetCarriedItemPacket> packet);
virtual void handleChat(std::shared_ptr<ChatPacket> packet); virtual void handleChat(std::shared_ptr<ChatPacket> packet);
private: private:
void handleCommand(const wstring& message); void handleCommand(const std::wstring& message);
public: public:
virtual void handleAnimate(std::shared_ptr<AnimatePacket> packet); virtual void handleAnimate(std::shared_ptr<AnimatePacket> packet);
virtual void handlePlayerCommand(std::shared_ptr<PlayerCommandPacket> packet); virtual void handlePlayerCommand(std::shared_ptr<PlayerCommandPacket> packet);
virtual void handleDisconnect(std::shared_ptr<DisconnectPacket> packet); virtual void handleDisconnect(std::shared_ptr<DisconnectPacket> packet);
int countDelayedPackets(); int countDelayedPackets();
virtual void info(const wstring& string); virtual void info(const std::wstring& string);
virtual void warn(const wstring& string); virtual void warn(const std::wstring& string);
virtual wstring getConsoleName(); virtual std::wstring getConsoleName();
virtual void handleInteract(std::shared_ptr<InteractPacket> packet); virtual void handleInteract(std::shared_ptr<InteractPacket> packet);
bool canHandleAsyncPackets(); bool canHandleAsyncPackets();
virtual void handleClientCommand(std::shared_ptr<ClientCommandPacket> packet); virtual void handleClientCommand(std::shared_ptr<ClientCommandPacket> packet);
@ -120,8 +120,8 @@ public:
void closeOnTick() { m_bCloseOnTick = true; } void closeOnTick() { m_bCloseOnTick = true; }
// 4J Added so that we can send on textures that get received after this connection requested them // 4J Added so that we can send on textures that get received after this connection requested them
void handleTextureReceived(const wstring &textureName); void handleTextureReceived(const std::wstring &textureName);
void handleTextureAndGeometryReceived(const wstring &textureName); void handleTextureAndGeometryReceived(const std::wstring &textureName);
void setShowOnMaps(bool bVal); void setShowOnMaps(bool bVal);
@ -133,7 +133,7 @@ public:
private: private:
bool m_bCloseOnTick; bool m_bCloseOnTick;
vector<wstring> m_texturesRequested; vector<std::wstring> m_texturesRequested;
bool m_bWasKicked; bool m_bWasKicked;
}; };

View file

@ -4,10 +4,10 @@ using namespace std;
class PlayerInfo class PlayerInfo
{ {
public: public:
wstring name; std::wstring name;
int latency; int latency;
PlayerInfo(const wstring &name) PlayerInfo(const std::wstring &name)
{ {
this->name = name; this->name = name;
latency = 0; latency = 0;

View file

@ -439,7 +439,7 @@ void PlayerList::remove(std::shared_ptr<ServerPlayer> player)
saveAll(NULL,false); saveAll(NULL,false);
} }
std::shared_ptr<ServerPlayer> PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) std::shared_ptr<ServerPlayer> PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const std::wstring& userName, PlayerUID xuid, PlayerUID onlineXuid)
{ {
if (players.size() >= maxPlayers) if (players.size() >= maxPlayers)
{ {
@ -957,9 +957,9 @@ void PlayerList::broadcastAll(std::shared_ptr<Packet> packet, int dimension)
} }
} }
wstring PlayerList::getPlayerNames() std::wstring PlayerList::getPlayerNames()
{ {
wstring msg; std::wstring msg;
for (unsigned int i = 0; i < players.size(); i++) for (unsigned int i = 0; i < players.size(); i++)
{ {
if (i > 0) msg += L", "; if (i > 0) msg += L", ";
@ -968,12 +968,12 @@ wstring PlayerList::getPlayerNames()
return msg; return msg;
} }
bool PlayerList::isWhiteListed(const wstring& name) bool PlayerList::isWhiteListed(const std::wstring& name)
{ {
return true; return true;
} }
bool PlayerList::isOp(const wstring& name) bool PlayerList::isOp(const std::wstring& name)
{ {
return false; return false;
} }
@ -989,7 +989,7 @@ bool PlayerList::isOp(std::shared_ptr<ServerPlayer> player)
return isOp; return isOp;
} }
std::shared_ptr<ServerPlayer> PlayerList::getPlayer(const wstring& name) std::shared_ptr<ServerPlayer> PlayerList::getPlayer(const std::wstring& name)
{ {
for (unsigned int i = 0; i < players.size(); i++) for (unsigned int i = 0; i < players.size(); i++)
{ {
@ -1016,7 +1016,7 @@ std::shared_ptr<ServerPlayer> PlayerList::getPlayer(PlayerUID uid)
return nullptr; return nullptr;
} }
void PlayerList::sendMessage(const wstring& name, const wstring& message) void PlayerList::sendMessage(const std::wstring& name, const std::wstring& message)
{ {
std::shared_ptr<ServerPlayer> player = getPlayer(name); std::shared_ptr<ServerPlayer> player = getPlayer(name);
if (player != NULL) if (player != NULL)
@ -1097,7 +1097,7 @@ void PlayerList::broadcast(std::shared_ptr<Player> except, double x, double y, d
} }
void PlayerList::broadcastToAllOps(const wstring& message) void PlayerList::broadcastToAllOps(const std::wstring& message)
{ {
std::shared_ptr<Packet> chatPacket = std::shared_ptr<ChatPacket>( new ChatPacket(message) ); std::shared_ptr<Packet> chatPacket = std::shared_ptr<ChatPacket>( new ChatPacket(message) );
for (unsigned int i = 0; i < players.size(); i++) for (unsigned int i = 0; i < players.size(); i++)
@ -1110,7 +1110,7 @@ void PlayerList::broadcastToAllOps(const wstring& message)
} }
} }
bool PlayerList::sendTo(const wstring& name, std::shared_ptr<Packet> packet) bool PlayerList::sendTo(const std::wstring& name, std::shared_ptr<Packet> packet)
{ {
std::shared_ptr<ServerPlayer> player = getPlayer(name); std::shared_ptr<ServerPlayer> player = getPlayer(name);
if (player != NULL) if (player != NULL)
@ -1142,11 +1142,11 @@ void PlayerList::saveAll(ProgressListener *progressListener, bool bDeleteGuestMa
} }
} }
void PlayerList::whiteList(const wstring& playerName) void PlayerList::whiteList(const std::wstring& playerName)
{ {
} }
void PlayerList::blackList(const wstring& playerName) void PlayerList::blackList(const std::wstring& playerName)
{ {
} }

View file

@ -75,7 +75,7 @@ public:
void add(std::shared_ptr<ServerPlayer> player); void add(std::shared_ptr<ServerPlayer> player);
void move(std::shared_ptr<ServerPlayer> player); void move(std::shared_ptr<ServerPlayer> player);
void remove(std::shared_ptr<ServerPlayer> player); void remove(std::shared_ptr<ServerPlayer> player);
std::shared_ptr<ServerPlayer> getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid); std::shared_ptr<ServerPlayer> getPlayerForLogin(PendingConnection *pendingConnection, const std::wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid);
std::shared_ptr<ServerPlayer> respawn(std::shared_ptr<ServerPlayer> serverPlayer, int targetDimension, bool keepAllPlayerData); std::shared_ptr<ServerPlayer> respawn(std::shared_ptr<ServerPlayer> serverPlayer, int targetDimension, bool keepAllPlayerData);
void toggleDimension(std::shared_ptr<ServerPlayer> player, int targetDimension); void toggleDimension(std::shared_ptr<ServerPlayer> player, int targetDimension);
void tick(); void tick();
@ -84,23 +84,23 @@ public:
void broadcastAll(std::shared_ptr<Packet> packet); void broadcastAll(std::shared_ptr<Packet> packet);
void broadcastAll(std::shared_ptr<Packet> packet, int dimension); void broadcastAll(std::shared_ptr<Packet> packet, int dimension);
wstring getPlayerNames(); std::wstring getPlayerNames();
public: public:
bool isWhiteListed(const wstring& name); bool isWhiteListed(const std::wstring& name);
bool isOp(const wstring& name); bool isOp(const std::wstring& name);
bool isOp(std::shared_ptr<ServerPlayer> player); // 4J Added bool isOp(std::shared_ptr<ServerPlayer> player); // 4J Added
std::shared_ptr<ServerPlayer> getPlayer(const wstring& name); std::shared_ptr<ServerPlayer> getPlayer(const std::wstring& name);
std::shared_ptr<ServerPlayer> getPlayer(PlayerUID uid); std::shared_ptr<ServerPlayer> getPlayer(PlayerUID uid);
void sendMessage(const wstring& name, const wstring& message); void sendMessage(const std::wstring& name, const std::wstring& message);
void broadcast(double x, double y, double z, double range, int dimension, std::shared_ptr<Packet> packet); void broadcast(double x, double y, double z, double range, int dimension, std::shared_ptr<Packet> packet);
void broadcast(std::shared_ptr<Player> except, double x, double y, double z, double range, int dimension, std::shared_ptr<Packet> packet); void broadcast(std::shared_ptr<Player> except, double x, double y, double z, double range, int dimension, std::shared_ptr<Packet> packet);
void broadcastToAllOps(const wstring& message); void broadcastToAllOps(const std::wstring& message);
bool sendTo(const wstring& name, std::shared_ptr<Packet> packet); bool sendTo(const std::wstring& name, std::shared_ptr<Packet> packet);
// 4J Added ProgressListener *progressListener param and bDeleteGuestMaps param // 4J Added ProgressListener *progressListener param and bDeleteGuestMaps param
void saveAll(ProgressListener *progressListener, bool bDeleteGuestMaps = false); void saveAll(ProgressListener *progressListener, bool bDeleteGuestMaps = false);
void whiteList(const wstring& playerName); void whiteList(const std::wstring& playerName);
void blackList(const wstring& playerName); void blackList(const std::wstring& playerName);
// Set<String> getWhiteList(); / 4J removed // Set<String> getWhiteList(); / 4J removed
void reloadWhitelist(); void reloadWhitelist();
void sendLevelInfo(std::shared_ptr<ServerPlayer> player, ServerLevel *level); void sendLevelInfo(std::shared_ptr<ServerPlayer> player, ServerLevel *level);

View file

@ -897,7 +897,7 @@ bool ServerChunkCache::shouldSave()
return !level->noSave; return !level->noSave;
} }
wstring ServerChunkCache::gatherStats() std::wstring ServerChunkCache::gatherStats()
{ {
return L"ServerChunkCache: ";// + _toString<int>(loadedChunks.size()) + L" Drop: " + _toString<int>(toDrop.size()); return L"ServerChunkCache: ";// + _toString<int>(loadedChunks.size()) + L" Drop: " + _toString<int>(toDrop.size());
} }
@ -907,7 +907,7 @@ vector<Biome::MobSpawnerData *> *ServerChunkCache::getMobsAt(MobCategory *mobCat
return source->getMobsAt(mobCategory, x, y, z); return source->getMobsAt(mobCategory, x, y, z);
} }
TilePos *ServerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z) TilePos *ServerChunkCache::findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z)
{ {
return source->findNearestMapFeature(level, featureName, x, y, z); return source->findNearestMapFeature(level, featureName, x, y, z);
} }

View file

@ -80,10 +80,10 @@ public:
virtual bool save(bool force, ProgressListener *progressListener); virtual bool save(bool force, ProgressListener *progressListener);
virtual bool tick(); virtual bool tick();
virtual bool shouldSave(); virtual bool shouldSave();
virtual wstring gatherStats(); virtual std::wstring gatherStats();
virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z); virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z);
virtual TilePos *findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z); virtual TilePos *findNearestMapFeature(Level *level, const std::wstring &featureName, int x, int y, int z);
private: private:
typedef struct _SaveThreadData typedef struct _SaveThreadData

View file

@ -52,7 +52,7 @@ ServerCommandDispatcher::ServerCommandDispatcher()
Command::setLogger(this); Command::setLogger(this);
} }
void ServerCommandDispatcher::logAdminCommand(std::shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) void ServerCommandDispatcher::logAdminCommand(std::shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message, int customData, const std::wstring& additionalMessage)
{ {
PlayerList *playerList = MinecraftServer::getInstance()->getPlayers(); PlayerList *playerList = MinecraftServer::getInstance()->getPlayers();
//for (Player player : MinecraftServer.getInstance().getPlayers().players) //for (Player player : MinecraftServer.getInstance().getPlayers().players)

View file

@ -7,5 +7,5 @@ class ServerCommandDispatcher : public CommandDispatcher, public AdminLogCommand
{ {
public: public:
ServerCommandDispatcher(); ServerCommandDispatcher();
void logAdminCommand(std::shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); void logAdminCommand(std::shared_ptr<CommandSender> source, int type, ChatPacket::EChatPacketMessage messageType, const std::wstring& message = L"", int customData = -1, const std::wstring& additionalMessage = L"");
}; };

View file

@ -114,7 +114,7 @@ void ServerConnection::tick()
} }
bool ServerConnection::addPendingTextureRequest(const wstring &textureName) bool ServerConnection::addPendingTextureRequest(const std::wstring &textureName)
{ {
AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName));
if( it == m_pendingTextureRequests.end() ) if( it == m_pendingTextureRequests.end() )
@ -129,7 +129,7 @@ bool ServerConnection::addPendingTextureRequest(const wstring &textureName)
return true; return true;
} }
void ServerConnection::handleTextureReceived(const wstring &textureName) void ServerConnection::handleTextureReceived(const std::wstring &textureName)
{ {
AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName));
if( it != m_pendingTextureRequests.end() ) if( it != m_pendingTextureRequests.end() )
@ -146,7 +146,7 @@ void ServerConnection::handleTextureReceived(const wstring &textureName)
} }
} }
void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureName) void ServerConnection::handleTextureAndGeometryReceived(const std::wstring &textureName)
{ {
AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName)); AUTO_VAR(it, find( m_pendingTextureRequests.begin(), m_pendingTextureRequests.end(), textureName));
if( it != m_pendingTextureRequests.end() ) if( it != m_pendingTextureRequests.end() )

View file

@ -24,7 +24,7 @@ private:
vector< std::shared_ptr<PlayerConnection> > players; vector< std::shared_ptr<PlayerConnection> > players;
// 4J - When the server requests a texture, it should add it to here while we are waiting for it // 4J - When the server requests a texture, it should add it to here while we are waiting for it
vector<wstring> m_pendingTextureRequests; vector<std::wstring> m_pendingTextureRequests;
public: public:
MinecraftServer *server; MinecraftServer *server;
@ -42,8 +42,8 @@ public:
void tick(); void tick();
// 4J Added // 4J Added
bool addPendingTextureRequest(const wstring &textureName); bool addPendingTextureRequest(const std::wstring &textureName);
void handleTextureReceived(const wstring &textureName); void handleTextureReceived(const std::wstring &textureName);
void handleTextureAndGeometryReceived(const wstring &textureName); void handleTextureAndGeometryReceived(const std::wstring &textureName);
void handleServerSettingsChanged(std::shared_ptr<ServerSettingsChangedPacket> packet); void handleServerSettingsChanged(std::shared_ptr<ServerSettingsChangedPacket> packet);
}; };

View file

@ -3,27 +3,27 @@ using namespace std;
class ServerInterface class ServerInterface
{ {
virtual int getConfigInt(const wstring &name, int defaultValue) = 0; virtual int getConfigInt(const std::wstring &name, int defaultValue) = 0;
virtual wstring getConfigString(const wstring &name, const wstring &defaultValue) = 0; virtual std::wstring getConfigString(const std::wstring &name, const std::wstring &defaultValue) = 0;
virtual bool getConfigBoolean(const wstring &name, bool defaultValue) = 0; virtual bool getConfigBoolean(const std::wstring &name, bool defaultValue) = 0;
virtual void setProperty(wstring &propertyName, void *value) = 0; virtual void setProperty(std::wstring &propertyName, void *value) = 0;
virtual void configSave() = 0; virtual void configSave() = 0;
virtual wstring getConfigPath() = 0; virtual std::wstring getConfigPath() = 0;
virtual wstring getServerIp() = 0; virtual std::wstring getServerIp() = 0;
virtual int getServerPort() = 0; virtual int getServerPort() = 0;
virtual wstring getServerName() = 0; virtual std::wstring getServerName() = 0;
virtual wstring getServerVersion() = 0; virtual std::wstring getServerVersion() = 0;
virtual int getPlayerCount() = 0; virtual int getPlayerCount() = 0;
virtual int getMaxPlayers() = 0; virtual int getMaxPlayers() = 0;
virtual wstring[] getPlayerNames() = 0; virtual std::wstring[] getPlayerNames() = 0;
virtual wstring getWorldName() = 0; virtual std::wstring getWorldName() = 0;
virtual wstring getPluginNames() = 0; virtual std::wstring getPluginNames() = 0;
virtual void disablePlugin() = 0; virtual void disablePlugin() = 0;
virtual wstring runCommand(const wstring &command) = 0; virtual std::wstring runCommand(const std::wstring &command) = 0;
virtual bool isDebugging() = 0; virtual bool isDebugging() = 0;
// Logging // Logging
virtual void info(const wstring &string) = 0; virtual void info(const std::wstring &string) = 0;
virtual void warn(const wstring &string) = 0; virtual void warn(const std::wstring &string) = 0;
virtual void error(const wstring &string) = 0; virtual void error(const std::wstring &string) = 0;
virtual void debug(const wstring &string) = 0; virtual void debug(const std::wstring &string) = 0;
}; };

View file

@ -474,7 +474,7 @@ public:
eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData); eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData);
eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData); eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData);
eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,LPVOID lpParam=NULL, int iUserData=0); eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,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);
eTitleStorageState TMSPP_GetTitleStorageState(int iPad); eTitleStorageState TMSPP_GetTitleStorageState(int iPad);
void TMSPP_ClearTitleStorageState(int iPad); void TMSPP_ClearTitleStorageState(int iPad);

View file

@ -169,7 +169,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
int CConsoleMinecraftApp::LoadLocalDLCImages() int CConsoleMinecraftApp::LoadLocalDLCImages()
{ {
std::unordered_map<wstring,DLC_INFO * > *pDLCInfoA=app.GetDLCInfo(); std::unordered_map<std::wstring,DLC_INFO * > *pDLCInfoA=app.GetDLCInfo();
// 4J-PB - Any local graphic files for the Minecraft Store? // 4J-PB - Any local graphic files for the Minecraft Store?
for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ )
{ {
@ -183,7 +183,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages()
void CConsoleMinecraftApp::FreeLocalDLCImages() void CConsoleMinecraftApp::FreeLocalDLCImages()
{ {
// 4J-PB - Any local graphic files for the Minecraft Store? // 4J-PB - Any local graphic files for the Minecraft Store?
std::unordered_map<wstring,DLC_INFO * > *pDLCInfoA=app.GetDLCInfo(); std::unordered_map<std::wstring,DLC_INFO * > *pDLCInfoA=app.GetDLCInfo();
for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ )
{ {
@ -263,7 +263,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); app.ClearTerrainFeaturePosition();
wstring wWorldName = L"TestWorld"; std::wstring wWorldName = L"TestWorld";
StorageManager.ResetSaveData(); StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(wWorldName.c_str()); StorageManager.SetSaveTitle(wWorldName.c_str());

View file

@ -408,7 +408,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
// Build stat names // Build stat names
m_statNames = ref new PC::Vector<P::String^>(); m_statNames = ref new PC::Vector<P::String^>();
m_statNames->Clear(); m_statNames->Clear();
for(wstring name : m_leaderboardStatNames[difficulty][type]) for(std::wstring name : m_leaderboardStatNames[difficulty][type])
{ {
m_statNames->Append(ref new P::String(name.c_str())); m_statNames->Append(ref new P::String(name.c_str()));
} }
@ -548,7 +548,7 @@ void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, E
} }
int statIndex = 0, sumScores = 0; int statIndex = 0, sumScores = 0;
for(wstring statName : m_leaderboardStatNames[difficulty][type]) for(std::wstring statName : m_leaderboardStatNames[difficulty][type])
{ {
bool found = false; bool found = false;
for(auto result : statsResult) for(auto result : statsResult)
@ -585,7 +585,7 @@ void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector<Mi
if (profiles.size() > 0) if (profiles.size() > 0)
{ {
dlm->m_displayNames = vector<wstring>(); dlm->m_displayNames = vector<std::wstring>();
for (int i = 0; i < profiles.size(); i++) for (int i = 0; i < profiles.size(); i++)
{ {
dlm->m_displayNames.push_back(profiles[i]->GameDisplayName->Data()); dlm->m_displayNames.push_back(profiles[i]->GameDisplayName->Data());
@ -699,7 +699,7 @@ void DurangoLeaderboardManager::setState(EStatsState newState)
LeaveCriticalSection(&m_csStatsState); LeaveCriticalSection(&m_csStatsState);
} }
wstring DurangoLeaderboardManager::stateToString(EStatsState eState) std::wstring DurangoLeaderboardManager::stateToString(EStatsState eState)
{ {
switch (eState) switch (eState)
{ {

View file

@ -35,12 +35,12 @@ private:
unsigned int m_maxRank; unsigned int m_maxRank;
MXS::XboxLiveContext^ m_xboxLiveContext; MXS::XboxLiveContext^ m_xboxLiveContext;
wstring m_leaderboardNames[4][eStatsType_MAX]; std::wstring m_leaderboardNames[4][eStatsType_MAX];
wstring m_socialLeaderboardNames[4][eStatsType_MAX]; std::wstring m_socialLeaderboardNames[4][eStatsType_MAX];
std::vector<wstring> m_leaderboardStatNames[4][eStatsType_MAX]; std::vector<std::wstring> m_leaderboardStatNames[4][eStatsType_MAX];
// Display names for the current scores // Display names for the current scores
std::vector<wstring> m_displayNames; std::vector<std::wstring> m_displayNames;
bool m_waitingForProfiles; bool m_waitingForProfiles;
int m_difficulty; int m_difficulty;
@ -90,5 +90,5 @@ private:
EStatsState getState(); EStatsState getState();
void setState(EStatsState newState); void setState(EStatsState newState);
wstring stateToString(EStatsState eState); std::wstring stateToString(EStatsState eState);
}; };

View file

@ -16,14 +16,14 @@
namespace WFC = Windows::Foundation::Collections; namespace WFC = Windows::Foundation::Collections;
namespace CC = concurrency; namespace CC = concurrency;
StatParam::StatParam(const wstring &base) StatParam::StatParam(const std::wstring &base)
{ {
m_base = base; m_base = base;
//m_numArgs = numArgs; //m_numArgs = numArgs;
m_args = vector<int>(); m_args = vector<int>();
unsigned int count=0; unsigned int count=0;
wstring::size_type pos =base.find(L"*"); std::wstring::size_type pos =base.find(L"*");
while(pos!=string::npos) while(pos!=string::npos)
{ {
count++; count++;
@ -46,14 +46,14 @@ void StatParam::addArgs(int v1, ...)
va_end(argptr); va_end(argptr);
} }
vector<wstring> *StatParam::getStats() vector<std::wstring> *StatParam::getStats()
{ {
vector<wstring> *out = new vector<wstring>(); vector<std::wstring> *out = new vector<std::wstring>();
static const int MAXSIZE = 256; static const int MAXSIZE = 256;
static const wstring SUBSTR = L"*"; static const std::wstring SUBSTR = L"*";
wstring wstr_itr, wstr_num; std::wstring wstr_itr, wstr_num;
if (m_args.size() <= 0 || m_numArgs <= 0) if (m_args.size() <= 0 || m_numArgs <= 0)
{ {
@ -69,10 +69,10 @@ vector<wstring> *StatParam::getStats()
{ {
for (int j=0; j<m_numArgs; j++) for (int j=0; j<m_numArgs; j++)
{ {
wstr_num = to_wstring(m_args.at(i+j)); wstr_num = to_std::wstring(m_args.at(i+j));
size_t sz = wstr_itr.find(SUBSTR); size_t sz = wstr_itr.find(SUBSTR);
if (sz != wstring::npos) if (sz != std::wstring::npos)
wstr_itr.replace(sz, SUBSTR.length(), wstr_num); wstr_itr.replace(sz, SUBSTR.length(), wstr_num);
} }
} }
@ -91,13 +91,13 @@ DurangoStatsDebugger::DurangoStatsDebugger()
InitializeCriticalSection(&m_retrievedStatsLock); InitializeCriticalSection(&m_retrievedStatsLock);
} }
vector<wstring> *DurangoStatsDebugger::getStats() vector<std::wstring> *DurangoStatsDebugger::getStats()
{ {
vector<wstring> *out = new vector<wstring>(); vector<std::wstring> *out = new vector<std::wstring>();
for (auto it = m_stats.begin(); it!=m_stats.end(); it++) for (auto it = m_stats.begin(); it!=m_stats.end(); it++)
{ {
vector<wstring> *sublist = (*it)->getStats(); vector<std::wstring> *sublist = (*it)->getStats();
out->insert(out->end(), sublist->begin(), sublist->end()); out->insert(out->end(), sublist->begin(), sublist->end());
} }
@ -322,11 +322,11 @@ void DurangoStatsDebugger::PrintStats(int iPad)
{ {
if (instance == NULL) instance = Initialize(); if (instance == NULL) instance = Initialize();
vector<wstring> *tmp = instance->getStats(); vector<std::wstring> *tmp = instance->getStats();
instance->m_printQueue.insert(instance->m_printQueue.end(), tmp->begin(), tmp->end()); instance->m_printQueue.insert(instance->m_printQueue.end(), tmp->begin(), tmp->end());
// app.DebugPrintf("[DEBUG] START\n"); // app.DebugPrintf("[DEBUG] START\n");
// for (wstring t : *tmp) app.DebugPrintf("[DEBUG] %s\n", wstringtofilename(t)); // for (std::wstring t : *tmp) app.DebugPrintf("[DEBUG] %s\n", wstringtofilename(t));
// app.DebugPrintf("[DEBUG] END\n"); // app.DebugPrintf("[DEBUG] END\n");
instance->retrieveStats(iPad); instance->retrieveStats(iPad);
@ -407,7 +407,7 @@ void DurangoStatsDebugger::retrieveStats(int iPad)
// Create Stat retrieval threads until there is no long any stats to start retrieving. // Create Stat retrieval threads until there is no long any stats to start retrieving.
while ( !instance->m_printQueue.empty() ) while ( !instance->m_printQueue.empty() )
{ {
vector<wstring> *printing = new vector<wstring>(); vector<std::wstring> *printing = new vector<std::wstring>();
if (m_printQueue.size() > R_SIZE) if (m_printQueue.size() > R_SIZE)
{ {

View file

@ -11,17 +11,17 @@ namespace MXSL = Microsoft::Xbox::Services::Leaderboard;
class StatParam class StatParam
{ {
private: private:
wstring m_base; std::wstring m_base;
int m_numArgs; int m_numArgs;
vector<int> m_args; vector<int> m_args;
public: public:
StatParam(const wstring &base); StatParam(const std::wstring &base);
void addArgs(int v1, ...); void addArgs(int v1, ...);
vector<wstring> *getStats(); vector<std::wstring> *getStats();
}; };
@ -67,7 +67,7 @@ protected:
vector<StatParam *> m_stats; vector<StatParam *> m_stats;
vector<wstring> *getStats(); vector<std::wstring> *getStats();
public: public:
static DurangoStatsDebugger *Initialize(); static DurangoStatsDebugger *Initialize();
@ -75,15 +75,15 @@ public:
static void PrintStats(int iPad); static void PrintStats(int iPad);
private: private:
vector<wstring> m_printQueue; vector<std::wstring> m_printQueue;
void retrieveStats(int iPad); void retrieveStats(int iPad);
typedef struct typedef struct
{ {
int m_iPad; int m_iPad;
wstring m_statName; std::wstring m_statName;
wstring m_score; std::wstring m_score;
} StatResult; } StatResult;
CRITICAL_SECTION m_retrievedStatsLock; CRITICAL_SECTION m_retrievedStatsLock;

View file

@ -22,14 +22,14 @@ DQRNetworkManager::ePartyProcessType DQRNetworkManager::m_partyProcess = DQRNetw
bool DQRNetworkManager::m_inviteReceived = false; bool DQRNetworkManager::m_inviteReceived = false;
int DQRNetworkManager::m_bootUserIndex; int DQRNetworkManager::m_bootUserIndex;
wstring DQRNetworkManager::m_bootSessionName; std::wstring DQRNetworkManager::m_bootSessionName;
wstring DQRNetworkManager::m_bootServiceConfig; std::wstring DQRNetworkManager::m_bootServiceConfig;
wstring DQRNetworkManager::m_bootSessionTemplate; std::wstring DQRNetworkManager::m_bootSessionTemplate;
DQRNetworkManager * DQRNetworkManager::s_pDQRManager = NULL; DQRNetworkManager * DQRNetworkManager::s_pDQRManager = NULL;
//using namespace Windows::Xbox::Networking; //using namespace Windows::Xbox::Networking;
DQRNetworkManager::SessionInfo::SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate) DQRNetworkManager::SessionInfo::SessionInfo(std::wstring& sessionName, std::wstring& serviceConfig, std::wstring& sessionTemplate)
{ {
m_detailsValid = true; m_detailsValid = true;
m_sessionName = sessionName; m_sessionName = sessionName;
@ -782,7 +782,7 @@ DQRNetworkPlayer *DQRNetworkManager::GetPlayerByXuid(PlayerUID xuid)
} }
// Retrieve player display name by gamertag // Retrieve player display name by gamertag
wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag) std::wstring DQRNetworkManager::GetDisplayNameByGamertag(std::wstring gamertag)
{ {
if (m_displayNames.find(gamertag) != m_displayNames.end()) if (m_displayNames.find(gamertag) != m_displayNames.end())
{ {
@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc()
if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i)) if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i))
{ {
auto user = ProfileManager.GetUser(i); auto user = ProfileManager.GetUser(i);
wstring displayName = ProfileManager.GetDisplayName(i); std::wstring displayName = ProfileManager.GetDisplayName(i);
DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress); DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress);
pPlayer->SetSmallId(smallId); pPlayer->SetSmallId(smallId);
@ -3031,7 +3031,7 @@ void DQRNetworkManager::GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Servi
} }
// Set player display name // Set player display name
void DQRNetworkManager::SetDisplayName(PlayerUID xuid, wstring displayName) void DQRNetworkManager::SetDisplayName(PlayerUID xuid, std::wstring displayName)
{ {
EnterCriticalSection(&m_csRoomSyncData); EnterCriticalSection(&m_csRoomSyncData);
for (int i = 0; i < m_roomSyncData.playerCount; i++) for (int i = 0; i < m_roomSyncData.playerCount; i++)

View file

@ -119,12 +119,12 @@ public:
class SessionInfo class SessionInfo
{ {
public: public:
SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate); SessionInfo(std::wstring& sessionName, std::wstring& serviceConfig, std::wstring& sessionTemplate);
SessionInfo(); SessionInfo();
bool m_detailsValid; bool m_detailsValid;
wstring m_sessionName; std::wstring m_sessionName;
wstring m_serviceConfig; std::wstring m_serviceConfig;
wstring m_sessionTemplate; std::wstring m_sessionTemplate;
}; };
static const int MAX_LOCAL_PLAYER_COUNT = 4; static const int MAX_LOCAL_PLAYER_COUNT = 4;
@ -153,7 +153,7 @@ public:
{ {
public:; public:;
DQRNetworkPlayer* m_pPlayer; DQRNetworkPlayer* m_pPlayer;
wstring m_name; std::wstring m_name;
unsigned int m_sessionAddress; unsigned int m_sessionAddress;
int m_channel; int m_channel;
bool m_sync; bool m_sync;
@ -181,7 +181,7 @@ public:
DQRNetworkPlayer *GetPlayerByIndex(int idx); DQRNetworkPlayer *GetPlayerByIndex(int idx);
DQRNetworkPlayer *GetPlayerBySmallId(int idx); DQRNetworkPlayer *GetPlayerBySmallId(int idx);
DQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid); DQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid);
wstring GetDisplayNameByGamertag(wstring gamertag); std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
DQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx); DQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx);
DQRNetworkPlayer *GetHostPlayer(); DQRNetworkPlayer *GetHostPlayer();
int GetSessionIndex(DQRNetworkPlayer *player); int GetSessionIndex(DQRNetworkPlayer *player);
@ -223,16 +223,16 @@ public:
public: public:
SessionSearchResult() { m_extData = NULL; } SessionSearchResult() { m_extData = NULL; }
~SessionSearchResult() { free(m_extData); } ~SessionSearchResult() { free(m_extData); }
wstring m_partyId; std::wstring m_partyId;
wstring m_sessionName; std::wstring m_sessionName;
// These names/xuids reflect the server controlled list of who is actually in the game // These names/xuids reflect the server controlled list of who is actually in the game
wstring m_playerNames[MAX_ONLINE_PLAYER_COUNT]; std::wstring m_playerNames[MAX_ONLINE_PLAYER_COUNT];
PlayerUID m_playerXuids[MAX_ONLINE_PLAYER_COUNT]; PlayerUID m_playerXuids[MAX_ONLINE_PLAYER_COUNT];
int m_playerCount; int m_playerCount;
// This count & set of xuids reflects the session document list of who is in the game // This count & set of xuids reflects the session document list of who is in the game
wstring m_sessionXuids[MAX_ONLINE_PLAYER_COUNT]; std::wstring m_sessionXuids[MAX_ONLINE_PLAYER_COUNT];
int m_usedSlotCount; int m_usedSlotCount;
void *m_extData; void *m_extData;
@ -488,7 +488,7 @@ public:
bool JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask); bool JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask);
void CancelJoinPartyFromSearchResult(); void CancelJoinPartyFromSearchResult();
void RequestDisplayName(DQRNetworkPlayer *player); void RequestDisplayName(DQRNetworkPlayer *player);
void SetDisplayName(PlayerUID xuid, wstring displayName); void SetDisplayName(PlayerUID xuid, std::wstring displayName);
private: private:
__int64 m_playersLeftPartyTime; __int64 m_playersLeftPartyTime;
@ -509,7 +509,7 @@ private:
int m_sessionResultCount; int m_sessionResultCount;
bool m_cancelJoinFromSearchResult; bool m_cancelJoinFromSearchResult;
map<wstring, wstring> m_displayNames; // Player display names by gamertag map<std::wstring, std::wstring> m_displayNames; // Player display names by gamertag
@ -521,9 +521,9 @@ private:
} ePartyProcessType; } ePartyProcessType;
static int m_bootUserIndex; static int m_bootUserIndex;
static ePartyProcessType m_partyProcess; static ePartyProcessType m_partyProcess;
static wstring m_bootSessionName; static std::wstring m_bootSessionName;
static wstring m_bootServiceConfig; static std::wstring m_bootServiceConfig;
static wstring m_bootSessionTemplate; static std::wstring m_bootSessionTemplate;
static bool m_inviteReceived; static bool m_inviteReceived;
static DQRNetworkManager *s_pDQRManager; static DQRNetworkManager *s_pDQRManager;

View file

@ -421,7 +421,7 @@ int DQRNetworkManager::GetFriendsThreadProc()
} }
for( int j = 0; j < m_sessionSearchResults[i].m_usedSlotCount; j++ ) for( int j = 0; j < m_sessionSearchResults[i].m_usedSlotCount; j++ )
{ {
m_sessionSearchResults[i].m_sessionXuids[j] = wstring( newSessionVector[i]->Members->GetAt(j)->XboxUserId->Data() ); m_sessionSearchResults[i].m_sessionXuids[j] = std::wstring( newSessionVector[i]->Members->GetAt(j)->XboxUserId->Data() );
} }
m_sessionSearchResults[i].m_extData = malloc( sizeof(GameSessionData) ); m_sessionSearchResults[i].m_extData = malloc( sizeof(GameSessionData) );

View file

@ -192,13 +192,13 @@ void DQRNetworkPlayer::SetName(const wchar_t *name)
} }
// Return display name (if display name is not set, return name instead) // Return display name (if display name is not set, return name instead)
wstring DQRNetworkPlayer::GetDisplayName() std::wstring DQRNetworkPlayer::GetDisplayName()
{ {
return (m_displayName == L"") ? m_name : m_displayName; return (m_displayName == L"") ? m_name : m_displayName;
} }
// Set display name // Set display name
void DQRNetworkPlayer::SetDisplayName(wstring displayName) void DQRNetworkPlayer::SetDisplayName(std::wstring displayName)
{ {
m_displayName = displayName; m_displayName = displayName;
} }

View file

@ -97,7 +97,7 @@ const wchar_t *NetworkPlayerDurango::GetOnlineName()
return m_dqrPlayer->GetName(); return m_dqrPlayer->GetName();
} }
wstring NetworkPlayerDurango::GetDisplayName() std::wstring NetworkPlayerDurango::GetDisplayName()
{ {
return m_dqrPlayer->GetDisplayName(); return m_dqrPlayer->GetDisplayName();
} }

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

@ -744,12 +744,12 @@ bool CPlatformNetworkManagerDurango::SystemFlagGet(INetworkPlayer *pNetworkPlaye
return false; return false;
} }
wstring CPlatformNetworkManagerDurango::GatherStats() std::wstring CPlatformNetworkManagerDurango::GatherStats()
{ {
return L""; return L"";
} }
wstring CPlatformNetworkManagerDurango::GatherRTTStats() std::wstring CPlatformNetworkManagerDurango::GatherRTTStats()
{ {
return L""; return L"";
} }
@ -883,7 +883,7 @@ INetworkPlayer * CPlatformNetworkManagerDurango::GetPlayerBySmallId(unsigned cha
return getNetworkPlayer(m_pDQRNet->GetPlayerBySmallId(smallId)); return getNetworkPlayer(m_pDQRNet->GetPlayerBySmallId(smallId));
} }
wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(wstring gamertag) std::wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(std::wstring gamertag)
{ {
return m_pDQRNet->GetDisplayNameByGamertag(gamertag); return m_pDQRNet->GetDisplayNameByGamertag(gamertag);
} }

View file

@ -28,7 +28,7 @@ public:
virtual INetworkPlayer *GetPlayerByIndex(int playerIndex); virtual INetworkPlayer *GetPlayerByIndex(int playerIndex);
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid); virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid);
virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId); virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId);
virtual wstring GetDisplayNameByGamertag(wstring gamertag); virtual std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
virtual bool ShouldMessageForFullSession(); virtual bool ShouldMessageForFullSession();
virtual INetworkPlayer *GetHostPlayer(); virtual INetworkPlayer *GetHostPlayer();
@ -120,8 +120,8 @@ 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]; vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT];

View file

@ -971,9 +971,9 @@ DurangoStats *CDurangoTelemetryManager::durangoStats()
return (DurangoStats*) GenericStats::getInstance(); return (DurangoStats*) GenericStats::getInstance();
} }
wstring CDurangoTelemetryManager::guid2str(LPCGUID guid) std::wstring CDurangoTelemetryManager::guid2str(LPCGUID guid)
{ {
wstring out = L"GUID<"; std::wstring out = L"GUID<";
out += _toString<unsigned long>(guid->Data1); out += _toString<unsigned long>(guid->Data1);
out += L":"; out += L":";
out += _toString<unsigned short>(guid->Data2); out += _toString<unsigned short>(guid->Data2);

View file

@ -9,7 +9,7 @@ class CDurangoTelemetryManager : public CTelemetryManager
public: public:
static GUID ZERO_GUID; static GUID ZERO_GUID;
std::unordered_map<wstring, float> m_multiplayerRoundStartTimes; std::unordered_map<std::wstring, float> m_multiplayerRoundStartTimes;
CDurangoTelemetryManager(); CDurangoTelemetryManager();
@ -46,5 +46,5 @@ public:
protected: protected:
DurangoStats *durangoStats(); DurangoStats *durangoStats();
wstring guid2str(LPCGUID guid); std::wstring guid2str(LPCGUID guid);
}; };

View file

@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); app.ClearTerrainFeaturePosition();
wstring wWorldName = L"TestWorld"; std::wstring wWorldName = L"TestWorld";
StorageManager.ResetSaveData(); StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(wWorldName.c_str()); StorageManager.SetSaveTitle(wWorldName.c_str());

View file

@ -568,7 +568,7 @@ int StartMinecraftThreadProc( void* lpParameter )
AABB::UseDefaultThreadStorage(); AABB::UseDefaultThreadStorage();
Tesselator::CreateNewThreadStorage(1024*1024); Tesselator::CreateNewThreadStorage(1024*1024);
RenderManager.InitialiseContext(); RenderManager.InitialiseContext();
Minecraft::start(wstring(),wstring()); Minecraft::start(std::wstring(),std::wstring());
delete Tesselator::getInstance(); delete Tesselator::getInstance();
return 0; return 0;
} }
@ -991,7 +991,7 @@ Vec3::resetPool();
vector<uint8_t *> vRichPresenceStrings; vector<uint8_t *> vRichPresenceStrings;
// convert wstring to UTF-8 string // convert std::wstring to UTF-8 string
std::string wstring_to_utf8 (const std::wstring& str) std::string wstring_to_utf8 (const std::wstring& str)
{ {
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv; std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;

View file

@ -88,7 +88,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 SetFullVersion(bool bFull); void SetFullVersion(bool bFull);
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);

View file

@ -405,7 +405,7 @@ public:
void SetDLCProductCode(const char* szProductCode); void SetDLCProductCode(const char* szProductCode);
void SetProductUpgradeKey(const char* szKey); void SetProductUpgradeKey(const char* szKey);
bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam); bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam);
void SetDLCInfoMap(std::unordered_map<wstring, SONYDLC *>* pSONYDLCMap); void SetDLCInfoMap(std::unordered_map<std::wstring, SONYDLC *>* pSONYDLCMap);
}; };
extern C4JStorage StorageManager; extern C4JStorage StorageManager;

View file

@ -1005,8 +1005,8 @@ void OrbisLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRank
out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_uid.setOnlineID( rankData.npId.handle, true );
out.m_rank = rankData.rank; out.m_rank = rankData.rank;
// Convert to wstring and copy name. // Convert to std::wstring and copy name.
wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
out.m_name=wstrName; out.m_name=wstrName;
} }

View file

@ -99,7 +99,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
{ {
wstring wstrTemp=convStringToWstring(pchTitle); std::wstring wstrTemp=convStringToWstring(pchTitle);
AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp)); AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp));
if(it == m_SONYDLCMap.end()) if(it == m_SONYDLCMap.end())
@ -191,7 +191,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
// push this into a vector // push this into a vector
wstring wstrTemp=convStringToWstring(chDLCTitle); std::wstring wstrTemp=convStringToWstring(chDLCTitle);
m_SONYDLCMap[wstrTemp]=pDLCInfo; m_SONYDLCMap[wstrTemp]=pDLCInfo;
} }
CloseHandle(file); CloseHandle(file);
@ -288,7 +288,7 @@ int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameI
int CConsoleMinecraftApp::LoadLocalDLCImages() int CConsoleMinecraftApp::LoadLocalDLCImages()
{ {
// 4J-PB - Any local graphic files for the Minecraft Store? // 4J-PB - Any local graphic files for the Minecraft Store?
std::unordered_map<wstring, SONYDLC *>*pDLCInfoA=app.GetSonyDLCMap(); std::unordered_map<std::wstring, SONYDLC *>*pDLCInfoA=app.GetSonyDLCMap();
for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ )
{ {
SONYDLC * pDLCInfo=(*it).second; SONYDLC * pDLCInfo=(*it).second;
@ -301,7 +301,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages()
void CConsoleMinecraftApp::FreeLocalDLCImages() void CConsoleMinecraftApp::FreeLocalDLCImages()
{ {
// 4J-PB - Any local graphic files for the Minecraft Store? // 4J-PB - Any local graphic files for the Minecraft Store?
std::unordered_map<wstring, SONYDLC *>*pDLCInfoA=app.GetSonyDLCMap(); std::unordered_map<std::wstring, SONYDLC *>*pDLCInfoA=app.GetSonyDLCMap();
for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ ) for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ )
{ {
SONYDLC * pDLCInfo=(*it).second; SONYDLC * pDLCInfo=(*it).second;
@ -394,7 +394,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); app.ClearTerrainFeaturePosition();
wstring wWorldName = L"TestWorld"; std::wstring wWorldName = L"TestWorld";
StorageManager.ResetSaveData(); StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(wWorldName.c_str()); StorageManager.SetSaveTitle(wWorldName.c_str());

View file

@ -161,7 +161,7 @@ public:
bool DLCAlreadyPurchased(char *pchTitle); bool DLCAlreadyPurchased(char *pchTitle);
char *GetSkuIDFromProductList(); char *GetSkuIDFromProductList();
void GetDLCSkuIDFromProductList(char *,char *); void GetDLCSkuIDFromProductList(char *,char *);
std::unordered_map<wstring, SONYDLC *>* GetSonyDLCMap() { return &m_SONYDLCMap; } std::unordered_map<std::wstring, SONYDLC *>* GetSonyDLCMap() { return &m_SONYDLCMap; }
static void CommerceInitCallback(LPVOID lpParam,int err); static void CommerceInitCallback(LPVOID lpParam,int err);
static void CommerceGetCategoriesCallback(LPVOID lpParam,int err); static void CommerceGetCategoriesCallback(LPVOID lpParam,int err);
static void CommerceGetProductListCallback(LPVOID lpParam,int err); static void CommerceGetProductListCallback(LPVOID lpParam,int err);
@ -210,7 +210,7 @@ private:
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
PRODUCTCODES ProductCodes; PRODUCTCODES ProductCodes;
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap; std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
bool m_bVoiceChatAndUGCRestricted; bool m_bVoiceChatAndUGCRestricted;

View file

@ -757,7 +757,7 @@ int StartMinecraftThreadProc( void* lpParameter )
AABB::UseDefaultThreadStorage(); AABB::UseDefaultThreadStorage();
Tesselator::CreateNewThreadStorage(1024*1024); Tesselator::CreateNewThreadStorage(1024*1024);
RenderManager.InitialiseContext(); RenderManager.InitialiseContext();
Minecraft::start(wstring(),wstring()); Minecraft::start(std::wstring(),std::wstring());
delete Tesselator::getInstance(); delete Tesselator::getInstance();
return 0; return 0;
} }
@ -1462,8 +1462,8 @@ int main(int argc, const char *argv[] )
vector<uint8_t *> vRichPresenceStrings; vector<uint8_t *> vRichPresenceStrings;
// convert wstring to UTF-8 string // convert std::wstring to UTF-8 string
std::string wstring_to_utf8 (const std::wstring& str) std::string std::wstring_to_utf8 (const std::wstring& str)
{ {
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv; std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.to_bytes(str); return myconv.to_bytes(str);
@ -1475,7 +1475,7 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID)
LPCWSTR wchString=app.GetString(iID); LPCWSTR wchString=app.GetString(iID);
std::wstring srcString = wchString; std::wstring srcString = wchString;
std::string dstString = wstring_to_utf8(srcString); std::string dstString = std::wstring_to_utf8(srcString);
int dst_len = dstString.size()+1; int dst_len = dstString.size()+1;
uint8_t *strUtf8=(uint8_t *)malloc(dst_len); uint8_t *strUtf8=(uint8_t *)malloc(dst_len);

View file

@ -41,7 +41,7 @@ PlayerUID::PlayerUID(SceUserServiceUserId userID, SceNpOnlineId& onlineID, bool
setOnlineID(onlineID, bSignedInPSN); setOnlineID(onlineID, bSignedInPSN);
} }
PlayerUID::PlayerUID(wstring fromString) PlayerUID::PlayerUID(std::wstring fromString)
{ {
// create for the format P_5e7ff8372ea9_00000004_Mark_4J // create for the format P_5e7ff8372ea9_00000004_Mark_4J
@ -53,14 +53,14 @@ PlayerUID::PlayerUID(wstring fromString)
// parse the mac address next // parse the mac address next
for(int i=0;i<6;i++) for(int i=0;i<6;i++)
{ {
wstring macDigit = fromString.substr(2+(i*2),2); std::wstring macDigit = fromString.substr(2+(i*2),2);
m_macAddress[i] = _fromHEXString<int>(macDigit); m_macAddress[i] = _fromHEXString<int>(macDigit);
} }
int userIdLen = 0; int userIdLen = 0;
// parse the userID // parse the userID
wstring userIDDigits = L""; std::wstring userIDDigits = L"";
while(fromString.at(15 + userIdLen) != L'_') while(fromString.at(15 + userIdLen) != L'_')
{ {
@ -71,7 +71,7 @@ PlayerUID::PlayerUID(wstring fromString)
m_userID = _fromString<int>(userIDDigits); m_userID = _fromString<int>(userIDDigits);
// finally, the onlineID, if there is one // finally, the onlineID, if there is one
wstring onlineID = fromString.substr(15 + userIdLen + 1); std::wstring onlineID = fromString.substr(15 + userIdLen + 1);
if(onlineID.size() > 0) if(onlineID.size() > 0)
{ {
wcstombs(m_onlineID, onlineID.c_str(), 16); wcstombs(m_onlineID, onlineID.c_str(), 16);

View file

@ -78,7 +78,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 SetFullVersion(bool bFull); void SetFullVersion(bool bFull);
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);

View file

@ -990,8 +990,8 @@ void PS3LeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRankDa
out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_uid.setOnlineID( rankData.npId.handle, true );
out.m_rank = rankData.rank; out.m_rank = rankData.rank;
// Convert to wstring and copy name. // Convert to std::wstring and copy name.
wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str(); std::wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str();
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
out.m_name=wstrName; out.m_name=wstrName;
} }

View file

@ -105,7 +105,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
{ {
wstring wstrTemp=convStringToWstring(pchTitle); std::wstring wstrTemp=convStringToWstring(pchTitle);
SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp); SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp);
return pTemp; return pTemp;
@ -174,7 +174,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
// push this into a vector // push this into a vector
wstring wstrTemp=convStringToWstring(chDLCTitle); std::wstring wstrTemp=convStringToWstring(chDLCTitle);
m_SONYDLCMap[wstrTemp]=pDLCInfo; m_SONYDLCMap[wstrTemp]=pDLCInfo;
} }
CloseHandle(file); CloseHandle(file);
@ -466,7 +466,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
} }
LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName) LoadSaveDataThreadParam* LoadSaveFromDisk(const std::wstring& pathName)
{ {
File saveFile(pathName); File saveFile(pathName);
__int64 fileSize = saveFile.length(); __int64 fileSize = saveFile.length();
@ -501,7 +501,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); wstring wWorldName = L"TestWorld"; app.ClearTerrainFeaturePosition(); std::wstring wWorldName = L"TestWorld";
StorageManager.ResetSaveData(); StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(wWorldName.c_str()); StorageManager.SetSaveTitle(wWorldName.c_str());
@ -519,7 +519,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
NetworkGameInitData *param = new NetworkGameInitData(); NetworkGameInitData *param = new NetworkGameInitData();
param->seed = seedValue; param->seed = seedValue;
#ifdef SAVE_GAME_TO_LOAD #ifdef SAVE_GAME_TO_LOAD
param->saveData = LoadSaveFromDisk(wstring(SAVE_GAME_TO_LOAD)); param->saveData = LoadSaveFromDisk(std::wstring(SAVE_GAME_TO_LOAD));
#else #else
param->saveData = NULL; param->saveData = NULL;
#endif #endif

View file

@ -202,7 +202,7 @@ private:
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
PRODUCTCODES ProductCodes; PRODUCTCODES ProductCodes;
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap; std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
bool m_bVoiceChatAndUGCRestricted; bool m_bVoiceChatAndUGCRestricted;

View file

@ -951,7 +951,7 @@ int main()
// 4J-PB - TRC that we need to be able to see the BD in a different titled save from the digital game // 4J-PB - TRC that we need to be able to see the BD in a different titled save from the digital game
if(StorageManager.GetBootTypeDisc()) if(StorageManager.GetBootTypeDisc())
{ {
wstring wsTemp = app.GetString(IDS_GAMENAME); std::wstring wsTemp = app.GetString(IDS_GAMENAME);
WCHAR wchTemp[64]; WCHAR wchTemp[64];
wsTemp.append(L" ("); wsTemp.append(L" (");
mbstowcs(wchTemp,app.GetDiscProductCode(),64); mbstowcs(wchTemp,app.GetDiscProductCode(),64);
@ -991,7 +991,7 @@ int main()
delete [] baSaveImage.data; delete [] baSaveImage.data;
} }
wstring wsName=L"Graphics\\SaveChest.png"; std::wstring wsName=L"Graphics\\SaveChest.png";
byteArray baSaveLoadIcon = app.getArchiveFile(wsName); byteArray baSaveLoadIcon = app.getArchiveFile(wsName);
if(baSaveLoadIcon.data!=NULL) if(baSaveLoadIcon.data!=NULL)
{ {

View file

@ -30,7 +30,7 @@ PlayerUID::PlayerUID(CellSysutilUserId userID, SceNpOnlineId& onlineID, bool bSi
setOnlineID(onlineID, bSignedInPSN); setOnlineID(onlineID, bSignedInPSN);
} }
PlayerUID::PlayerUID(wstring fromString) PlayerUID::PlayerUID(std::wstring fromString)
{ {
// create for the format P_5e7ff8372ea9_00000004_Mark_4J // create for the format P_5e7ff8372ea9_00000004_Mark_4J
@ -42,16 +42,16 @@ PlayerUID::PlayerUID(wstring fromString)
// parse the mac address next // parse the mac address next
for(int i=0;i<6;i++) for(int i=0;i<6;i++)
{ {
wstring macDigit = fromString.substr(2+(i*2),2); std::wstring macDigit = fromString.substr(2+(i*2),2);
m_macAddress[i] = _fromHEXString<int>(macDigit); m_macAddress[i] = _fromHEXString<int>(macDigit);
} }
// parse the userID // parse the userID
wstring userIDDigits = fromString.substr(15,8); std::wstring userIDDigits = fromString.substr(15,8);
m_userID = _fromString<int>(userIDDigits); m_userID = _fromString<int>(userIDDigits);
// finally, the onlineID, if there is one // finally, the onlineID, if there is one
wstring onlineID = fromString.substr(24); std::wstring onlineID = fromString.substr(24);
if(onlineID.size() > 0) if(onlineID.size() > 0)
{ {
wcstombs(m_onlineID, onlineID.c_str(), 16); wcstombs(m_onlineID, onlineID.c_str(), 16);

View file

@ -4,8 +4,8 @@
class HugeMushroomTile_SPU : public Tile_SPU class HugeMushroomTile_SPU : public Tile_SPU
{ {
public: public:
// static const wstring TEXTURE_STEM; // static const std::wstring TEXTURE_STEM;
// static const wstring TEXTURE_INSIDE; // static const std::wstring TEXTURE_INSIDE;
private: private:
static const int HUGE_MUSHROOM_TEXTURE_COUNT = 2; static const int HUGE_MUSHROOM_TEXTURE_COUNT = 2;

View file

@ -49,7 +49,7 @@ public:
return getV0() + (diff * ((float) offset / 16)); //SharedConstants::WORLD_RESOLUTION)); return getV0() + (diff * ((float) offset / 16)); //SharedConstants::WORLD_RESOLUTION));
} }
// virtual wstring getName() const = 0; // virtual std::wstring getName() const = 0;
// virtual int getSourceWidth() const = 0; // virtual int getSourceWidth() const = 0;
// virtual int getSourceHeight() const = 0; // virtual int getSourceHeight() const = 0;
}; };

View file

@ -8,7 +8,7 @@
// IDS_TILE_LEAVES_BIRCH, // IDS_TILE_LEAVES_BIRCH,
// }; // };
// //
// const wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},}; // const std::wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},};
// from TransparentTile, since we're no longer inheriting // from TransparentTile, since we're no longer inheriting

View file

@ -7,10 +7,10 @@
#include "../Common/spu_assert.h" #include "../Common/spu_assert.h"
#endif #endif
// const wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava"; // const std::wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava";
// const wstring LiquidTile::TEXTURE_WATER_STILL = L"water"; // const std::wstring LiquidTile::TEXTURE_WATER_STILL = L"water";
// const wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow"; // const std::wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow";
// const wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow"; // const std::wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow";
#define MATH_PI (3.141592654f) #define MATH_PI (3.141592654f)

View file

@ -11,7 +11,7 @@ const int TallGrass_SPU::DEAD_SHRUB = 0;
const int TallGrass_SPU::TALL_GRASS = 1; const int TallGrass_SPU::TALL_GRASS = 1;
const int TallGrass_SPU::FERN = 2; const int TallGrass_SPU::FERN = 2;
// const wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"}; // const std::wstring TallGrass::TEXTURE_NAMES[] = {L"deadbush", L"tallgrass", L"fern"};
Icon_SPU *TallGrass_SPU::getTexture(int face, int data) Icon_SPU *TallGrass_SPU::getTexture(int face, int data)

View file

@ -575,7 +575,7 @@ void Tile_SPU::updateDefaultShape()
// return this; // return this;
// } // }
// //
// wstring Tile_SPU::getName() // std::wstring Tile_SPU::getName()
// { // {
// return I18n::get(getDescriptionId() + L".name"); // return I18n::get(getDescriptionId() + L".name");
// } // }
@ -655,12 +655,12 @@ Material_SPU* Tile_SPU::getMaterial()
// icon = iconRegister->registerIcon(m_textureName); // icon = iconRegister->registerIcon(m_textureName);
// } // }
// //
// wstring Tile_SPU::getTileItemIconName() // std::wstring Tile_SPU::getTileItemIconName()
// { // {
// return L""; // return L"";
// } // }
// //
// Tile *Tile_SPU::setTextureName(const wstring &name) // Tile *Tile_SPU::setTextureName(const std::wstring &name)
// { // {
// m_textureName = name; // m_textureName = name;
// return this; // return this;

View file

@ -223,7 +223,7 @@ private:
// unsigned int descriptionId; // unsigned int descriptionId;
// unsigned int useDescriptionId; // 4J Added // unsigned int useDescriptionId; // 4J Added
// //
// wstring m_textureName; // std::wstring m_textureName;
protected: protected:
// Icon *icon; // Icon *icon;

View file

@ -173,7 +173,7 @@ public:
// public: // public:
// ZipFile(File *file) {} // ZipFile(File *file) {}
// InputStream *getInputStream(ZipEntry *entry) { return NULL; } // InputStream *getInputStream(ZipEntry *entry) { return NULL; }
// ZipEntry *getEntry(const wstring& name) {return NULL;} // ZipEntry *getEntry(const std::wstring& name) {return NULL;}
// void close() {} // void close() {}
// }; // };
// //
@ -189,7 +189,7 @@ public:
// static void create() {} // static void create() {}
// static void destroy() {} // static void destroy() {}
// static bool isKeyDown(int) {return false;} // static bool isKeyDown(int) {return false;}
// static wstring getKeyName(int) { return L"KEYNAME"; } // static std::wstring getKeyName(int) { return L"KEYNAME"; }
// static void enableRepeatEvents(bool) {} // static void enableRepeatEvents(bool) {}
// static const int KEY_A = 0; // static const int KEY_A = 0;
// static const int KEY_B = 1; // static const int KEY_B = 1;

View file

@ -101,7 +101,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 SetFullVersion(bool bFull); void SetFullVersion(bool bFull);

View file

@ -381,7 +381,7 @@ public:
void SetDLCProductCode(const char* szProductCode); void SetDLCProductCode(const char* szProductCode);
void SetProductUpgradeKey(const char* szKey); void SetProductUpgradeKey(const char* szKey);
bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam); bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam);
void SetDLCInfoMap(std::unordered_map<wstring, SONYDLC *>* pSONYDLCMap); void SetDLCInfoMap(std::unordered_map<std::wstring, SONYDLC *>* pSONYDLCMap);
void EntitlementsCallback(bool bFoundEntitlements); void EntitlementsCallback(bool bFoundEntitlements);
}; };

View file

@ -1012,8 +1012,8 @@ void PSVitaLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRan
out.m_uid.setOnlineID( rankData.npId.handle, true ); out.m_uid.setOnlineID( rankData.npId.handle, true );
out.m_rank = rankData.rank; out.m_rank = rankData.rank;
// Convert to wstring and copy name. // Convert to std::wstring and copy name.
wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str(); std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE); //memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
out.m_name=wstrName; out.m_name=wstrName;
} }

View file

@ -94,7 +94,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle) SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
{ {
wstring wstrTemp=convStringToWstring(pchTitle); std::wstring wstrTemp=convStringToWstring(pchTitle);
AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp)); AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp));
if(it == m_SONYDLCMap.end()) if(it == m_SONYDLCMap.end())
@ -105,7 +105,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
} }
return it->second; return it->second;
/*wstring wstrTemp=convStringToWstring(pchTitle); /*std::wstring wstrTemp=convStringToWstring(pchTitle);
SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp); SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp);
return pTemp;*/ return pTemp;*/
@ -172,7 +172,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
// push this into a vector // push this into a vector
wstring wstrTemp=convStringToWstring(chDLCTitle); std::wstring wstrTemp=convStringToWstring(chDLCTitle);
m_SONYDLCMap[wstrTemp]=pDLCInfo; m_SONYDLCMap[wstrTemp]=pDLCInfo;
} }
CloseHandle(file); CloseHandle(file);
@ -304,7 +304,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); app.ClearTerrainFeaturePosition();
wstring wWorldName = L"TestWorld"; std::wstring wWorldName = L"TestWorld";
bool isFlat = false; bool isFlat = false;
__int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements __int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements

View file

@ -159,7 +159,7 @@ public:
bool DLCAlreadyPurchased(char *pchTitle); bool DLCAlreadyPurchased(char *pchTitle);
char *GetSkuIDFromProductList(); char *GetSkuIDFromProductList();
void GetDLCSkuIDFromProductList(char *,char *); void GetDLCSkuIDFromProductList(char *,char *);
std::unordered_map<wstring, SONYDLC *>* GetSonyDLCMap() { return &m_SONYDLCMap; } std::unordered_map<std::wstring, SONYDLC *>* GetSonyDLCMap() { return &m_SONYDLCMap; }
static void CommerceInitCallback(LPVOID lpParam,int err); static void CommerceInitCallback(LPVOID lpParam,int err);
static void CommerceGetCategoriesCallback(LPVOID lpParam,int err); static void CommerceGetCategoriesCallback(LPVOID lpParam,int err);
static void CommerceGetProductListCallback(LPVOID lpParam,int err); static void CommerceGetProductListCallback(LPVOID lpParam,int err);
@ -230,7 +230,7 @@ private:
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed; // SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
PRODUCTCODES ProductCodes; PRODUCTCODES ProductCodes;
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap; std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
bool m_bVoiceChatAndUGCRestricted; bool m_bVoiceChatAndUGCRestricted;

View file

@ -35,7 +35,7 @@ PlayerUID::PlayerUID(int userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int
setOnlineID(onlineID, bSignedInPSN); setOnlineID(onlineID, bSignedInPSN);
} }
PlayerUID::PlayerUID(wstring fromString) PlayerUID::PlayerUID(std::wstring fromString)
{ {
// create for the format P_5e7ff8372ea9_00000004_Mark_4J // create for the format P_5e7ff8372ea9_00000004_Mark_4J
@ -47,16 +47,16 @@ PlayerUID::PlayerUID(wstring fromString)
// parse the mac address next // parse the mac address next
for(int i=0;i<6;i++) for(int i=0;i<6;i++)
{ {
wstring macDigit = fromString.substr(2+(i*2),2); std::wstring macDigit = fromString.substr(2+(i*2),2);
m_macAddress[i] = _fromHEXString<int>(macDigit); m_macAddress[i] = _fromHEXString<int>(macDigit);
} }
// parse the userID // parse the userID
wstring userIDDigits = fromString.substr(15,8); std::wstring userIDDigits = fromString.substr(15,8);
m_userID = _fromString<int>(userIDDigits); m_userID = _fromString<int>(userIDDigits);
// finally, the onlineID, if there is one // finally, the onlineID, if there is one
wstring onlineID = fromString.substr(24); std::wstring onlineID = fromString.substr(24);
if(onlineID.size() > 0) if(onlineID.size() > 0)
{ {
wcstombs(m_onlineID, onlineID.c_str(), 16); wcstombs(m_onlineID, onlineID.c_str(), 16);

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

@ -319,7 +319,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

@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
app.ClearTerrainFeaturePosition(); app.ClearTerrainFeaturePosition();
wstring wWorldName = L"TestWorld"; std::wstring wWorldName = L"TestWorld";
StorageManager.ResetSaveData(); StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(wWorldName.c_str()); StorageManager.SetSaveTitle(wWorldName.c_str());

View file

@ -287,7 +287,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);
C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0, C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0,

View file

@ -438,7 +438,7 @@ void SoundEngine::XACTNotificationCallback( const XACT_NOTIFICATION* pNotificati
} }
} }
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);
@ -468,7 +468,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
{ {
return; return;
} }
wstring name = wchSoundNames[iSound]; std::wstring name = wchSoundNames[iSound];
//const unsigned char *name=ucSoundNames[iSound]; //const unsigned char *name=ucSoundNames[iSound];
char *xboxName = ConvertSoundPathToName(name); char *xboxName = ConvertSoundPathToName(name);
@ -576,7 +576,7 @@ void SoundEngine::playUI(int iSound, float, float)
{ {
return; return;
} }
wstring name = wchSoundNames[iSound]; std::wstring name = wchSoundNames[iSound];
char *xboxName = (char *)ConvertSoundPathToName(name); char *xboxName = (char *)ConvertSoundPathToName(name);
@ -635,7 +635,7 @@ void SoundEngine::playUI(int iSound, float, float)
cueInstance->Play(); cueInstance->Play();
} }
void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, float vol, float pitch, bool bMusicDelay) void SoundEngine::playStreaming(const std::wstring& name, float x, float y, float z, float vol, float pitch, bool bMusicDelay)
{ {
IXACT3SoundBank *pSoundBank=NULL; IXACT3SoundBank *pSoundBank=NULL;
@ -1065,14 +1065,14 @@ void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
m_pXACT3Engine->DoWork(); m_pXACT3Engine->DoWork();
} }
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)
{ {
} }

View file

@ -79,7 +79,7 @@ public:
SoundEngine(); SoundEngine();
virtual void destroy(); virtual void destroy();
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);
@ -87,16 +87,16 @@ public:
virtual void updateSoundEffectVolume(float fVal); virtual void updateSoundEffectVolume(float fVal);
virtual void init(Options *); virtual void init(Options *);
virtual void tick(std::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);
#ifndef __PS3__ #ifndef __PS3__
static void setXACTEngine( IXACT3Engine *pXACT3Engine); static void setXACTEngine( IXACT3Engine *pXACT3Engine);
void CreateStreamingWavebank(const char *pchName, IXACT3WaveBank **ppStreamedWaveBank); void CreateStreamingWavebank(const char *pchName, IXACT3WaveBank **ppStreamedWaveBank);
void CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSoundBank); void CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSoundBank);
#endif // __PS3__ #endif // __PS3__
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
#ifdef _XBOX #ifdef _XBOX
bool isStreamingWavebankReady(IXACT3WaveBank *pWaveBank); bool isStreamingWavebankReady(IXACT3WaveBank *pWaveBank);

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