mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-28 16:30:47 +00:00
refactor: unglob std::wstring
This commit is contained in:
@@ -11,7 +11,7 @@ public:
|
||||
int id;
|
||||
int x, y, z;
|
||||
int dir;
|
||||
wstring motive;
|
||||
std::wstring motive;
|
||||
|
||||
public:
|
||||
AddPaintingPacket();
|
||||
|
||||
@@ -15,7 +15,7 @@ private:
|
||||
|
||||
public:
|
||||
int id;
|
||||
wstring name;
|
||||
std::wstring name;
|
||||
int x, y, z;
|
||||
char yRot, xRot;
|
||||
int carriedItem;
|
||||
|
||||
@@ -14,7 +14,7 @@ ChatPacket::ChatPacket()
|
||||
}
|
||||
|
||||
// Old chat packet constructor, adds message, custom data and additional message to arg vectors
|
||||
ChatPacket::ChatPacket(const wstring& message, EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const wstring& additionalMessage /*= L""*/)
|
||||
ChatPacket::ChatPacket(const std::wstring& message, EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const std::wstring& additionalMessage /*= L""*/)
|
||||
{
|
||||
m_messageType = type;
|
||||
if (customData != -1) m_intArgs.push_back(customData);
|
||||
|
||||
@@ -79,12 +79,12 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
vector<wstring> m_stringArgs;
|
||||
vector<std::wstring> m_stringArgs;
|
||||
vector<int> m_intArgs;
|
||||
EChatPacketMessage m_messageType;
|
||||
|
||||
ChatPacket();
|
||||
ChatPacket(const wstring& message, EChatPacketMessage type = e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"");
|
||||
ChatPacket(const std::wstring& message, EChatPacketMessage type = e_ChatCustom, int customData = -1, const std::wstring& additionalMessage = L"");
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
#include "CustomPayloadPacket.h"
|
||||
|
||||
// Mojang-defined custom packets
|
||||
const wstring CustomPayloadPacket::CUSTOM_BOOK_PACKET = L"MC|BEdit";
|
||||
const wstring CustomPayloadPacket::CUSTOM_BOOK_SIGN_PACKET = L"MC|BSign";
|
||||
const wstring CustomPayloadPacket::TEXTURE_PACK_PACKET = L"MC|TPack";
|
||||
const wstring CustomPayloadPacket::TRADER_LIST_PACKET = L"MC|TrList";
|
||||
const wstring CustomPayloadPacket::TRADER_SELECTION_PACKET = L"MC|TrSel";
|
||||
const wstring CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET = L"MC|AdvCdm";
|
||||
const wstring CustomPayloadPacket::SET_BEACON_PACKET = L"MC|Beacon";
|
||||
const wstring CustomPayloadPacket::SET_ITEM_NAME_PACKET = L"MC|ItemName";
|
||||
const std::wstring CustomPayloadPacket::CUSTOM_BOOK_PACKET = L"MC|BEdit";
|
||||
const std::wstring CustomPayloadPacket::CUSTOM_BOOK_SIGN_PACKET = L"MC|BSign";
|
||||
const std::wstring CustomPayloadPacket::TEXTURE_PACK_PACKET = L"MC|TPack";
|
||||
const std::wstring CustomPayloadPacket::TRADER_LIST_PACKET = L"MC|TrList";
|
||||
const std::wstring CustomPayloadPacket::TRADER_SELECTION_PACKET = L"MC|TrSel";
|
||||
const std::wstring CustomPayloadPacket::SET_ADVENTURE_COMMAND_PACKET = L"MC|AdvCdm";
|
||||
const std::wstring CustomPayloadPacket::SET_BEACON_PACKET = L"MC|Beacon";
|
||||
const std::wstring CustomPayloadPacket::SET_ITEM_NAME_PACKET = L"MC|ItemName";
|
||||
|
||||
CustomPayloadPacket::CustomPayloadPacket()
|
||||
{
|
||||
}
|
||||
|
||||
CustomPayloadPacket::CustomPayloadPacket(const wstring &identifier, byteArray data)
|
||||
CustomPayloadPacket::CustomPayloadPacket(const std::wstring &identifier, byteArray data)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
this->data = data;
|
||||
|
||||
@@ -8,21 +8,21 @@ class CustomPayloadPacket : public Packet, public enable_shared_from_this<Custom
|
||||
public:
|
||||
|
||||
// Mojang-defined custom packets
|
||||
static const wstring CUSTOM_BOOK_PACKET;
|
||||
static const wstring CUSTOM_BOOK_SIGN_PACKET;
|
||||
static const wstring TEXTURE_PACK_PACKET;
|
||||
static const wstring TRADER_LIST_PACKET;
|
||||
static const wstring TRADER_SELECTION_PACKET;
|
||||
static const wstring SET_ADVENTURE_COMMAND_PACKET;
|
||||
static const wstring SET_BEACON_PACKET;
|
||||
static const wstring SET_ITEM_NAME_PACKET;
|
||||
static const std::wstring CUSTOM_BOOK_PACKET;
|
||||
static const std::wstring CUSTOM_BOOK_SIGN_PACKET;
|
||||
static const std::wstring TEXTURE_PACK_PACKET;
|
||||
static const std::wstring TRADER_LIST_PACKET;
|
||||
static const std::wstring TRADER_SELECTION_PACKET;
|
||||
static const std::wstring SET_ADVENTURE_COMMAND_PACKET;
|
||||
static const std::wstring SET_BEACON_PACKET;
|
||||
static const std::wstring SET_ITEM_NAME_PACKET;
|
||||
|
||||
wstring identifier;
|
||||
std::wstring identifier;
|
||||
int length;
|
||||
byteArray data;
|
||||
|
||||
CustomPayloadPacket();
|
||||
CustomPayloadPacket(const wstring &identifier, byteArray data);
|
||||
CustomPayloadPacket(const std::wstring &identifier, byteArray data);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
@@ -36,7 +36,7 @@ LoginPacket::LoginPacket()
|
||||
}
|
||||
|
||||
// Client -> Server
|
||||
LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest)
|
||||
LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest)
|
||||
{
|
||||
this->userName = userName;
|
||||
this->clientVersion = clientVersion;
|
||||
@@ -65,7 +65,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o
|
||||
}
|
||||
|
||||
// Server -> Client
|
||||
LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale)
|
||||
LoginPacket::LoginPacket(const std::wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale)
|
||||
{
|
||||
this->userName = userName;
|
||||
this->clientVersion = clientVersion;
|
||||
@@ -97,7 +97,7 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException
|
||||
{
|
||||
clientVersion = dis->readInt();
|
||||
userName = readUtf(dis, Player::MAX_NAME_LENGTH);
|
||||
wstring typeName = readUtf(dis, 16);
|
||||
std::wstring typeName = readUtf(dis, 16);
|
||||
m_pLevelType = LevelType::getLevelType(typeName);
|
||||
if (m_pLevelType == NULL)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ class LoginPacket : public Packet, public enable_shared_from_this<LoginPacket>
|
||||
{
|
||||
public:
|
||||
int clientVersion;
|
||||
wstring userName;
|
||||
std::wstring userName;
|
||||
__int64 seed;
|
||||
char dimension;
|
||||
PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added
|
||||
@@ -31,8 +31,8 @@ public:
|
||||
BYTE maxPlayers;
|
||||
|
||||
LoginPacket();
|
||||
LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client
|
||||
LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server
|
||||
LoginPacket(const std::wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client
|
||||
LoginPacket(const std::wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
@@ -144,17 +144,17 @@ void Packet::staticCtor()
|
||||
map(255, true, true, true, false, typeid(DisconnectPacket), DisconnectPacket::create);
|
||||
}
|
||||
|
||||
IllegalArgumentException::IllegalArgumentException(const wstring& information)
|
||||
IllegalArgumentException::IllegalArgumentException(const std::wstring& information)
|
||||
{
|
||||
this->information = information;
|
||||
}
|
||||
|
||||
IOException::IOException(const wstring& information)
|
||||
IOException::IOException(const std::wstring& information)
|
||||
{
|
||||
this->information = information;
|
||||
}
|
||||
|
||||
RuntimeException::RuntimeException(const wstring& /*information*/)
|
||||
RuntimeException::RuntimeException(const std::wstring& /*information*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ int Packet::renderPos = 0;
|
||||
void Packet::map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn createFn)
|
||||
{
|
||||
#if 0
|
||||
if (idToClassMap.count(id) > 0) throw new IllegalArgumentException(wstring(L"Duplicate packet id:") + _toString<int>(id));
|
||||
if (idToClassMap.count(id) > 0) throw new IllegalArgumentException(std::wstring(L"Duplicate packet id:") + _toString<int>(id));
|
||||
if (classToIdMap.count(clazz) > 0) throw new IllegalArgumentException(L"Duplicate packet class:"); // TODO + clazz);
|
||||
#endif
|
||||
|
||||
@@ -389,7 +389,7 @@ std::shared_ptr<Packet> Packet::readPacket(DataInputStream *dis, bool isServer)
|
||||
// Close the stream to prevent further reads on a desynced stream
|
||||
dis->close();
|
||||
return nullptr;
|
||||
// throw new IOException(wstring(L"Bad packet id ") + _toString<int>(id));
|
||||
// throw new IOException(std::wstring(L"Bad packet id ") + _toString<int>(id));
|
||||
}
|
||||
|
||||
// Record successfully read packet ID
|
||||
@@ -437,7 +437,7 @@ void Packet::writePacket(std::shared_ptr<Packet> packet, DataOutputStream *dos)
|
||||
packet->write(dos);
|
||||
}
|
||||
|
||||
void Packet::writeUtf(const wstring& value, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws?
|
||||
void Packet::writeUtf(const std::wstring& value, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws?
|
||||
{
|
||||
#if 0
|
||||
if (value.length() > Short::MAX_VALUE)
|
||||
@@ -450,7 +450,7 @@ void Packet::writeUtf(const wstring& value, DataOutputStream *dos) // throws IOE
|
||||
dos->writeChars(value);
|
||||
}
|
||||
|
||||
wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOException TODO 4J JEV, should this declare a throws?
|
||||
std::wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOException TODO 4J JEV, should this declare a throws?
|
||||
{
|
||||
|
||||
short stringLength = dis->readShort();
|
||||
@@ -465,7 +465,7 @@ wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOExcepti
|
||||
return L"";
|
||||
}
|
||||
|
||||
wstring builder = L"";
|
||||
std::wstring builder = L"";
|
||||
for (int i = 0; i < stringLength; i++)
|
||||
{
|
||||
wchar_t rc = dis->readChar();
|
||||
@@ -530,7 +530,7 @@ __int64 Packet::PacketStatistics::getCountSample(int samplePos)
|
||||
return countSamples[samplePos] * 10;
|
||||
}
|
||||
|
||||
wstring Packet::PacketStatistics::getLegendString()
|
||||
std::wstring Packet::PacketStatistics::getLegendString()
|
||||
{
|
||||
static wchar_t string[128];
|
||||
double bps = 0.0;
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
// 4J Added
|
||||
void renderStats();
|
||||
__int64 getCountSample(int samplePos);
|
||||
wstring getLegendString();
|
||||
std::wstring getLegendString();
|
||||
};
|
||||
|
||||
// 4J JEV, replaces the static blocks.
|
||||
@@ -93,8 +93,8 @@ private :
|
||||
public:
|
||||
static std::shared_ptr<Packet> readPacket(DataInputStream *dis, bool isServer);
|
||||
static void writePacket(std::shared_ptr<Packet> packet, DataOutputStream *dos);
|
||||
static void writeUtf(const wstring& value, DataOutputStream *dos);
|
||||
static wstring readUtf(DataInputStream *dis, int maxLength);
|
||||
static void writeUtf(const std::wstring& value, DataOutputStream *dos);
|
||||
static std::wstring readUtf(DataInputStream *dis, int maxLength);
|
||||
virtual void read(DataInputStream *dis) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws?
|
||||
virtual void write(DataOutputStream *dos) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws?
|
||||
virtual void handle(PacketListener *listener) = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ int PlayerAbilitiesPacket::getEstimatedSize()
|
||||
return 2;
|
||||
}
|
||||
|
||||
//wstring getDebugInfo()
|
||||
//std::wstring getDebugInfo()
|
||||
//{
|
||||
// return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", isInvulnerable(), isFlying(), canFly(), canInstabuild(), getFlyingSpeed(), getWalkingSpeed());
|
||||
//}
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
void write(DataOutputStream *dos);
|
||||
void handle(PacketListener *listener);
|
||||
int getEstimatedSize();
|
||||
//wstring getDebugInfo();
|
||||
//std::wstring getDebugInfo();
|
||||
bool isInvulnerable();
|
||||
void setInvulnerable(bool invulnerable);
|
||||
bool isFlying();
|
||||
|
||||
@@ -8,7 +8,7 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this<PlayerInf
|
||||
{
|
||||
public:
|
||||
// 4J Stu - I have re-purposed this packet for our uses
|
||||
//wstring name;
|
||||
//std::wstring name;
|
||||
//bool add;
|
||||
//int latency;
|
||||
short m_networkSmallId;
|
||||
@@ -17,7 +17,7 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this<PlayerInf
|
||||
int m_entityId;
|
||||
|
||||
PlayerInfoPacket();
|
||||
//PlayerInfoPacket(const wstring &name, bool add, int latency);
|
||||
//PlayerInfoPacket(const std::wstring &name, bool add, int latency);
|
||||
PlayerInfoPacket(BYTE networkSmallId, short playerColourIndex, unsigned int playerPrivileges = 0);
|
||||
PlayerInfoPacket(std::shared_ptr<ServerPlayer> player);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ PreLoginPacket::PreLoginPacket()
|
||||
m_netcodeVersion = 0;
|
||||
}
|
||||
|
||||
PreLoginPacket::PreLoginPacket(wstring userName)
|
||||
PreLoginPacket::PreLoginPacket(std::wstring userName)
|
||||
{
|
||||
this->loginKey = userName;
|
||||
m_playerXuids = NULL;
|
||||
@@ -32,7 +32,7 @@ PreLoginPacket::PreLoginPacket(wstring userName)
|
||||
m_netcodeVersion = 0;
|
||||
}
|
||||
|
||||
PreLoginPacket::PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId)
|
||||
PreLoginPacket::PreLoginPacket(std::wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId)
|
||||
{
|
||||
this->loginKey = userName;
|
||||
m_playerXuids = playerXuids;
|
||||
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
DWORD m_texturePackId;
|
||||
SHORT m_netcodeVersion;
|
||||
|
||||
wstring loginKey;
|
||||
std::wstring loginKey;
|
||||
|
||||
PreLoginPacket();
|
||||
PreLoginPacket(wstring userName);
|
||||
PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId);
|
||||
PreLoginPacket(std::wstring userName);
|
||||
PreLoginPacket(std::wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId);
|
||||
~PreLoginPacket();
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
|
||||
@@ -45,7 +45,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException
|
||||
dimension = dis->readByte();
|
||||
playerGameType = GameType::byId(dis->readByte());
|
||||
mapHeight = dis->readShort();
|
||||
wstring typeName = readUtf(dis, 16);
|
||||
std::wstring typeName = readUtf(dis, 16);
|
||||
m_pLevelType = LevelType::getLevelType(typeName);
|
||||
if (m_pLevelType == NULL)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ SignUpdatePacket::SignUpdatePacket()
|
||||
|
||||
}
|
||||
|
||||
SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, wstring lines[])
|
||||
SignUpdatePacket::SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, std::wstring lines[])
|
||||
{
|
||||
shouldDelay = true;
|
||||
this->m_bVerified=bVerified;
|
||||
|
||||
@@ -9,10 +9,10 @@ public:
|
||||
int x, y, z;
|
||||
bool m_bVerified;
|
||||
bool m_bCensored;
|
||||
wstring lines[4];
|
||||
std::wstring lines[4];
|
||||
|
||||
SignUpdatePacket();
|
||||
SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, wstring lines[]);
|
||||
SignUpdatePacket(int x, int y, int z, bool bVerified, bool bCensored, std::wstring lines[]);
|
||||
bool GetVerified() {return m_bVerified;}
|
||||
bool GetCensored() {return m_bCensored;}
|
||||
virtual void read(DataInputStream *dis);
|
||||
|
||||
@@ -15,11 +15,11 @@ TextureAndGeometryChangePacket::TextureAndGeometryChangePacket()
|
||||
dwSkinID = 0;
|
||||
}
|
||||
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr<Entity> e, const wstring &path)
|
||||
TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr<Entity> e, const std::wstring &path)
|
||||
{
|
||||
id = e->entityId;
|
||||
this->path = path;
|
||||
wstring skinValue = path.substr(7,path.size());
|
||||
std::wstring skinValue = path.substr(7,path.size());
|
||||
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
|
||||
@@ -8,11 +8,11 @@ class TextureAndGeometryChangePacket : public Packet, public enable_shared_from_
|
||||
public:
|
||||
|
||||
int id;
|
||||
wstring path;
|
||||
std::wstring path;
|
||||
DWORD dwSkinID;
|
||||
|
||||
TextureAndGeometryChangePacket();
|
||||
TextureAndGeometryChangePacket(std::shared_ptr<Entity> e, const wstring &path);
|
||||
TextureAndGeometryChangePacket(std::shared_ptr<Entity> e, const std::wstring &path);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
@@ -30,11 +30,11 @@ TextureAndGeometryPacket::~TextureAndGeometryPacket()
|
||||
// }
|
||||
}
|
||||
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes)
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes)
|
||||
{
|
||||
this->textureName = textureName;
|
||||
|
||||
wstring skinValue = textureName.substr(7,textureName.size());
|
||||
std::wstring skinValue = textureName.substr(7,textureName.size());
|
||||
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
@@ -47,11 +47,11 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P
|
||||
this->uiAnimOverrideBitmask=0;
|
||||
}
|
||||
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile)
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile)
|
||||
{
|
||||
this->textureName = textureName;
|
||||
|
||||
wstring skinValue = textureName.substr(7,textureName.size());
|
||||
std::wstring skinValue = textureName.substr(7,textureName.size());
|
||||
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
@@ -80,11 +80,11 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P
|
||||
}
|
||||
}
|
||||
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes,vector<SKIN_BOX *> *pvSkinBoxes, unsigned int uiAnimOverrideBitmask)
|
||||
TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes,vector<SKIN_BOX *> *pvSkinBoxes, unsigned int uiAnimOverrideBitmask)
|
||||
{
|
||||
this->textureName = textureName;
|
||||
|
||||
wstring skinValue = textureName.substr(7,textureName.size());
|
||||
std::wstring skinValue = textureName.substr(7,textureName.size());
|
||||
skinValue = skinValue.substr(0,skinValue.find_first_of(L'.'));
|
||||
std::wstringstream ss;
|
||||
ss << std::dec << skinValue.c_str();
|
||||
|
||||
@@ -10,7 +10,7 @@ class DLCSkinFile;
|
||||
class TextureAndGeometryPacket : public Packet, public enable_shared_from_this<TextureAndGeometryPacket>
|
||||
{
|
||||
public:
|
||||
wstring textureName;
|
||||
std::wstring textureName;
|
||||
DWORD dwSkinID;
|
||||
PBYTE pbData;
|
||||
DWORD dwTextureBytes;
|
||||
@@ -20,9 +20,9 @@ public:
|
||||
|
||||
TextureAndGeometryPacket();
|
||||
~TextureAndGeometryPacket();
|
||||
TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes);
|
||||
TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile);
|
||||
TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, vector<SKIN_BOX *> *pvSkinBoxes, unsigned int uiAnimOverrideBitmask);
|
||||
TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes);
|
||||
TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile);
|
||||
TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, vector<SKIN_BOX *> *pvSkinBoxes, unsigned int uiAnimOverrideBitmask);
|
||||
|
||||
virtual void handle(PacketListener *listener);
|
||||
virtual void read(DataInputStream *dis);
|
||||
|
||||
@@ -14,7 +14,7 @@ TextureChangePacket::TextureChangePacket()
|
||||
path = L"";
|
||||
}
|
||||
|
||||
TextureChangePacket::TextureChangePacket(std::shared_ptr<Entity> e, ETextureChangeType action, const wstring &path)
|
||||
TextureChangePacket::TextureChangePacket(std::shared_ptr<Entity> e, ETextureChangeType action, const std::wstring &path)
|
||||
{
|
||||
id = e->entityId;
|
||||
this->action = action;
|
||||
|
||||
@@ -14,10 +14,10 @@ public:
|
||||
|
||||
int id;
|
||||
ETextureChangeType action;
|
||||
wstring path;
|
||||
std::wstring path;
|
||||
|
||||
TextureChangePacket();
|
||||
TextureChangePacket(std::shared_ptr<Entity> e, ETextureChangeType action, const wstring &path);
|
||||
TextureChangePacket(std::shared_ptr<Entity> e, ETextureChangeType action, const std::wstring &path);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
@@ -22,7 +22,7 @@ TexturePacket::~TexturePacket()
|
||||
// }
|
||||
}
|
||||
|
||||
TexturePacket::TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes)
|
||||
TexturePacket::TexturePacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes)
|
||||
{
|
||||
this->textureName = textureName;
|
||||
this->pbData = pbData;
|
||||
|
||||
@@ -6,13 +6,13 @@ using namespace std;
|
||||
class TexturePacket : public Packet, public enable_shared_from_this<TexturePacket>
|
||||
{
|
||||
public:
|
||||
wstring textureName;
|
||||
std::wstring textureName;
|
||||
PBYTE pbData;
|
||||
DWORD dwBytes;
|
||||
|
||||
TexturePacket();
|
||||
~TexturePacket();
|
||||
TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes);
|
||||
TexturePacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes);
|
||||
|
||||
virtual void handle(PacketListener *listener);
|
||||
virtual void read(DataInputStream *dis);
|
||||
|
||||
@@ -14,7 +14,7 @@ UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket()
|
||||
m_dataTag = 0;
|
||||
}
|
||||
|
||||
UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength)
|
||||
UpdateGameRuleProgressPacket::UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const std::wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength)
|
||||
{
|
||||
m_definitionType = definitionType;
|
||||
m_messageId = messageId;
|
||||
|
||||
@@ -7,13 +7,13 @@ class UpdateGameRuleProgressPacket : public Packet, public enable_shared_from_th
|
||||
{
|
||||
public:
|
||||
ConsoleGameRules::EGameRuleType m_definitionType;
|
||||
wstring m_messageId;
|
||||
std::wstring m_messageId;
|
||||
int m_icon, m_auxValue;
|
||||
int m_dataTag;
|
||||
byteArray m_data;
|
||||
|
||||
UpdateGameRuleProgressPacket();
|
||||
UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength);
|
||||
UpdateGameRuleProgressPacket(ConsoleGameRules::EGameRuleType definitionType, const std::wstring &messageId, int icon, int auxValue, int dataTag, void *data, int dataLength);
|
||||
|
||||
virtual void read(DataInputStream *dis);
|
||||
virtual void write(DataOutputStream *dos);
|
||||
|
||||
Reference in New Issue
Block a user