refactor: unglob std::wstring
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user