Removed STLport requirement

This commit is contained in:
Anonymous
2014-01-23 00:16:13 -07:00
parent a9ac73d4e5
commit fac1f2c5ae
173 changed files with 454 additions and 479 deletions
-4
View File
@@ -22,7 +22,6 @@ find_package(LibXml2 REQUIRED)
find_package(Oracle REQUIRED)
find_package(PCRE REQUIRED)
find_package(Perl REQUIRED)
find_package(STLPort REQUIRED)
find_package(Threads)
find_package(ZLIB REQUIRED)
@@ -45,9 +44,6 @@ elseif(UNIX)
add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D__STL_NO_BAD_ALLOC -D_GNU_SOURCE -D_XOPEN_SOURCE=500)
endif()
include_directories(${STLPORT_INCLUDE_DIR})
link_directories(${STLPORT_LIBDIR})
add_subdirectory(external)
add_subdirectory(engine)
add_subdirectory(game)
-8
View File
@@ -19,14 +19,6 @@ https://help.ubuntu.com/community/Oracle%20Instant%20Client
You must log out and back in (or just reboot) for the $JAVA_HOME and $ORACLE_HOME to be set properly after these tools are installed. This is required in order for cmake to be able to find these tools when configuring the source code for building.
### STLPort
wget http://downloads.sourceforge.net/project/stlport/STLport/STLport-5.2.1/STLport-5.2.1.tar.bz2
tar -xvjf STLport-5.2.1.tar.bz2
cd STLport-5.2.1
./configure
sudo make install
## Build code
git clone git@bitbucket.org:apathyboy/swg-src.git -b cmake
-111
View File
@@ -1,111 +0,0 @@
# Look for a directory containing STLport.
#
# The following values are defined
# STLPORT_INCLUDE_DIR - where to find vector, etc.
# STLPORT_LIBRARIES - link against these to use STLport
# STLPORT_FOUND - True if the STLport is available.
# also defined, but not for general use are
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
# in cache already
SET(STLPORT_FIND_QUIETLY TRUE)
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
FIND_PATH(STLPORT_INCLUDE_DIR
iostream
PATHS
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
PATH_SUFFIXES stlport
HINTS
$ENV{STLPORT_ROOT}
)
FIND_LIBRARY(STLPORT_LIBRARY_DEBUG
NAMES
stlport_cygwin_debug
stlport_cygwin_stldebug
stlport_gcc_debug
stlport_gcc_stldebug
stlportstld_x
stlportstld_x.5.2
stlportd
stlportd_statix
stlportd_static
stlportd_static.5.0
PATHS
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
PATH_SUFFIXES lib
HINTS
$ENV{STLPORT_ROOT}
)
FIND_LIBRARY(STLPORT_LIBRARY_RELEASE
NAMES
stlport_cygwin
stlport_gcc
stlport
stlport_x
stlport_x.5.2
stlport_statix
stlport_static
stlport_static.5.0
PATHS
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
PATH_SUFFIXES lib
HINTS
$ENV{STLPORT_ROOT}
)
GET_FILENAME_COMPONENT(STLPORT_LIBDIR "${STLPORT_LIBRARY_DEBUG}" PATH)
IF(STLPORT_INCLUDE_DIR)
IF(STLPORT_LIBRARY_RELEASE)
SET(STLPORT_FOUND TRUE)
SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE})
IF(STLPORT_LIBRARY_DEBUG)
SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG})
ENDIF(STLPORT_LIBRARY_DEBUG)
ENDIF(STLPORT_LIBRARY_RELEASE)
ENDIF(STLPORT_INCLUDE_DIR)
IF(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ELSE(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find STLport!")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ENDIF(STLPORT_FOUND)
MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG)
@@ -67,34 +67,12 @@ add_executable(Miff
)
target_link_libraries(Miff
#sharedCommandParser
sharedCompression
sharedDebug
sharedFile
sharedFoundation
#sharedGame
#sharedLog
#sharedMath
sharedMemoryManager
#sharedMessageDispatch
#sharedNetwork
#sharedNetworkMessages
#sharedObject
#sharedRandom
#sharedSynchronization
sharedThread
#sharedUtility
#serverKeyShare
#serverMetrics
#serverNetworkMessages
#serverUtility
#archive
#crypto
fileInterface
#localization
#localizationArchive
#unicode
#unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -190,6 +190,5 @@ target_link_libraries(CentralServer
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -3220,7 +3220,7 @@ void CentralServer::handleRequestGameServerForLoginMessage(const RequestGameServ
LOG(loginTrace, ("deferring RequestGameServerForLoginMessage(%s)", msg.getCharacterId().getValueString().c_str()));
DEBUG_REPORT_LOG(true, ("Starting planet server for login"));
startPlanetServer(getHostForScene(msg.getScene()), msg.getScene(), 0);
m_messagesWaitingForPlanetServer.push_back();
m_messagesWaitingForPlanetServer.push_back(Archive::ByteStream());
msg.pack(m_messagesWaitingForPlanetServer.back());
}
else
@@ -3243,7 +3243,7 @@ void CentralServer::handleRequestSceneTransfer(const RequestSceneTransfer &msg)
{
DEBUG_REPORT_LOG(true, ("Starting planet server for login"));
startPlanetServer(getHostForScene(msg.getSceneName()), msg.getSceneName(), 0);
m_messagesWaitingForPlanetServer.push_back();
m_messagesWaitingForPlanetServer.push_back(Archive::ByteStream());
msg.pack(m_messagesWaitingForPlanetServer.back());
}
}
@@ -7,7 +7,7 @@
//-----------------------------------------------------------------------
#pragma warning(disable : 4100)
#include <hash_map>
#include <tr1/unordered_map>
#include <map>
#include <string>
#include <vector>
@@ -61,10 +61,10 @@ public:
private:
typedef std::vector<ConnectionServerConnection *> ConnectionServerConnectionList;
typedef std::map<NetworkId, CentralObject> CentralObjectMap;
typedef std::hash_multimap<SceneId, GameServerConnection *> SceneGameMap;
typedef std::tr1::unordered_multimap<SceneId, GameServerConnection *> SceneGameMap;
typedef std::pair<SceneGameMap::const_iterator, SceneGameMap::const_iterator> ServersList;
typedef std::hash_map<uint32, ConnectionServerConnection *> ConnectionServerSUIDMap;
typedef std::tr1::unordered_map<uint32, ConnectionServerConnection *> ConnectionServerSUIDMap;
typedef std::map<NetworkId, std::pair<SceneId, time_t> > PlayerSceneMapType;
@@ -102,6 +102,5 @@ target_link_libraries(ChatServer
unicodeArchive
ChatMono
VChatAPI
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -89,7 +89,7 @@ namespace ChatInterfaceNamespace
static int s_maxHeadersToSendToClientPerInterval;
// to prevent sending duplicate room chat message
std::hash_map<unsigned, std::pair<unsigned, unsigned> > s_mostRecentRoomChatMessage;
std::tr1::unordered_map<unsigned, std::pair<unsigned, unsigned> > s_mostRecentRoomChatMessage;
}
using namespace ChatInterfaceNamespace;
@@ -356,7 +356,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r
}
std::string lowerRoomName = toLower(roomName);
unsigned sequence = (unsigned)user;
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerRoomName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerRoomName);
if (f != roomList.end() && room)
{
(*f).second.updateRoomData(room);
@@ -443,7 +443,7 @@ const ChatServerRoomOwner * ChatInterface::getRoomByName(const std::string & roo
std::string lowerRoomName = toLower(roomName);
const ChatServerRoomOwner * result = 0;
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerRoomName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerRoomName);
if(f != roomList.end())
{
result = &(*f).second;
@@ -546,7 +546,7 @@ void ChatInterface::sendMessageToAllAvatars(const GameNetworkMessage & message)
}
//send to all pending avatars
std::hash_map<std::string, NetworkId>::iterator p = pendingAvatars.begin();
std::tr1::unordered_map<std::string, NetworkId>::iterator p = pendingAvatars.begin();
while (p != pendingAvatars.end())
{
ConnectionServerConnection * connection =
@@ -570,7 +570,7 @@ std::string ChatInterface::getChatName(const NetworkId &id)
{
ChatServer::fileLog(false, "ChatInterface", "getChatName() id(%s)", id.getValueString().c_str());
std::hash_map<std::string, NetworkId>::iterator i;
std::tr1::unordered_map<std::string, NetworkId>::iterator i;
for (i = pendingAvatars.begin(); i != pendingAvatars.end(); ++i)
{
if (id == (*i).second)
@@ -588,7 +588,7 @@ bool ChatInterface::sendMessageToPendingAvatar(const ChatAvatarId &id, const Gam
{
ChatServer::fileLog(false, "ChatInterface", "sendMessageToPendingAvatar() id(%s) message(%s)", id.getFullName().c_str(), message.getCmdName().c_str());
std::hash_map<std::string, NetworkId>::iterator f = pendingAvatars.find(id.name);
std::tr1::unordered_map<std::string, NetworkId>::iterator f = pendingAvatars.find(id.name);
if (f != pendingAvatars.end())
{
ConnectionServerConnection * connection =
@@ -609,7 +609,7 @@ bool ChatInterface::sendMessageToPendingAvatar(const ChatAvatarId &id, const Gam
//-----------------------------------------------------------------------
const std::hash_map<std::string, ChatServerRoomOwner> & ChatInterface::getRoomList() const
const std::tr1::unordered_map<std::string, ChatServerRoomOwner> & ChatInterface::getRoomList() const
{
return roomList;
}
@@ -618,7 +618,7 @@ const std::hash_map<std::string, ChatServerRoomOwner> & ChatInterface::getRoomLi
void ChatInterface::updateRooms()
{
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator i;
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator i;
for(i = roomList.begin(); i != roomList.end(); ++i)
{
ChatServerRoomOwner & roomOwner = const_cast<ChatServerRoomOwner &>((*i).second);
@@ -656,7 +656,7 @@ void ChatInterface::requestRoomList(const NetworkId & id, ConnectionServerConnec
++roomQueriesThisFrame;
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator i;
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator i;
std::vector<ChatRoomData> rooms;
const ChatAvatar * target = ChatServer::getAvatarByNetworkId(id);
ChatAvatarId requestingAvatar;
@@ -1010,7 +1010,7 @@ void ChatInterface::OnReceiveAddModeratorRoom(const ChatAvatar *srcAvatar, const
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -1123,7 +1123,7 @@ void ChatInterface::OnReceiveRemoveModeratorRoom(const ChatAvatar *srcAvatar, co
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -1473,7 +1473,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
ChatAvatarId failedAvatarId;
makeAvatarId(ChatUnicodeString(info->name.data(), info->name.size()), ChatUnicodeString(info->address.data(), info->address.size()), failedAvatarId);
std::hash_map<std::string, NetworkId>::iterator f = pendingAvatars.find(failedAvatarId.name);
std::tr1::unordered_map<std::string, NetworkId>::iterator f = pendingAvatars.find(failedAvatarId.name);
if (f != pendingAvatars.end())
{
pendingAvatars.erase(f);
@@ -1511,7 +1511,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
else
{
// look up a connection for this avatar
std::hash_map<std::string, NetworkId>::iterator f = pendingAvatars.find(id.name);
std::tr1::unordered_map<std::string, NetworkId>::iterator f = pendingAvatars.find(id.name);
if(f != pendingAvatars.end())
{
GenericValueTypeMessage<NetworkId> const avatarConnectedMessage("ChatAvatarConnected", (*f).second);
@@ -1536,7 +1536,7 @@ void ChatInterface::OnLoginAvatar(unsigned track, unsigned result, const ChatAva
ChatServer::chatConnectedAvatar((*f).second, *newAvatar);
// flush chat messages pending for this avatar
std::hash_map<NetworkId, std::vector<Archive::ByteStream>, NetworkId::Hash >::iterator df = deferredChatMessages.find((*f).second);
std::tr1::unordered_map<NetworkId, std::vector<Archive::ByteStream>, NetworkId::Hash >::iterator df = deferredChatMessages.find((*f).second);
if(df != deferredChatMessages.end())
{
std::vector<Archive::ByteStream> & v = (*df).second;
@@ -1642,7 +1642,7 @@ void ChatInterface::OnGetRoomSummaries(unsigned track, unsigned result, unsigned
makeRoomName(&(foundRooms[i]), roomName);
std::string lowerRoomName = toLower(roomName);
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerRoomName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerRoomName);
if(f == roomList.end())
{
RequestGetRoom(foundRooms[i].getRoomAddress(), NULL);
@@ -1660,7 +1660,7 @@ void ChatInterface::OnGetRoomSummaries(unsigned track, unsigned result, unsigned
const ChatServerRoomOwner *ChatInterface::getRoomOwner(const std::string & roomName)
{
std::string lowerName = toLower(roomName);
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = roomList.find(lowerName);
if(f != roomList.end())
{
return &((*f).second);
@@ -1672,7 +1672,7 @@ const ChatServerRoomOwner *ChatInterface::getRoomOwner(const std::string & roomN
ChatServerRoomOwner *ChatInterface::getRoomOwner(unsigned roomId)
{
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.begin();
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.begin();
while (f != roomList.end())
{
if ((*f).second.getRoomData().id == roomId)
@@ -1709,7 +1709,7 @@ void ChatInterface::OnReceiveDestroyRoom(const ChatAvatar *srcAvatar, const Chat
std::string roomName;
makeRoomName(destRoom, roomName);
std::string lowerName = toLower(roomName);
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerName);
if(f != roomList.end())
{
roomList.erase(f);
@@ -1753,7 +1753,7 @@ void ChatInterface::OnDestroyRoom(unsigned track, unsigned result, void *user)
if (result == CHATRESULT_SUCCESS)
{
std::string lowerName = toLower(owner->getRoomData().path);
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(lowerName);
if(f != roomList.end())
{
roomList.erase(f);
@@ -1985,7 +1985,7 @@ void ChatInterface::OnReceiveEnterRoom(const ChatAvatar *srcAvatar, const ChatRo
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2182,7 +2182,7 @@ void ChatInterface::OnReceiveAddBanRoom(const ChatAvatar *srcAvatar, const ChatA
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2300,7 +2300,7 @@ void ChatInterface::OnReceiveRemoveBanRoom(const ChatAvatar *srcAvatar, const Ch
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2419,7 +2419,7 @@ void ChatInterface::OnReceiveAddInviteRoom(const ChatAvatar *srcAvatar, const Ch
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2518,7 +2518,7 @@ void ChatInterface::OnReceiveRemoveInviteRoom(const ChatAvatar *srcAvatar, const
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2599,7 +2599,7 @@ void ChatInterface::OnReceiveLeaveRoom(const ChatAvatar *srcAvatar, const ChatRo
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator const f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator const f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2719,7 +2719,7 @@ void ChatInterface::OnReceiveKickRoom(const ChatAvatar *srcAvatar, const ChatAva
makeRoomName(destRoom, roomName);
// Update info about the room
std::hash_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::iterator f = roomList.find(toLower(roomName));
if(f != roomList.end())
(*f).second.updateRoomData(destRoom);
@@ -2940,7 +2940,7 @@ void ChatInterface::OnReceiveRoomMessage(const ChatAvatar *srcAvatar, const Chat
{
unsigned const destAvatarId = destAvatar->getAvatarID();
unsigned const destRoomId = destRoom->getRoomID();
std::hash_map<unsigned, std::pair<unsigned, unsigned> >::iterator const iterFind = s_mostRecentRoomChatMessage.find(destAvatarId);
std::tr1::unordered_map<unsigned, std::pair<unsigned, unsigned> >::iterator const iterFind = s_mostRecentRoomChatMessage.find(destAvatarId);
if (iterFind != s_mostRecentRoomChatMessage.end())
{
if ((iterFind->second.first == destRoomId) && (iterFind->second.second == messageID))
@@ -12,7 +12,7 @@
#include "ChatServerAvatarOwner.h"
#include "ChatServerRoomOwner.h"
#include <deque>
#include <hash_map>
#include <tr1/unordered_map>
#include <map>
#include <set>
#include <string>
@@ -47,7 +47,7 @@ public:
const NetworkId & getNetworkIdByAvatarId(const ChatAvatarId &id);
ChatServerAvatarOwner *getAvatarOwner(const ChatAvatar *avatar);
void disconnectPlayer (const ChatAvatarId & avatarId);
const std::hash_map<std::string, ChatServerRoomOwner> & getRoomList () const;
const std::tr1::unordered_map<std::string, ChatServerRoomOwner> & getRoomList () const;
const ChatServerRoomOwner *getRoomOwner(const std::string &roomName);
ChatServerRoomOwner *getRoomOwner(unsigned roomId);
@@ -157,11 +157,11 @@ public:
private:
std::map<ChatAvatarId, ChatServerAvatarOwner *> avatarMap;
std::hash_map<std::string, NetworkId> pendingAvatars;
std::tr1::unordered_map<std::string, NetworkId> pendingAvatars;
std::set<NetworkId> pendingRoomQueries;
int roomQueriesThisFrame;
std::hash_map<std::string, ChatServerRoomOwner> roomList;
std::hash_map<NetworkId, std::vector<Archive::ByteStream>, NetworkId::Hash > deferredChatMessages;
std::tr1::unordered_map<std::string, ChatServerRoomOwner> roomList;
std::tr1::unordered_map<NetworkId, std::vector<Archive::ByteStream>, NetworkId::Hash > deferredChatMessages;
std::map<ChatAvatarId, std::pair<unsigned long, std::deque<const ChatPersistentMessageToClient *> > > queuedHeaders;
std::map<unsigned, std::pair<std::pair<ChatUnicodeString, ChatUnicodeString>, int> > trackingRequestGetAnyAvatarForDestroy;
};
@@ -71,7 +71,7 @@ namespace ChatServerNamespace
ChatServerMetricsData * s_chatServerMetricsData = 0;
typedef std::list<std::pair<int, time_t> > MessageList;
typedef std::hash_map<Unicode::String, MessageList> PlayerMessageList;
typedef std::tr1::unordered_map<Unicode::String, MessageList> PlayerMessageList;
PlayerMessageList s_playerMessageList;
void cleanChatLog();
@@ -430,7 +430,7 @@ void ChatServer::sendToClient(const NetworkId & id, const GameNetworkMessage & m
{
ChatServer::fileLog(false, "ChatServer", "sendToClient() id(%s) message(%s)", id.getValueString().c_str(), message.getCmdName().c_str());
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator f = instance().clientMap.find(id);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator f = instance().clientMap.find(id);
if(f != instance().clientMap.end())
{
(*f).second->sendToClient(id, message);
@@ -604,7 +604,7 @@ void ChatServer::removeServices()
ChatAvatarId ChatServer::getAvatarIdForTrackId(unsigned trackId)
{
ChatServer & server = instance();
std::hash_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
std::tr1::unordered_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
if(f != server.pendingRequests.end())
{
const ChatAvatar *avatar = getAvatarByNetworkId((*f).second);
@@ -681,11 +681,11 @@ NetworkId ChatServer::sendResponseForTrackId(unsigned trackId, const GameNetwork
{
NetworkId id;
ChatServer & server = instance();
std::hash_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
std::tr1::unordered_map<unsigned, NetworkId>::iterator f = server.pendingRequests.find(trackId);
if(f != server.pendingRequests.end())
{
id = (*f).second;
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator c = server.clientMap.find((*f).second);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator c = server.clientMap.find((*f).second);
if(c != server.clientMap.end())
{
ConnectionServerConnection * conn = (*c).second;
@@ -701,7 +701,7 @@ NetworkId ChatServer::sendResponseForTrackId(unsigned trackId, const GameNetwork
GameServerConnection *ChatServer::getGameServerConnection(unsigned int sequence)
{
GameServerConnection * result = 0;
std::hash_map<unsigned int, GameServerConnection *>::iterator f = instance().gameServerConnectionMap.find(sequence);
std::tr1::unordered_map<unsigned int, GameServerConnection *>::iterator f = instance().gameServerConnectionMap.find(sequence);
if(f != instance().gameServerConnectionMap.end())
{
result = (*f).second;
@@ -724,7 +724,7 @@ void ChatServer::addGameServerConnection(unsigned int sequence, GameServerConnec
void ChatServer::clearGameServerConnection(const GameServerConnection *connection)
{
std::vector<unsigned int> removeKeyList;
std::hash_map<unsigned int, GameServerConnection *>::const_iterator i;
std::tr1::unordered_map<unsigned int, GameServerConnection *>::const_iterator i;
for(i = instance().gameServerConnectionMap.begin(); i != instance().gameServerConnectionMap.end(); ++i)
{
if ((*i).second == connection)
@@ -746,7 +746,7 @@ void ChatServer::clearGameServerConnection(const GameServerConnection *connectio
ConnectionServerConnection * ChatServer::getConnectionForCharacter(const NetworkId & characterId)
{
ConnectionServerConnection * result = 0;
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator f = instance().clientMap.find(characterId);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator f = instance().clientMap.find(characterId);
if(f != instance().clientMap.end())
{
result = (*f).second;
@@ -1039,7 +1039,7 @@ void ChatServer::connectPlayer(ConnectionServerConnection * connection, const un
{
ChatServer::fileLog(false, "ChatServer", "connectPlayer() address(%s) suid(%u) characterName(%s) networkId(%s)", getConnectionAddress(connection).c_str(), suid, characterName.c_str(), networkId.getValueString().c_str());
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator cf = instance().clientMap.find(networkId);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator cf = instance().clientMap.find(networkId);
if (cf != instance().clientMap.end())
{
DEBUG_WARNING(true, ("We received a chat login attempt for a player (%s) that we think is already logged in. We're going to try to log out the old avatar then log in the new one.", characterName.c_str()));
@@ -1260,7 +1260,7 @@ void ChatServer::destroyRoom(const NetworkId & id, const unsigned int sequence,
ChatAvatarId destroyer(avatar->GetGameCode(), avatar->GetGameServerName(), avatar->GetCharacterName());
// can this avatar destroy the room?
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator i;
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator i;
for(i = instance().chatInterface->getRoomList().begin(); i != instance().chatInterface->getRoomList().end(); ++i)
{
if((*i).second.getRoomData().id == roomId)
@@ -1373,7 +1373,7 @@ void ChatServer::disconnectPlayer(const NetworkId & id)
instance().chatAvatars.erase(f);
}
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator cf = instance().clientMap.find(id);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator cf = instance().clientMap.find(id);
if(cf != instance().clientMap.end())
{
instance().clientMap.erase(cf);
@@ -2268,7 +2268,7 @@ void ChatServer::sendRoomMessage(const ChatAvatarId &id, const std::string & roo
}
// get room id
std::string lowerName = toLower(roomName);
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator f = instance().chatInterface->getRoomList().find(lowerName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = instance().chatInterface->getRoomList().find(lowerName);
if(f != instance().chatInterface->getRoomList().end())
{
const ChatAvatar *sender = instance().ownerSystem;
@@ -2386,7 +2386,7 @@ void ChatServer::sendStandardRoomMessage(const ChatAvatarId &senderId, const std
return;
}
std::hash_map<std::string, ChatServerRoomOwner>::const_iterator f = instance().chatInterface->getRoomList().find(lowerName);
std::tr1::unordered_map<std::string, ChatServerRoomOwner>::const_iterator f = instance().chatInterface->getRoomList().find(lowerName);
if(f != instance().chatInterface->getRoomList().end())
{
const ChatAvatar *sender;
@@ -2457,13 +2457,13 @@ void ChatServer::removeConnectionServerConnection(ConnectionServerConnection * t
{
ChatServer::fileLog(false, "ChatServer", "removeConnectionServerConnection() target(%s)", getConnectionAddress(target).c_str());
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> tmpList = instance().clientMap;
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator i;
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> tmpList = instance().clientMap;
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::const_iterator i;
for(i = tmpList.begin(); i != tmpList.end(); ++i)
{
if((*i).second == target)
disconnectPlayer((*i).first);
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator f = instance().clientMap.find((*i).first);
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash>::iterator f = instance().clientMap.find((*i).first);
if (f != instance().clientMap.end())
{
instance().clientMap.erase(f);
@@ -2913,7 +2913,7 @@ void ChatServer::sendToGameServerById(unsigned const connectionId, GameNetworkMe
GameServerConnection *ChatServer::getGameServerConnectionFromId(unsigned int sequence)
{
GameServerConnection * result = NULL;
std::hash_map<unsigned int, GameServerConnection *>::iterator f = m_gameServerConnectionRegistry.find(sequence);
std::tr1::unordered_map<unsigned int, GameServerConnection *>::iterator f = m_gameServerConnectionRegistry.find(sequence);
if(f != m_gameServerConnectionRegistry.end())
{
result = (*f).second;
@@ -11,7 +11,7 @@
#include "ChatAPI/ChatAPI.h"
#include "sharedFoundation/NetworkId.h"
#include "sharedNetworkMessages/ChatAvatarId.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <map>
#include <set>
#include <string>
@@ -111,7 +111,7 @@ public:
//-----------------------------------------------------------------------
std::hash_map<unsigned, NetworkId> pendingRequests;
std::tr1::unordered_map<unsigned, NetworkId> pendingRequests;
static ChatServer & instance ();
static bool isValidChatAvatarName(Unicode::String const &chatName);
@@ -225,7 +225,7 @@ private:
time_t chatSpamNextTimeToNotifyPlayerWhenLimited;
time_t unsquelchTime;
};
typedef std::hash_map<NetworkId, AvatarExtendedData, NetworkId::Hash> ChatAvatarList;
typedef std::tr1::unordered_map<NetworkId, AvatarExtendedData, NetworkId::Hash> ChatAvatarList;
struct VoiceChatAvatarData
@@ -234,7 +234,7 @@ private:
std::string playerName;
};
typedef std::hash_map<NetworkId, VoiceChatAvatarData, NetworkId::Hash> VoiceChatAvatarList;
typedef std::tr1::unordered_map<NetworkId, VoiceChatAvatarData, NetworkId::Hash> VoiceChatAvatarList;
static AvatarExtendedData * getAvatarExtendedDataByNetworkId(const NetworkId & id);
@@ -243,8 +243,8 @@ private:
ChatAvatarList chatAvatars;
ChatInterface * chatInterface;
VChatInterface * voiceChatInterface;
std::hash_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> clientMap;
std::hash_map<unsigned int, GameServerConnection *> gameServerConnectionMap;
std::tr1::unordered_map<NetworkId, ConnectionServerConnection *, NetworkId::Hash> clientMap;
std::tr1::unordered_map<unsigned int, GameServerConnection *> gameServerConnectionMap;
std::set<ConnectionServerConnection *> connectionServerConnections;
bool done;
@@ -255,7 +255,7 @@ private:
static ChatServer * m_instance;
CustomerServiceServerConnection *customerServiceServerConnection;
typedef std::hash_map<unsigned int, GameServerConnection *> GameServerMap;
typedef std::tr1::unordered_map<unsigned int, GameServerConnection *> GameServerMap;
GameServerMap m_gameServerConnectionRegistry;
VoiceChatAvatarList m_voiceChatIdMap;
std::map<std::string, NetworkId> m_voiceChatNameToIdMap;
@@ -27,7 +27,7 @@ namespace Archive
#include "sharedFoundation/NetworkId.h"
#include "sharedNetwork/Connection.h"
#include "ChatAPI/ChatAPI.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <string>
//-----------------------------------------------------------------------
@@ -85,6 +85,5 @@ target_link_libraries(CommoditiesServer
serverMetrics
serverNetworkMessages
serverUtility
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -14,8 +14,10 @@
#include "FirstCommodityServer.h"
#include "AuctionBid.h"
#include <algorithm>
// ======================================================================
AuctionBid::AuctionBid(
@@ -39,35 +41,35 @@ AuctionBid::~AuctionBid()
const bool AuctionBid::operator > (const AuctionBid & rhs) const
{
return (max(m_bid, m_maxProxyBid) > max(rhs.m_bid, rhs.m_maxProxyBid));
return (std::max(m_bid, m_maxProxyBid) > std::max(rhs.m_bid, rhs.m_maxProxyBid));
}
// ----------------------------------------------------------------------
const bool AuctionBid::operator >= (const AuctionBid & rhs) const
{
return (max(m_bid, m_maxProxyBid) >= max(rhs.m_bid, rhs.m_maxProxyBid));
return (std::max(m_bid, m_maxProxyBid) >= std::max(rhs.m_bid, rhs.m_maxProxyBid));
}
// ----------------------------------------------------------------------
const bool AuctionBid::operator == (const AuctionBid & rhs) const
{
return (max(m_bid, m_maxProxyBid) == max(rhs.m_bid, rhs.m_maxProxyBid));
return (std::max(m_bid, m_maxProxyBid) == std::max(rhs.m_bid, rhs.m_maxProxyBid));
}
// ----------------------------------------------------------------------
const bool AuctionBid::operator < (const AuctionBid & rhs) const
{
return (max(m_bid, m_maxProxyBid) < max(rhs.m_bid, rhs.m_maxProxyBid));
return (std::max(m_bid, m_maxProxyBid) < std::max(rhs.m_bid, rhs.m_maxProxyBid));
}
// ----------------------------------------------------------------------
const bool AuctionBid::operator <= (const AuctionBid & rhs) const
{
return (max(m_bid, m_maxProxyBid) <= max(rhs.m_bid, rhs.m_maxProxyBid));
return (std::max(m_bid, m_maxProxyBid) <= std::max(rhs.m_bid, rhs.m_maxProxyBid));
}
// ======================================================================
@@ -4326,8 +4326,7 @@ void AuctionMarket::OnVendorStatusChange (
void static decodeOOB(const std::string & UTF8String, Unicode::String & UniString)
{
std::string::iterator c = const_cast<std::string::iterator> (UTF8String.begin());
std::string::const_iterator c = UTF8String.begin();
std::string tempstring;
unsigned short unicharvalue;
char * pEnd;
@@ -104,6 +104,5 @@ target_link_libraries(ConnectionServer
Base
CommonAPI
LoginAPI
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -395,7 +395,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg& msg)
m_suid = atoi(m_accountName.c_str());
if (m_suid == 0)
{
std::hash<std::string> h;
std::tr1::hash<std::string> h;
m_suid = h(m_accountName.c_str());
}
onValidateClient(m_suid, m_accountName, m_isSecure, NULL, ConfigConnectionServer::getDefaultGameFeatures(), ConfigConnectionServer::getDefaultSubscriptionFeatures(), 0, 0, 0, 0, ConfigConnectionServer::getFakeBuddyPoints());
@@ -6,7 +6,7 @@
//-----------------------------------------------------------------------
#include <hash_map>
#include <tr1/unordered_map>
#include <set>
#include <string>
@@ -40,9 +40,9 @@ class ConnectionServer : public MessageDispatch::Receiver
~ConnectionServer ();
typedef std::hash_map<uint32, GameConnection *> GameServerMap;
typedef std::hash_map<NetworkId, Client *,NetworkId::Hash> ClientMap;
typedef std::hash_map<uint32, ClientConnection *> SuidMap;
typedef std::tr1::unordered_map<uint32, GameConnection *> GameServerMap;
typedef std::tr1::unordered_map<NetworkId, Client *,NetworkId::Hash> ClientMap;
typedef std::tr1::unordered_map<uint32, ClientConnection *> SuidMap;
typedef std::set<uint32> FreeTrialsSet;
static void addNewClient(ClientConnection* cconn, const NetworkId &oid, GameConnection* gconn, const std::string &sceneName, bool sendToStarport );
@@ -84,6 +84,5 @@ target_link_libraries(CustomerServiceServer
unicode
unicodeArchive
CSAssist
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -12,7 +12,7 @@
#include "sharedNetworkMessages/SetupSharedNetworkMessages.h"
#include "sharedRandom/SetupSharedRandom.h"
#include "sharedThread/SetupSharedThread.h"
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -37,7 +37,7 @@ private:
int m_pendingTicketCount;
};
typedef stdhash_map<NetworkId, ClientInfo, NetworkId::Hash>::fwd ClientConnectionMap;
typedef stdunordered_map<NetworkId, ClientInfo, NetworkId::Hash>::fwd ClientConnectionMap;
typedef stdmap<unsigned int, NetworkId>::fwd SuidToNetworkIdMap;
typedef stdvector<CustomerServiceCategory>::fwd CategoryList;
@@ -12,7 +12,7 @@
#include "sharedFoundation/FirstSharedFoundation.h"
#include "sharedFoundation/NetworkId.h"
#include "sharedNetwork/Connection.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <string>
//-----------------------------------------------------------------------
@@ -76,6 +76,5 @@ target_link_libraries(LogServer
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -56,6 +56,5 @@ target_link_libraries(LoginPing
sharedThread
serverNetworkMessages
archive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -150,6 +150,5 @@ target_link_libraries(LoginServer
CommonAPI
LoginAPI
MonAPI2
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -23,6 +23,8 @@
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "sharedNetworkMessages/LoginEnumCluster.h"
#include <algorithm>
//-----------------------------------------------------------------------
ClientConnection::ClientConnection(UdpConnectionMT * u, TcpClient * t) :
@@ -194,7 +196,7 @@ void ClientConnection::validateClient(const std::string & id, const std::string
if (suid==0)
{
std::hash<std::string> h;
std::tr1::hash<std::string> h;
suid = h(id); //lint !e603 // Symbol 'h' not initialized (it's a functor)
}
@@ -12,7 +12,7 @@
#include "sharedFoundation/StationId.h"
#include "sharedMessageDispatch/Receiver.h"
#include "sharedNetwork/Service.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <map>
#include <string>
@@ -43,7 +43,7 @@ public:
ClientConnection* getUnvalidatedClient (int clientId);
void removeClient (int clientId);
const std::hash_map<std::string, const CentralServerConnection *> & getCentralServerMap_hide() const;
const std::tr1::unordered_map<std::string, const CentralServerConnection *> & getCentralServerMap_hide() const;
bool deleteCharacter (uint32 clusterId, NetworkId const & characterId, StationId suid);
@@ -71,6 +71,5 @@ target_link_libraries(MetricsServer
unicode
unicodeArchive
MonAPI2
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -102,6 +102,5 @@ target_link_libraries(PlanetServer
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -10,8 +10,8 @@
// ======================================================================
#include <hash_map>
#include <hash_set>
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#include <string>
#include <set>
@@ -93,9 +93,9 @@ class Scene : public Singleton2<Scene>, public MessageDispatch::Receiver
Coordinates();
};
typedef std::hash_map<NetworkId, PlanetProxyObject*, NetworkId::Hash> ObjectMapType;
typedef std::hash_set<NetworkId, NetworkId::Hash> DeletedSetType;
typedef std::hash_map<Coordinates, Node*, Coordinates::Hasher> NodeMapType;
typedef std::tr1::unordered_map<NetworkId, PlanetProxyObject*, NetworkId::Hash> ObjectMapType;
typedef std::tr1::unordered_set<NetworkId, NetworkId::Hash> DeletedSetType;
typedef std::tr1::unordered_map<Coordinates, Node*, Coordinates::Hasher> NodeMapType;
private:
std::string m_sceneId;
@@ -50,6 +50,5 @@ target_link_libraries(ServerConsole
sharedNetwork
sharedNetworkMessages
sharedThread
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -69,6 +69,5 @@ target_link_libraries(StationPlayersCollector
serverUtility
archive
unicode
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -102,6 +102,5 @@ target_link_libraries(TaskManager
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -15,6 +15,8 @@
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "ProcessSpawner.h"
#include <algorithm>
//-----------------------------------------------------------------------
namespace GameConnectionNamespace
@@ -78,6 +78,5 @@ target_link_libraries(TransferServer
unicode
unicodeArchive
CTServiceGameAPI
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -369,7 +369,7 @@ void DatabaseProcess::connectToGameServer(const char *address, uint16 port, uint
if(i == pendingGameServerConnections.end())
{
// check to see if there is already a connection active
std::hash_map<uint32, GameServerConnection *>::const_iterator j = gameServerConnections.find(processId);
std::tr1::unordered_map<uint32, GameServerConnection *>::const_iterator j = gameServerConnections.find(processId);
if(j == gameServerConnections.end())
{
// make the connection
@@ -383,7 +383,7 @@ void DatabaseProcess::connectToGameServer(const char *address, uint16 port, uint
GameServerConnection * DatabaseProcess::getConnectionByProcess(const uint32 processId)
{
GameServerConnection * result = 0;
std::hash_map<uint32, GameServerConnection *>::const_iterator j = gameServerConnections.find(processId);
std::tr1::unordered_map<uint32, GameServerConnection *>::const_iterator j = gameServerConnections.find(processId);
if(j != gameServerConnections.end())
{
result = (*j).second;
@@ -395,7 +395,7 @@ GameServerConnection * DatabaseProcess::getConnectionByProcess(const uint32 proc
void DatabaseProcess::getGameServerProcessIds(std::vector<uint32> &processIds) const
{
for (std::hash_map<uint32, GameServerConnection *>::const_iterator i = gameServerConnections.begin(); i != gameServerConnections.end(); ++i)
for (std::tr1::unordered_map<uint32, GameServerConnection *>::const_iterator i = gameServerConnections.begin(); i != gameServerConnections.end(); ++i)
processIds.push_back((*i).first);
}
@@ -637,7 +637,7 @@ void DatabaseProcess::sendToCommoditiesServer(GameNetworkMessage const &message,
void DatabaseProcess::sendToAllGameServers(GameNetworkMessage const &message, bool reliable)
{
for (std::hash_map<uint32, GameServerConnection *>::const_iterator i=gameServerConnections.begin(); i!=gameServerConnections.end(); ++i)
for (std::tr1::unordered_map<uint32, GameServerConnection *>::const_iterator i=gameServerConnections.begin(); i!=gameServerConnections.end(); ++i)
i->second->send(message,reliable);
}
@@ -645,7 +645,7 @@ void DatabaseProcess::sendToAllGameServers(GameNetworkMessage const &message, bo
void DatabaseProcess::sendToGameServer(uint32 serverId, GameNetworkMessage const &message)
{
std::hash_map<uint32, GameServerConnection *>::const_iterator i=gameServerConnections.find(serverId);
std::tr1::unordered_map<uint32, GameServerConnection *>::const_iterator i=gameServerConnections.find(serverId);
if (i!=gameServerConnections.end())
i->second->send(message,true);
else
@@ -10,7 +10,7 @@
// ======================================================================
#include <hash_map>
#include <tr1/unordered_map>
#include <set>
#include <string>
#include "sharedFoundation/NetworkIdArchive.h"
@@ -88,7 +88,7 @@ class DatabaseProcess : public MessageDispatch::Receiver
CommoditiesServerConnection * commoditiesConnection;
DatabaseMetricsData * m_metricsData;
std::hash_map<uint32, GameServerConnection *> gameServerConnections;
std::tr1::unordered_map<uint32, GameServerConnection *> gameServerConnections;
std::set<std::pair<std::string, unsigned short> > pendingGameServerConnections;
int m_queryExecCount;
@@ -51,6 +51,8 @@
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include "unicodeArchive/UnicodeArchive.h"
#include <algorithm>
// ======================================================================
Loader *Loader::ms_instance = NULL;
@@ -12,7 +12,7 @@
#include <map>
#include <string>
#include <hash_map>
#include <tr1/unordered_map>
#include <vector>
#include <set> //TODO: remove when we clean up newCharacterLock hack
@@ -105,7 +105,7 @@ class Persister : public MessageDispatch::Receiver
};
typedef std::map<uint32,Snapshot*> ServerSnapshotMap;
typedef std::hash_map<NetworkId,Snapshot*> ObjectSnapshotMap;
typedef std::tr1::unordered_map<NetworkId,Snapshot*> ObjectSnapshotMap;
typedef std::map<NetworkId,PendingCharacter> PendingCharactersType;
typedef std::vector<Snapshot*> SnapshotListType;
typedef std::set<uint32> NewCharacterLockType;
@@ -18,15 +18,15 @@
#include "sharedLog/Log.h"
#include "sharedObject/World.h"
#include <hash_map>
#include <tr1/unordered_map>
using namespace Scripting;
namespace AiMovementSwarmNamespace
{
typedef std::hash_map<CachedNetworkId, std::vector<AiMovementSwarm::CreatureWatcher>, CachedNetworkId> targetMap;
typedef std::hash_map<CachedNetworkId, Vector, CachedNetworkId> offsetMap;
typedef std::tr1::unordered_map<CachedNetworkId, std::vector<AiMovementSwarm::CreatureWatcher>, CachedNetworkId> targetMap;
typedef std::tr1::unordered_map<CachedNetworkId, Vector, CachedNetworkId> offsetMap;
// map of swarm targets to the creatures swarming them
targetMap s_swarmMap;
@@ -72,7 +72,7 @@ AiShipBehaviorAttackFighter::Maneuver::~Maneuver()
delete m_pathList;
m_currentPath = NULL;
//m_currentPath = NULL;
}
// ----------------------------------------------------------------------
@@ -590,8 +590,8 @@ static time_t s_timeMarketConnectionCre
static std::map<int, std::pair<CachedNetworkId, int> > s_queries;
static std::map<NetworkId, QueuedQuery *> s_queryTime;
static int s_nextRequestId;
static std::hash_map<NetworkId, ItemLoadPair, NetworkId::Hash> s_pendingLoads;
static std::hash_map<int, int> s_pendingAdds; //sequence to cost map
static std::tr1::unordered_map<NetworkId, ItemLoadPair, NetworkId::Hash> s_pendingLoads;
static std::tr1::unordered_map<int, int> s_pendingAdds; //sequence to cost map
// all money transactions transfer money out of or to the bank of the player and never to or from the vendor/bazaar location except bazaar sale fees
static const std::string COMMODITIES_NAMED_ACCOUNT("commodities_named_escrow_account");
@@ -1321,7 +1321,7 @@ void CommoditiesMarket::onAddAuction(int sequence, int32 result, const NetworkId
}
}
}
std::hash_map<int, int>::iterator f = s_pendingAdds.find(sequence);
std::tr1::unordered_map<int, int>::iterator f = s_pendingAdds.find(sequence);
int auctionFee = 0;
if (f != s_pendingAdds.end())
{
@@ -2488,7 +2488,7 @@ void CommoditiesMarket::checkPendingLoads(const NetworkId &itemId)
if (!ConfigServerGame::getCommoditiesMarketEnabled())
return;
LOG("AuctionRetrieval", ("CommoditiesMarket::response from DB for loading object %s for retrieval", itemId.getValueString().c_str()));
std::hash_map<NetworkId, ItemLoadPair, NetworkId::Hash>::iterator f = s_pendingLoads.find(itemId);
std::tr1::unordered_map<NetworkId, ItemLoadPair, NetworkId::Hash>::iterator f = s_pendingLoads.find(itemId);
if (f != s_pendingLoads.end())
{
CreatureObject *player = dynamic_cast<CreatureObject *>(NetworkIdManager::getObjectById((*f).second.ownerId));
@@ -10,7 +10,7 @@
#include "sharedCommandParser/CommandParser.h"
#include <map>
#include <hash_set>
#include <tr1/unordered_set>
#include "UnicodeUtils.h"
// ======================================================================
@@ -18,7 +18,7 @@ class ConsoleCommandParserDefault : public CommandParser
{
public:
typedef std::map<String_t, String_t> AliasMap_t;
typedef std::hash_set<String_t> AliasGuardSet_t;
typedef std::tr1::unordered_set<String_t> AliasGuardSet_t;
explicit ConsoleCommandParserDefault (void);
@@ -520,7 +520,7 @@ bool ConsoleCommandParserServer::performParsing (const NetworkId & userId, const
sprintf(
count,
"Sphere id=[%lu] origin=[%f, %f, %f] radius=[%f] OID=[%s] %s\n",
reinterpret_cast<unsigned long>(i),
std::distance(results.begin(), i),//reinterpret_cast<unsigned long>(i),
(*i).second.getCenter().x,
(*i).second.getCenter().y,
(*i).second.getCenter().z,
@@ -556,7 +556,7 @@ bool ConsoleCommandParserServer::performParsing (const NetworkId & userId, const
sprintf(
count,
"Sphere id=[%lu] origin=[%f, %f, %f] radius=[%f] OID=[%s] %s\n",
reinterpret_cast<unsigned long>(i),
std::distance(results.begin(), i),
(*i).second.getCenter().x,
(*i).second.getCenter().y,
(*i).second.getCenter().z,
@@ -36,6 +36,7 @@
#include "sharedObject/AlterResult.h"
#include "sharedObject/NetworkIdManager.h"
#include <limits>
#include <map>
// ======================================================================
@@ -487,7 +487,7 @@ bool ShipController::face(Vector const & goalPosition_w, float elapsedTime)
Vector const upPoint_w = shipTransform.getPosition_p() + Vector::unitY;
Vector const upPoint_o = shipTransform.rotateTranslate_p2l(upPoint_w);
float d2 = sqrt(sqr(upPoint_o.x) + sqr(upPoint_o.y));
float phi2 = atan2(d2,abs(upPoint_o.z));
float phi2 = atan2(d2,std::abs(upPoint_o.z));
if(phi2 > convertDegreesToRadians(10.f))
{
@@ -16,6 +16,7 @@
#include "sharedFoundation/NetworkIdArchive.h"
#include "sharedLog/Log.h"
#include "sharedNetworkMessages/GenericValueTypeMessage.h"
#include <algorithm>
#include <queue>
#include <cstdio>
@@ -33,7 +33,8 @@
#include "sharedObject/NetworkIdManager.h"
#include "sharedSkillSystem/SkillManager.h"
#include "sharedSkillSystem/SkillObject.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <limits>
#include <map>
#include <vector>
@@ -19,7 +19,7 @@
#include "sharedObject/CachedNetworkId.h"
#include "sharedObject/Object.h"
#include "unicodeArchive/UnicodeArchive.h"
#include <hash_set>
#include <tr1/unordered_set>
#include <map>
class ConnectionServerConnection;
@@ -128,12 +128,12 @@ public:
return (reinterpret_cast<const size_t>(ptr) >> 4);
};
};
typedef std::hash_set<ServerObject*, ServerObjectPointerHash> ObservingList;
typedef std::tr1::unordered_set<ServerObject*, ServerObjectPointerHash> ObservingList;
// objects being observed that are in this list needs
// to have their pvp status updated when there are changes
// that requires pvp status to be recalcuclated
typedef std::hash_set<TangibleObject*, TangibleObjectPointerHash> ObservingListPvpSync;
typedef std::tr1::unordered_set<TangibleObject*, TangibleObjectPointerHash> ObservingListPvpSync;
ObservingList const & getObserving() const;
ObservingListPvpSync const & getObservingPvpSync() const;
@@ -230,6 +230,8 @@
#include "swgSharedUtility/SpeciesRestrictions.h"
#include "unicodeArchive/UnicodeArchive.h"
#include <limits>
//-----------------------------------------------------------------------
//#undef PROFILE_INDIVIDUAL_MESSAGES
@@ -3643,9 +3645,9 @@ bool GameServer::requestSceneWarp(const CachedNetworkId &objectId, const std::st
// clamp destination if in space
if ( !strncmp(sceneName.c_str(), "space_", 6)
&& ( abs(newPosition_w.x) > 8000.f
|| abs(newPosition_w.y) > 8000.f
|| abs(newPosition_w.z) > 8000.f))
&& ( std::abs(newPosition_w.x) > 8000.f
|| std::abs(newPosition_w.y) > 8000.f
|| std::abs(newPosition_w.z) > 8000.f))
{
WARNING(true, ("Tried to warp object %s outside of space zone boundaries (%g,%g,%g)", object->getDebugInformation().c_str(), newPosition_w.x, newPosition_w.y, newPosition_w.z));
destPosition_w.set(
@@ -3706,9 +3708,9 @@ bool GameServer::requestSceneWarp(const CachedNetworkId &objectId, const std::st
// clamp destination if in space
if ( !strncmp(sceneName.c_str(), "space_", 6)
&& ( abs(newPosition_w.x) > 8000.f
|| abs(newPosition_w.y) > 8000.f
|| abs(newPosition_w.z) > 8000.f))
&& ( std::abs(newPosition_w.x) > 8000.f
|| std::abs(newPosition_w.y) > 8000.f
|| std::abs(newPosition_w.z) > 8000.f))
{
WARNING(true, ("Tried to warp object %s outside of space zone boundaries (%g,%g,%g)", object->getDebugInformation().c_str(), newPosition_w.x, newPosition_w.y, newPosition_w.z));
destPosition_w.set(
@@ -62,7 +62,7 @@ class GameServer :
public MessageDispatch::Receiver
{
public:
typedef stdhash_map<NetworkId, Client *, NetworkId::Hash>::fwd ClientMap;
typedef stdunordered_map<NetworkId, Client *, NetworkId::Hash>::fwd ClientMap;
typedef stdvector<ConnectionServerConnection *>::fwd ConnectionServerVector;
virtual ~GameServer ();
@@ -25,14 +25,14 @@
#include "sharedObject/Container.h"
#include <queue>
#include <map>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
static bool s_installed;
static Scheduler *s_logoutTrackerScheduler;
static std::queue<NetworkId> s_logoutCallbacks;
static std::hash_map<NetworkId, int, NetworkId::Hash> s_logoutCallbacksCount;
static std::tr1::unordered_map<NetworkId, int, NetworkId::Hash> s_logoutCallbacksCount;
namespace LogoutTrackerNamespace
{
@@ -76,7 +76,7 @@ void LogoutTracker::add(NetworkId const &networkId)
// when they go off, and only when the last 3 minute timer goes off do we remove him from the
// world, which is the desired behavior of leaving a disconnected character in the world for
// 3 minutes before removing him from the world
std::hash_map<NetworkId, int, NetworkId::Hash>::iterator iter = s_logoutCallbacksCount.find(networkId);
std::tr1::unordered_map<NetworkId, int, NetworkId::Hash>::iterator iter = s_logoutCallbacksCount.find(networkId);
if (iter == s_logoutCallbacksCount.end())
{
s_logoutCallbacksCount[networkId] = 1;
@@ -97,7 +97,7 @@ void LogoutTracker::handleLogoutCallback(const void *context)
UNREF(context);
NetworkId const &networkId = s_logoutCallbacks.front();
std::hash_map<NetworkId, int, NetworkId::Hash>::iterator iter = s_logoutCallbacksCount.find(networkId);
std::tr1::unordered_map<NetworkId, int, NetworkId::Hash>::iterator iter = s_logoutCallbacksCount.find(networkId);
// only process the *LAST* logout callback that is put into the logout callback
// queue for this object as the previous ones are no longer applicable
@@ -80,7 +80,7 @@ namespace MessageToQueueNamespace
private:
CachedNetworkId m_networkId;
unsigned long m_deliveryTime;
SchedulerItem & operator= (SchedulerItem const &); //disable
//SchedulerItem & operator= (SchedulerItem const &); //disable
};
typedef std::map<NetworkId, uint32> LastKnownLocationsType;
@@ -191,7 +191,7 @@ void MoveSimManager::checkApplySimulation (CreatureObject & creature)
creature.setController (msc);
creature.scheduleForAlter ();
if (!std::find (s_moveSimCreatures.begin (), s_moveSimCreatures.end (), id))
if (std::find (s_moveSimCreatures.begin (), s_moveSimCreatures.end (), id) != s_moveSimCreatures.end())
s_moveSimCreatures.push_back (id);
REPORT_LOG_PRINT (true, ("MoveSimManager [%ld] applied simulation to [%s]\n", GameServer::getInstance ().getProcessId (), id.getValueString ().c_str ()));
@@ -78,7 +78,7 @@ Vector NewbieTutorial::getTutorialLocation()
{
x = s_tutorialSpacing*Random::random(s_sqrtMaxTutorials-1) - s_tutorialMapWidth/2.0f;
z = s_tutorialSpacing*Random::random(s_sqrtMaxTutorials-1) - s_tutorialMapWidth/2.0f;
} while (abs(x) < 300.0f || abs(z) < 300.0f);
} while (std::abs(x) < 300.0f || std::abs(z) < 300.0f);
return Vector(x, 0.0f, z);
}
@@ -135,7 +135,7 @@ void ServerBuildoutManager::install()
for (std::vector<BuildoutArea>::const_iterator i = buildoutAreas.begin(); i != buildoutAreas.end(); ++i)
{
s_areas.push_back();
s_areas.push_back(AreaInfo());
AreaInfo &areaInfo = s_areas.back();
areaInfo.buildoutArea = *i;
areaInfo.loaded = false;
@@ -458,7 +458,7 @@ void ServerBuildoutManagerNamespace::generateBuildoutData(float x1, float z1, fl
packedScriptList += (*j).getScriptName();
}
serverRows.push_back();
serverRows.push_back(ServerBuildoutAreaRow());
ServerBuildoutAreaRow &serverRow = serverRows.back();
serverRow.id = static_cast< int >( obj->getNetworkId().getValue() );
@@ -494,7 +494,7 @@ void ServerBuildoutManagerNamespace::generateBuildoutData(float x1, float z1, fl
if (!serverOnly)
{
clientRows.push_back();
clientRows.push_back(ClientBuildoutAreaRow());
ClientBuildoutAreaRow &clientRow = clientRows.back();
clientRow.id = serverRow.id;
@@ -46,6 +46,7 @@
#include "sharedUtility/DataTable.h"
#include "sharedUtility/DataTableManager.h"
#include <algorithm>
#include <limits>
// ======================================================================
@@ -23,7 +23,7 @@
#include "sharedFoundation/FormattedString.h"
#include "sharedNetworkMessages/ChatRoomData.h"
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -89,7 +89,7 @@ public:
};
};
typedef stdhash_set<const BuildingObject *, BuildingObjectPointerHash>::fwd AllBuildingsSet;
typedef stdunordered_set<const BuildingObject *, BuildingObjectPointerHash>::fwd AllBuildingsSet;
static const AllBuildingsSet & getAllBuildings();
protected:
@@ -182,7 +182,8 @@
#include "sharedUtility/ValueDictionary.h"
#include <algorithm>
#include <deque>
#include <hash_set>
#include <limits>
#include <tr1/unordered_set>
#include <set>
//----------------------------------------------------------------------
@@ -625,7 +626,7 @@ float CreatureAttitude::operator-(CreatureAttitude const &other) const
if (m_fearState != other.m_fearState)
result += 30.0f;
for (int i = 0; i < MentalStates::NumberOfMentalStates; ++i)
result += abs(m_currentValues[i] - other.m_currentValues[i]);
result += std::abs(m_currentValues[i] - other.m_currentValues[i]);
return result;
}
@@ -651,9 +652,9 @@ bool MonitoredCreatureMovement::operator!=(MonitoredCreatureMovement const &othe
float MonitoredCreatureMovement::operator-(MonitoredCreatureMovement const &other) const
{
return abs(m_lastDistance - other.m_lastDistance)
+ abs(m_skittishness - other.m_skittishness)
+ abs(m_curve - other.m_curve);
return std::abs(m_lastDistance - other.m_lastDistance)
+ std::abs(m_skittishness - other.m_skittishness)
+ std::abs(m_curve - other.m_curve);
}
// ======================================================================
@@ -7717,7 +7718,7 @@ void CreatureObject::reportMonitoredCreatures(float time)
{
percent = -percent;
}
float absCurve = abs(i->second.m_curve);
float absCurve = std::abs(i->second.m_curve);
float scale = pow(percent, absCurve) * (1+absCurve);
float speedScale = float(sqrt(approachVelocity / getRunSpeed()));
float fearDelta = approach * i->second.m_skittishness * speedScale * scale;
@@ -519,7 +519,7 @@ public:
};
};
typedef stdhash_set<const CreatureObject *, CreatureObjectPointerHash>::fwd AllCreaturesSet;
typedef stdunordered_set<const CreatureObject *, CreatureObjectPointerHash>::fwd AllCreaturesSet;
static const AllCreaturesSet & getAllCreatures();
bool monitorCreatureMovement(const CachedNetworkId &ofTarget, float i_skittishness, float i_curve);
@@ -379,7 +379,7 @@ float InstallationObject::getOutOfPowerTime(void) const
void InstallationObject::setPowerRate(float rate)
{
// don't do anything if we're not really changing the rate
if (abs(rate - m_powerRate.get()) < 0.01f)
if (std::abs(rate - m_powerRate.get()) < 0.01f)
return;
if (isAuthoritative())
@@ -67,7 +67,7 @@ public:
};
};
typedef stdhash_set<const InstallationObject *, InstallationObjectPointerHash>::fwd AllInstallationsSet;
typedef stdunordered_set<const InstallationObject *, InstallationObjectPointerHash>::fwd AllInstallationsSet;
static const AllInstallationsSet & getAllInstallations();
protected:
@@ -39,6 +39,7 @@
#include "sharedUtility/DataTable.h"
#include "sharedUtility/DataTableManager.h"
#include <climits>
// ======================================================================
@@ -92,6 +92,7 @@
#include "sharedUtility/LocationArchive.h"
#include "UnicodeUtils.h"
#include <limits>
#include <list>
const SharedObjectTemplate * PlayerObject::m_defaultSharedTemplate = NULL;
@@ -6210,8 +6211,7 @@ void PlayerObject::setAutoVariableFromByteStream(const std::string & name, const
for (std::vector<Commands>::const_iterator questIter = quests.begin(); questIter != quests.end(); ++questIter)
{
if (questIter)
m_quests.set(questIter->key, questIter->value);
m_quests.set(questIter->key, questIter->value);
}
}
else if(name == "completedQuests")
@@ -4172,9 +4172,9 @@ void ServerObject::teleportObject(Vector const &position_w, NetworkId const &tar
// clamp destination if in space
if ( ServerWorld::isSpaceScene()
&& ( abs(position_w.x) > 8000.f
|| abs(position_w.y) > 8000.f
|| abs(position_w.z) > 8000.f))
&& ( std::abs(position_w.x) > 8000.f
|| std::abs(position_w.y) > 8000.f
|| std::abs(position_w.z) > 8000.f))
{
WARNING(true, ("Tried to warp object %s outside of space zone boundaries (%g,%g,%g)", getDebugInformation().c_str(), position_w.x, position_w.y, position_w.z));
destPosition_w.set(
@@ -8393,11 +8393,11 @@ void ServerObject::stopListeningToAllBroadcastMessages()
else
{
// build list of all broadcasters this object is currently listening to
std::hash_set<NetworkId> broadcasters;
std::tr1::unordered_set<NetworkId> broadcasters;
for (BroadcastMap::const_iterator iter = m_broadcastBroadcasters.begin(); iter != m_broadcastBroadcasters.end(); ++iter)
IGNORE_RETURN(broadcasters.insert(iter->second));
for (std::hash_set<NetworkId>::const_iterator iter2 = broadcasters.begin(); iter2 != broadcasters.end(); ++iter2)
for (std::tr1::unordered_set<NetworkId>::const_iterator iter2 = broadcasters.begin(); iter2 != broadcasters.end(); ++iter2)
{
// need to send a message to the broadcaster if the broadcaster is not on this game server
ServerObject * objBroadcaster = ServerWorld::findObjectByNetworkId(*iter2);
@@ -116,6 +116,7 @@
#include <cstdio>
#include <algorithm>
#include <limits>
#pragma warning(disable:4355)
@@ -18,7 +18,7 @@
#include "sharedDebug/Profiler.h"
#include "sharedObject/NetworkIdManager.h"
#include <algorithm>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -48,8 +48,8 @@ namespace TriggerVolumeNamespace
// optimization to track how many time a NetworkId appears
// in sources and targets, so that we can avoid unnecessarily
// searching the entire sources and targets vectors
std::hash_map<NetworkId, int> m_sourcesCount;
std::hash_map<NetworkId, int> m_targetsCount;
std::tr1::unordered_map<NetworkId, int> m_sourcesCount;
std::tr1::unordered_map<NetworkId, int> m_targetsCount;
};
// ----------------------------------------------------------------------
@@ -61,7 +61,7 @@ namespace TriggerVolumeNamespace
m_sources.push_back(source);
m_targets.push_back(target);
std::hash_map<NetworkId, int>::iterator i = m_sourcesCount.find(source);
std::tr1::unordered_map<NetworkId, int>::iterator i = m_sourcesCount.find(source);
if (i == m_sourcesCount.end())
m_sourcesCount[source] = 1;
else
@@ -80,7 +80,7 @@ namespace TriggerVolumeNamespace
{
// remove all entries from sources
// and targets for the specified id
std::hash_map<NetworkId, int>::iterator const iterCountSource = m_sourcesCount.find(id);
std::tr1::unordered_map<NetworkId, int>::iterator const iterCountSource = m_sourcesCount.find(id);
if (iterCountSource != m_sourcesCount.end())
{
int countSource = iterCountSource->second;
@@ -104,7 +104,7 @@ namespace TriggerVolumeNamespace
std::vector<NetworkId>::iterator targetsIter = m_targets.begin();
std::advance(targetsIter, index);
std::hash_map<NetworkId, int>::iterator const iterCountTarget = m_targetsCount.find(*targetsIter);
std::tr1::unordered_map<NetworkId, int>::iterator const iterCountTarget = m_targetsCount.find(*targetsIter);
if (iterCountTarget != m_targetsCount.end())
{
if (iterCountTarget->second <= 1)
@@ -128,7 +128,7 @@ namespace TriggerVolumeNamespace
m_sourcesCount.erase(iterCountSource);
}
std::hash_map<NetworkId, int>::iterator const iterCountTarget = m_targetsCount.find(id);
std::tr1::unordered_map<NetworkId, int>::iterator const iterCountTarget = m_targetsCount.find(id);
if (iterCountTarget != m_targetsCount.end())
{
int countTarget = iterCountTarget->second;
@@ -152,7 +152,7 @@ namespace TriggerVolumeNamespace
std::vector<NetworkId>::iterator sourcesIter = m_sources.begin();
std::advance(sourcesIter, index);
std::hash_map<NetworkId, int>::iterator const iterCountSource = m_sourcesCount.find(*sourcesIter);
std::tr1::unordered_map<NetworkId, int>::iterator const iterCountSource = m_sourcesCount.find(*sourcesIter);
if (iterCountSource != m_sourcesCount.end())
{
if (iterCountSource->second <= 1)
@@ -14,7 +14,7 @@
#include "sharedFoundation/NetworkId.h"
#include "sharedUtility/PooledString.h"
#include <hash_set>
#include <tr1/unordered_set>
// ======================================================================
@@ -40,7 +40,7 @@ public:
};
};
typedef std::hash_set<ServerObject *, ServerObjectPointerHash> ContentsSet;
typedef std::tr1::unordered_set<ServerObject *, ServerObjectPointerHash> ContentsSet;
void addObject(ServerObject &object);
void addEventSource(NetworkId const &source);
@@ -14,6 +14,8 @@
#include "serverGame/ServerWeaponObjectTemplate.h"
#include "sharedGame/SharedWeaponObjectTemplate.h"
#include <climits>
class NetworkId;
/**
@@ -21,7 +21,7 @@
//@END TFD TEMPLATE REFS
#include <stdio.h>
#include <hash_map>
#include <tr1/unordered_map>
const std::string DefaultString("");
const StringId DefaultStringId("", 0);
@@ -30,7 +30,7 @@ const TriggerVolumeData DefaultTriggerVolumeData;
bool ServerObjectTemplate::ms_allowDefaultTemplateParams = true;
typedef std::hash_map<ServerObjectTemplate::XpTypes, std::string, std::hash<int> > XP_MAP;
typedef std::tr1::unordered_map<ServerObjectTemplate::XpTypes, std::string, std::tr1::hash<int> > XP_MAP;
static XP_MAP * XpMap = NULL;
@@ -35,6 +35,8 @@
#include "sharedUtility/DataTable.h"
#include "sharedUtility/DataTableManager.h"
#include <limits>
// ======================================================================
namespace PvpNamespace
@@ -18,8 +18,8 @@
#include "sharedLog/Log.h"
#include "sharedNetworkMessages/UpdatePvpStatusMessage.h"
#include <hash_map>
#include <hash_set>
#include <tr1/unordered_map>
#include <tr1/unordered_set>
// ======================================================================
@@ -41,12 +41,12 @@ namespace PvpUpdateObserverNamespace
};
};
std::hash_set<TangibleObject const *, TangibleObjectPointerHash> s_activeUpdaters;
std::tr1::unordered_set<TangibleObject const *, TangibleObjectPointerHash> s_activeUpdaters;
typedef std::hash_map<Client const *, std::hash_map<NetworkId, std::pair<uint32, uint32> >, ClientObjectPointerHash> PvpUpdateObserverCache;
typedef std::tr1::unordered_map<Client const *, std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> >, ClientObjectPointerHash> PvpUpdateObserverCache;
PvpUpdateObserverCache s_pvpUpdateObserverCache;
typedef std::hash_map<Client const *, std::hash_set<NetworkId>, ClientObjectPointerHash> PvpUpdateObserverRequestsThisFrame;
typedef std::tr1::unordered_map<Client const *, std::tr1::unordered_set<NetworkId>, ClientObjectPointerHash> PvpUpdateObserverRequestsThisFrame;
PvpUpdateObserverRequestsThisFrame s_pvpUpdateObserverRequestsThisFrame;
// PvpUpdateObserver can be called multiple times per frame for the same object,
@@ -57,10 +57,10 @@ namespace PvpUpdateObserverNamespace
// so as an optimization, we'll only iterate over these 2 lists once per frame,
// and then just watch on individual updates to these 2 lists afterwards, and
// process the individual updates to these 2 lists when the updates occur
std::hash_set<NetworkId> s_objectsProcessedThisFrame;
std::hash_set<Client const *, ClientObjectPointerHash> s_clientsProcessedThisFrame;
std::tr1::unordered_set<NetworkId> s_objectsProcessedThisFrame;
std::tr1::unordered_set<Client const *, ClientObjectPointerHash> s_clientsProcessedThisFrame;
void sendUpdatePvpStatusMessage(Client const & client, std::hash_set<NetworkId> const & requestedNetworkId, std::hash_map<NetworkId, std::pair<uint32, uint32> > & cachedNetworkId);
void sendUpdatePvpStatusMessage(Client const & client, std::tr1::unordered_set<NetworkId> const & requestedNetworkId, std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> > & cachedNetworkId);
}
using namespace PvpUpdateObserverNamespace;
@@ -86,7 +86,7 @@ PvpUpdateObserver::PvpUpdateObserver(TangibleObject const *who, Archive::AutoDel
std::set<Client *> const &clients = who->getObservers();
for (std::set<Client *>::const_iterator i = clients.begin(); i != clients.end(); ++i)
{
std::hash_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[*i];
std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[*i];
if (pvpUpdateObserverCache.count(who->getNetworkId()) == 0)
{
uint32 flags, factionId;
@@ -104,8 +104,8 @@ PvpUpdateObserver::PvpUpdateObserver(TangibleObject const *who, Archive::AutoDel
Client * const client = who->getClient();
if (client && (s_clientsProcessedThisFrame.count(client) == 0))
{
std::hash_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client];
std::hash_set<NetworkId> & pvpUpdateObserverRequestsThisFrame = s_pvpUpdateObserverRequestsThisFrame[client];
std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client];
std::tr1::unordered_set<NetworkId> & pvpUpdateObserverRequestsThisFrame = s_pvpUpdateObserverRequestsThisFrame[client];
Client::ObservingListPvpSync const &objs = client->getObservingPvpSync();
for (Client::ObservingListPvpSync::const_iterator i = objs.begin(); i != objs.end(); ++i)
@@ -218,7 +218,7 @@ void PvpUpdateObserver::startObservingPvpSyncNotification(Client const *client,
if ((s_objectsProcessedThisFrame.count(who.getNetworkId()) != 0) || (s_clientsProcessedThisFrame.count(client) != 0))
{
std::hash_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client];
std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client];
if (pvpUpdateObserverCache.count(who.getNetworkId()) == 0)
{
uint32 flags, factionId;
@@ -274,14 +274,14 @@ void PvpUpdateObserver::update()
// ----------------------------------------------------------------------
void PvpUpdateObserverNamespace::sendUpdatePvpStatusMessage(Client const & client, std::hash_set<NetworkId> const & requestedNetworkId, std::hash_map<NetworkId, std::pair<uint32, uint32> > & cachedNetworkId)
void PvpUpdateObserverNamespace::sendUpdatePvpStatusMessage(Client const & client, std::tr1::unordered_set<NetworkId> const & requestedNetworkId, std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> > & cachedNetworkId)
{
uint32 flags, factionId;
ServerObject const * serverObject;
TangibleObject const * tangibleObject;
std::hash_map<NetworkId, std::pair<uint32, uint32> >::iterator iterCacheNetworkId;
std::tr1::unordered_map<NetworkId, std::pair<uint32, uint32> >::iterator iterCacheNetworkId;
for (std::hash_set<NetworkId>::const_iterator iterRequestedNetworkId = requestedNetworkId.begin(); iterRequestedNetworkId != requestedNetworkId.end(); ++iterRequestedNetworkId)
for (std::tr1::unordered_set<NetworkId>::const_iterator iterRequestedNetworkId = requestedNetworkId.begin(); iterRequestedNetworkId != requestedNetworkId.end(); ++iterRequestedNetworkId)
{
iterCacheNetworkId = cachedNetworkId.find(*iterRequestedNetworkId);
if (iterCacheNetworkId == cachedNetworkId.end())
@@ -25,6 +25,7 @@
#include "sharedTerrain/TerrainObject.h"
#include "sharedUtility/DataTable.h"
#include <limits>
#include <list>
#include <map>
#include <set>
@@ -16,7 +16,7 @@
#include "sharedObject/NetworkIdManager.h"
#include <algorithm>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -37,7 +37,7 @@ namespace SpaceVisibilityManager_namespace
typedef std::set<Client*> ClientSet;
typedef std::set<TrackedObject*> ObjectSet;
typedef std::map<Client*, TrackedObject*> ClientToObjectMapType;
typedef std::hash_map<NetworkId, TrackedObject*> TrackedObjectsType;
typedef std::tr1::unordered_map<NetworkId, TrackedObject*> TrackedObjectsType;
// Classes
@@ -16,13 +16,13 @@
#include "AuctionData.h"
#ifndef max
#define max(a, b) ((a > b) ? a : b)
#endif
#ifndef min
#define min(a, b) ((a < b) ? a : b)
#endif
//#ifndef max
// #define max(a, b) ((a > b) ? a : b)
//#endif
//
//#ifndef min
// #define min(a, b) ((a < b) ? a : b)
//#endif
enum AuctionSearchType
{
@@ -12,6 +12,7 @@
#include "sharedDebug/PerformanceTimer.h"
#include <algorithm>
#include <list>
typedef std::list< ServerPathBuilder * > BuildQueue;
@@ -28,6 +28,7 @@
#include "serverGame/ServerObject.h"
#include <algorithm>
#include <climits>
#ifdef _WIN32
@@ -9,7 +9,7 @@
#ifndef _INCLUDED_ScriptFuncTable_H
#define _INCLUDED_ScriptFuncTable_H
#include <hash_map>
#include <tr1/unordered_map>
namespace Scripting
{
@@ -495,7 +495,7 @@ struct ScriptFuncTable
const char *argList;
};
typedef std::hash_map< int, const ScriptFuncTable * > _ScriptFuncHashMap;
typedef std::tr1::unordered_map< int, const ScriptFuncTable * > _ScriptFuncHashMap;
extern _ScriptFuncHashMap *ScriptFuncHashMap;
extern void InitScriptFuncHashMap(void);
extern void RemoveScriptFuncHashMap(void);
@@ -19,6 +19,8 @@
#include "sharedGame/GameObjectTypes.h"
#include "swgSharedUtility/CombatEngineData.h"
#include <climits>
using namespace JNIWrappersNamespace;
@@ -2310,7 +2310,7 @@ jboolean JNICALL ScriptMethodsObjectInfoNamespace::isFacing(JNIEnv *env, jobject
Vector positionInObjectSpace = object->rotateTranslate_w2o (v);
real theta = positionInObjectSpace.theta ();
if (abs(theta) <= PI_OVER_4)
if (std::abs(theta) <= PI_OVER_4)
return JNI_TRUE;
else
return JNI_FALSE;
@@ -2559,7 +2559,7 @@ jboolean JNICALL ScriptMethodsObjectInfoNamespace::areFacingEachOther(JNIEnv *en
Vector positionInObjectSpace = object1->rotateTranslate_w2o (object2->getPosition_w());
real theta = positionInObjectSpace.theta ();
if (abs(theta) > PI_OVER_4)
if (std::abs(theta) > PI_OVER_4)
return JNI_FALSE;
else
{
@@ -2567,7 +2567,7 @@ jboolean JNICALL ScriptMethodsObjectInfoNamespace::areFacingEachOther(JNIEnv *en
Vector positionInObjectSpace2 = object2->rotateTranslate_w2o (object1->getPosition_w());
real theta2 = positionInObjectSpace2.theta ();
if (abs(theta2) > PI_OVER_4)
if (std::abs(theta2) > PI_OVER_4)
return JNI_FALSE;
else
return JNI_TRUE;
@@ -38,7 +38,7 @@
#include "serverUtility/FreeCtsDataTable.h"
#include "UnicodeUtils.h"
#include <hash_set>
#include <tr1/unordered_set>
using namespace JNIWrappersNamespace;
@@ -434,7 +434,7 @@ jboolean JNICALL ScriptMethodsPlayerAccountNamespace::isAccountQualifiedForHouse
UNREF(self);
NOT_NULL(env);
static std::hash_set<StationId> accountsQualifiedForHousePackup;
static std::tr1::unordered_set<StationId> accountsQualifiedForHousePackup;
if (accountsQualifiedForHousePackup.empty())
{
DataTable * table = DataTableManager::getTable(ConfigServerGame::getHousePackupAccountListDataTableName(), true);
@@ -23,6 +23,9 @@
#include "sharedSkillSystem/SkillObject.h"
#include "UnicodeUtils.h"
#include <climits>
using namespace JNIWrappersNamespace;
@@ -1,5 +1,5 @@
//#include "FirstGame.h"
#include <hash_map> //without this we get an internal compiler error
//#include <hash_map> //without this we get an internal compiler error
// This resolves a problem with stlport compiling under gcc 2.91 that ships with RedHat 6.2.
// Basically, the compiler has trouble instantiating an instance of _Stl_prime<bool> without it
@@ -53,6 +53,5 @@ target_link_libraries(DataTableTool
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -60,6 +60,5 @@ target_link_libraries(TemplateCompiler
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -60,6 +60,5 @@ target_link_libraries(TemplateDefinitionCompiler
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -913,7 +913,7 @@ void BuildConvexHull ( VertexList const & verts, VertexList & outPoly )
int count = verts.size();
BuildConvexHull( sortedVerts.begin(), count, outPoly );
BuildConvexHull( &sortedVerts.front(), count, outPoly );
}
// ----------------------------------------------------------------------
@@ -1512,7 +1512,7 @@ bool CalcAvoidancePoints3d ( Sphere const & mob, Vector const & delta, Sphere co
Vector I,J;
if(abs(K.y) > 0.95)
if(std::abs(K.y) > 0.95)
{
// line A-B is almost vertical, build orthonormal basis using X axis
@@ -1781,14 +1781,14 @@ bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProp
bool epsilonEqual ( Sphere const & A, Sphere const & B, float epsilon )
{
if(abs(A.getRadius() - B.getRadius()) > epsilon) return false;
if(std::abs(A.getRadius() - B.getRadius()) > epsilon) return false;
Vector cA = A.getCenter();
Vector cB = B.getCenter();
if(abs(cA.x - cB.x) > epsilon) return false;
if(abs(cA.y - cB.y) > epsilon) return false;
if(abs(cA.z - cB.z) > epsilon) return false;
if(std::abs(cA.x - cB.x) > epsilon) return false;
if(std::abs(cA.y - cB.y) > epsilon) return false;
if(std::abs(cA.z - cB.z) > epsilon) return false;
return true;
}
@@ -718,9 +718,9 @@ Range ProjectAxis ( Line3d const & L, AxialBox const & B )
Vector const & N = L.getNormal();
Vector extent = B.getDelta();
real x = abs( Collision3d::ComponentAlong( Vector::unitX, N ) ) * extent.x;
real y = abs( Collision3d::ComponentAlong( Vector::unitY, N ) ) * extent.y;
real z = abs( Collision3d::ComponentAlong( Vector::unitZ, N ) ) * extent.z;
real x = std::abs( Collision3d::ComponentAlong( Vector::unitX, N ) ) * extent.x;
real y = std::abs( Collision3d::ComponentAlong( Vector::unitY, N ) ) * extent.y;
real z = std::abs( Collision3d::ComponentAlong( Vector::unitZ, N ) ) * extent.z;
real d = x + y + z;
@@ -735,9 +735,9 @@ Range ProjectAxis ( Line3d const & L, OrientedBox const & B )
{
Vector const & N = L.getNormal();
real x = abs( Collision3d::ComponentAlong( B.getAxisX(), N ) ) * B.getExtentX();
real y = abs( Collision3d::ComponentAlong( B.getAxisY(), N ) ) * B.getExtentY();
real z = abs( Collision3d::ComponentAlong( B.getAxisZ(), N ) ) * B.getExtentZ();
real x = std::abs( Collision3d::ComponentAlong( B.getAxisX(), N ) ) * B.getExtentX();
real y = std::abs( Collision3d::ComponentAlong( B.getAxisY(), N ) ) * B.getExtentY();
real z = std::abs( Collision3d::ComponentAlong( B.getAxisZ(), N ) ) * B.getExtentZ();
real d = x + y + z;
@@ -32,6 +32,8 @@
#include "sharedObject/Portal.h"
#include "sharedObject/Tweakable.h"
#include <algorithm>
static VectorArgb gs_forceFieldColor(0.6f,0.5f,0.5f,1.0f);
// ======================================================================
@@ -1614,7 +1614,7 @@ bool FloorMesh::findFloorTri ( FloorLocator const & testLoc,
// ----------
if(abs(dist) < gs_hopTolerance)
if(std::abs(dist) < gs_hopTolerance)
{
// Floor tri is above the test point but within the hop
// tolerance and we're allowing hops - we can hop up onto it.
@@ -2911,7 +2911,7 @@ PathWalkResult FloorMesh::pathWalkCircleGetIds ( FloorLocator const & inStartLoc
{
float stepDistance = delta.magnitude();
float contactDist = abs(stepDistance * circleHitTime);
float contactDist = std::abs(stepDistance * circleHitTime);
if((circleHitTime < 0) && (contactDist > wallEpsilon))
{
@@ -3619,8 +3619,8 @@ bool FloorMesh::dropTest ( FloorLocator const & testLoc, float hopHeight, FloorL
if( findClosestPair(line,-1,closestBelow,closestAbove) )
{
float distBelow = abs(closestBelow.getOffset());
float distAbove = abs(closestAbove.getOffset());
float distBelow = std::abs(closestBelow.getOffset());
float distAbove = std::abs(closestAbove.getOffset());
closestAbove.setSurface(this);
closestBelow.setSurface(this);
@@ -3701,7 +3701,7 @@ bool FloorMesh::dropTest ( FloorLocator const & testLoc, int triID, FloorLocator
if(testIntersect(line,triID,tempLoc))
{
float absDist = abs(tempLoc.getOffset());
float absDist = std::abs(tempLoc.getOffset());
if(absDist <= ConfigSharedCollision::getHopHeight())
{
@@ -461,7 +461,7 @@ bool TestTriTri ( Triangle3d const & A, Triangle3d const & B )
bool TestSpherePlane ( Sphere const & A, Plane3d const & B )
{
float dist = abs(Distance3d::DistancePointPlane(A.getCenter(),B));
float dist = std::abs(Distance3d::DistancePointPlane(A.getCenter(),B));
return dist <= A.getRadius();
}
@@ -14,6 +14,8 @@
#include "sharedDatabaseInterface/NullEncodedUnicodeString.h"
#include "sharedLog/Log.h"
#include <climits>
using namespace DB;
// ======================================================================
@@ -11,6 +11,7 @@
#include "sharedDatabaseInterface/DbServer.h"
#include <string>
#include <climits>
// ======================================================================
@@ -14,6 +14,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
#include <cstddef>
#include <map>
#include <vector>
@@ -17,7 +17,7 @@
#include <vector>
#include <list>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -89,7 +89,7 @@ protected:
ReferenceCountingData *referenceData;
};
typedef std::hash_map<void *, ObjectData, ptr_hash> ObjectMap;
typedef std::tr1::unordered_map<void *, ObjectData, ptr_hash> ObjectMap;
ObjectMap liveObjects;
};
@@ -14,6 +14,7 @@
#include "sharedFoundation/ConfigSharedFoundation.h"
#include "sharedSynchronization/Mutex.h"
#include <algorithm>
#include <map>
#include <vector>
@@ -156,6 +156,8 @@ inline size_t NetworkId::getHashValue () const
// STL standard hash function
namespace std
{
namespace tr1
{
template <>
struct hash<NetworkId> // stl standard hash
@@ -163,6 +165,6 @@ struct hash<NetworkId> // stl standard hash
size_t operator()(const NetworkId &x) const { return x.getHashValue(); }
};
}
}}
#endif
@@ -31,7 +31,7 @@
// ======================================================================
// grab stlport configuration
#include "stl/config/features.h" // uncomment for newer stlport versions
//#include "stl/config/features.h" // uncomment for newer stlport versions
//#include "stl/_config.h"
namespace std
@@ -42,7 +42,7 @@ namespace std
template <class _T1> struct hash;
template <class _Tp> class allocator;
template <class _CharT, class _Traits, class _Alloc> class basic_string;
template <class _CharT> class char_traits;
template <class _CharT> struct char_traits;
template <size_t _Nb> class bitset;
template <class _Tp, class _Alloc> class deque;
@@ -52,13 +52,36 @@ namespace std
template <class _Tp, class _Sequence> class stack;
template <class _Tp, class _Container, class _Compare> class priority_queue;
template <class _Key, class _Tp, class _Compare, class _Alloc> class map;
template <class _Key, class _Tp, class _HashFcn, class _Compare, class _Alloc> class hash_map;
//template <class _Key, class _Tp, class _HashFcn, class _Compare, class _Alloc> class hash_map;
template <class _Key, class _Tp, class _Compare, class _Alloc> class multimap;
template <class _Key, class _Compare, class _Alloc> class set;
template <class _Key, class _HashFcn, class _Compare, class _Alloc> class hash_set;
//template <class _Key, class _HashFcn, class _Compare, class _Alloc> class hash_set;
template <class _Key, class _Compare, class _Alloc> class multiset;
typedef basic_string<char, char_traits<char>, allocator<char> > string;
namespace tr1
{
template <class _T1> struct hash;
template <class _Key, class _Tp, class _Hash, class _Compare, class _Alloc> class unordered_map;
template <class _Key, class _Hash, class _Compare, class _Alloc> class unordered_set;
}
template <class ForwardIterator>
bool is_sorted (ForwardIterator first, ForwardIterator last)
{
if (first==last) return true;
ForwardIterator next = first;
while (++next!=last) {
if (*next<*first) // or, if (comp(*next,*first)) for version (2)
return false;
++first;
}
return true;
}
}
template <class _Tp, class _Alloc = std::allocator<_Tp> > struct stddeque
@@ -76,9 +99,14 @@ template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc
typedef std::map<_Key, _Tp, _Compare, _Alloc> fwd;
};
template <class _Key, class _Tp, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdhash_map
//template <class _Key, class _Tp, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdhash_map
//{
// typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
//};
template <class _Key, class _Tp, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdunordered_map
{
typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
typedef std::tr1::unordered_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
};
template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdmultimap
@@ -91,9 +119,14 @@ template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allo
typedef std::set<_Key, _Compare, _Alloc> fwd;
};
template <class _Key, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdhash_set
//template <class _Key, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdhash_set
//{
// typedef std::hash_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
//};
template <class _Key, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdunordered_set
{
typedef std::hash_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
typedef std::tr1::unordered_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
};
template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> > struct stdmultiset

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