mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 04:13:37 +00:00
refactor: unglob std::wstring
This commit is contained in:
parent
41db813a6d
commit
cdc08700e4
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
|||
Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/
|
||||
|
||||
# ----- Build output directories -----
|
||||
build/
|
||||
builddir/
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void C_4JProfile::SetPrimaryPad(int iPad) {}
|
|||
|
||||
static char s_gamertag[64] = "Player";
|
||||
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; }
|
||||
void C_4JProfile::SetSignInChangeCallback(void(*Func)(LPVOID, bool, unsigned int), LPVOID lpParam) {}
|
||||
void C_4JProfile::SetNotificationsCallback(void(*Func)(LPVOID, DWORD, unsigned int), LPVOID lpParam) {}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public:
|
|||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
|
|
|
|||
|
|
@ -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_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);
|
||||
// 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);
|
||||
|
||||
// enum eXBLWS
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); }
|
|||
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
|
||||
#else
|
||||
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
|
||||
bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; }
|
||||
void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ class ZipFile
|
|||
public:
|
||||
ZipFile(File *file) {}
|
||||
InputStream *getInputStream(ZipEntry *entry) { return NULL; }
|
||||
ZipEntry *getEntry(const wstring& name) {return NULL;}
|
||||
ZipEntry *getEntry(const std::wstring& name) {return NULL;}
|
||||
void close() {}
|
||||
};
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
static void create() {}
|
||||
static void destroy() {}
|
||||
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 const int KEY_A = 0;
|
||||
static const int KEY_B = 1;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "Build/stdafx.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;
|
||||
|
|
@ -12,7 +12,7 @@ class ClientConstants
|
|||
|
||||
// INTERNAL DEVELOPMENT SETTINGS
|
||||
public:
|
||||
static const wstring VERSION_STRING;
|
||||
static const std::wstring VERSION_STRING;
|
||||
|
||||
static const bool DEADMAU5_CAMERA_CHEATS = false;
|
||||
static const bool IS_DEMO_VERSION = false;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void DemoMode::tick()
|
|||
else if (day == 1)
|
||||
{
|
||||
Options *options = minecraft->options;
|
||||
wstring message;
|
||||
std::wstring message;
|
||||
|
||||
if (time == 100) {
|
||||
minecraft.gui.addMessage("Seed: " + minecraft.level.getSeed());
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ const Options::Option *Options::Option::getItem(int 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);
|
||||
}
|
||||
|
||||
wstring Options::Option::getCaptionId() const
|
||||
std::wstring Options::Option::getCaptionId() const
|
||||
{
|
||||
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"
|
||||
};
|
||||
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"
|
||||
};
|
||||
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"
|
||||
};
|
||||
const wstring Options::FRAMERATE_LIMITS[] =
|
||||
const std::wstring Options::FRAMERATE_LIMITS[] =
|
||||
{
|
||||
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"
|
||||
};
|
||||
|
||||
|
|
@ -184,13 +184,13 @@ Options::Options()
|
|||
init();
|
||||
}
|
||||
|
||||
wstring Options::getKeyDescription(int i)
|
||||
std::wstring Options::getKeyDescription(int i)
|
||||
{
|
||||
Language *language = Language::getInstance();
|
||||
return language->getElement(keyMappings[i]->name);
|
||||
}
|
||||
|
||||
wstring Options::getKeyMessage(int i)
|
||||
std::wstring Options::getKeyMessage(int i)
|
||||
{
|
||||
int key = keyMappings[i]->key;
|
||||
if (key < 0) {
|
||||
|
|
@ -307,12 +307,12 @@ bool Options::getBooleanValue(const Options::Option *item)
|
|||
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();
|
||||
wstring caption = language->getElement(item->getCaptionId()) + L": ";
|
||||
std::wstring caption = language->getElement(item->getCaptionId()) + L": ";
|
||||
|
||||
if (item->isProgress())
|
||||
{
|
||||
|
|
@ -411,14 +411,14 @@ void Options::load()
|
|||
// 4J - was new BufferedReader(new FileReader(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?
|
||||
{
|
||||
// 4J - removed try/catch
|
||||
// try {
|
||||
wstring cmds[2];
|
||||
std::wstring cmds[2];
|
||||
int splitpos = (int)line.find(L":");
|
||||
if( splitpos == wstring::npos )
|
||||
if( splitpos == std::wstring::npos )
|
||||
{
|
||||
cmds[0] = line;
|
||||
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"false") return 0;
|
||||
|
|
@ -488,20 +488,20 @@ void Options::save()
|
|||
|
||||
dos.writeChars(L"music:" + _toString<float>(music) + 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"fov:" + _toString<float>(fov));
|
||||
dos.writeChars(L"gamma:" + _toString<float>(gamma));
|
||||
dos.writeChars(L"viewDistance:" + _toString<int>(viewDistance));
|
||||
dos.writeChars(L"guiScale:" + _toString<int>(guiScale));
|
||||
dos.writeChars(L"particles:" + _toString<int>(particles));
|
||||
dos.writeChars(L"bobView:" + wstring(bobView ? L"true" : L"false"));
|
||||
dos.writeChars(L"anaglyph3d:" + wstring(anaglyph3d ? L"true" : L"false"));
|
||||
dos.writeChars(L"advancedOpengl:" + wstring(advancedOpengl ? L"true" : L"false"));
|
||||
dos.writeChars(L"bobView:" + std::wstring(bobView ? L"true" : L"false"));
|
||||
dos.writeChars(L"anaglyph3d:" + std::wstring(anaglyph3d ? 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"difficulty:" + _toString<int>(difficulty));
|
||||
dos.writeChars(L"fancyGraphics:" + wstring(fancyGraphics ? L"true" : L"false"));
|
||||
dos.writeChars(L"ao:" + wstring(ambientOcclusion ? L"true" : L"false"));
|
||||
dos.writeChars(L"fancyGraphics:" + std::wstring(fancyGraphics ? 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"skin:" + skin);
|
||||
dos.writeChars(L"lastServer:" + lastMpIp);
|
||||
|
|
|
|||
|
|
@ -37,24 +37,24 @@ public:
|
|||
private:
|
||||
const bool _isProgress;
|
||||
const bool _isBoolean;
|
||||
const wstring captionId;
|
||||
const std::wstring captionId;
|
||||
|
||||
public:
|
||||
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 isBoolean() const;
|
||||
int getId() const;
|
||||
wstring getCaptionId() const;
|
||||
std::wstring getCaptionId() const;
|
||||
};
|
||||
|
||||
private:
|
||||
static const wstring RENDER_DISTANCE_NAMES[];
|
||||
static const wstring DIFFICULTY_NAMES[];
|
||||
static const wstring GUI_SCALE[];
|
||||
static const wstring FRAMERATE_LIMITS[];
|
||||
static const wstring PARTICLES[];
|
||||
static const std::wstring RENDER_DISTANCE_NAMES[];
|
||||
static const std::wstring DIFFICULTY_NAMES[];
|
||||
static const std::wstring GUI_SCALE[];
|
||||
static const std::wstring FRAMERATE_LIMITS[];
|
||||
static const std::wstring PARTICLES[];
|
||||
|
||||
public:
|
||||
float music;
|
||||
|
|
@ -69,7 +69,7 @@ public:
|
|||
bool fancyGraphics;
|
||||
bool ambientOcclusion;
|
||||
bool renderClouds;
|
||||
wstring skin;
|
||||
std::wstring skin;
|
||||
|
||||
KeyMapping *keyUp;
|
||||
KeyMapping *keyLeft;
|
||||
|
|
@ -99,7 +99,7 @@ public:
|
|||
bool hideGui;
|
||||
bool thirdPersonView;
|
||||
bool renderDebug;
|
||||
wstring lastMpIp;
|
||||
std::wstring lastMpIp;
|
||||
|
||||
bool isFlying;
|
||||
bool smoothCamera;
|
||||
|
|
@ -114,17 +114,17 @@ public:
|
|||
void init(); // 4J added
|
||||
Options(Minecraft *minecraft, File workingDirectory);
|
||||
Options();
|
||||
wstring getKeyDescription(int i);
|
||||
wstring getKeyMessage(int i);
|
||||
std::wstring getKeyDescription(int i);
|
||||
std::wstring getKeyMessage(int i);
|
||||
void setKey(int i, int key);
|
||||
void set(const Options::Option *item, float value);
|
||||
void toggle(const Options::Option *option, int dir);
|
||||
float getProgressValue(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();
|
||||
private:
|
||||
float readFloat(wstring string);
|
||||
float readFloat(std::wstring string);
|
||||
public:
|
||||
void save();
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
{
|
||||
|
|
@ -25,7 +25,7 @@ wstring Settings::getString(const wstring& key, const wstring& defaultValue)
|
|||
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())
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ int Settings::getInt(const wstring& key, int defaultValue)
|
|||
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())
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ bool Settings::getBoolean(const wstring& key, bool defaultValue)
|
|||
return retval;
|
||||
}
|
||||
|
||||
void Settings::setBooleanAndSave(const wstring& key, bool value)
|
||||
void Settings::setBooleanAndSave(const std::wstring& key, bool value)
|
||||
{
|
||||
properties[key] = _toString<bool>(value);
|
||||
saveProperties();
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@ class Settings
|
|||
// public static Logger logger = Logger.getLogger("Minecraft");
|
||||
// private Properties properties = new Properties();
|
||||
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;
|
||||
|
||||
public:
|
||||
Settings(File *file);
|
||||
void generateNewProperties();
|
||||
void saveProperties();
|
||||
wstring getString(const wstring& key, const wstring& defaultValue);
|
||||
int getInt(const wstring& key, int defaultValue);
|
||||
bool getBoolean(const wstring& key, bool defaultValue);
|
||||
void setBooleanAndSave(const wstring& key, bool value);
|
||||
std::wstring getString(const std::wstring& key, const std::wstring& defaultValue);
|
||||
int getInt(const std::wstring& key, int defaultValue);
|
||||
bool getBoolean(const std::wstring& key, bool defaultValue);
|
||||
void setBooleanAndSave(const std::wstring& key, bool value);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ private:
|
|||
public:
|
||||
StatsSyncher(User *user, StatsCounter *statsCounter, File *dir);
|
||||
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);
|
||||
void doSend(std::unordered_map<Stat *, int> *stats);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "../Build/stdafx.h"
|
||||
#include "ConsoleInput.h"
|
||||
|
||||
ConsoleInput::ConsoleInput(const wstring& msg, ConsoleInputSource *source)
|
||||
ConsoleInput::ConsoleInput(const std::wstring& msg, ConsoleInputSource *source)
|
||||
{
|
||||
this->msg = msg;
|
||||
this->source = source;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ using namespace std;
|
|||
class ConsoleInput
|
||||
{
|
||||
public:
|
||||
wstring msg;
|
||||
std::wstring msg;
|
||||
ConsoleInputSource *source;
|
||||
|
||||
ConsoleInput(const wstring& msg, ConsoleInputSource *source);
|
||||
ConsoleInput(const std::wstring& msg, ConsoleInputSource *source);
|
||||
};
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
class ConsoleInputSource
|
||||
{
|
||||
public:
|
||||
virtual void info(const wstring& string) = 0;
|
||||
virtual void warn(const wstring& string) = 0;
|
||||
virtual wstring getConsoleName() = 0;
|
||||
virtual void info(const std::wstring& string) = 0;
|
||||
virtual void warn(const std::wstring& string) = 0;
|
||||
virtual std::wstring getConsoleName() = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "../Build/stdafx.h"
|
||||
#include "KeyMapping.h"
|
||||
|
||||
KeyMapping::KeyMapping(const wstring& name, int key)
|
||||
KeyMapping::KeyMapping(const std::wstring& name, int key)
|
||||
{
|
||||
this->name = name;
|
||||
this->key = key;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using namespace std;
|
|||
class KeyMapping
|
||||
{
|
||||
public:
|
||||
wstring name;
|
||||
std::wstring name;
|
||||
int key;
|
||||
KeyMapping(const wstring& name, int key);
|
||||
KeyMapping(const std::wstring& name, int key);
|
||||
};
|
||||
|
|
@ -11,7 +11,7 @@ LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings(
|
|||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ private:
|
|||
static const int DEMO_SPAWN_Z = -731;
|
||||
static LevelSettings DEMO_LEVEL_SETTINGS;
|
||||
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);
|
||||
protected:
|
||||
virtual void setInitialSpawn();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "../../Minecraft.World/Level/Storage/SavedDataStorage.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)
|
||||
{
|
||||
// 4J-PB - we're going to override the savedDataStorage, so we need to delete the current one
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
class DerivedServerLevel : public ServerLevel
|
||||
{
|
||||
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();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -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_tickNextTickCS);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ private:
|
|||
int activeTileEventsList;
|
||||
public:
|
||||
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();
|
||||
void tick();
|
||||
Biome::MobSpawnerData *getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ ServerLevelListener::ServerLevelListener(MinecraftServer *server, ServerLevel *l
|
|||
|
||||
// 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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ private:
|
|||
|
||||
public:
|
||||
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 allChanged();
|
||||
virtual void entityAdded(std::shared_ptr<Entity> entity);
|
||||
|
|
@ -27,7 +27,7 @@ public:
|
|||
virtual void skyColorChanged();
|
||||
virtual void tileChanged(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 destroyTileProgress(int id, int x, int y, int z, int progress);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ void Minecraft::clearConnectionFailed()
|
|||
app.SetDisconnectReason(DisconnectPacket::eDisconnect_None);
|
||||
}
|
||||
|
||||
void Minecraft::connectTo(const wstring& server, int port)
|
||||
void Minecraft::connectTo(const std::wstring& server, int port)
|
||||
{
|
||||
connectToIp = server;
|
||||
connectToPort = port;
|
||||
|
|
@ -489,7 +489,7 @@ File Minecraft::getWorkingDirectory()
|
|||
return workDir;
|
||||
}
|
||||
|
||||
File Minecraft::getWorkingDirectory(const wstring& applicationName)
|
||||
File Minecraft::getWorkingDirectory(const std::wstring& applicationName)
|
||||
{
|
||||
#if 0
|
||||
// 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);
|
||||
return workingDirectory;
|
||||
#else
|
||||
wstring userHome = L"home"; // 4J - TODO
|
||||
std::wstring userHome = L"home"; // 4J - TODO
|
||||
File workingDirectory(userHome, applicationName);
|
||||
// 4J Removed
|
||||
//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
|
||||
}
|
||||
|
|
@ -1025,7 +1025,7 @@ void Minecraft::addPendingLocalConnection(int idx, ClientConnection *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;
|
||||
|
||||
|
|
@ -1037,7 +1037,7 @@ std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int id
|
|||
// A temp player displaying a connecting screen
|
||||
tempScreenSection = localplayers[idx]->m_iScreenSection;
|
||||
}
|
||||
wstring prevname = user->name;
|
||||
std::wstring prevname = user->name;
|
||||
user->name = name;
|
||||
|
||||
// Don't need this any more
|
||||
|
|
@ -3439,7 +3439,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
#endif
|
||||
if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) )
|
||||
{
|
||||
wstring itemName = L"";
|
||||
std::wstring itemName = L"";
|
||||
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
|
||||
int iCount=0;
|
||||
|
|
@ -3782,16 +3782,16 @@ bool Minecraft::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;
|
||||
}
|
||||
|
||||
bool Minecraft::loadSlot(const wstring& userName, int slot)
|
||||
bool Minecraft::loadSlot(const std::wstring& userName, int slot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3835,7 +3835,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension)
|
|||
|
||||
// Also causing ambiguous call for some reason
|
||||
// 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);
|
||||
//}
|
||||
|
|
@ -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"/");
|
||||
wstring category = name.substr(0, p);
|
||||
wstring name2 = name.substr(p + 1);
|
||||
std::wstring category = name.substr(0, p);
|
||||
std::wstring name2 = name.substr(p + 1);
|
||||
toLower(category);
|
||||
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 L"Time to autosave: " + _toString<unsigned int>( app.SecondsToAutosave() ) + L"s";
|
||||
}
|
||||
|
||||
wstring Minecraft::gatherStats2()
|
||||
std::wstring Minecraft::gatherStats2()
|
||||
{
|
||||
return g_NetworkManager.GatherStats();
|
||||
//return levelRenderer->gatherStats2();
|
||||
}
|
||||
|
||||
wstring Minecraft::gatherStats3()
|
||||
std::wstring Minecraft::gatherStats3()
|
||||
{
|
||||
return g_NetworkManager.GatherRTTStats();
|
||||
//return L"P: " + particleEngine->countParticles() + L". T: " + level->gatherStats();
|
||||
}
|
||||
|
||||
wstring Minecraft::gatherStats4()
|
||||
std::wstring Minecraft::gatherStats4()
|
||||
{
|
||||
return level->gatherChunkSourceStats();
|
||||
}
|
||||
|
|
@ -4260,15 +4260,15 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId)
|
|||
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"");
|
||||
}
|
||||
|
||||
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;
|
||||
wstring userName = name;
|
||||
std::wstring userName = name;
|
||||
|
||||
/* 4J - removed window handling things here
|
||||
final Frame frame = new Frame("Minecraft");
|
||||
|
|
@ -4367,8 +4367,8 @@ int g_iMainThreadId;
|
|||
|
||||
void Minecraft::main()
|
||||
{
|
||||
wstring name;
|
||||
wstring sessionId;
|
||||
std::wstring name;
|
||||
std::wstring sessionId;
|
||||
|
||||
//g_iMainThreadId = GetCurrentThreadId();
|
||||
|
||||
|
|
@ -4452,7 +4452,7 @@ bool Minecraft::renderDebug()
|
|||
return (m_instance != NULL && m_instance->options->renderDebug);
|
||||
}
|
||||
|
||||
bool Minecraft::handleClientSideCommand(const wstring& chatMessage)
|
||||
bool Minecraft::handleClientSideCommand(const std::wstring& chatMessage)
|
||||
{
|
||||
/* 4J - TODO
|
||||
if (chatMessage.startsWith("/")) {
|
||||
|
|
@ -4841,7 +4841,7 @@ void Minecraft::tickAllConnections()
|
|||
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));
|
||||
if( it == m_pendingTextureRequests.end() )
|
||||
|
|
@ -4852,7 +4852,7 @@ bool Minecraft::addPendingClientTextureRequest(const wstring &textureName)
|
|||
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));
|
||||
if( it != m_pendingTextureRequests.end() )
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ private:
|
|||
};
|
||||
|
||||
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);
|
||||
void init();
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ public:
|
|||
void addPendingLocalConnection(int idx, ClientConnection *connection);
|
||||
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);
|
||||
bool setLocalPlayerIdx(int idx);
|
||||
int getLocalPlayerIdx();
|
||||
|
|
@ -126,7 +126,7 @@ public:
|
|||
std::shared_ptr<Mob> cameraTargetPlayer;
|
||||
ParticleEngine *particleEngine;
|
||||
User *user;
|
||||
wstring serverDomain;
|
||||
std::wstring serverDomain;
|
||||
Canvas *parent;
|
||||
bool appletMode;
|
||||
|
||||
|
|
@ -181,12 +181,12 @@ public:
|
|||
StatsCounter* stats[4];
|
||||
|
||||
private:
|
||||
wstring connectToIp;
|
||||
std::wstring connectToIp;
|
||||
int connectToPort;
|
||||
|
||||
public:
|
||||
void clearConnectionFailed();
|
||||
void connectTo(const wstring& server, int port);
|
||||
void connectTo(const std::wstring& server, int port);
|
||||
|
||||
private:
|
||||
void renderLoadingScreen();
|
||||
|
|
@ -199,14 +199,14 @@ private:
|
|||
|
||||
public:
|
||||
static File getWorkingDirectory();
|
||||
static File getWorkingDirectory(const wstring& applicationName);
|
||||
static File getWorkingDirectory(const std::wstring& applicationName);
|
||||
private:
|
||||
static OS getPlatform();
|
||||
public:
|
||||
LevelStorageSource *getLevelSource();
|
||||
void setScreen(Screen *screen);
|
||||
private:
|
||||
void checkGlError(const wstring& string);
|
||||
void checkGlError(const std::wstring& string);
|
||||
|
||||
#ifdef __ORBIS__
|
||||
PsPlusUpsellWrapper *m_pPsPlusUpsell;
|
||||
|
|
@ -215,7 +215,7 @@ private:
|
|||
public:
|
||||
void destroy();
|
||||
volatile bool running;
|
||||
wstring fpsString;
|
||||
std::wstring fpsString;
|
||||
void run();
|
||||
// 4J-PB - split the run into 3 parts so we can run it from our xbox game loop
|
||||
static Minecraft *GetInstance();
|
||||
|
|
@ -269,36 +269,36 @@ private:
|
|||
void reloadSound();
|
||||
public:
|
||||
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);
|
||||
bool saveSlot(int slot, const wstring& name);
|
||||
bool loadSlot(const wstring& userName, int slot);
|
||||
bool saveSlot(int slot, const std::wstring& name);
|
||||
bool loadSlot(const std::wstring& userName, int slot);
|
||||
void releaseLevel(int message);
|
||||
// 4J Stu - Added the doForceStatsSave param
|
||||
//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);
|
||||
// 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 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
|
||||
|
||||
wstring gatherStats1();
|
||||
wstring gatherStats2();
|
||||
wstring gatherStats3();
|
||||
wstring gatherStats4();
|
||||
std::wstring gatherStats1();
|
||||
std::wstring gatherStats2();
|
||||
std::wstring gatherStats3();
|
||||
std::wstring gatherStats4();
|
||||
|
||||
void respawnPlayer(int iPad,int dimension,int newEntityId);
|
||||
static void start(const wstring& name, const wstring& sid);
|
||||
static void startAndConnectTo(const wstring& name, const wstring& sid, const wstring& url);
|
||||
static void start(const std::wstring& name, const std::wstring& sid);
|
||||
static void startAndConnectTo(const std::wstring& name, const std::wstring& sid, const std::wstring& url);
|
||||
ClientConnection *getConnection(int iPad); // 4J Stu added iPad param
|
||||
static void main();
|
||||
static bool renderNames();
|
||||
static bool useFancyGraphics();
|
||||
static bool useAmbientOcclusion();
|
||||
static bool renderDebug();
|
||||
bool handleClientSideCommand(const wstring& chatMessage);
|
||||
bool handleClientSideCommand(const std::wstring& chatMessage);
|
||||
|
||||
static int maxSupportedTextureSize();
|
||||
void delayTextureReload();
|
||||
|
|
@ -331,15 +331,15 @@ public:
|
|||
Level *animateTickLevel; // 4J added
|
||||
|
||||
// 4J - When a client requests a texture, it should add it to here while we are waiting for it
|
||||
vector<wstring> m_pendingTextureRequests;
|
||||
vector<wstring> m_pendingGeometryRequests; // additional skin box geometry
|
||||
vector<std::wstring> m_pendingTextureRequests;
|
||||
vector<std::wstring> m_pendingGeometryRequests; // additional skin box geometry
|
||||
|
||||
// 4J Added
|
||||
bool addPendingClientTextureRequest(const wstring &textureName);
|
||||
void handleClientTextureReceived(const wstring &textureName);
|
||||
bool addPendingClientTextureRequest(const std::wstring &textureName);
|
||||
void handleClientTextureReceived(const std::wstring &textureName);
|
||||
void clearPendingClientTextureRequests() { m_pendingTextureRequests.clear(); }
|
||||
bool addPendingClientGeometryRequest(const wstring &textureName);
|
||||
void handleClientGeometryReceived(const wstring &textureName);
|
||||
bool addPendingClientGeometryRequest(const std::wstring &textureName);
|
||||
void handleClientGeometryReceived(const std::wstring &textureName);
|
||||
void clearPendingClientGeometryRequests() { m_pendingGeometryRequests.clear(); }
|
||||
|
||||
unsigned int getCurrentTexturePackId();
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ int MinecraftServer::s_slowQueuePlayerIndex = 0;
|
|||
int MinecraftServer::s_slowQueueLastTime = 0;
|
||||
bool MinecraftServer::s_slowQueuePacketSent = false;
|
||||
|
||||
std::unordered_map<wstring, int> MinecraftServer::ironTimers;
|
||||
std::unordered_map<std::wstring, int> MinecraftServer::ironTimers;
|
||||
|
||||
MinecraftServer::MinecraftServer()
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ MinecraftServer::MinecraftServer()
|
|||
m_bLoaded = false;
|
||||
stopped = false;
|
||||
tickCount = 0;
|
||||
wstring progressStatus;
|
||||
std::wstring progressStatus;
|
||||
progress = 0;
|
||||
motd = L"";
|
||||
|
||||
|
|
@ -203,8 +203,8 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
|
||||
__int64 levelNanoTime = System::nanoTime();
|
||||
|
||||
wstring levelName = settings->getString(L"level-name", L"world");
|
||||
wstring levelTypeString;
|
||||
std::wstring levelName = settings->getString(L"level-name", L"world");
|
||||
std::wstring levelTypeString;
|
||||
|
||||
bool gameRuleUseFlatWorld = false;
|
||||
if(app.getLevelGenerationOptions() != NULL)
|
||||
|
|
@ -244,7 +244,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
|||
//settings->setProperty(L"max-build-height", maxBuildHeight);
|
||||
|
||||
#if 0
|
||||
wstring levelSeedString = settings->getString(L"level-seed", L"");
|
||||
std::wstring levelSeedString = settings->getString(L"level-seed", L"");
|
||||
__int64 levelSeed = (new Random())->nextLong();
|
||||
if (levelSeedString.length() > 0)
|
||||
{
|
||||
|
|
@ -378,7 +378,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress)
|
|||
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
|
||||
// if (storageSource->requiresConversion(name))
|
||||
|
|
@ -750,7 +750,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
return true;
|
||||
}
|
||||
|
||||
void MinecraftServer::setProgress(const wstring& status, int progress)
|
||||
void MinecraftServer::setProgress(const std::wstring& status, int progress)
|
||||
{
|
||||
progressStatus = status;
|
||||
this->progress = progress;
|
||||
|
|
@ -1347,7 +1347,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter)
|
|||
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));
|
||||
|
||||
File dataFile = File( targetFileDir, wstring(filename) );
|
||||
File dataFile = File( targetFileDir, std::wstring(filename) );
|
||||
if(dataFile.exists()) dataFile._delete();
|
||||
FileOutputStream fos = FileOutputStream(dataFile);
|
||||
DataOutputStream dos = DataOutputStream(&fos);
|
||||
|
|
@ -1440,7 +1440,7 @@ void MinecraftServer::broadcastStopSavingPacket()
|
|||
|
||||
void MinecraftServer::tick()
|
||||
{
|
||||
vector<wstring> toRemove;
|
||||
vector<std::wstring> toRemove;
|
||||
for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++ )
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ typedef struct _LoadSaveDataThreadParam
|
|||
{
|
||||
LPVOID data;
|
||||
__int64 fileSize;
|
||||
const wstring saveName;
|
||||
_LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {}
|
||||
const std::wstring saveName;
|
||||
_LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const std::wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {}
|
||||
} LoadSaveDataThreadParam;
|
||||
|
||||
typedef struct _NetworkGameInitData
|
||||
|
|
@ -60,18 +60,18 @@ using namespace std;
|
|||
class MinecraftServer : public ConsoleInputSource
|
||||
{
|
||||
public:
|
||||
static const wstring VERSION;
|
||||
static const std::wstring VERSION;
|
||||
static const int TICK_STATS_SPAN = SharedConstants::TICKS_PER_SECOND * 5;
|
||||
|
||||
// static Logger logger = Logger.getLogger("Minecraft");
|
||||
static std::unordered_map<wstring, int> ironTimers;
|
||||
static std::unordered_map<std::wstring, int> ironTimers;
|
||||
|
||||
private:
|
||||
static const int DEFAULT_MINECRAFT_PORT = 25565;
|
||||
static const int MS_PER_TICK = 1000 / SharedConstants::TICKS_PER_SECOND;
|
||||
|
||||
// 4J Stu - Added 1.0.1, Not needed
|
||||
//wstring localIp;
|
||||
//std::wstring localIp;
|
||||
//int port;
|
||||
public:
|
||||
ServerConnection *connection;
|
||||
|
|
@ -93,7 +93,7 @@ public:
|
|||
int tickCount;
|
||||
|
||||
public:
|
||||
wstring progressStatus;
|
||||
std::wstring progressStatus;
|
||||
int progress;
|
||||
private:
|
||||
// vector<Tickable *> tickables = new ArrayList<Tickable>(); // 4J - removed
|
||||
|
|
@ -105,7 +105,7 @@ public:
|
|||
bool npcs;
|
||||
bool pvp;
|
||||
bool allowFlight;
|
||||
wstring motd;
|
||||
std::wstring motd;
|
||||
int maxBuildHeight;
|
||||
|
||||
private:
|
||||
|
|
@ -127,8 +127,8 @@ private:
|
|||
// 4J Added - LoadSaveDataThreadParam
|
||||
bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed);
|
||||
void postProcessTerminate(ProgressRenderer *mcprogress);
|
||||
bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData);
|
||||
void setProgress(const wstring& status, int progress);
|
||||
bool loadLevel(LevelStorageSource *storageSource, const std::wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData);
|
||||
void setProgress(const std::wstring& status, int progress);
|
||||
void endProgress();
|
||||
void saveAllChunks();
|
||||
void saveGameRules();
|
||||
|
|
@ -162,16 +162,16 @@ public:
|
|||
private:
|
||||
void tick();
|
||||
public:
|
||||
void handleConsoleInput(const wstring& msg, ConsoleInputSource *source);
|
||||
void handleConsoleInput(const std::wstring& msg, ConsoleInputSource *source);
|
||||
void handleConsoleInputs();
|
||||
// void addTickable(Tickable tickable); // 4J removed
|
||||
static void main(__int64 seed, void *lpParameter);
|
||||
static void HaltServer(bool bPrimaryPlayerSignedOut=false);
|
||||
|
||||
File *getFile(const wstring& name);
|
||||
void info(const wstring& string);
|
||||
void warn(const wstring& string);
|
||||
wstring getConsoleName();
|
||||
File *getFile(const std::wstring& name);
|
||||
void info(const std::wstring& string);
|
||||
void warn(const std::wstring& string);
|
||||
std::wstring getConsoleName();
|
||||
ServerLevel *getLevel(int dimension);
|
||||
void setLevel(int dimension, ServerLevel *level); // 4J added
|
||||
static MinecraftServer *getInstance() { return server; } // 4J added
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
#include "../../Minecraft.World/Stats/GenericStats.h"
|
||||
#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.
|
||||
assert(FALSE);
|
||||
|
|
@ -207,7 +207,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet)
|
|||
// a skin?
|
||||
if(pMojangData->wchSkin[0]!=0L)
|
||||
{
|
||||
wstring wstr=pMojangData->wchSkin;
|
||||
std::wstring wstr=pMojangData->wchSkin;
|
||||
// check the file is not already in
|
||||
bRes=app.IsFileInMemoryTextures(wstr);
|
||||
if(!bRes)
|
||||
|
|
@ -229,7 +229,7 @@ void ClientConnection::handleLogin(std::shared_ptr<LoginPacket> packet)
|
|||
// a cloak?
|
||||
if(pMojangData->wchCape[0]!=0L)
|
||||
{
|
||||
wstring wstr=pMojangData->wchCape;
|
||||
std::wstring wstr=pMojangData->wchCape;
|
||||
// check the file is not already in
|
||||
bRes=app.IsFileInMemoryTextures(wstr);
|
||||
if(!bRes)
|
||||
|
|
@ -1277,12 +1277,12 @@ void ClientConnection::handleTakeItemEntity(std::shared_ptr<TakeItemEntityPacket
|
|||
|
||||
void ClientConnection::handleChat(std::shared_ptr<ChatPacket> packet)
|
||||
{
|
||||
wstring message;
|
||||
std::wstring message;
|
||||
int iPos;
|
||||
bool displayOnGui = true;
|
||||
|
||||
wstring playerDisplayName = L"";
|
||||
wstring sourceDisplayName = L"";
|
||||
std::wstring playerDisplayName = L"";
|
||||
std::wstring sourceDisplayName = L"";
|
||||
|
||||
// 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]);
|
||||
|
|
@ -3053,7 +3053,7 @@ void ClientConnection::displayPrivilegeChanges(std::shared_ptr<MultiplayerLocalP
|
|||
if( Player::getPlayerGamePrivilege(newPrivileges,priv) != Player::getPlayerGamePrivilege(oldPrivileges,priv))
|
||||
{
|
||||
privOn = Player::getPlayerGamePrivilege(newPrivileges,priv);
|
||||
wstring message = L"";
|
||||
std::wstring message = L"";
|
||||
if(app.GetGameHostOption(eGameHostOption_TrustPlayers) == 0)
|
||||
{
|
||||
switch(priv)
|
||||
|
|
@ -3246,7 +3246,7 @@ void ClientConnection::handleUpdateGameRuleProgressPacket(std::shared_ptr<Update
|
|||
LPCWSTR string = app.GetGameRulesString(packet->m_messageId);
|
||||
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);
|
||||
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
|
||||
wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag);
|
||||
std::wstring displayName = g_NetworkManager.GetDisplayNameByGamertag(gamertag);
|
||||
return displayName;
|
||||
#else
|
||||
return gamertag;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ private:
|
|||
bool done;
|
||||
Connection *connection;
|
||||
public:
|
||||
wstring message;
|
||||
std::wstring message;
|
||||
bool createdOk; // 4J added
|
||||
private:
|
||||
Minecraft *minecraft;
|
||||
|
|
@ -44,7 +44,7 @@ private:
|
|||
DWORD m_userIndex; // 4J Added
|
||||
public:
|
||||
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();
|
||||
void tick();
|
||||
|
|
@ -90,7 +90,7 @@ public:
|
|||
virtual void handleEntityEvent(std::shared_ptr<EntityEventPacket> packet);
|
||||
private:
|
||||
std::shared_ptr<Entity> getEntity(int entityId);
|
||||
wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
|
||||
public:
|
||||
virtual void handleSetHealth(std::shared_ptr<SetHealthPacket> packet);
|
||||
virtual void handleSetExperience(std::shared_ptr<SetExperiencePacket> packet);
|
||||
|
|
|
|||
|
|
@ -280,12 +280,12 @@ vector<Biome::MobSpawnerData *> *MultiPlayerChunkCache::getMobsAt(MobCategory *m
|
|||
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;
|
||||
}
|
||||
|
||||
wstring MultiPlayerChunkCache::gatherStats()
|
||||
std::wstring MultiPlayerChunkCache::gatherStats()
|
||||
{
|
||||
EnterCriticalSection(&m_csLoadCreate);
|
||||
int size = (int)loadedChunkList.size();
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public:
|
|||
virtual bool tick();
|
||||
virtual bool shouldSave();
|
||||
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 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 LevelChunk **getCache() { return cache; } // 4J added
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
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
|
||||
done = false;
|
||||
|
|
@ -257,7 +257,7 @@ void PendingConnection::send(std::shared_ptr<Packet> packet)
|
|||
connection->send(packet);
|
||||
}
|
||||
|
||||
wstring PendingConnection::getName()
|
||||
std::wstring PendingConnection::getName()
|
||||
{
|
||||
return L"Unimplemented";
|
||||
// if (name != null) return name + " [" + connection.getRemoteAddress().toString() + "]";
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ public:
|
|||
private:
|
||||
MinecraftServer *server;
|
||||
int _tick;
|
||||
wstring name;
|
||||
std::wstring name;
|
||||
std::shared_ptr<LoginPacket> acceptedLogin;
|
||||
wstring loginKey;
|
||||
std::wstring loginKey;
|
||||
|
||||
public:
|
||||
PendingConnection(MinecraftServer *server, Socket *socket, const wstring& id);
|
||||
PendingConnection(MinecraftServer *server, Socket *socket, const std::wstring& id);
|
||||
~PendingConnection();
|
||||
void tick();
|
||||
void disconnect(DisconnectPacket::eDisconnectReason reason);
|
||||
|
|
@ -40,7 +40,7 @@ public:
|
|||
virtual void handleKeepAlive(std::shared_ptr<KeepAlivePacket> packet);
|
||||
virtual void onUnhandledPacket(std::shared_ptr<Packet> packet);
|
||||
void send(std::shared_ptr<Packet> packet);
|
||||
wstring getName();
|
||||
std::wstring getName();
|
||||
virtual bool isServerPacketListener();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ void PlayerConnection::handleChat(std::shared_ptr<ChatPacket> packet)
|
|||
{
|
||||
// 4J - TODO
|
||||
#if 0
|
||||
wstring message = packet->message;
|
||||
std::wstring message = packet->message;
|
||||
if (message.length() > SharedConstants::maxChatLength)
|
||||
{
|
||||
disconnect(L"Chat message too long");
|
||||
|
|
@ -670,7 +670,7 @@ void PlayerConnection::handleChat(std::shared_ptr<ChatPacket> packet)
|
|||
#endif
|
||||
}
|
||||
|
||||
void PlayerConnection::handleCommand(const wstring& message)
|
||||
void PlayerConnection::handleCommand(const std::wstring& message)
|
||||
{
|
||||
// 4J - TODO
|
||||
#if 0
|
||||
|
|
@ -737,19 +737,19 @@ int PlayerConnection::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
|
||||
//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
|
||||
//send( std::shared_ptr<ChatPacket>( new ChatPacket(L"§9" + string) ) );
|
||||
}
|
||||
|
||||
wstring PlayerConnection::getConsoleName()
|
||||
std::wstring PlayerConnection::getConsoleName()
|
||||
{
|
||||
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
|
||||
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
|
||||
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
|
||||
wchar_t buf[64];
|
||||
swprintf(buf,64,L"map_%d", item->getAuxValue());
|
||||
std::wstring id = wstring(buf);
|
||||
std::wstring id = std::wstring(buf);
|
||||
if( data == NULL )
|
||||
{
|
||||
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);
|
||||
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->SetVerified(false);
|
||||
|
|
@ -1498,7 +1498,7 @@ void PlayerConnection::handleCustomPayload(std::shared_ptr<CustomPayloadPacket>
|
|||
{
|
||||
ByteArrayInputStream bais(customPayloadPacket->data);
|
||||
DataInputStream dis(&bais);
|
||||
wstring name = dis.readUTF();
|
||||
std::wstring name = dis.readUTF();
|
||||
if (name.length() <= 30)
|
||||
{
|
||||
menu->setItemName(name);
|
||||
|
|
|
|||
|
|
@ -62,15 +62,15 @@ public:
|
|||
virtual void handleSetCarriedItem(std::shared_ptr<SetCarriedItemPacket> packet);
|
||||
virtual void handleChat(std::shared_ptr<ChatPacket> packet);
|
||||
private:
|
||||
void handleCommand(const wstring& message);
|
||||
void handleCommand(const std::wstring& message);
|
||||
public:
|
||||
virtual void handleAnimate(std::shared_ptr<AnimatePacket> packet);
|
||||
virtual void handlePlayerCommand(std::shared_ptr<PlayerCommandPacket> packet);
|
||||
virtual void handleDisconnect(std::shared_ptr<DisconnectPacket> packet);
|
||||
int countDelayedPackets();
|
||||
virtual void info(const wstring& string);
|
||||
virtual void warn(const wstring& string);
|
||||
virtual wstring getConsoleName();
|
||||
virtual void info(const std::wstring& string);
|
||||
virtual void warn(const std::wstring& string);
|
||||
virtual std::wstring getConsoleName();
|
||||
virtual void handleInteract(std::shared_ptr<InteractPacket> packet);
|
||||
bool canHandleAsyncPackets();
|
||||
virtual void handleClientCommand(std::shared_ptr<ClientCommandPacket> packet);
|
||||
|
|
@ -120,8 +120,8 @@ public:
|
|||
void closeOnTick() { m_bCloseOnTick = true; }
|
||||
|
||||
// 4J Added so that we can send on textures that get received after this connection requested them
|
||||
void handleTextureReceived(const wstring &textureName);
|
||||
void handleTextureAndGeometryReceived(const wstring &textureName);
|
||||
void handleTextureReceived(const std::wstring &textureName);
|
||||
void handleTextureAndGeometryReceived(const std::wstring &textureName);
|
||||
|
||||
void setShowOnMaps(bool bVal);
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ public:
|
|||
|
||||
private:
|
||||
bool m_bCloseOnTick;
|
||||
vector<wstring> m_texturesRequested;
|
||||
vector<std::wstring> m_texturesRequested;
|
||||
|
||||
bool m_bWasKicked;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ using namespace std;
|
|||
class PlayerInfo
|
||||
{
|
||||
public:
|
||||
wstring name;
|
||||
std::wstring name;
|
||||
int latency;
|
||||
|
||||
PlayerInfo(const wstring &name)
|
||||
PlayerInfo(const std::wstring &name)
|
||||
{
|
||||
this->name = name;
|
||||
latency = 0;
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ void PlayerList::remove(std::shared_ptr<ServerPlayer> player)
|
|||
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)
|
||||
{
|
||||
|
|
@ -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++)
|
||||
{
|
||||
if (i > 0) msg += L", ";
|
||||
|
|
@ -968,12 +968,12 @@ wstring PlayerList::getPlayerNames()
|
|||
return msg;
|
||||
}
|
||||
|
||||
bool PlayerList::isWhiteListed(const wstring& name)
|
||||
bool PlayerList::isWhiteListed(const std::wstring& name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PlayerList::isOp(const wstring& name)
|
||||
bool PlayerList::isOp(const std::wstring& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -989,7 +989,7 @@ bool PlayerList::isOp(std::shared_ptr<ServerPlayer> player)
|
|||
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++)
|
||||
{
|
||||
|
|
@ -1016,7 +1016,7 @@ std::shared_ptr<ServerPlayer> PlayerList::getPlayer(PlayerUID uid)
|
|||
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);
|
||||
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) );
|
||||
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);
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public:
|
|||
void add(std::shared_ptr<ServerPlayer> player);
|
||||
void move(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);
|
||||
void toggleDimension(std::shared_ptr<ServerPlayer> player, int targetDimension);
|
||||
void tick();
|
||||
|
|
@ -84,23 +84,23 @@ public:
|
|||
void broadcastAll(std::shared_ptr<Packet> packet);
|
||||
void broadcastAll(std::shared_ptr<Packet> packet, int dimension);
|
||||
|
||||
wstring getPlayerNames();
|
||||
std::wstring getPlayerNames();
|
||||
|
||||
public:
|
||||
bool isWhiteListed(const wstring& name);
|
||||
bool isOp(const wstring& name);
|
||||
bool isWhiteListed(const std::wstring& name);
|
||||
bool isOp(const std::wstring& name);
|
||||
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);
|
||||
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(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);
|
||||
bool sendTo(const wstring& name, std::shared_ptr<Packet> packet);
|
||||
void broadcastToAllOps(const std::wstring& message);
|
||||
bool sendTo(const std::wstring& name, std::shared_ptr<Packet> packet);
|
||||
// 4J Added ProgressListener *progressListener param and bDeleteGuestMaps param
|
||||
void saveAll(ProgressListener *progressListener, bool bDeleteGuestMaps = false);
|
||||
void whiteList(const wstring& playerName);
|
||||
void blackList(const wstring& playerName);
|
||||
void whiteList(const std::wstring& playerName);
|
||||
void blackList(const std::wstring& playerName);
|
||||
// Set<String> getWhiteList(); / 4J removed
|
||||
void reloadWhitelist();
|
||||
void sendLevelInfo(std::shared_ptr<ServerPlayer> player, ServerLevel *level);
|
||||
|
|
|
|||
|
|
@ -897,7 +897,7 @@ bool ServerChunkCache::shouldSave()
|
|||
return !level->noSave;
|
||||
}
|
||||
|
||||
wstring ServerChunkCache::gatherStats()
|
||||
std::wstring ServerChunkCache::gatherStats()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ public:
|
|||
virtual bool save(bool force, ProgressListener *progressListener);
|
||||
virtual bool tick();
|
||||
virtual bool shouldSave();
|
||||
virtual wstring gatherStats();
|
||||
virtual std::wstring gatherStats();
|
||||
|
||||
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:
|
||||
typedef struct _SaveThreadData
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ ServerCommandDispatcher::ServerCommandDispatcher()
|
|||
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();
|
||||
//for (Player player : MinecraftServer.getInstance().getPlayers().players)
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ class ServerCommandDispatcher : public CommandDispatcher, public AdminLogCommand
|
|||
{
|
||||
public:
|
||||
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"");
|
||||
};
|
||||
|
|
@ -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));
|
||||
if( it == m_pendingTextureRequests.end() )
|
||||
|
|
@ -129,7 +129,7 @@ bool ServerConnection::addPendingTextureRequest(const wstring &textureName)
|
|||
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));
|
||||
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));
|
||||
if( it != m_pendingTextureRequests.end() )
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ private:
|
|||
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
|
||||
vector<wstring> m_pendingTextureRequests;
|
||||
vector<std::wstring> m_pendingTextureRequests;
|
||||
public:
|
||||
MinecraftServer *server;
|
||||
|
||||
|
|
@ -42,8 +42,8 @@ public:
|
|||
void tick();
|
||||
|
||||
// 4J Added
|
||||
bool addPendingTextureRequest(const wstring &textureName);
|
||||
void handleTextureReceived(const wstring &textureName);
|
||||
void handleTextureAndGeometryReceived(const wstring &textureName);
|
||||
bool addPendingTextureRequest(const std::wstring &textureName);
|
||||
void handleTextureReceived(const std::wstring &textureName);
|
||||
void handleTextureAndGeometryReceived(const std::wstring &textureName);
|
||||
void handleServerSettingsChanged(std::shared_ptr<ServerSettingsChangedPacket> packet);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,27 +3,27 @@ using namespace std;
|
|||
|
||||
class ServerInterface
|
||||
{
|
||||
virtual int getConfigInt(const wstring &name, int defaultValue) = 0;
|
||||
virtual wstring getConfigString(const wstring &name, const wstring &defaultValue) = 0;
|
||||
virtual bool getConfigBoolean(const wstring &name, bool defaultValue) = 0;
|
||||
virtual void setProperty(wstring &propertyName, void *value) = 0;
|
||||
virtual int getConfigInt(const std::wstring &name, int defaultValue) = 0;
|
||||
virtual std::wstring getConfigString(const std::wstring &name, const std::wstring &defaultValue) = 0;
|
||||
virtual bool getConfigBoolean(const std::wstring &name, bool defaultValue) = 0;
|
||||
virtual void setProperty(std::wstring &propertyName, void *value) = 0;
|
||||
virtual void configSave() = 0;
|
||||
virtual wstring getConfigPath() = 0;
|
||||
virtual wstring getServerIp() = 0;
|
||||
virtual std::wstring getConfigPath() = 0;
|
||||
virtual std::wstring getServerIp() = 0;
|
||||
virtual int getServerPort() = 0;
|
||||
virtual wstring getServerName() = 0;
|
||||
virtual wstring getServerVersion() = 0;
|
||||
virtual std::wstring getServerName() = 0;
|
||||
virtual std::wstring getServerVersion() = 0;
|
||||
virtual int getPlayerCount() = 0;
|
||||
virtual int getMaxPlayers() = 0;
|
||||
virtual wstring[] getPlayerNames() = 0;
|
||||
virtual wstring getWorldName() = 0;
|
||||
virtual wstring getPluginNames() = 0;
|
||||
virtual std::wstring[] getPlayerNames() = 0;
|
||||
virtual std::wstring getWorldName() = 0;
|
||||
virtual std::wstring getPluginNames() = 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;
|
||||
// Logging
|
||||
virtual void info(const wstring &string) = 0;
|
||||
virtual void warn(const wstring &string) = 0;
|
||||
virtual void error(const wstring &string) = 0;
|
||||
virtual void debug(const wstring &string) = 0;
|
||||
virtual void info(const std::wstring &string) = 0;
|
||||
virtual void warn(const std::wstring &string) = 0;
|
||||
virtual void error(const std::wstring &string) = 0;
|
||||
virtual void debug(const std::wstring &string) = 0;
|
||||
};
|
||||
|
|
@ -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_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);
|
||||
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);
|
||||
void TMSPP_ClearTitleStorageState(int iPad);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
|
|||
|
||||
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?
|
||||
for( AUTO_VAR(it, pDLCInfoA->begin()); it != pDLCInfoA->end(); it++ )
|
||||
{
|
||||
|
|
@ -183,7 +183,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages()
|
|||
void CConsoleMinecraftApp::FreeLocalDLCImages()
|
||||
{
|
||||
// 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++ )
|
||||
{
|
||||
|
|
@ -263,7 +263,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
|
|||
// Build stat names
|
||||
m_statNames = ref new PC::Vector<P::String^>();
|
||||
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()));
|
||||
}
|
||||
|
|
@ -548,7 +548,7 @@ void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, E
|
|||
}
|
||||
|
||||
int statIndex = 0, sumScores = 0;
|
||||
for(wstring statName : m_leaderboardStatNames[difficulty][type])
|
||||
for(std::wstring statName : m_leaderboardStatNames[difficulty][type])
|
||||
{
|
||||
bool found = false;
|
||||
for(auto result : statsResult)
|
||||
|
|
@ -585,7 +585,7 @@ void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector<Mi
|
|||
|
||||
if (profiles.size() > 0)
|
||||
{
|
||||
dlm->m_displayNames = vector<wstring>();
|
||||
dlm->m_displayNames = vector<std::wstring>();
|
||||
for (int i = 0; i < profiles.size(); i++)
|
||||
{
|
||||
dlm->m_displayNames.push_back(profiles[i]->GameDisplayName->Data());
|
||||
|
|
@ -699,7 +699,7 @@ void DurangoLeaderboardManager::setState(EStatsState newState)
|
|||
LeaveCriticalSection(&m_csStatsState);
|
||||
}
|
||||
|
||||
wstring DurangoLeaderboardManager::stateToString(EStatsState eState)
|
||||
std::wstring DurangoLeaderboardManager::stateToString(EStatsState eState)
|
||||
{
|
||||
switch (eState)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ private:
|
|||
unsigned int m_maxRank;
|
||||
|
||||
MXS::XboxLiveContext^ m_xboxLiveContext;
|
||||
wstring m_leaderboardNames[4][eStatsType_MAX];
|
||||
wstring m_socialLeaderboardNames[4][eStatsType_MAX];
|
||||
std::vector<wstring> m_leaderboardStatNames[4][eStatsType_MAX];
|
||||
std::wstring m_leaderboardNames[4][eStatsType_MAX];
|
||||
std::wstring m_socialLeaderboardNames[4][eStatsType_MAX];
|
||||
std::vector<std::wstring> m_leaderboardStatNames[4][eStatsType_MAX];
|
||||
|
||||
// Display names for the current scores
|
||||
std::vector<wstring> m_displayNames;
|
||||
std::vector<std::wstring> m_displayNames;
|
||||
bool m_waitingForProfiles;
|
||||
|
||||
int m_difficulty;
|
||||
|
|
@ -90,5 +90,5 @@ private:
|
|||
|
||||
EStatsState getState();
|
||||
void setState(EStatsState newState);
|
||||
wstring stateToString(EStatsState eState);
|
||||
std::wstring stateToString(EStatsState eState);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
namespace WFC = Windows::Foundation::Collections;
|
||||
namespace CC = concurrency;
|
||||
|
||||
StatParam::StatParam(const wstring &base)
|
||||
StatParam::StatParam(const std::wstring &base)
|
||||
{
|
||||
m_base = base;
|
||||
//m_numArgs = numArgs;
|
||||
m_args = vector<int>();
|
||||
|
||||
unsigned int count=0;
|
||||
wstring::size_type pos =base.find(L"*");
|
||||
std::wstring::size_type pos =base.find(L"*");
|
||||
while(pos!=string::npos)
|
||||
{
|
||||
count++;
|
||||
|
|
@ -46,14 +46,14 @@ void StatParam::addArgs(int v1, ...)
|
|||
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 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)
|
||||
{
|
||||
|
|
@ -69,10 +69,10 @@ vector<wstring> *StatParam::getStats()
|
|||
{
|
||||
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);
|
||||
|
||||
if (sz != wstring::npos)
|
||||
if (sz != std::wstring::npos)
|
||||
wstr_itr.replace(sz, SUBSTR.length(), wstr_num);
|
||||
}
|
||||
}
|
||||
|
|
@ -91,13 +91,13 @@ DurangoStatsDebugger::DurangoStatsDebugger()
|
|||
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++)
|
||||
{
|
||||
vector<wstring> *sublist = (*it)->getStats();
|
||||
vector<std::wstring> *sublist = (*it)->getStats();
|
||||
out->insert(out->end(), sublist->begin(), sublist->end());
|
||||
}
|
||||
|
||||
|
|
@ -322,11 +322,11 @@ void DurangoStatsDebugger::PrintStats(int iPad)
|
|||
{
|
||||
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());
|
||||
|
||||
// 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");
|
||||
|
||||
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.
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@ namespace MXSL = Microsoft::Xbox::Services::Leaderboard;
|
|||
class StatParam
|
||||
{
|
||||
private:
|
||||
wstring m_base;
|
||||
std::wstring m_base;
|
||||
int m_numArgs;
|
||||
|
||||
vector<int> m_args;
|
||||
|
||||
public:
|
||||
StatParam(const wstring &base);
|
||||
StatParam(const std::wstring &base);
|
||||
|
||||
void addArgs(int v1, ...);
|
||||
|
||||
vector<wstring> *getStats();
|
||||
vector<std::wstring> *getStats();
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ protected:
|
|||
|
||||
vector<StatParam *> m_stats;
|
||||
|
||||
vector<wstring> *getStats();
|
||||
vector<std::wstring> *getStats();
|
||||
|
||||
public:
|
||||
static DurangoStatsDebugger *Initialize();
|
||||
|
|
@ -75,15 +75,15 @@ public:
|
|||
static void PrintStats(int iPad);
|
||||
|
||||
private:
|
||||
vector<wstring> m_printQueue;
|
||||
vector<std::wstring> m_printQueue;
|
||||
|
||||
void retrieveStats(int iPad);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int m_iPad;
|
||||
wstring m_statName;
|
||||
wstring m_score;
|
||||
std::wstring m_statName;
|
||||
std::wstring m_score;
|
||||
} StatResult;
|
||||
|
||||
CRITICAL_SECTION m_retrievedStatsLock;
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ DQRNetworkManager::ePartyProcessType DQRNetworkManager::m_partyProcess = DQRNetw
|
|||
|
||||
bool DQRNetworkManager::m_inviteReceived = false;
|
||||
int DQRNetworkManager::m_bootUserIndex;
|
||||
wstring DQRNetworkManager::m_bootSessionName;
|
||||
wstring DQRNetworkManager::m_bootServiceConfig;
|
||||
wstring DQRNetworkManager::m_bootSessionTemplate;
|
||||
std::wstring DQRNetworkManager::m_bootSessionName;
|
||||
std::wstring DQRNetworkManager::m_bootServiceConfig;
|
||||
std::wstring DQRNetworkManager::m_bootSessionTemplate;
|
||||
DQRNetworkManager * DQRNetworkManager::s_pDQRManager = NULL;
|
||||
|
||||
//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_sessionName = sessionName;
|
||||
|
|
@ -782,7 +782,7 @@ DQRNetworkPlayer *DQRNetworkManager::GetPlayerByXuid(PlayerUID xuid)
|
|||
}
|
||||
|
||||
// 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())
|
||||
{
|
||||
|
|
@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc()
|
|||
if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(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);
|
||||
pPlayer->SetSmallId(smallId);
|
||||
|
|
@ -3031,7 +3031,7 @@ void DQRNetworkManager::GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Servi
|
|||
}
|
||||
|
||||
// Set player display name
|
||||
void DQRNetworkManager::SetDisplayName(PlayerUID xuid, wstring displayName)
|
||||
void DQRNetworkManager::SetDisplayName(PlayerUID xuid, std::wstring displayName)
|
||||
{
|
||||
EnterCriticalSection(&m_csRoomSyncData);
|
||||
for (int i = 0; i < m_roomSyncData.playerCount; i++)
|
||||
|
|
|
|||
|
|
@ -119,12 +119,12 @@ public:
|
|||
class SessionInfo
|
||||
{
|
||||
public:
|
||||
SessionInfo(wstring& sessionName, wstring& serviceConfig, wstring& sessionTemplate);
|
||||
SessionInfo(std::wstring& sessionName, std::wstring& serviceConfig, std::wstring& sessionTemplate);
|
||||
SessionInfo();
|
||||
bool m_detailsValid;
|
||||
wstring m_sessionName;
|
||||
wstring m_serviceConfig;
|
||||
wstring m_sessionTemplate;
|
||||
std::wstring m_sessionName;
|
||||
std::wstring m_serviceConfig;
|
||||
std::wstring m_sessionTemplate;
|
||||
};
|
||||
|
||||
static const int MAX_LOCAL_PLAYER_COUNT = 4;
|
||||
|
|
@ -153,7 +153,7 @@ public:
|
|||
{
|
||||
public:;
|
||||
DQRNetworkPlayer* m_pPlayer;
|
||||
wstring m_name;
|
||||
std::wstring m_name;
|
||||
unsigned int m_sessionAddress;
|
||||
int m_channel;
|
||||
bool m_sync;
|
||||
|
|
@ -181,7 +181,7 @@ public:
|
|||
DQRNetworkPlayer *GetPlayerByIndex(int idx);
|
||||
DQRNetworkPlayer *GetPlayerBySmallId(int idx);
|
||||
DQRNetworkPlayer *GetPlayerByXuid(PlayerUID xuid);
|
||||
wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
|
||||
DQRNetworkPlayer *GetLocalPlayerByUserIndex(int idx);
|
||||
DQRNetworkPlayer *GetHostPlayer();
|
||||
int GetSessionIndex(DQRNetworkPlayer *player);
|
||||
|
|
@ -223,16 +223,16 @@ public:
|
|||
public:
|
||||
SessionSearchResult() { m_extData = NULL; }
|
||||
~SessionSearchResult() { free(m_extData); }
|
||||
wstring m_partyId;
|
||||
wstring m_sessionName;
|
||||
std::wstring m_partyId;
|
||||
std::wstring m_sessionName;
|
||||
|
||||
// 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];
|
||||
int m_playerCount;
|
||||
|
||||
// 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;
|
||||
|
||||
void *m_extData;
|
||||
|
|
@ -488,7 +488,7 @@ public:
|
|||
bool JoinPartyFromSearchResult(SessionSearchResult *searchResult, int playerMask);
|
||||
void CancelJoinPartyFromSearchResult();
|
||||
void RequestDisplayName(DQRNetworkPlayer *player);
|
||||
void SetDisplayName(PlayerUID xuid, wstring displayName);
|
||||
void SetDisplayName(PlayerUID xuid, std::wstring displayName);
|
||||
|
||||
private:
|
||||
__int64 m_playersLeftPartyTime;
|
||||
|
|
@ -509,7 +509,7 @@ private:
|
|||
int m_sessionResultCount;
|
||||
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;
|
||||
static int m_bootUserIndex;
|
||||
static ePartyProcessType m_partyProcess;
|
||||
static wstring m_bootSessionName;
|
||||
static wstring m_bootServiceConfig;
|
||||
static wstring m_bootSessionTemplate;
|
||||
static std::wstring m_bootSessionName;
|
||||
static std::wstring m_bootServiceConfig;
|
||||
static std::wstring m_bootSessionTemplate;
|
||||
static bool m_inviteReceived;
|
||||
|
||||
static DQRNetworkManager *s_pDQRManager;
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ int DQRNetworkManager::GetFriendsThreadProc()
|
|||
}
|
||||
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) );
|
||||
|
|
|
|||
|
|
@ -192,13 +192,13 @@ void DQRNetworkPlayer::SetName(const wchar_t *name)
|
|||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Set display name
|
||||
void DQRNetworkPlayer::SetDisplayName(wstring displayName)
|
||||
void DQRNetworkPlayer::SetDisplayName(std::wstring displayName)
|
||||
{
|
||||
m_displayName = displayName;
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ const wchar_t *NetworkPlayerDurango::GetOnlineName()
|
|||
return m_dqrPlayer->GetName();
|
||||
}
|
||||
|
||||
wstring NetworkPlayerDurango::GetDisplayName()
|
||||
std::wstring NetworkPlayerDurango::GetDisplayName()
|
||||
{
|
||||
return m_dqrPlayer->GetDisplayName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual void SetSocket(Socket *pSocket);
|
||||
virtual Socket *GetSocket();
|
||||
virtual const wchar_t *GetOnlineName();
|
||||
virtual wstring GetDisplayName();
|
||||
virtual std::wstring GetDisplayName();
|
||||
virtual PlayerUID GetUID();
|
||||
|
||||
void SetUID(PlayerUID UID);
|
||||
|
|
|
|||
|
|
@ -744,12 +744,12 @@ bool CPlatformNetworkManagerDurango::SystemFlagGet(INetworkPlayer *pNetworkPlaye
|
|||
return false;
|
||||
}
|
||||
|
||||
wstring CPlatformNetworkManagerDurango::GatherStats()
|
||||
std::wstring CPlatformNetworkManagerDurango::GatherStats()
|
||||
{
|
||||
return L"";
|
||||
}
|
||||
|
||||
wstring CPlatformNetworkManagerDurango::GatherRTTStats()
|
||||
std::wstring CPlatformNetworkManagerDurango::GatherRTTStats()
|
||||
{
|
||||
return L"";
|
||||
}
|
||||
|
|
@ -883,7 +883,7 @@ INetworkPlayer * CPlatformNetworkManagerDurango::GetPlayerBySmallId(unsigned cha
|
|||
return getNetworkPlayer(m_pDQRNet->GetPlayerBySmallId(smallId));
|
||||
}
|
||||
|
||||
wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(wstring gamertag)
|
||||
std::wstring CPlatformNetworkManagerDurango::GetDisplayNameByGamertag(std::wstring gamertag)
|
||||
{
|
||||
return m_pDQRNet->GetDisplayNameByGamertag(gamertag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual INetworkPlayer *GetPlayerByIndex(int playerIndex);
|
||||
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid);
|
||||
virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId);
|
||||
virtual wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
virtual std::wstring GetDisplayNameByGamertag(std::wstring gamertag);
|
||||
virtual bool ShouldMessageForFullSession();
|
||||
|
||||
virtual INetworkPlayer *GetHostPlayer();
|
||||
|
|
@ -120,8 +120,8 @@ private:
|
|||
float m_lastPlayerEventTimeStart;
|
||||
|
||||
public:
|
||||
wstring GatherStats();
|
||||
wstring GatherRTTStats();
|
||||
std::wstring GatherStats();
|
||||
std::wstring GatherRTTStats();
|
||||
|
||||
private:
|
||||
vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT];
|
||||
|
|
|
|||
|
|
@ -971,9 +971,9 @@ DurangoStats *CDurangoTelemetryManager::durangoStats()
|
|||
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 += L":";
|
||||
out += _toString<unsigned short>(guid->Data2);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class CDurangoTelemetryManager : public CTelemetryManager
|
|||
public:
|
||||
static GUID ZERO_GUID;
|
||||
|
||||
std::unordered_map<wstring, float> m_multiplayerRoundStartTimes;
|
||||
std::unordered_map<std::wstring, float> m_multiplayerRoundStartTimes;
|
||||
|
||||
CDurangoTelemetryManager();
|
||||
|
||||
|
|
@ -46,5 +46,5 @@ public:
|
|||
protected:
|
||||
DurangoStats *durangoStats();
|
||||
|
||||
wstring guid2str(LPCGUID guid);
|
||||
std::wstring guid2str(LPCGUID guid);
|
||||
};
|
||||
|
|
@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ int StartMinecraftThreadProc( void* lpParameter )
|
|||
AABB::UseDefaultThreadStorage();
|
||||
Tesselator::CreateNewThreadStorage(1024*1024);
|
||||
RenderManager.InitialiseContext();
|
||||
Minecraft::start(wstring(),wstring());
|
||||
Minecraft::start(std::wstring(),std::wstring());
|
||||
delete Tesselator::getInstance();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -991,7 +991,7 @@ Vec3::resetPool();
|
|||
|
||||
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::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetFullVersion(bool bFull);
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ public:
|
|||
void SetDLCProductCode(const char* szProductCode);
|
||||
void SetProductUpgradeKey(const char* szKey);
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -1005,8 +1005,8 @@ void OrbisLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRank
|
|||
out.m_uid.setOnlineID( rankData.npId.handle, true );
|
||||
out.m_rank = rankData.rank;
|
||||
|
||||
// Convert to wstring and copy name.
|
||||
wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
|
||||
// Convert to std::wstring and copy name.
|
||||
std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
|
||||
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
|
||||
out.m_name=wstrName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
|
|||
|
||||
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
{
|
||||
wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
|
||||
AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp));
|
||||
if(it == m_SONYDLCMap.end())
|
||||
|
|
@ -191,7 +191,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
|||
|
||||
// push this into a vector
|
||||
|
||||
wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
m_SONYDLCMap[wstrTemp]=pDLCInfo;
|
||||
}
|
||||
CloseHandle(file);
|
||||
|
|
@ -288,7 +288,7 @@ int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameI
|
|||
int CConsoleMinecraftApp::LoadLocalDLCImages()
|
||||
{
|
||||
// 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++ )
|
||||
{
|
||||
SONYDLC * pDLCInfo=(*it).second;
|
||||
|
|
@ -301,7 +301,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImages()
|
|||
void CConsoleMinecraftApp::FreeLocalDLCImages()
|
||||
{
|
||||
// 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++ )
|
||||
{
|
||||
SONYDLC * pDLCInfo=(*it).second;
|
||||
|
|
@ -394,7 +394,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public:
|
|||
bool DLCAlreadyPurchased(char *pchTitle);
|
||||
char *GetSkuIDFromProductList();
|
||||
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 CommerceGetCategoriesCallback(LPVOID lpParam,int err);
|
||||
static void CommerceGetProductListCallback(LPVOID lpParam,int err);
|
||||
|
|
@ -210,7 +210,7 @@ private:
|
|||
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
|
||||
|
||||
PRODUCTCODES ProductCodes;
|
||||
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap;
|
||||
std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
|
||||
|
||||
|
||||
bool m_bVoiceChatAndUGCRestricted;
|
||||
|
|
|
|||
|
|
@ -757,7 +757,7 @@ int StartMinecraftThreadProc( void* lpParameter )
|
|||
AABB::UseDefaultThreadStorage();
|
||||
Tesselator::CreateNewThreadStorage(1024*1024);
|
||||
RenderManager.InitialiseContext();
|
||||
Minecraft::start(wstring(),wstring());
|
||||
Minecraft::start(std::wstring(),std::wstring());
|
||||
delete Tesselator::getInstance();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1462,8 +1462,8 @@ int main(int argc, const char *argv[] )
|
|||
|
||||
vector<uint8_t *> vRichPresenceStrings;
|
||||
|
||||
// convert wstring to UTF-8 string
|
||||
std::string wstring_to_utf8 (const std::wstring& str)
|
||||
// convert std::wstring to UTF-8 string
|
||||
std::string std::wstring_to_utf8 (const std::wstring& str)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
|
||||
return myconv.to_bytes(str);
|
||||
|
|
@ -1475,7 +1475,7 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID)
|
|||
LPCWSTR wchString=app.GetString(iID);
|
||||
|
||||
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;
|
||||
uint8_t *strUtf8=(uint8_t *)malloc(dst_len);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ PlayerUID::PlayerUID(SceUserServiceUserId userID, SceNpOnlineId& onlineID, bool
|
|||
setOnlineID(onlineID, bSignedInPSN);
|
||||
}
|
||||
|
||||
PlayerUID::PlayerUID(wstring fromString)
|
||||
PlayerUID::PlayerUID(std::wstring fromString)
|
||||
{
|
||||
// create for the format P_5e7ff8372ea9_00000004_Mark_4J
|
||||
|
||||
|
|
@ -53,14 +53,14 @@ PlayerUID::PlayerUID(wstring fromString)
|
|||
// parse the mac address next
|
||||
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);
|
||||
}
|
||||
|
||||
int userIdLen = 0;
|
||||
|
||||
// parse the userID
|
||||
wstring userIDDigits = L"";
|
||||
std::wstring userIDDigits = L"";
|
||||
|
||||
while(fromString.at(15 + userIdLen) != L'_')
|
||||
{
|
||||
|
|
@ -71,7 +71,7 @@ PlayerUID::PlayerUID(wstring fromString)
|
|||
m_userID = _fromString<int>(userIDDigits);
|
||||
|
||||
// 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)
|
||||
{
|
||||
wcstombs(m_onlineID, onlineID.c_str(), 16);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetFullVersion(bool bFull);
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
|
|
|
|||
|
|
@ -990,8 +990,8 @@ void PS3LeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRankDa
|
|||
out.m_uid.setOnlineID( rankData.npId.handle, true );
|
||||
out.m_rank = rankData.rank;
|
||||
|
||||
// Convert to wstring and copy name.
|
||||
wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str();
|
||||
// Convert to std::wstring and copy name.
|
||||
std::wstring wstrName = convStringToWstring( string(rankData.onlineName.data) ).c_str();
|
||||
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
|
||||
out.m_name=wstrName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
|
|||
|
||||
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
{
|
||||
wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp);
|
||||
|
||||
return pTemp;
|
||||
|
|
@ -174,7 +174,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
|||
|
||||
// push this into a vector
|
||||
|
||||
wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
m_SONYDLCMap[wstrTemp]=pDLCInfo;
|
||||
}
|
||||
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);
|
||||
__int64 fileSize = saveFile.length();
|
||||
|
|
@ -501,7 +501,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition(); wstring wWorldName = L"TestWorld";
|
||||
app.ClearTerrainFeaturePosition(); std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
|
@ -519,7 +519,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
NetworkGameInitData *param = new NetworkGameInitData();
|
||||
param->seed = seedValue;
|
||||
#ifdef SAVE_GAME_TO_LOAD
|
||||
param->saveData = LoadSaveFromDisk(wstring(SAVE_GAME_TO_LOAD));
|
||||
param->saveData = LoadSaveFromDisk(std::wstring(SAVE_GAME_TO_LOAD));
|
||||
#else
|
||||
param->saveData = NULL;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ private:
|
|||
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
|
||||
|
||||
PRODUCTCODES ProductCodes;
|
||||
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap;
|
||||
std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
|
||||
|
||||
|
||||
bool m_bVoiceChatAndUGCRestricted;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
if(StorageManager.GetBootTypeDisc())
|
||||
{
|
||||
wstring wsTemp = app.GetString(IDS_GAMENAME);
|
||||
std::wstring wsTemp = app.GetString(IDS_GAMENAME);
|
||||
WCHAR wchTemp[64];
|
||||
wsTemp.append(L" (");
|
||||
mbstowcs(wchTemp,app.GetDiscProductCode(),64);
|
||||
|
|
@ -991,7 +991,7 @@ int main()
|
|||
delete [] baSaveImage.data;
|
||||
}
|
||||
|
||||
wstring wsName=L"Graphics\\SaveChest.png";
|
||||
std::wstring wsName=L"Graphics\\SaveChest.png";
|
||||
byteArray baSaveLoadIcon = app.getArchiveFile(wsName);
|
||||
if(baSaveLoadIcon.data!=NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ PlayerUID::PlayerUID(CellSysutilUserId userID, SceNpOnlineId& onlineID, bool bSi
|
|||
setOnlineID(onlineID, bSignedInPSN);
|
||||
}
|
||||
|
||||
PlayerUID::PlayerUID(wstring fromString)
|
||||
PlayerUID::PlayerUID(std::wstring fromString)
|
||||
{
|
||||
// create for the format P_5e7ff8372ea9_00000004_Mark_4J
|
||||
|
||||
|
|
@ -42,16 +42,16 @@ PlayerUID::PlayerUID(wstring fromString)
|
|||
// parse the mac address next
|
||||
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);
|
||||
}
|
||||
|
||||
// parse the userID
|
||||
wstring userIDDigits = fromString.substr(15,8);
|
||||
std::wstring userIDDigits = fromString.substr(15,8);
|
||||
m_userID = _fromString<int>(userIDDigits);
|
||||
|
||||
// finally, the onlineID, if there is one
|
||||
wstring onlineID = fromString.substr(24);
|
||||
std::wstring onlineID = fromString.substr(24);
|
||||
if(onlineID.size() > 0)
|
||||
{
|
||||
wcstombs(m_onlineID, onlineID.c_str(), 16);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
class HugeMushroomTile_SPU : public Tile_SPU
|
||||
{
|
||||
public:
|
||||
// static const wstring TEXTURE_STEM;
|
||||
// static const wstring TEXTURE_INSIDE;
|
||||
// static const std::wstring TEXTURE_STEM;
|
||||
// static const std::wstring TEXTURE_INSIDE;
|
||||
|
||||
private:
|
||||
static const int HUGE_MUSHROOM_TEXTURE_COUNT = 2;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
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 getSourceHeight() const = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
#include "../Common/spu_assert.h"
|
||||
#endif
|
||||
|
||||
// const wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava";
|
||||
// const wstring LiquidTile::TEXTURE_WATER_STILL = L"water";
|
||||
// const wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow";
|
||||
// const wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow";
|
||||
// const std::wstring LiquidTile::TEXTURE_LAVA_STILL = L"lava";
|
||||
// const std::wstring LiquidTile::TEXTURE_WATER_STILL = L"water";
|
||||
// const std::wstring LiquidTile::TEXTURE_WATER_FLOW = L"water_flow";
|
||||
// const std::wstring LiquidTile::TEXTURE_LAVA_FLOW = L"lava_flow";
|
||||
|
||||
#define MATH_PI (3.141592654f)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const int TallGrass_SPU::DEAD_SHRUB = 0;
|
|||
const int TallGrass_SPU::TALL_GRASS = 1;
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ void Tile_SPU::updateDefaultShape()
|
|||
// return this;
|
||||
// }
|
||||
//
|
||||
// wstring Tile_SPU::getName()
|
||||
// std::wstring Tile_SPU::getName()
|
||||
// {
|
||||
// return I18n::get(getDescriptionId() + L".name");
|
||||
// }
|
||||
|
|
@ -655,12 +655,12 @@ Material_SPU* Tile_SPU::getMaterial()
|
|||
// icon = iconRegister->registerIcon(m_textureName);
|
||||
// }
|
||||
//
|
||||
// wstring Tile_SPU::getTileItemIconName()
|
||||
// std::wstring Tile_SPU::getTileItemIconName()
|
||||
// {
|
||||
// return L"";
|
||||
// }
|
||||
//
|
||||
// Tile *Tile_SPU::setTextureName(const wstring &name)
|
||||
// Tile *Tile_SPU::setTextureName(const std::wstring &name)
|
||||
// {
|
||||
// m_textureName = name;
|
||||
// return this;
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ private:
|
|||
// unsigned int descriptionId;
|
||||
// unsigned int useDescriptionId; // 4J Added
|
||||
//
|
||||
// wstring m_textureName;
|
||||
// std::wstring m_textureName;
|
||||
|
||||
protected:
|
||||
// Icon *icon;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public:
|
|||
// public:
|
||||
// ZipFile(File *file) {}
|
||||
// InputStream *getInputStream(ZipEntry *entry) { return NULL; }
|
||||
// ZipEntry *getEntry(const wstring& name) {return NULL;}
|
||||
// ZipEntry *getEntry(const std::wstring& name) {return NULL;}
|
||||
// void close() {}
|
||||
// };
|
||||
//
|
||||
|
|
@ -189,7 +189,7 @@ public:
|
|||
// static void create() {}
|
||||
// static void destroy() {}
|
||||
// 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 const int KEY_A = 0;
|
||||
// static const int KEY_B = 1;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public:
|
|||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
|
||||
bool IsFullVersion();
|
||||
void SetFullVersion(bool bFull);
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ public:
|
|||
void SetDLCProductCode(const char* szProductCode);
|
||||
void SetProductUpgradeKey(const char* szKey);
|
||||
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);
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1012,8 +1012,8 @@ void PSVitaLeaderboardManager::initReadScoreStruct(ReadScore &out, SceNpScoreRan
|
|||
out.m_uid.setOnlineID( rankData.npId.handle, true );
|
||||
out.m_rank = rankData.rank;
|
||||
|
||||
// Convert to wstring and copy name.
|
||||
wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
|
||||
// Convert to std::wstring and copy name.
|
||||
std::wstring wstrName = convStringToWstring( string(rankData.npId.handle.data) ).c_str();
|
||||
//memcpy(&out.m_name, wstrName.c_str(), XUSER_NAME_SIZE);
|
||||
out.m_name=wstrName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ bool CConsoleMinecraftApp::IsAmericanSKU()
|
|||
|
||||
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
{
|
||||
wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
|
||||
AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp));
|
||||
if(it == m_SONYDLCMap.end())
|
||||
|
|
@ -105,7 +105,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
|||
}
|
||||
return it->second;
|
||||
|
||||
/*wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
/*std::wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
SONYDLC *pTemp=m_SONYDLCMap.at(wstrTemp);
|
||||
|
||||
return pTemp;*/
|
||||
|
|
@ -172,7 +172,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
|||
|
||||
// push this into a vector
|
||||
|
||||
wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
std::wstring wstrTemp=convStringToWstring(chDLCTitle);
|
||||
m_SONYDLCMap[wstrTemp]=pDLCInfo;
|
||||
}
|
||||
CloseHandle(file);
|
||||
|
|
@ -304,7 +304,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ public:
|
|||
bool DLCAlreadyPurchased(char *pchTitle);
|
||||
char *GetSkuIDFromProductList();
|
||||
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 CommerceGetCategoriesCallback(LPVOID lpParam,int err);
|
||||
static void CommerceGetProductListCallback(LPVOID lpParam,int err);
|
||||
|
|
@ -230,7 +230,7 @@ private:
|
|||
// SonyCommerce::ProductInfoDetailed m_ProductInfoDetailed;
|
||||
|
||||
PRODUCTCODES ProductCodes;
|
||||
std::unordered_map<wstring, SONYDLC *> m_SONYDLCMap;
|
||||
std::unordered_map<std::wstring, SONYDLC *> m_SONYDLCMap;
|
||||
|
||||
|
||||
bool m_bVoiceChatAndUGCRestricted;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ PlayerUID::PlayerUID(int userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int
|
|||
setOnlineID(onlineID, bSignedInPSN);
|
||||
}
|
||||
|
||||
PlayerUID::PlayerUID(wstring fromString)
|
||||
PlayerUID::PlayerUID(std::wstring fromString)
|
||||
{
|
||||
// create for the format P_5e7ff8372ea9_00000004_Mark_4J
|
||||
|
||||
|
|
@ -47,16 +47,16 @@ PlayerUID::PlayerUID(wstring fromString)
|
|||
// parse the mac address next
|
||||
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);
|
||||
}
|
||||
|
||||
// parse the userID
|
||||
wstring userIDDigits = fromString.substr(15,8);
|
||||
std::wstring userIDDigits = fromString.substr(15,8);
|
||||
m_userID = _fromString<int>(userIDDigits);
|
||||
|
||||
// finally, the onlineID, if there is one
|
||||
wstring onlineID = fromString.substr(24);
|
||||
std::wstring onlineID = fromString.substr(24);
|
||||
if(onlineID.size() > 0)
|
||||
{
|
||||
wcstombs(m_onlineID, onlineID.c_str(), 16);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public:
|
|||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
std::wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
|
|
|
|||
|
|
@ -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_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);
|
||||
// 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);
|
||||
|
||||
// enum eXBLWS
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
|||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameCreate::CreateGame
|
||||
|
||||
app.ClearTerrainFeaturePosition();
|
||||
wstring wWorldName = L"TestWorld";
|
||||
std::wstring wWorldName = L"TestWorld";
|
||||
|
||||
StorageManager.ResetSaveData();
|
||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||
|
|
|
|||
|
|
@ -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_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);
|
||||
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);
|
||||
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
assert(name.length()<256);
|
||||
|
|
@ -468,7 +468,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
|||
{
|
||||
return;
|
||||
}
|
||||
wstring name = wchSoundNames[iSound];
|
||||
std::wstring name = wchSoundNames[iSound];
|
||||
//const unsigned char *name=ucSoundNames[iSound];
|
||||
|
||||
char *xboxName = ConvertSoundPathToName(name);
|
||||
|
|
@ -576,7 +576,7 @@ void SoundEngine::playUI(int iSound, float, float)
|
|||
{
|
||||
return;
|
||||
}
|
||||
wstring name = wchSoundNames[iSound];
|
||||
std::wstring name = wchSoundNames[iSound];
|
||||
|
||||
char *xboxName = (char *)ConvertSoundPathToName(name);
|
||||
|
||||
|
|
@ -635,7 +635,7 @@ void SoundEngine::playUI(int iSound, float, float)
|
|||
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;
|
||||
|
||||
|
|
@ -1065,14 +1065,14 @@ void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
|
|||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public:
|
|||
SoundEngine();
|
||||
virtual void destroy();
|
||||
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 playMusicTick();
|
||||
virtual void updateMusicVolume(float fVal);
|
||||
|
|
@ -87,16 +87,16 @@ public:
|
|||
virtual void updateSoundEffectVolume(float fVal);
|
||||
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 add(const wstring& name, File *file);
|
||||
virtual void addMusic(const wstring& name, File *file);
|
||||
virtual void addStreaming(const wstring& name, File *file);
|
||||
virtual void add(const std::wstring& name, File *file);
|
||||
virtual void addMusic(const std::wstring& name, File *file);
|
||||
virtual void addStreaming(const std::wstring& name, File *file);
|
||||
#ifndef __PS3__
|
||||
static void setXACTEngine( IXACT3Engine *pXACT3Engine);
|
||||
void CreateStreamingWavebank(const char *pchName, IXACT3WaveBank **ppStreamedWaveBank);
|
||||
void CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSoundBank);
|
||||
|
||||
#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
|
||||
#ifdef _XBOX
|
||||
bool isStreamingWavebankReady(IXACT3WaveBank *pWaveBank);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue