From fac1f2c5ae8becad5e6ba35c22179843c47c9410 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 23 Jan 2014 00:16:13 -0700 Subject: [PATCH] Removed STLport requirement --- CMakeLists.txt | 4 - README.markdown | 8 -- cmake/FindSTLPort.cmake | 111 ------------------ .../application/Miff/src/CMakeLists.txt | 22 ---- .../CentralServer/src/CMakeLists.txt | 1 - .../src/shared/CentralServer.cpp | 4 +- .../CentralServer/src/shared/CentralServer.h | 6 +- .../application/ChatServer/src/CMakeLists.txt | 1 - .../ChatServer/src/shared/ChatInterface.cpp | 54 ++++----- .../ChatServer/src/shared/ChatInterface.h | 10 +- .../ChatServer/src/shared/ChatServer.cpp | 34 +++--- .../ChatServer/src/shared/ChatServer.h | 14 +-- .../ChatServer/src/shared/FirstChatServer.h | 2 +- .../CommoditiesServer/src/CMakeLists.txt | 1 - .../src/shared/AuctionBid.cpp | 12 +- .../src/shared/AuctionMarket.cpp | 3 +- .../ConnectionServer/src/CMakeLists.txt | 1 - .../src/shared/ClientConnection.cpp | 2 +- .../src/shared/ConnectionServer.h | 8 +- .../CustomerServiceServer/src/CMakeLists.txt | 1 - .../CustomerServiceServer/src/linux/main.cpp | 2 +- .../src/shared/CustomerServiceInterface.h | 2 +- .../src/shared/FirstCustomerServiceServer.h | 2 +- .../application/LogServer/src/CMakeLists.txt | 1 - .../application/LoginPing/src/CMakeLists.txt | 1 - .../LoginServer/src/CMakeLists.txt | 1 - .../src/shared/ClientConnection.cpp | 4 +- .../LoginServer/src/shared/LoginServer.h | 4 +- .../MetricsServer/src/CMakeLists.txt | 1 - .../PlanetServer/src/CMakeLists.txt | 1 - .../PlanetServer/src/shared/Scene.h | 10 +- .../ServerConsole/src/CMakeLists.txt | 1 - .../src/CMakeLists.txt | 1 - .../TaskManager/src/CMakeLists.txt | 1 - .../TaskManager/src/shared/GameConnection.cpp | 2 + .../TransferServer/src/CMakeLists.txt | 1 - .../src/shared/DatabaseProcess.cpp | 10 +- .../src/shared/DatabaseProcess.h | 4 +- .../serverDatabase/src/shared/Loader.cpp | 2 + .../serverDatabase/src/shared/Persister.h | 4 +- .../src/shared/ai/AiMovementSwarm.cpp | 6 +- .../AiShipBehaviorAttackFighter_Maneuver.cpp | 2 +- .../commoditiesMarket/CommoditiesMarket.cpp | 8 +- .../console/ConsoleCommandParserDefault.h | 4 +- .../console/ConsoleCommandParserServer.cpp | 4 +- .../controller/PlayerShipController.cpp | 1 + .../src/shared/controller/ShipController.cpp | 2 +- .../src/shared/core/AuthTransferTracker.cpp | 1 + .../src/shared/core/CharacterMatchManager.cpp | 3 +- .../serverGame/src/shared/core/Client.h | 6 +- .../serverGame/src/shared/core/GameServer.cpp | 14 ++- .../serverGame/src/shared/core/GameServer.h | 2 +- .../src/shared/core/LogoutTracker.cpp | 8 +- .../src/shared/core/MessageToQueue.cpp | 2 +- .../src/shared/core/MoveSimManager.cpp | 2 +- .../src/shared/core/NewbieTutorial.cpp | 2 +- .../src/shared/core/ServerBuildoutManager.cpp | 6 +- .../src/shared/core/VeteranRewardManager.cpp | 1 + .../src/shared/guild/GuildInterface.cpp | 2 +- .../src/shared/object/BuildingObject.h | 2 +- .../src/shared/object/CreatureObject.cpp | 13 +- .../src/shared/object/CreatureObject.h | 2 +- .../src/shared/object/InstallationObject.cpp | 2 +- .../src/shared/object/InstallationObject.h | 2 +- .../src/shared/object/IntangibleObject.cpp | 1 + .../src/shared/object/PlayerObject.cpp | 4 +- .../src/shared/object/ServerObject.cpp | 10 +- .../src/shared/object/TangibleObject.cpp | 1 + .../src/shared/object/TriggerVolume.cpp | 16 +-- .../src/shared/object/TriggerVolume.h | 4 +- .../src/shared/object/WeaponObject.h | 2 + .../objectTemplate/ServerObjectTemplate.cpp | 4 +- .../library/serverGame/src/shared/pvp/Pvp.cpp | 2 + .../src/shared/pvp/PvpUpdateObserver.cpp | 30 ++--- .../src/shared/space/SpaceSquad.cpp | 1 + .../shared/space/SpaceVisibilityManager.cpp | 4 +- .../gameCommoditiesServer/AuctionBase.h | 14 +-- .../src/shared/ServerPathBuildManager.cpp | 1 + .../src/shared/GameScriptObject.cpp | 1 + .../src/shared/ScriptFunctionTable.h | 4 +- .../src/shared/ScriptMethodsAttributes.cpp | 2 + .../src/shared/ScriptMethodsObjectInfo.cpp | 6 +- .../src/shared/ScriptMethodsPlayerAccount.cpp | 4 +- .../src/shared/ScriptMethodsSkill.cpp | 3 + .../serverUtility/src/linux/stlhack.cpp | 2 +- .../DataTableTool/src/CMakeLists.txt | 1 - .../TemplateCompiler/src/CMakeLists.txt | 1 - .../src/CMakeLists.txt | 1 - .../src/shared/core/CollisionUtils.cpp | 12 +- .../src/shared/core/Distance3d.cpp | 12 +- .../src/shared/core/DoorObject.cpp | 2 + .../src/shared/core/FloorMesh.cpp | 10 +- .../src/shared/core/Overlap3d.cpp | 2 +- .../src/shared/core/BufferString.cpp | 2 + .../src/shared/core/DbBindableDouble.cpp | 1 + .../sharedDebug/src/linux/DebugHelp.cpp | 1 + .../sharedDebug/src/shared/LeakFinder.h | 4 +- .../src/shared/MemoryBlockManager.cpp | 1 + .../sharedFoundation/src/shared/NetworkId.h | 4 +- .../src/shared/StlForwardDeclaration.h | 49 ++++++-- .../src/shared/combat/CombatDataTable.cpp | 6 +- .../core/DraftSchematicGroupManager.cpp | 2 + .../shared/core/SharedBuffBuilderManager.cpp | 1 + .../shared/core/SharedBuildoutAreaManager.cpp | 2 +- .../sharedGame/src/shared/object/Waypoint.cpp | 8 +- .../src/shared/space/ShipChassisSlotType.cpp | 4 +- .../src/shared/space/ShipComponentType.cpp | 4 +- .../src/shared/CompressedQuaternion.cpp | 12 +- .../sharedMath/src/shared/MxCifQuadTree.cpp | 2 + .../src/shared/PositionVertexIndexer.h | 4 +- .../sharedMath/src/shared/Rectangle2d.h | 4 +- .../sharedMath/src/shared/SphereTreeNode.h | 3 +- .../library/sharedMath/src/shared/Vector.cpp | 9 +- .../library/sharedMath/src/shared/Vector.h | 6 +- .../sharedMath/src/shared/core/MultiShape.cpp | 2 +- .../sharedMath/src/shared/core/RangeLoop.cpp | 2 +- .../src/shared/FirstSharedMessageDispatch.h | 2 +- .../src/shared/MessageManager.cpp | 18 +-- .../src/shared/Transceiver.h | 1 + .../src/shared/NetworkHandler.cpp | 3 +- .../sharedNetwork/src/win32/Address.cpp | 2 +- .../ClientMfdStatusUpdateMessage.cpp | 2 + .../MessageQueueCraftExperiment.h | 8 +- .../clientGameServer/MessageQueueCreateSaga.h | 4 +- .../src/shared/common/GameNetworkMessage.cpp | 8 +- .../src/shared/container/Container.cpp | 1 + .../customization/CustomizationData.cpp | 1 + .../src/shared/object/NetworkIdManager.cpp | 2 +- .../src/shared/object/NetworkIdManager.h | 2 +- .../sharedObject/src/shared/object/Object.cpp | 2 +- .../shared/portal/PortalPropertyTemplate.cpp | 2 +- .../src/shared/SkillManager.cpp | 2 +- .../src/shared/SkillManager.h | 4 +- .../src/shared/core/Filename.cpp | 2 + .../src/shared/core/TemplateData.h | 2 + .../ProceduralTerrainAppearance.cpp | 1 + .../SpaceTerrainAppearanceTemplate.h | 8 +- .../src/shared/object/TerrainObject.cpp | 4 +- .../sharedUtility/src/shared/DataTable.cpp | 2 +- .../sharedUtility/src/shared/DataTable.h | 3 +- .../src/shared/WorldSnapshotReaderWriter.cpp | 4 +- .../src/shared/WorldSnapshotReaderWriter.h | 2 +- .../CSAssist/utils/Unicode/UnicodeBlocks.cpp | 2 + .../utils/Unicode/UnicodeCharacterDataMap.cpp | 1 + .../Unicode/UnicodeBlocks.cpp | 2 + .../Unicode/UnicodeCharacterDataMap.cpp | 1 + .../soePlatform/ChatAPI/utils/Base/Base64.cpp | 4 +- .../ChatAPI/utils/Base/CmdLine.cpp | 3 +- .../ChatAPI/utils/Unicode/UnicodeBlocks.cpp | 2 + .../utils/Unicode/UnicodeCharacterDataMap.cpp | 1 + .../utils2.0/utils/Api/apiTypeNameValuePair.h | 1 + .../VChatAPI/utils2.0/utils/Base/Base64.cpp | 3 +- .../utils2.0/utils/Base/basicConfig.cpp | 3 +- .../VChatAPI/utils2.0/utils/Base/cmdLine.cpp | 3 +- .../VChatAPI/utils2.0/utils/Base/pid.cpp | 1 + .../utils2.0/utils/Base/serializeClasses.h | 3 +- .../utils2.0/utils/Base/serializeTemplates.h | 1 + .../utils2.0/utils/Base/stringutils.cpp | 10 +- .../library/archive/src/shared/ByteStream.cpp | 1 + .../src/shared/LocalizationManager.h | 6 +- .../src/shared/LocalizedStringTable.cpp | 2 + .../localization/src/shared/StringId.cpp | 1 + .../ours/library/unicode/src/shared/Unicode.h | 21 ++++ .../unicode/src/shared/UnicodeBlocks.cpp | 2 + .../src/shared/UnicodeCharacterDataMap.cpp | 1 + .../library/unicode/src/shared/UnicodeUtils.h | 2 + .../SwgDatabaseServer/src/CMakeLists.txt | 1 - .../src/shared/buffers/IndexedTableBuffer.h | 4 +- .../src/shared/buffers/MarketAuctionsBuffer.h | 10 +- .../src/shared/core/ObjvarNameManager.cpp | 2 +- .../src/shared/core/ObjvarNameManager.h | 4 +- .../SwgGameServer/src/CMakeLists.txt | 1 - .../src/shared/object/JediManagerObject.cpp | 1 + 173 files changed, 454 insertions(+), 479 deletions(-) delete mode 100644 cmake/FindSTLPort.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b2b0eba..223e4cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.markdown b/README.markdown index 7d146493..b9ff1724 100644 --- a/README.markdown +++ b/README.markdown @@ -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 diff --git a/cmake/FindSTLPort.cmake b/cmake/FindSTLPort.cmake deleted file mode 100644 index 850af8c5..00000000 --- a/cmake/FindSTLPort.cmake +++ /dev/null @@ -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) - diff --git a/engine/client/application/Miff/src/CMakeLists.txt b/engine/client/application/Miff/src/CMakeLists.txt index 4b8ddde9..18a17744 100644 --- a/engine/client/application/Miff/src/CMakeLists.txt +++ b/engine/client/application/Miff/src/CMakeLists.txt @@ -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} ) diff --git a/engine/server/application/CentralServer/src/CMakeLists.txt b/engine/server/application/CentralServer/src/CMakeLists.txt index fa0fc6f2..338554da 100644 --- a/engine/server/application/CentralServer/src/CMakeLists.txt +++ b/engine/server/application/CentralServer/src/CMakeLists.txt @@ -190,6 +190,5 @@ target_link_libraries(CentralServer localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp index 9cc4068b..ec59cdf1 100644 --- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp +++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp @@ -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()); } } diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.h b/engine/server/application/CentralServer/src/shared/CentralServer.h index 04fa237f..39b0fc93 100644 --- a/engine/server/application/CentralServer/src/shared/CentralServer.h +++ b/engine/server/application/CentralServer/src/shared/CentralServer.h @@ -7,7 +7,7 @@ //----------------------------------------------------------------------- #pragma warning(disable : 4100) -#include +#include #include #include #include @@ -61,10 +61,10 @@ public: private: typedef std::vector ConnectionServerConnectionList; typedef std::map CentralObjectMap; - typedef std::hash_multimap SceneGameMap; + typedef std::tr1::unordered_multimap SceneGameMap; typedef std::pair ServersList; - typedef std::hash_map ConnectionServerSUIDMap; + typedef std::tr1::unordered_map ConnectionServerSUIDMap; typedef std::map > PlayerSceneMapType; diff --git a/engine/server/application/ChatServer/src/CMakeLists.txt b/engine/server/application/ChatServer/src/CMakeLists.txt index cfe6e0cc..669d7e10 100644 --- a/engine/server/application/ChatServer/src/CMakeLists.txt +++ b/engine/server/application/ChatServer/src/CMakeLists.txt @@ -102,6 +102,5 @@ target_link_libraries(ChatServer unicodeArchive ChatMono VChatAPI - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp index 3c7cacd9..1f23c456 100644 --- a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp +++ b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp @@ -89,7 +89,7 @@ namespace ChatInterfaceNamespace static int s_maxHeadersToSendToClientPerInterval; // to prevent sending duplicate room chat message - std::hash_map > s_mostRecentRoomChatMessage; + std::tr1::unordered_map > 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::iterator f = roomList.find(lowerRoomName); + std::tr1::unordered_map::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::const_iterator f = roomList.find(lowerRoomName); + std::tr1::unordered_map::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::iterator p = pendingAvatars.begin(); + std::tr1::unordered_map::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::iterator i; + std::tr1::unordered_map::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::iterator f = pendingAvatars.find(id.name); + std::tr1::unordered_map::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 & ChatInterface::getRoomList() const +const std::tr1::unordered_map & ChatInterface::getRoomList() const { return roomList; } @@ -618,7 +618,7 @@ const std::hash_map & ChatInterface::getRoomLi void ChatInterface::updateRooms() { - std::hash_map::const_iterator i; + std::tr1::unordered_map::const_iterator i; for(i = roomList.begin(); i != roomList.end(); ++i) { ChatServerRoomOwner & roomOwner = const_cast((*i).second); @@ -656,7 +656,7 @@ void ChatInterface::requestRoomList(const NetworkId & id, ConnectionServerConnec ++roomQueriesThisFrame; - std::hash_map::const_iterator i; + std::tr1::unordered_map::const_iterator i; std::vector 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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = pendingAvatars.find(failedAvatarId.name); + std::tr1::unordered_map::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::iterator f = pendingAvatars.find(id.name); + std::tr1::unordered_map::iterator f = pendingAvatars.find(id.name); if(f != pendingAvatars.end()) { GenericValueTypeMessage 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::Hash >::iterator df = deferredChatMessages.find((*f).second); + std::tr1::unordered_map, NetworkId::Hash >::iterator df = deferredChatMessages.find((*f).second); if(df != deferredChatMessages.end()) { std::vector & 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::const_iterator f = roomList.find(lowerRoomName); + std::tr1::unordered_map::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::const_iterator f = roomList.find(lowerName); + std::tr1::unordered_map::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::iterator f = roomList.begin(); + std::tr1::unordered_map::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::iterator f = roomList.find(lowerName); + std::tr1::unordered_map::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::iterator f = roomList.find(lowerName); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator const f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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::iterator f = roomList.find(toLower(roomName)); + std::tr1::unordered_map::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 >::iterator const iterFind = s_mostRecentRoomChatMessage.find(destAvatarId); + std::tr1::unordered_map >::iterator const iterFind = s_mostRecentRoomChatMessage.find(destAvatarId); if (iterFind != s_mostRecentRoomChatMessage.end()) { if ((iterFind->second.first == destRoomId) && (iterFind->second.second == messageID)) diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.h b/engine/server/application/ChatServer/src/shared/ChatInterface.h index 79e97a5e..65403040 100644 --- a/engine/server/application/ChatServer/src/shared/ChatInterface.h +++ b/engine/server/application/ChatServer/src/shared/ChatInterface.h @@ -12,7 +12,7 @@ #include "ChatServerAvatarOwner.h" #include "ChatServerRoomOwner.h" #include -#include +#include #include #include #include @@ -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 & getRoomList () const; + const std::tr1::unordered_map & getRoomList () const; const ChatServerRoomOwner *getRoomOwner(const std::string &roomName); ChatServerRoomOwner *getRoomOwner(unsigned roomId); @@ -157,11 +157,11 @@ public: private: std::map avatarMap; - std::hash_map pendingAvatars; + std::tr1::unordered_map pendingAvatars; std::set pendingRoomQueries; int roomQueriesThisFrame; - std::hash_map roomList; - std::hash_map, NetworkId::Hash > deferredChatMessages; + std::tr1::unordered_map roomList; + std::tr1::unordered_map, NetworkId::Hash > deferredChatMessages; std::map > > queuedHeaders; std::map, int> > trackingRequestGetAnyAvatarForDestroy; }; diff --git a/engine/server/application/ChatServer/src/shared/ChatServer.cpp b/engine/server/application/ChatServer/src/shared/ChatServer.cpp index 22a017e7..7361930b 100644 --- a/engine/server/application/ChatServer/src/shared/ChatServer.cpp +++ b/engine/server/application/ChatServer/src/shared/ChatServer.cpp @@ -71,7 +71,7 @@ namespace ChatServerNamespace ChatServerMetricsData * s_chatServerMetricsData = 0; typedef std::list > MessageList; - typedef std::hash_map PlayerMessageList; + typedef std::tr1::unordered_map 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::const_iterator f = instance().clientMap.find(id); + std::tr1::unordered_map::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::iterator f = server.pendingRequests.find(trackId); + std::tr1::unordered_map::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::iterator f = server.pendingRequests.find(trackId); + std::tr1::unordered_map::iterator f = server.pendingRequests.find(trackId); if(f != server.pendingRequests.end()) { id = (*f).second; - std::hash_map::const_iterator c = server.clientMap.find((*f).second); + std::tr1::unordered_map::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::iterator f = instance().gameServerConnectionMap.find(sequence); + std::tr1::unordered_map::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 removeKeyList; - std::hash_map::const_iterator i; + std::tr1::unordered_map::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::iterator f = instance().clientMap.find(characterId); + std::tr1::unordered_map::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::iterator cf = instance().clientMap.find(networkId); + std::tr1::unordered_map::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::const_iterator i; + std::tr1::unordered_map::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::iterator cf = instance().clientMap.find(id); + std::tr1::unordered_map::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::const_iterator f = instance().chatInterface->getRoomList().find(lowerName); + std::tr1::unordered_map::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::const_iterator f = instance().chatInterface->getRoomList().find(lowerName); + std::tr1::unordered_map::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 tmpList = instance().clientMap; - std::hash_map::const_iterator i; + std::tr1::unordered_map tmpList = instance().clientMap; + std::tr1::unordered_map::const_iterator i; for(i = tmpList.begin(); i != tmpList.end(); ++i) { if((*i).second == target) disconnectPlayer((*i).first); - std::hash_map::iterator f = instance().clientMap.find((*i).first); + std::tr1::unordered_map::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::iterator f = m_gameServerConnectionRegistry.find(sequence); + std::tr1::unordered_map::iterator f = m_gameServerConnectionRegistry.find(sequence); if(f != m_gameServerConnectionRegistry.end()) { result = (*f).second; diff --git a/engine/server/application/ChatServer/src/shared/ChatServer.h b/engine/server/application/ChatServer/src/shared/ChatServer.h index dc79ab20..017773a3 100644 --- a/engine/server/application/ChatServer/src/shared/ChatServer.h +++ b/engine/server/application/ChatServer/src/shared/ChatServer.h @@ -11,7 +11,7 @@ #include "ChatAPI/ChatAPI.h" #include "sharedFoundation/NetworkId.h" #include "sharedNetworkMessages/ChatAvatarId.h" -#include +#include #include #include #include @@ -111,7 +111,7 @@ public: //----------------------------------------------------------------------- - std::hash_map pendingRequests; + std::tr1::unordered_map 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 ChatAvatarList; + typedef std::tr1::unordered_map ChatAvatarList; struct VoiceChatAvatarData @@ -234,7 +234,7 @@ private: std::string playerName; }; - typedef std::hash_map VoiceChatAvatarList; + typedef std::tr1::unordered_map VoiceChatAvatarList; static AvatarExtendedData * getAvatarExtendedDataByNetworkId(const NetworkId & id); @@ -243,8 +243,8 @@ private: ChatAvatarList chatAvatars; ChatInterface * chatInterface; VChatInterface * voiceChatInterface; - std::hash_map clientMap; - std::hash_map gameServerConnectionMap; + std::tr1::unordered_map clientMap; + std::tr1::unordered_map gameServerConnectionMap; std::set connectionServerConnections; bool done; @@ -255,7 +255,7 @@ private: static ChatServer * m_instance; CustomerServiceServerConnection *customerServiceServerConnection; - typedef std::hash_map GameServerMap; + typedef std::tr1::unordered_map GameServerMap; GameServerMap m_gameServerConnectionRegistry; VoiceChatAvatarList m_voiceChatIdMap; std::map m_voiceChatNameToIdMap; diff --git a/engine/server/application/ChatServer/src/shared/FirstChatServer.h b/engine/server/application/ChatServer/src/shared/FirstChatServer.h index 9f323402..c68be87c 100644 --- a/engine/server/application/ChatServer/src/shared/FirstChatServer.h +++ b/engine/server/application/ChatServer/src/shared/FirstChatServer.h @@ -27,7 +27,7 @@ namespace Archive #include "sharedFoundation/NetworkId.h" #include "sharedNetwork/Connection.h" #include "ChatAPI/ChatAPI.h" -#include +#include #include //----------------------------------------------------------------------- diff --git a/engine/server/application/CommoditiesServer/src/CMakeLists.txt b/engine/server/application/CommoditiesServer/src/CMakeLists.txt index e446e11c..8a5c9057 100644 --- a/engine/server/application/CommoditiesServer/src/CMakeLists.txt +++ b/engine/server/application/CommoditiesServer/src/CMakeLists.txt @@ -85,6 +85,5 @@ target_link_libraries(CommoditiesServer serverMetrics serverNetworkMessages serverUtility - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/CommoditiesServer/src/shared/AuctionBid.cpp b/engine/server/application/CommoditiesServer/src/shared/AuctionBid.cpp index a91526b4..b62a343c 100644 --- a/engine/server/application/CommoditiesServer/src/shared/AuctionBid.cpp +++ b/engine/server/application/CommoditiesServer/src/shared/AuctionBid.cpp @@ -14,8 +14,10 @@ #include "FirstCommodityServer.h" #include "AuctionBid.h" + #include + // ====================================================================== 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)); } // ====================================================================== diff --git a/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp b/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp index f5549484..11208577 100644 --- a/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp +++ b/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp @@ -4326,8 +4326,7 @@ void AuctionMarket::OnVendorStatusChange ( void static decodeOOB(const std::string & UTF8String, Unicode::String & UniString) { - - std::string::iterator c = const_cast (UTF8String.begin()); + std::string::const_iterator c = UTF8String.begin(); std::string tempstring; unsigned short unicharvalue; char * pEnd; diff --git a/engine/server/application/ConnectionServer/src/CMakeLists.txt b/engine/server/application/ConnectionServer/src/CMakeLists.txt index e6f93b51..27834dd8 100644 --- a/engine/server/application/ConnectionServer/src/CMakeLists.txt +++ b/engine/server/application/ConnectionServer/src/CMakeLists.txt @@ -104,6 +104,5 @@ target_link_libraries(ConnectionServer Base CommonAPI LoginAPI - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp index 892937fb..7f1cce1a 100644 --- a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp @@ -395,7 +395,7 @@ void ClientConnection::handleClientIdMessage(const ClientIdMsg& msg) m_suid = atoi(m_accountName.c_str()); if (m_suid == 0) { - std::hash h; + std::tr1::hash 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()); diff --git a/engine/server/application/ConnectionServer/src/shared/ConnectionServer.h b/engine/server/application/ConnectionServer/src/shared/ConnectionServer.h index 4d220497..7a18e783 100644 --- a/engine/server/application/ConnectionServer/src/shared/ConnectionServer.h +++ b/engine/server/application/ConnectionServer/src/shared/ConnectionServer.h @@ -6,7 +6,7 @@ //----------------------------------------------------------------------- -#include +#include #include #include @@ -40,9 +40,9 @@ class ConnectionServer : public MessageDispatch::Receiver ~ConnectionServer (); - typedef std::hash_map GameServerMap; - typedef std::hash_map ClientMap; - typedef std::hash_map SuidMap; + typedef std::tr1::unordered_map GameServerMap; + typedef std::tr1::unordered_map ClientMap; + typedef std::tr1::unordered_map SuidMap; typedef std::set FreeTrialsSet; static void addNewClient(ClientConnection* cconn, const NetworkId &oid, GameConnection* gconn, const std::string &sceneName, bool sendToStarport ); diff --git a/engine/server/application/CustomerServiceServer/src/CMakeLists.txt b/engine/server/application/CustomerServiceServer/src/CMakeLists.txt index 94ad317d..be0080a6 100644 --- a/engine/server/application/CustomerServiceServer/src/CMakeLists.txt +++ b/engine/server/application/CustomerServiceServer/src/CMakeLists.txt @@ -84,6 +84,5 @@ target_link_libraries(CustomerServiceServer unicode unicodeArchive CSAssist - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/CustomerServiceServer/src/linux/main.cpp b/engine/server/application/CustomerServiceServer/src/linux/main.cpp index 3c071fd6..5c5d7660 100644 --- a/engine/server/application/CustomerServiceServer/src/linux/main.cpp +++ b/engine/server/application/CustomerServiceServer/src/linux/main.cpp @@ -12,7 +12,7 @@ #include "sharedNetworkMessages/SetupSharedNetworkMessages.h" #include "sharedRandom/SetupSharedRandom.h" #include "sharedThread/SetupSharedThread.h" -#include +#include // ====================================================================== diff --git a/engine/server/application/CustomerServiceServer/src/shared/CustomerServiceInterface.h b/engine/server/application/CustomerServiceServer/src/shared/CustomerServiceInterface.h index 36acb978..07fc38bd 100644 --- a/engine/server/application/CustomerServiceServer/src/shared/CustomerServiceInterface.h +++ b/engine/server/application/CustomerServiceServer/src/shared/CustomerServiceInterface.h @@ -37,7 +37,7 @@ private: int m_pendingTicketCount; }; - typedef stdhash_map::fwd ClientConnectionMap; + typedef stdunordered_map::fwd ClientConnectionMap; typedef stdmap::fwd SuidToNetworkIdMap; typedef stdvector::fwd CategoryList; diff --git a/engine/server/application/CustomerServiceServer/src/shared/FirstCustomerServiceServer.h b/engine/server/application/CustomerServiceServer/src/shared/FirstCustomerServiceServer.h index 24edd4d1..2937cec5 100644 --- a/engine/server/application/CustomerServiceServer/src/shared/FirstCustomerServiceServer.h +++ b/engine/server/application/CustomerServiceServer/src/shared/FirstCustomerServiceServer.h @@ -12,7 +12,7 @@ #include "sharedFoundation/FirstSharedFoundation.h" #include "sharedFoundation/NetworkId.h" #include "sharedNetwork/Connection.h" -#include +#include #include //----------------------------------------------------------------------- diff --git a/engine/server/application/LogServer/src/CMakeLists.txt b/engine/server/application/LogServer/src/CMakeLists.txt index 5431ccbb..d1fe60d8 100644 --- a/engine/server/application/LogServer/src/CMakeLists.txt +++ b/engine/server/application/LogServer/src/CMakeLists.txt @@ -76,6 +76,5 @@ target_link_libraries(LogServer localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/LoginPing/src/CMakeLists.txt b/engine/server/application/LoginPing/src/CMakeLists.txt index c3dc5709..2fa5ec39 100644 --- a/engine/server/application/LoginPing/src/CMakeLists.txt +++ b/engine/server/application/LoginPing/src/CMakeLists.txt @@ -56,6 +56,5 @@ target_link_libraries(LoginPing sharedThread serverNetworkMessages archive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/LoginServer/src/CMakeLists.txt b/engine/server/application/LoginServer/src/CMakeLists.txt index 398d8da8..94910cb3 100644 --- a/engine/server/application/LoginServer/src/CMakeLists.txt +++ b/engine/server/application/LoginServer/src/CMakeLists.txt @@ -150,6 +150,5 @@ target_link_libraries(LoginServer CommonAPI LoginAPI MonAPI2 - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index e18508ee..7430d23e 100644 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -23,6 +23,8 @@ #include "sharedNetworkMessages/GenericValueTypeMessage.h" #include "sharedNetworkMessages/LoginEnumCluster.h" +#include + //----------------------------------------------------------------------- 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 h; + std::tr1::hash h; suid = h(id); //lint !e603 // Symbol 'h' not initialized (it's a functor) } diff --git a/engine/server/application/LoginServer/src/shared/LoginServer.h b/engine/server/application/LoginServer/src/shared/LoginServer.h index 00bc5ffa..2d9456ef 100644 --- a/engine/server/application/LoginServer/src/shared/LoginServer.h +++ b/engine/server/application/LoginServer/src/shared/LoginServer.h @@ -12,7 +12,7 @@ #include "sharedFoundation/StationId.h" #include "sharedMessageDispatch/Receiver.h" #include "sharedNetwork/Service.h" -#include +#include #include #include @@ -43,7 +43,7 @@ public: ClientConnection* getUnvalidatedClient (int clientId); void removeClient (int clientId); - const std::hash_map & getCentralServerMap_hide() const; + const std::tr1::unordered_map & getCentralServerMap_hide() const; bool deleteCharacter (uint32 clusterId, NetworkId const & characterId, StationId suid); diff --git a/engine/server/application/MetricsServer/src/CMakeLists.txt b/engine/server/application/MetricsServer/src/CMakeLists.txt index 5a068dfd..1133349b 100644 --- a/engine/server/application/MetricsServer/src/CMakeLists.txt +++ b/engine/server/application/MetricsServer/src/CMakeLists.txt @@ -71,6 +71,5 @@ target_link_libraries(MetricsServer unicode unicodeArchive MonAPI2 - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/PlanetServer/src/CMakeLists.txt b/engine/server/application/PlanetServer/src/CMakeLists.txt index b82d9021..9ffb704b 100644 --- a/engine/server/application/PlanetServer/src/CMakeLists.txt +++ b/engine/server/application/PlanetServer/src/CMakeLists.txt @@ -102,6 +102,5 @@ target_link_libraries(PlanetServer localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/PlanetServer/src/shared/Scene.h b/engine/server/application/PlanetServer/src/shared/Scene.h index 95c965a4..24bfbdd8 100644 --- a/engine/server/application/PlanetServer/src/shared/Scene.h +++ b/engine/server/application/PlanetServer/src/shared/Scene.h @@ -10,8 +10,8 @@ // ====================================================================== -#include -#include +#include +#include #include #include @@ -93,9 +93,9 @@ class Scene : public Singleton2, public MessageDispatch::Receiver Coordinates(); }; - typedef std::hash_map ObjectMapType; - typedef std::hash_set DeletedSetType; - typedef std::hash_map NodeMapType; + typedef std::tr1::unordered_map ObjectMapType; + typedef std::tr1::unordered_set DeletedSetType; + typedef std::tr1::unordered_map NodeMapType; private: std::string m_sceneId; diff --git a/engine/server/application/ServerConsole/src/CMakeLists.txt b/engine/server/application/ServerConsole/src/CMakeLists.txt index 594b790f..6bf5f9d6 100644 --- a/engine/server/application/ServerConsole/src/CMakeLists.txt +++ b/engine/server/application/ServerConsole/src/CMakeLists.txt @@ -50,6 +50,5 @@ target_link_libraries(ServerConsole sharedNetwork sharedNetworkMessages sharedThread - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/StationPlayersCollector/src/CMakeLists.txt b/engine/server/application/StationPlayersCollector/src/CMakeLists.txt index 63a77cd8..20912987 100644 --- a/engine/server/application/StationPlayersCollector/src/CMakeLists.txt +++ b/engine/server/application/StationPlayersCollector/src/CMakeLists.txt @@ -69,6 +69,5 @@ target_link_libraries(StationPlayersCollector serverUtility archive unicode - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/TaskManager/src/CMakeLists.txt b/engine/server/application/TaskManager/src/CMakeLists.txt index 1db7a259..2a744604 100644 --- a/engine/server/application/TaskManager/src/CMakeLists.txt +++ b/engine/server/application/TaskManager/src/CMakeLists.txt @@ -102,6 +102,5 @@ target_link_libraries(TaskManager localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/application/TaskManager/src/shared/GameConnection.cpp b/engine/server/application/TaskManager/src/shared/GameConnection.cpp index c0ea39e5..d297a6dd 100644 --- a/engine/server/application/TaskManager/src/shared/GameConnection.cpp +++ b/engine/server/application/TaskManager/src/shared/GameConnection.cpp @@ -15,6 +15,8 @@ #include "sharedNetworkMessages/GenericValueTypeMessage.h" #include "ProcessSpawner.h" +#include + //----------------------------------------------------------------------- namespace GameConnectionNamespace diff --git a/engine/server/application/TransferServer/src/CMakeLists.txt b/engine/server/application/TransferServer/src/CMakeLists.txt index 5626bc22..024c5369 100644 --- a/engine/server/application/TransferServer/src/CMakeLists.txt +++ b/engine/server/application/TransferServer/src/CMakeLists.txt @@ -78,6 +78,5 @@ target_link_libraries(TransferServer unicode unicodeArchive CTServiceGameAPI - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp index 2bdfa93a..8435b366 100644 --- a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp +++ b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp @@ -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::const_iterator j = gameServerConnections.find(processId); + std::tr1::unordered_map::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::const_iterator j = gameServerConnections.find(processId); + std::tr1::unordered_map::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 &processIds) const { - for (std::hash_map::const_iterator i = gameServerConnections.begin(); i != gameServerConnections.end(); ++i) + for (std::tr1::unordered_map::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::const_iterator i=gameServerConnections.begin(); i!=gameServerConnections.end(); ++i) + for (std::tr1::unordered_map::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::const_iterator i=gameServerConnections.find(serverId); + std::tr1::unordered_map::const_iterator i=gameServerConnections.find(serverId); if (i!=gameServerConnections.end()) i->second->send(message,true); else diff --git a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.h b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.h index 9ab24885..af47fb5b 100644 --- a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.h +++ b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.h @@ -10,7 +10,7 @@ // ====================================================================== -#include +#include #include #include #include "sharedFoundation/NetworkIdArchive.h" @@ -88,7 +88,7 @@ class DatabaseProcess : public MessageDispatch::Receiver CommoditiesServerConnection * commoditiesConnection; DatabaseMetricsData * m_metricsData; - std::hash_map gameServerConnections; + std::tr1::unordered_map gameServerConnections; std::set > pendingGameServerConnections; int m_queryExecCount; diff --git a/engine/server/library/serverDatabase/src/shared/Loader.cpp b/engine/server/library/serverDatabase/src/shared/Loader.cpp index a03476e9..fb4b5a6c 100644 --- a/engine/server/library/serverDatabase/src/shared/Loader.cpp +++ b/engine/server/library/serverDatabase/src/shared/Loader.cpp @@ -51,6 +51,8 @@ #include "sharedNetworkMessages/GenericValueTypeMessage.h" #include "unicodeArchive/UnicodeArchive.h" +#include + // ====================================================================== Loader *Loader::ms_instance = NULL; diff --git a/engine/server/library/serverDatabase/src/shared/Persister.h b/engine/server/library/serverDatabase/src/shared/Persister.h index b4e12afc..0b6dd8c8 100644 --- a/engine/server/library/serverDatabase/src/shared/Persister.h +++ b/engine/server/library/serverDatabase/src/shared/Persister.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include //TODO: remove when we clean up newCharacterLock hack @@ -105,7 +105,7 @@ class Persister : public MessageDispatch::Receiver }; typedef std::map ServerSnapshotMap; - typedef std::hash_map ObjectSnapshotMap; + typedef std::tr1::unordered_map ObjectSnapshotMap; typedef std::map PendingCharactersType; typedef std::vector SnapshotListType; typedef std::set NewCharacterLockType; diff --git a/engine/server/library/serverGame/src/shared/ai/AiMovementSwarm.cpp b/engine/server/library/serverGame/src/shared/ai/AiMovementSwarm.cpp index ec7713f1..74bb6b93 100644 --- a/engine/server/library/serverGame/src/shared/ai/AiMovementSwarm.cpp +++ b/engine/server/library/serverGame/src/shared/ai/AiMovementSwarm.cpp @@ -18,15 +18,15 @@ #include "sharedLog/Log.h" #include "sharedObject/World.h" -#include +#include using namespace Scripting; namespace AiMovementSwarmNamespace { - typedef std::hash_map, CachedNetworkId> targetMap; - typedef std::hash_map offsetMap; + typedef std::tr1::unordered_map, CachedNetworkId> targetMap; + typedef std::tr1::unordered_map offsetMap; // map of swarm targets to the creatures swarming them targetMap s_swarmMap; diff --git a/engine/server/library/serverGame/src/shared/behavior/AiShipBehaviorAttackFighter_Maneuver.cpp b/engine/server/library/serverGame/src/shared/behavior/AiShipBehaviorAttackFighter_Maneuver.cpp index 165b9864..17fa39ea 100644 --- a/engine/server/library/serverGame/src/shared/behavior/AiShipBehaviorAttackFighter_Maneuver.cpp +++ b/engine/server/library/serverGame/src/shared/behavior/AiShipBehaviorAttackFighter_Maneuver.cpp @@ -72,7 +72,7 @@ AiShipBehaviorAttackFighter::Maneuver::~Maneuver() delete m_pathList; - m_currentPath = NULL; + //m_currentPath = NULL; } // ---------------------------------------------------------------------- diff --git a/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp b/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp index 0c6781ce..630df29a 100644 --- a/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp +++ b/engine/server/library/serverGame/src/shared/commoditiesMarket/CommoditiesMarket.cpp @@ -590,8 +590,8 @@ static time_t s_timeMarketConnectionCre static std::map > s_queries; static std::map s_queryTime; static int s_nextRequestId; -static std::hash_map s_pendingLoads; -static std::hash_map s_pendingAdds; //sequence to cost map +static std::tr1::unordered_map s_pendingLoads; +static std::tr1::unordered_map 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::iterator f = s_pendingAdds.find(sequence); + std::tr1::unordered_map::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::iterator f = s_pendingLoads.find(itemId); + std::tr1::unordered_map::iterator f = s_pendingLoads.find(itemId); if (f != s_pendingLoads.end()) { CreatureObject *player = dynamic_cast(NetworkIdManager::getObjectById((*f).second.ownerId)); diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserDefault.h b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserDefault.h index cd97c1eb..a1d859eb 100644 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserDefault.h +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserDefault.h @@ -10,7 +10,7 @@ #include "sharedCommandParser/CommandParser.h" #include -#include +#include #include "UnicodeUtils.h" // ====================================================================== @@ -18,7 +18,7 @@ class ConsoleCommandParserDefault : public CommandParser { public: typedef std::map AliasMap_t; - typedef std::hash_set AliasGuardSet_t; + typedef std::tr1::unordered_set AliasGuardSet_t; explicit ConsoleCommandParserDefault (void); diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp index d99af85f..f789d127 100644 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserServer.cpp @@ -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(i), + std::distance(results.begin(), i),//reinterpret_cast(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(i), + std::distance(results.begin(), i), (*i).second.getCenter().x, (*i).second.getCenter().y, (*i).second.getCenter().z, diff --git a/engine/server/library/serverGame/src/shared/controller/PlayerShipController.cpp b/engine/server/library/serverGame/src/shared/controller/PlayerShipController.cpp index 2d62f13d..9b0cec0e 100644 --- a/engine/server/library/serverGame/src/shared/controller/PlayerShipController.cpp +++ b/engine/server/library/serverGame/src/shared/controller/PlayerShipController.cpp @@ -36,6 +36,7 @@ #include "sharedObject/AlterResult.h" #include "sharedObject/NetworkIdManager.h" +#include #include // ====================================================================== diff --git a/engine/server/library/serverGame/src/shared/controller/ShipController.cpp b/engine/server/library/serverGame/src/shared/controller/ShipController.cpp index 7b397f12..3367476d 100644 --- a/engine/server/library/serverGame/src/shared/controller/ShipController.cpp +++ b/engine/server/library/serverGame/src/shared/controller/ShipController.cpp @@ -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)) { diff --git a/engine/server/library/serverGame/src/shared/core/AuthTransferTracker.cpp b/engine/server/library/serverGame/src/shared/core/AuthTransferTracker.cpp index dd024fed..18881fba 100644 --- a/engine/server/library/serverGame/src/shared/core/AuthTransferTracker.cpp +++ b/engine/server/library/serverGame/src/shared/core/AuthTransferTracker.cpp @@ -16,6 +16,7 @@ #include "sharedFoundation/NetworkIdArchive.h" #include "sharedLog/Log.h" #include "sharedNetworkMessages/GenericValueTypeMessage.h" +#include #include #include diff --git a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp index f2e5e340..2d4786e9 100644 --- a/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/CharacterMatchManager.cpp @@ -33,7 +33,8 @@ #include "sharedObject/NetworkIdManager.h" #include "sharedSkillSystem/SkillManager.h" #include "sharedSkillSystem/SkillObject.h" -#include +#include +#include #include #include diff --git a/engine/server/library/serverGame/src/shared/core/Client.h b/engine/server/library/serverGame/src/shared/core/Client.h index a8d429ee..4907e4d9 100644 --- a/engine/server/library/serverGame/src/shared/core/Client.h +++ b/engine/server/library/serverGame/src/shared/core/Client.h @@ -19,7 +19,7 @@ #include "sharedObject/CachedNetworkId.h" #include "sharedObject/Object.h" #include "unicodeArchive/UnicodeArchive.h" -#include +#include #include class ConnectionServerConnection; @@ -128,12 +128,12 @@ public: return (reinterpret_cast(ptr) >> 4); }; }; - typedef std::hash_set ObservingList; + typedef std::tr1::unordered_set 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 ObservingListPvpSync; + typedef std::tr1::unordered_set ObservingListPvpSync; ObservingList const & getObserving() const; ObservingListPvpSync const & getObservingPvpSync() const; diff --git a/engine/server/library/serverGame/src/shared/core/GameServer.cpp b/engine/server/library/serverGame/src/shared/core/GameServer.cpp index f061d4b2..cf3cb708 100644 --- a/engine/server/library/serverGame/src/shared/core/GameServer.cpp +++ b/engine/server/library/serverGame/src/shared/core/GameServer.cpp @@ -230,6 +230,8 @@ #include "swgSharedUtility/SpeciesRestrictions.h" #include "unicodeArchive/UnicodeArchive.h" +#include + //----------------------------------------------------------------------- //#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( diff --git a/engine/server/library/serverGame/src/shared/core/GameServer.h b/engine/server/library/serverGame/src/shared/core/GameServer.h index ca44785d..59743b7c 100644 --- a/engine/server/library/serverGame/src/shared/core/GameServer.h +++ b/engine/server/library/serverGame/src/shared/core/GameServer.h @@ -62,7 +62,7 @@ class GameServer : public MessageDispatch::Receiver { public: - typedef stdhash_map::fwd ClientMap; + typedef stdunordered_map::fwd ClientMap; typedef stdvector::fwd ConnectionServerVector; virtual ~GameServer (); diff --git a/engine/server/library/serverGame/src/shared/core/LogoutTracker.cpp b/engine/server/library/serverGame/src/shared/core/LogoutTracker.cpp index 6e647de7..e74a4322 100644 --- a/engine/server/library/serverGame/src/shared/core/LogoutTracker.cpp +++ b/engine/server/library/serverGame/src/shared/core/LogoutTracker.cpp @@ -25,14 +25,14 @@ #include "sharedObject/Container.h" #include #include -#include +#include // ====================================================================== static bool s_installed; static Scheduler *s_logoutTrackerScheduler; static std::queue s_logoutCallbacks; -static std::hash_map s_logoutCallbacksCount; +static std::tr1::unordered_map 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::iterator iter = s_logoutCallbacksCount.find(networkId); + std::tr1::unordered_map::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::iterator iter = s_logoutCallbacksCount.find(networkId); + std::tr1::unordered_map::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 diff --git a/engine/server/library/serverGame/src/shared/core/MessageToQueue.cpp b/engine/server/library/serverGame/src/shared/core/MessageToQueue.cpp index dc63ba9a..005a6260 100644 --- a/engine/server/library/serverGame/src/shared/core/MessageToQueue.cpp +++ b/engine/server/library/serverGame/src/shared/core/MessageToQueue.cpp @@ -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 LastKnownLocationsType; diff --git a/engine/server/library/serverGame/src/shared/core/MoveSimManager.cpp b/engine/server/library/serverGame/src/shared/core/MoveSimManager.cpp index 1cad1de3..bc67a91b 100644 --- a/engine/server/library/serverGame/src/shared/core/MoveSimManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/MoveSimManager.cpp @@ -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 ())); diff --git a/engine/server/library/serverGame/src/shared/core/NewbieTutorial.cpp b/engine/server/library/serverGame/src/shared/core/NewbieTutorial.cpp index 12726bb6..4388ad2a 100644 --- a/engine/server/library/serverGame/src/shared/core/NewbieTutorial.cpp +++ b/engine/server/library/serverGame/src/shared/core/NewbieTutorial.cpp @@ -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); } diff --git a/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp b/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp index dda89d33..f371ee83 100644 --- a/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/ServerBuildoutManager.cpp @@ -135,7 +135,7 @@ void ServerBuildoutManager::install() for (std::vector::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; diff --git a/engine/server/library/serverGame/src/shared/core/VeteranRewardManager.cpp b/engine/server/library/serverGame/src/shared/core/VeteranRewardManager.cpp index 06497c4b..c9bb11a0 100644 --- a/engine/server/library/serverGame/src/shared/core/VeteranRewardManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/VeteranRewardManager.cpp @@ -46,6 +46,7 @@ #include "sharedUtility/DataTable.h" #include "sharedUtility/DataTableManager.h" #include +#include // ====================================================================== diff --git a/engine/server/library/serverGame/src/shared/guild/GuildInterface.cpp b/engine/server/library/serverGame/src/shared/guild/GuildInterface.cpp index d09b8c13..6282ec5a 100644 --- a/engine/server/library/serverGame/src/shared/guild/GuildInterface.cpp +++ b/engine/server/library/serverGame/src/shared/guild/GuildInterface.cpp @@ -23,7 +23,7 @@ #include "sharedFoundation/FormattedString.h" #include "sharedNetworkMessages/ChatRoomData.h" -#include +#include // ====================================================================== diff --git a/engine/server/library/serverGame/src/shared/object/BuildingObject.h b/engine/server/library/serverGame/src/shared/object/BuildingObject.h index 36e3f245..ff58fef8 100644 --- a/engine/server/library/serverGame/src/shared/object/BuildingObject.h +++ b/engine/server/library/serverGame/src/shared/object/BuildingObject.h @@ -89,7 +89,7 @@ public: }; }; - typedef stdhash_set::fwd AllBuildingsSet; + typedef stdunordered_set::fwd AllBuildingsSet; static const AllBuildingsSet & getAllBuildings(); protected: diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index 6313f0e8..a776bc89 100644 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -182,7 +182,8 @@ #include "sharedUtility/ValueDictionary.h" #include #include -#include +#include +#include #include //---------------------------------------------------------------------- @@ -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; diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.h b/engine/server/library/serverGame/src/shared/object/CreatureObject.h index 93705f66..f2fb0607 100644 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.h +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.h @@ -519,7 +519,7 @@ public: }; }; - typedef stdhash_set::fwd AllCreaturesSet; + typedef stdunordered_set::fwd AllCreaturesSet; static const AllCreaturesSet & getAllCreatures(); bool monitorCreatureMovement(const CachedNetworkId &ofTarget, float i_skittishness, float i_curve); diff --git a/engine/server/library/serverGame/src/shared/object/InstallationObject.cpp b/engine/server/library/serverGame/src/shared/object/InstallationObject.cpp index 1094b3d5..a3f1127f 100644 --- a/engine/server/library/serverGame/src/shared/object/InstallationObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/InstallationObject.cpp @@ -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()) diff --git a/engine/server/library/serverGame/src/shared/object/InstallationObject.h b/engine/server/library/serverGame/src/shared/object/InstallationObject.h index 642ea0a6..742ae266 100644 --- a/engine/server/library/serverGame/src/shared/object/InstallationObject.h +++ b/engine/server/library/serverGame/src/shared/object/InstallationObject.h @@ -67,7 +67,7 @@ public: }; }; - typedef stdhash_set::fwd AllInstallationsSet; + typedef stdunordered_set::fwd AllInstallationsSet; static const AllInstallationsSet & getAllInstallations(); protected: diff --git a/engine/server/library/serverGame/src/shared/object/IntangibleObject.cpp b/engine/server/library/serverGame/src/shared/object/IntangibleObject.cpp index 0f9216a9..0f21840a 100644 --- a/engine/server/library/serverGame/src/shared/object/IntangibleObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/IntangibleObject.cpp @@ -39,6 +39,7 @@ #include "sharedUtility/DataTable.h" #include "sharedUtility/DataTableManager.h" +#include // ====================================================================== diff --git a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp index 39e6f335..76c64d74 100644 --- a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp @@ -92,6 +92,7 @@ #include "sharedUtility/LocationArchive.h" #include "UnicodeUtils.h" +#include #include const SharedObjectTemplate * PlayerObject::m_defaultSharedTemplate = NULL; @@ -6210,8 +6211,7 @@ void PlayerObject::setAutoVariableFromByteStream(const std::string & name, const for (std::vector::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") diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp index b32f84a9..b7cf15c6 100644 --- a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp @@ -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 broadcasters; + std::tr1::unordered_set broadcasters; for (BroadcastMap::const_iterator iter = m_broadcastBroadcasters.begin(); iter != m_broadcastBroadcasters.end(); ++iter) IGNORE_RETURN(broadcasters.insert(iter->second)); - for (std::hash_set::const_iterator iter2 = broadcasters.begin(); iter2 != broadcasters.end(); ++iter2) + for (std::tr1::unordered_set::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); diff --git a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp index 01283913..ba4dac2a 100644 --- a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp @@ -116,6 +116,7 @@ #include #include +#include #pragma warning(disable:4355) diff --git a/engine/server/library/serverGame/src/shared/object/TriggerVolume.cpp b/engine/server/library/serverGame/src/shared/object/TriggerVolume.cpp index b9251c57..2492a844 100644 --- a/engine/server/library/serverGame/src/shared/object/TriggerVolume.cpp +++ b/engine/server/library/serverGame/src/shared/object/TriggerVolume.cpp @@ -18,7 +18,7 @@ #include "sharedDebug/Profiler.h" #include "sharedObject/NetworkIdManager.h" #include -#include +#include // ====================================================================== @@ -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 m_sourcesCount; - std::hash_map m_targetsCount; + std::tr1::unordered_map m_sourcesCount; + std::tr1::unordered_map m_targetsCount; }; // ---------------------------------------------------------------------- @@ -61,7 +61,7 @@ namespace TriggerVolumeNamespace m_sources.push_back(source); m_targets.push_back(target); - std::hash_map::iterator i = m_sourcesCount.find(source); + std::tr1::unordered_map::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::iterator const iterCountSource = m_sourcesCount.find(id); + std::tr1::unordered_map::iterator const iterCountSource = m_sourcesCount.find(id); if (iterCountSource != m_sourcesCount.end()) { int countSource = iterCountSource->second; @@ -104,7 +104,7 @@ namespace TriggerVolumeNamespace std::vector::iterator targetsIter = m_targets.begin(); std::advance(targetsIter, index); - std::hash_map::iterator const iterCountTarget = m_targetsCount.find(*targetsIter); + std::tr1::unordered_map::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::iterator const iterCountTarget = m_targetsCount.find(id); + std::tr1::unordered_map::iterator const iterCountTarget = m_targetsCount.find(id); if (iterCountTarget != m_targetsCount.end()) { int countTarget = iterCountTarget->second; @@ -152,7 +152,7 @@ namespace TriggerVolumeNamespace std::vector::iterator sourcesIter = m_sources.begin(); std::advance(sourcesIter, index); - std::hash_map::iterator const iterCountSource = m_sourcesCount.find(*sourcesIter); + std::tr1::unordered_map::iterator const iterCountSource = m_sourcesCount.find(*sourcesIter); if (iterCountSource != m_sourcesCount.end()) { if (iterCountSource->second <= 1) diff --git a/engine/server/library/serverGame/src/shared/object/TriggerVolume.h b/engine/server/library/serverGame/src/shared/object/TriggerVolume.h index 11851752..509cf761 100644 --- a/engine/server/library/serverGame/src/shared/object/TriggerVolume.h +++ b/engine/server/library/serverGame/src/shared/object/TriggerVolume.h @@ -14,7 +14,7 @@ #include "sharedFoundation/NetworkId.h" #include "sharedUtility/PooledString.h" -#include +#include // ====================================================================== @@ -40,7 +40,7 @@ public: }; }; - typedef std::hash_set ContentsSet; + typedef std::tr1::unordered_set ContentsSet; void addObject(ServerObject &object); void addEventSource(NetworkId const &source); diff --git a/engine/server/library/serverGame/src/shared/object/WeaponObject.h b/engine/server/library/serverGame/src/shared/object/WeaponObject.h index 305ad128..95982635 100644 --- a/engine/server/library/serverGame/src/shared/object/WeaponObject.h +++ b/engine/server/library/serverGame/src/shared/object/WeaponObject.h @@ -14,6 +14,8 @@ #include "serverGame/ServerWeaponObjectTemplate.h" #include "sharedGame/SharedWeaponObjectTemplate.h" +#include + class NetworkId; /** diff --git a/engine/server/library/serverGame/src/shared/objectTemplate/ServerObjectTemplate.cpp b/engine/server/library/serverGame/src/shared/objectTemplate/ServerObjectTemplate.cpp index 718b680f..cbef50e9 100644 --- a/engine/server/library/serverGame/src/shared/objectTemplate/ServerObjectTemplate.cpp +++ b/engine/server/library/serverGame/src/shared/objectTemplate/ServerObjectTemplate.cpp @@ -21,7 +21,7 @@ //@END TFD TEMPLATE REFS #include -#include +#include const std::string DefaultString(""); const StringId DefaultStringId("", 0); @@ -30,7 +30,7 @@ const TriggerVolumeData DefaultTriggerVolumeData; bool ServerObjectTemplate::ms_allowDefaultTemplateParams = true; -typedef std::hash_map > XP_MAP; +typedef std::tr1::unordered_map > XP_MAP; static XP_MAP * XpMap = NULL; diff --git a/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp b/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp index d705d1cf..4de849cd 100644 --- a/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp +++ b/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp @@ -35,6 +35,8 @@ #include "sharedUtility/DataTable.h" #include "sharedUtility/DataTableManager.h" +#include + // ====================================================================== namespace PvpNamespace diff --git a/engine/server/library/serverGame/src/shared/pvp/PvpUpdateObserver.cpp b/engine/server/library/serverGame/src/shared/pvp/PvpUpdateObserver.cpp index 094ccdb9..aa61690d 100644 --- a/engine/server/library/serverGame/src/shared/pvp/PvpUpdateObserver.cpp +++ b/engine/server/library/serverGame/src/shared/pvp/PvpUpdateObserver.cpp @@ -18,8 +18,8 @@ #include "sharedLog/Log.h" #include "sharedNetworkMessages/UpdatePvpStatusMessage.h" -#include -#include +#include +#include // ====================================================================== @@ -41,12 +41,12 @@ namespace PvpUpdateObserverNamespace }; }; - std::hash_set s_activeUpdaters; + std::tr1::unordered_set s_activeUpdaters; - typedef std::hash_map >, ClientObjectPointerHash> PvpUpdateObserverCache; + typedef std::tr1::unordered_map >, ClientObjectPointerHash> PvpUpdateObserverCache; PvpUpdateObserverCache s_pvpUpdateObserverCache; - typedef std::hash_map, ClientObjectPointerHash> PvpUpdateObserverRequestsThisFrame; + typedef std::tr1::unordered_map, 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 s_objectsProcessedThisFrame; - std::hash_set s_clientsProcessedThisFrame; + std::tr1::unordered_set s_objectsProcessedThisFrame; + std::tr1::unordered_set s_clientsProcessedThisFrame; - void sendUpdatePvpStatusMessage(Client const & client, std::hash_set const & requestedNetworkId, std::hash_map > & cachedNetworkId); + void sendUpdatePvpStatusMessage(Client const & client, std::tr1::unordered_set const & requestedNetworkId, std::tr1::unordered_map > & cachedNetworkId); } using namespace PvpUpdateObserverNamespace; @@ -86,7 +86,7 @@ PvpUpdateObserver::PvpUpdateObserver(TangibleObject const *who, Archive::AutoDel std::set const &clients = who->getObservers(); for (std::set::const_iterator i = clients.begin(); i != clients.end(); ++i) { - std::hash_map > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[*i]; + std::tr1::unordered_map > & 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 > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client]; - std::hash_set & pvpUpdateObserverRequestsThisFrame = s_pvpUpdateObserverRequestsThisFrame[client]; + std::tr1::unordered_map > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client]; + std::tr1::unordered_set & 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 > & pvpUpdateObserverCache = s_pvpUpdateObserverCache[client]; + std::tr1::unordered_map > & 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 const & requestedNetworkId, std::hash_map > & cachedNetworkId) +void PvpUpdateObserverNamespace::sendUpdatePvpStatusMessage(Client const & client, std::tr1::unordered_set const & requestedNetworkId, std::tr1::unordered_map > & cachedNetworkId) { uint32 flags, factionId; ServerObject const * serverObject; TangibleObject const * tangibleObject; - std::hash_map >::iterator iterCacheNetworkId; + std::tr1::unordered_map >::iterator iterCacheNetworkId; - for (std::hash_set::const_iterator iterRequestedNetworkId = requestedNetworkId.begin(); iterRequestedNetworkId != requestedNetworkId.end(); ++iterRequestedNetworkId) + for (std::tr1::unordered_set::const_iterator iterRequestedNetworkId = requestedNetworkId.begin(); iterRequestedNetworkId != requestedNetworkId.end(); ++iterRequestedNetworkId) { iterCacheNetworkId = cachedNetworkId.find(*iterRequestedNetworkId); if (iterCacheNetworkId == cachedNetworkId.end()) diff --git a/engine/server/library/serverGame/src/shared/space/SpaceSquad.cpp b/engine/server/library/serverGame/src/shared/space/SpaceSquad.cpp index 10d6fc60..332188c6 100644 --- a/engine/server/library/serverGame/src/shared/space/SpaceSquad.cpp +++ b/engine/server/library/serverGame/src/shared/space/SpaceSquad.cpp @@ -25,6 +25,7 @@ #include "sharedTerrain/TerrainObject.h" #include "sharedUtility/DataTable.h" +#include #include #include #include diff --git a/engine/server/library/serverGame/src/shared/space/SpaceVisibilityManager.cpp b/engine/server/library/serverGame/src/shared/space/SpaceVisibilityManager.cpp index e64fafaf..54f7e147 100644 --- a/engine/server/library/serverGame/src/shared/space/SpaceVisibilityManager.cpp +++ b/engine/server/library/serverGame/src/shared/space/SpaceVisibilityManager.cpp @@ -16,7 +16,7 @@ #include "sharedObject/NetworkIdManager.h" #include -#include +#include // ====================================================================== @@ -37,7 +37,7 @@ namespace SpaceVisibilityManager_namespace typedef std::set ClientSet; typedef std::set ObjectSet; typedef std::map ClientToObjectMapType; - typedef std::hash_map TrackedObjectsType; + typedef std::tr1::unordered_map TrackedObjectsType; // Classes diff --git a/engine/server/library/serverNetworkMessages/src/shared/gameCommoditiesServer/AuctionBase.h b/engine/server/library/serverNetworkMessages/src/shared/gameCommoditiesServer/AuctionBase.h index 22bf6cc0..230cc975 100644 --- a/engine/server/library/serverNetworkMessages/src/shared/gameCommoditiesServer/AuctionBase.h +++ b/engine/server/library/serverNetworkMessages/src/shared/gameCommoditiesServer/AuctionBase.h @@ -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 { diff --git a/engine/server/library/serverPathfinding/src/shared/ServerPathBuildManager.cpp b/engine/server/library/serverPathfinding/src/shared/ServerPathBuildManager.cpp index 0b8bf2a5..617cabae 100644 --- a/engine/server/library/serverPathfinding/src/shared/ServerPathBuildManager.cpp +++ b/engine/server/library/serverPathfinding/src/shared/ServerPathBuildManager.cpp @@ -12,6 +12,7 @@ #include "sharedDebug/PerformanceTimer.h" +#include #include typedef std::list< ServerPathBuilder * > BuildQueue; diff --git a/engine/server/library/serverScript/src/shared/GameScriptObject.cpp b/engine/server/library/serverScript/src/shared/GameScriptObject.cpp index c2d5c40f..c93ebbf4 100644 --- a/engine/server/library/serverScript/src/shared/GameScriptObject.cpp +++ b/engine/server/library/serverScript/src/shared/GameScriptObject.cpp @@ -28,6 +28,7 @@ #include "serverGame/ServerObject.h" #include +#include #ifdef _WIN32 diff --git a/engine/server/library/serverScript/src/shared/ScriptFunctionTable.h b/engine/server/library/serverScript/src/shared/ScriptFunctionTable.h index 3b47c932..896b68d9 100644 --- a/engine/server/library/serverScript/src/shared/ScriptFunctionTable.h +++ b/engine/server/library/serverScript/src/shared/ScriptFunctionTable.h @@ -9,7 +9,7 @@ #ifndef _INCLUDED_ScriptFuncTable_H #define _INCLUDED_ScriptFuncTable_H -#include +#include 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); diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsAttributes.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsAttributes.cpp index 7c5cc5ca..266b10f8 100644 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsAttributes.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsAttributes.cpp @@ -19,6 +19,8 @@ #include "sharedGame/GameObjectTypes.h" #include "swgSharedUtility/CombatEngineData.h" +#include + using namespace JNIWrappersNamespace; diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp index 8075cb7c..7e1206de 100644 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp @@ -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; diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsPlayerAccount.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsPlayerAccount.cpp index 3830b681..f29095fa 100644 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsPlayerAccount.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsPlayerAccount.cpp @@ -38,7 +38,7 @@ #include "serverUtility/FreeCtsDataTable.h" #include "UnicodeUtils.h" -#include +#include using namespace JNIWrappersNamespace; @@ -434,7 +434,7 @@ jboolean JNICALL ScriptMethodsPlayerAccountNamespace::isAccountQualifiedForHouse UNREF(self); NOT_NULL(env); - static std::hash_set accountsQualifiedForHousePackup; + static std::tr1::unordered_set accountsQualifiedForHousePackup; if (accountsQualifiedForHousePackup.empty()) { DataTable * table = DataTableManager::getTable(ConfigServerGame::getHousePackupAccountListDataTableName(), true); diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsSkill.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsSkill.cpp index df5453bf..ae184f4b 100644 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsSkill.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsSkill.cpp @@ -23,6 +23,9 @@ #include "sharedSkillSystem/SkillObject.h" #include "UnicodeUtils.h" + +#include + using namespace JNIWrappersNamespace; diff --git a/engine/server/library/serverUtility/src/linux/stlhack.cpp b/engine/server/library/serverUtility/src/linux/stlhack.cpp index 50a75598..5b63831a 100644 --- a/engine/server/library/serverUtility/src/linux/stlhack.cpp +++ b/engine/server/library/serverUtility/src/linux/stlhack.cpp @@ -1,5 +1,5 @@ //#include "FirstGame.h" -#include //without this we get an internal compiler error +//#include //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 without it diff --git a/engine/shared/application/DataTableTool/src/CMakeLists.txt b/engine/shared/application/DataTableTool/src/CMakeLists.txt index 93c041ec..b8b3402b 100644 --- a/engine/shared/application/DataTableTool/src/CMakeLists.txt +++ b/engine/shared/application/DataTableTool/src/CMakeLists.txt @@ -53,6 +53,5 @@ target_link_libraries(DataTableTool localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/shared/application/TemplateCompiler/src/CMakeLists.txt b/engine/shared/application/TemplateCompiler/src/CMakeLists.txt index 4c58d729..64f853fd 100644 --- a/engine/shared/application/TemplateCompiler/src/CMakeLists.txt +++ b/engine/shared/application/TemplateCompiler/src/CMakeLists.txt @@ -60,6 +60,5 @@ target_link_libraries(TemplateCompiler localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/shared/application/TemplateDefinitionCompiler/src/CMakeLists.txt b/engine/shared/application/TemplateDefinitionCompiler/src/CMakeLists.txt index ddfb7d15..4577d93d 100644 --- a/engine/shared/application/TemplateDefinitionCompiler/src/CMakeLists.txt +++ b/engine/shared/application/TemplateDefinitionCompiler/src/CMakeLists.txt @@ -60,6 +60,5 @@ target_link_libraries(TemplateDefinitionCompiler localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/engine/shared/library/sharedCollision/src/shared/core/CollisionUtils.cpp b/engine/shared/library/sharedCollision/src/shared/core/CollisionUtils.cpp index f9a485d1..4c994abf 100644 --- a/engine/shared/library/sharedCollision/src/shared/core/CollisionUtils.cpp +++ b/engine/shared/library/sharedCollision/src/shared/core/CollisionUtils.cpp @@ -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; } diff --git a/engine/shared/library/sharedCollision/src/shared/core/Distance3d.cpp b/engine/shared/library/sharedCollision/src/shared/core/Distance3d.cpp index 5a32dfe1..0ea58d51 100644 --- a/engine/shared/library/sharedCollision/src/shared/core/Distance3d.cpp +++ b/engine/shared/library/sharedCollision/src/shared/core/Distance3d.cpp @@ -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; diff --git a/engine/shared/library/sharedCollision/src/shared/core/DoorObject.cpp b/engine/shared/library/sharedCollision/src/shared/core/DoorObject.cpp index 98cf5297..7041fa86 100644 --- a/engine/shared/library/sharedCollision/src/shared/core/DoorObject.cpp +++ b/engine/shared/library/sharedCollision/src/shared/core/DoorObject.cpp @@ -32,6 +32,8 @@ #include "sharedObject/Portal.h" #include "sharedObject/Tweakable.h" +#include + static VectorArgb gs_forceFieldColor(0.6f,0.5f,0.5f,1.0f); // ====================================================================== diff --git a/engine/shared/library/sharedCollision/src/shared/core/FloorMesh.cpp b/engine/shared/library/sharedCollision/src/shared/core/FloorMesh.cpp index 01ec2350..370f13b7 100644 --- a/engine/shared/library/sharedCollision/src/shared/core/FloorMesh.cpp +++ b/engine/shared/library/sharedCollision/src/shared/core/FloorMesh.cpp @@ -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()) { diff --git a/engine/shared/library/sharedCollision/src/shared/core/Overlap3d.cpp b/engine/shared/library/sharedCollision/src/shared/core/Overlap3d.cpp index d5106836..ab316424 100644 --- a/engine/shared/library/sharedCollision/src/shared/core/Overlap3d.cpp +++ b/engine/shared/library/sharedCollision/src/shared/core/Overlap3d.cpp @@ -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(); } diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/BufferString.cpp b/engine/shared/library/sharedDatabaseInterface/src/shared/core/BufferString.cpp index 09c21876..ae2cbc9d 100644 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/BufferString.cpp +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/BufferString.cpp @@ -14,6 +14,8 @@ #include "sharedDatabaseInterface/NullEncodedUnicodeString.h" #include "sharedLog/Log.h" +#include + using namespace DB; // ====================================================================== diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableDouble.cpp b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableDouble.cpp index 438ea6ec..c3868f45 100644 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableDouble.cpp +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableDouble.cpp @@ -11,6 +11,7 @@ #include "sharedDatabaseInterface/DbServer.h" #include +#include // ====================================================================== diff --git a/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp b/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp index 28561846..c02aa59f 100644 --- a/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp +++ b/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/engine/shared/library/sharedDebug/src/shared/LeakFinder.h b/engine/shared/library/sharedDebug/src/shared/LeakFinder.h index e3a44d84..a4f80ce5 100644 --- a/engine/shared/library/sharedDebug/src/shared/LeakFinder.h +++ b/engine/shared/library/sharedDebug/src/shared/LeakFinder.h @@ -17,7 +17,7 @@ #include #include -#include +#include // ====================================================================== @@ -89,7 +89,7 @@ protected: ReferenceCountingData *referenceData; }; - typedef std::hash_map ObjectMap; + typedef std::tr1::unordered_map ObjectMap; ObjectMap liveObjects; }; diff --git a/engine/shared/library/sharedFoundation/src/shared/MemoryBlockManager.cpp b/engine/shared/library/sharedFoundation/src/shared/MemoryBlockManager.cpp index 2ded12c9..c5c86efd 100644 --- a/engine/shared/library/sharedFoundation/src/shared/MemoryBlockManager.cpp +++ b/engine/shared/library/sharedFoundation/src/shared/MemoryBlockManager.cpp @@ -14,6 +14,7 @@ #include "sharedFoundation/ConfigSharedFoundation.h" #include "sharedSynchronization/Mutex.h" +#include #include #include diff --git a/engine/shared/library/sharedFoundation/src/shared/NetworkId.h b/engine/shared/library/sharedFoundation/src/shared/NetworkId.h index 1f42fc60..0a966ea1 100644 --- a/engine/shared/library/sharedFoundation/src/shared/NetworkId.h +++ b/engine/shared/library/sharedFoundation/src/shared/NetworkId.h @@ -156,6 +156,8 @@ inline size_t NetworkId::getHashValue () const // STL standard hash function namespace std { +namespace tr1 +{ template <> struct hash // stl standard hash @@ -163,6 +165,6 @@ struct hash // stl standard hash size_t operator()(const NetworkId &x) const { return x.getHashValue(); } }; -} +}} #endif diff --git a/engine/shared/library/sharedFoundation/src/shared/StlForwardDeclaration.h b/engine/shared/library/sharedFoundation/src/shared/StlForwardDeclaration.h index 3780012c..31cbeff4 100644 --- a/engine/shared/library/sharedFoundation/src/shared/StlForwardDeclaration.h +++ b/engine/shared/library/sharedFoundation/src/shared/StlForwardDeclaration.h @@ -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 struct hash; template class allocator; template class basic_string; - template class char_traits; + template struct char_traits; template class bitset; template class deque; @@ -52,13 +52,36 @@ namespace std template class stack; template class priority_queue; template class map; - template class hash_map; + //template class hash_map; template class multimap; template class set; - template class hash_set; + //template class hash_set; template class multiset; typedef basic_string, allocator > string; + + namespace tr1 + { + template struct hash; + template class unordered_map; + template class unordered_set; + } + + template + 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 > struct stddeque @@ -76,9 +99,14 @@ template , class _Alloc typedef std::map<_Key, _Tp, _Compare, _Alloc> fwd; }; -template , class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair > > struct stdhash_map +//template , class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair > > struct stdhash_map +//{ +// typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd; +//}; + +template , class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair > > 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 _Alloc = std::allocator< std::pair > > struct stdmultimap @@ -91,9 +119,14 @@ template , class _Alloc = std::allo typedef std::set<_Key, _Compare, _Alloc> fwd; }; -template , class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdhash_set +//template , 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 _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 _Alloc = std::allocator<_Key> > struct stdmultiset diff --git a/engine/shared/library/sharedGame/src/shared/combat/CombatDataTable.cpp b/engine/shared/library/sharedGame/src/shared/combat/CombatDataTable.cpp index 21bf8b23..0114af08 100644 --- a/engine/shared/library/sharedGame/src/shared/combat/CombatDataTable.cpp +++ b/engine/shared/library/sharedGame/src/shared/combat/CombatDataTable.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include // ====================================================================== @@ -25,7 +25,7 @@ namespace CombatDataTableNamespace std::string const cs_columnActionNameCrc("actionNameCrc"); int s_actionNameCrcColumn; - std::hash_map s_commandsWithMinInvisLevelRequired; + std::tr1::unordered_map s_commandsWithMinInvisLevelRequired; } using namespace CombatDataTableNamespace; @@ -402,7 +402,7 @@ int CombatDataTable::getMinInvisLevelRequired(uint32 commandHash) if(commandHash == 0) return -1; - std::hash_map::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash); + std::tr1::unordered_map::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash); if (it != s_commandsWithMinInvisLevelRequired.end()) return it->second; diff --git a/engine/shared/library/sharedGame/src/shared/core/DraftSchematicGroupManager.cpp b/engine/shared/library/sharedGame/src/shared/core/DraftSchematicGroupManager.cpp index 670d76c9..4c2b7a17 100644 --- a/engine/shared/library/sharedGame/src/shared/core/DraftSchematicGroupManager.cpp +++ b/engine/shared/library/sharedGame/src/shared/core/DraftSchematicGroupManager.cpp @@ -15,6 +15,8 @@ #include "sharedObject/ObjectTemplateList.h" #include "sharedUtility/DataTable.h" #include "sharedUtility/DataTableManager.h" + +#include #include #include diff --git a/engine/shared/library/sharedGame/src/shared/core/SharedBuffBuilderManager.cpp b/engine/shared/library/sharedGame/src/shared/core/SharedBuffBuilderManager.cpp index 5e3a6ee3..40e7ffb8 100644 --- a/engine/shared/library/sharedGame/src/shared/core/SharedBuffBuilderManager.cpp +++ b/engine/shared/library/sharedGame/src/shared/core/SharedBuffBuilderManager.cpp @@ -16,6 +16,7 @@ #include "UnicodeUtils.h" +#include #include // ====================================================================== diff --git a/engine/shared/library/sharedGame/src/shared/core/SharedBuildoutAreaManager.cpp b/engine/shared/library/sharedGame/src/shared/core/SharedBuildoutAreaManager.cpp index 792cf3c2..cec5ff33 100644 --- a/engine/shared/library/sharedGame/src/shared/core/SharedBuildoutAreaManager.cpp +++ b/engine/shared/library/sharedGame/src/shared/core/SharedBuildoutAreaManager.cpp @@ -223,7 +223,7 @@ void SharedBuildoutAreaManager::install() int const areaCount = areaListTable.getNumRows(); for (int areaRow = 0; areaRow < areaCount; ++areaRow) { - areasForScene.push_back(); + areasForScene.push_back(BuildoutArea()); BuildoutArea &buildoutArea = areasForScene.back(); buildoutArea.areaIndex = i*100+areaRow; buildoutArea.areaName = areaListTable.getStringValue("area", areaRow); diff --git a/engine/shared/library/sharedGame/src/shared/object/Waypoint.cpp b/engine/shared/library/sharedGame/src/shared/object/Waypoint.cpp index a0a4a71b..f389a5c6 100644 --- a/engine/shared/library/sharedGame/src/shared/object/Waypoint.cpp +++ b/engine/shared/library/sharedGame/src/shared/object/Waypoint.cpp @@ -19,13 +19,13 @@ #include "sharedMessageDispatch/Transceiver.h" #include "unicodeArchive/UnicodeArchive.h" #include "UnicodeUtils.h" -#include +#include // ====================================================================== namespace WaypointNamespace { - typedef std::hash_map WaypointMapById; + typedef std::tr1::unordered_map WaypointMapById; WaypointMapById s_waypointMapById; bool s_installed; @@ -106,7 +106,7 @@ namespace Archive if (networkId.isValid()) { WaypointData *data = 0; - std::hash_map::iterator f = s_waypointMapById.find(networkId); + std::tr1::unordered_map::iterator f = s_waypointMapById.find(networkId); if (f == s_waypointMapById.end()) data = new WaypointData(networkId); else @@ -331,7 +331,7 @@ std::string const &Waypoint::getColorNameById(uint8 id) // static Waypoint const Waypoint::getWaypointById(NetworkId const &id) // static { Waypoint result; - std::hash_map::iterator f = s_waypointMapById.find(id); + std::tr1::unordered_map::iterator f = s_waypointMapById.find(id); if (f != s_waypointMapById.end()) result.releaseData(f->second); return result; diff --git a/engine/shared/library/sharedGame/src/shared/space/ShipChassisSlotType.cpp b/engine/shared/library/sharedGame/src/shared/space/ShipChassisSlotType.cpp index ab0bd1b8..b26cc0f8 100644 --- a/engine/shared/library/sharedGame/src/shared/space/ShipChassisSlotType.cpp +++ b/engine/shared/library/sharedGame/src/shared/space/ShipChassisSlotType.cpp @@ -12,7 +12,7 @@ #include "Unicode.h" -#include +#include //====================================================================== @@ -273,7 +273,7 @@ namespace ShipChassisSlotTypeNamespace static_cast(ShipComponentType::SCT_weapon), // SCST_weapon_99 }; - typedef stdhash_map::fwd SlotNameTypeMap; + typedef stdunordered_map::fwd SlotNameTypeMap; SlotNameTypeMap s_slotNameTypeMap; bool s_installed = false; diff --git a/engine/shared/library/sharedGame/src/shared/space/ShipComponentType.cpp b/engine/shared/library/sharedGame/src/shared/space/ShipComponentType.cpp index 04e92f3e..11a1398c 100644 --- a/engine/shared/library/sharedGame/src/shared/space/ShipComponentType.cpp +++ b/engine/shared/library/sharedGame/src/shared/space/ShipComponentType.cpp @@ -8,7 +8,7 @@ #include "sharedGame/FirstSharedGame.h" #include "sharedGame/ShipComponentType.h" -#include +#include //====================================================================== @@ -48,7 +48,7 @@ namespace ShipComponentTypeNamespace "mod_" }; - typedef stdhash_map::fwd ComponentNameTypeMap; + typedef stdunordered_map::fwd ComponentNameTypeMap; ComponentNameTypeMap s_componentNameTypeMap; bool s_installed = false; diff --git a/engine/shared/library/sharedMath/src/shared/CompressedQuaternion.cpp b/engine/shared/library/sharedMath/src/shared/CompressedQuaternion.cpp index d3cf61ba..0764eb55 100644 --- a/engine/shared/library/sharedMath/src/shared/CompressedQuaternion.cpp +++ b/engine/shared/library/sharedMath/src/shared/CompressedQuaternion.cpp @@ -260,7 +260,7 @@ void CompressedQuaternionNamespace::findClosestBase(int baseShiftCount, float mi for (int testBaseIndex = 0; testBaseIndex < baseCount; ++testBaseIndex) { const float testBaseValue = -1.0f + (testBaseIndex + 1) * baseSeparation; - const float testDistance = abs(testBaseValue - midpoint); + const float testDistance = std::abs(testBaseValue - midpoint); if (testDistance < closestBaseDistance) { @@ -349,7 +349,7 @@ uint32 CompressedQuaternionNamespace::doCompress(float w, float x, float y, floa #ifdef _DEBUG // If w is small enough, we won't be able to take the square root. - if (abs(w) >= cs_wAcceptableEpsilon) + if (std::abs(w) >= cs_wAcceptableEpsilon) { const float calculatedW = sqrt(1.0f - (x*x + y*y + z*z)); DEBUG_FATAL(!WithinEpsilonInclusive(calculatedW, w, cs_wAcceptableEpsilon), ("Quaternion (w=%g,x=%g,y=%g,z=%g) does not appear to be a unit quaternion.", w, x, y, z)); @@ -546,10 +546,10 @@ void CompressedQuaternion::compressRotations(const QuaternionVector &sourceRotat sourceRotation.z = -sourceRotation.z; } - const float deltaW = abs(expandedRotation.w - sourceRotation.w); - const float deltaX = abs(expandedRotation.x - sourceRotation.x); - const float deltaY = abs(expandedRotation.y - sourceRotation.y); - const float deltaZ = abs(expandedRotation.z - sourceRotation.z); + const float deltaW = std::abs(expandedRotation.w - sourceRotation.w); + const float deltaX = std::abs(expandedRotation.x - sourceRotation.x); + const float deltaY = std::abs(expandedRotation.y - sourceRotation.y); + const float deltaZ = std::abs(expandedRotation.z - sourceRotation.z); if ( (deltaW > cs_wAcceptableEpsilon) || (deltaX > cs_xAcceptableEpsilon) || diff --git a/engine/shared/library/sharedMath/src/shared/MxCifQuadTree.cpp b/engine/shared/library/sharedMath/src/shared/MxCifQuadTree.cpp index 81aa4012..0b77b2ec 100644 --- a/engine/shared/library/sharedMath/src/shared/MxCifQuadTree.cpp +++ b/engine/shared/library/sharedMath/src/shared/MxCifQuadTree.cpp @@ -10,6 +10,8 @@ #include "sharedMath/MxCifQuadTree.h" #include "sharedMath/MxCifQuadTreeBounds.h" +#include + //============================================================================== diff --git a/engine/shared/library/sharedMath/src/shared/PositionVertexIndexer.h b/engine/shared/library/sharedMath/src/shared/PositionVertexIndexer.h index 8fc181d5..63ecd3eb 100644 --- a/engine/shared/library/sharedMath/src/shared/PositionVertexIndexer.h +++ b/engine/shared/library/sharedMath/src/shared/PositionVertexIndexer.h @@ -12,7 +12,7 @@ #include "sharedMath/Vector.h" -#include +#include // ====================================================================== @@ -42,7 +42,7 @@ private: private: - typedef std::hash_multimap VertexIndexMap; + typedef std::tr1::unordered_multimap VertexIndexMap; VectorVector * m_vertices; VertexIndexMap * m_indexMap; diff --git a/engine/shared/library/sharedMath/src/shared/Rectangle2d.h b/engine/shared/library/sharedMath/src/shared/Rectangle2d.h index a8c4dcbd..a92e676c 100644 --- a/engine/shared/library/sharedMath/src/shared/Rectangle2d.h +++ b/engine/shared/library/sharedMath/src/shared/Rectangle2d.h @@ -97,14 +97,14 @@ inline void Rectangle2d::set (const float newX0, const float newY0, const float inline float Rectangle2d::getWidth () const { - return abs(x1 - x0); + return std::abs(x1 - x0); } //------------------------------------------------------------------- inline float Rectangle2d::getHeight () const { - return abs(y1 - y0); + return std::abs(y1 - y0); } //------------------------------------------------------------------- diff --git a/engine/shared/library/sharedMath/src/shared/SphereTreeNode.h b/engine/shared/library/sharedMath/src/shared/SphereTreeNode.h index 7cb4f053..706f846d 100644 --- a/engine/shared/library/sharedMath/src/shared/SphereTreeNode.h +++ b/engine/shared/library/sharedMath/src/shared/SphereTreeNode.h @@ -11,6 +11,7 @@ #include "sharedMath/Capsule.h" #include "sharedMath/SpatialSubdivision.h" +#include #include static const float SphereTreeEpsilon = 0.01f; @@ -1436,7 +1437,7 @@ inline void SphereTreeNode::resizeRealSphere(const f float BR = realSphere.getRadius(); float D = A.magnitudeBetween(B); - float O = abs(AR - (D + BR)); + float O = std::abs(AR - (D + BR)); // Fatal if the error is significant, otherwise just warn. diff --git a/engine/shared/library/sharedMath/src/shared/Vector.cpp b/engine/shared/library/sharedMath/src/shared/Vector.cpp index 341cfed8..8f3ee55d 100644 --- a/engine/shared/library/sharedMath/src/shared/Vector.cpp +++ b/engine/shared/library/sharedMath/src/shared/Vector.cpp @@ -12,6 +12,7 @@ #include "sharedRandom/Random.h" +#include #include // ====================================================================== @@ -284,7 +285,7 @@ bool Vector::inPolygon(const std::vector &convexPolygonVertices) const */ bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const { - return (abs(x - rhs.x) < epsilon) && (abs(y - rhs.y) < epsilon) && (abs(z - rhs.z) < epsilon); + return (std::abs(x - rhs.x) < epsilon) && (std::abs(y - rhs.y) < epsilon) && (std::abs(z - rhs.z) < epsilon); } @@ -297,9 +298,9 @@ bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const const Vector Vector::perpendicular(Vector const & direction) { // Measure the projection of "direction" onto each of the axes - float const id = abs(direction.dot(Vector::unitX)); - float const jd = abs(direction.dot(Vector::unitY)); - float const kd = abs(direction.dot(Vector::unitZ)); + float const id = std::abs(direction.dot(Vector::unitX)); + float const jd = std::abs(direction.dot(Vector::unitY)); + float const kd = std::abs(direction.dot(Vector::unitZ)); Vector result; diff --git a/engine/shared/library/sharedMath/src/shared/Vector.h b/engine/shared/library/sharedMath/src/shared/Vector.h index ceda3509..c44cef3c 100644 --- a/engine/shared/library/sharedMath/src/shared/Vector.h +++ b/engine/shared/library/sharedMath/src/shared/Vector.h @@ -265,9 +265,9 @@ inline real Vector::magnitudeSquared(void) const inline real Vector::approximateMagnitude(void) const { - real minc = abs(x); - real midc = abs(y); - real maxc = abs(z); + real minc = std::abs(x); + real midc = std::abs(y); + real maxc = std::abs(z); // sort the vectors // we do our own swapping to avoid heavy-weight includes in such a low-level class diff --git a/engine/shared/library/sharedMath/src/shared/core/MultiShape.cpp b/engine/shared/library/sharedMath/src/shared/core/MultiShape.cpp index cb556d62..2cd99f1d 100644 --- a/engine/shared/library/sharedMath/src/shared/core/MultiShape.cpp +++ b/engine/shared/library/sharedMath/src/shared/core/MultiShape.cpp @@ -221,7 +221,7 @@ float MultiShape::calcAvoidanceRadius ( void ) const float sinTheta = m_axisY.y; float cosTheta = sqrt( m_axisY.x * m_axisY.x + m_axisY.z * m_axisY.z ); - float twoContactRadius = abs(m_extentY * sinTheta + m_extentX * cosTheta); + float twoContactRadius = std::abs(m_extentY * sinTheta + m_extentX * cosTheta); float blah = m_extentY * sinTheta; diff --git a/engine/shared/library/sharedMath/src/shared/core/RangeLoop.cpp b/engine/shared/library/sharedMath/src/shared/core/RangeLoop.cpp index 1fab4723..f52fba71 100644 --- a/engine/shared/library/sharedMath/src/shared/core/RangeLoop.cpp +++ b/engine/shared/library/sharedMath/src/shared/core/RangeLoop.cpp @@ -89,7 +89,7 @@ RangeLoop::RangeLoop ( float min, float max ) : m_min( clip(min) ), m_max( clip(max) ) { - if(abs(max-min) >= 1.0f) + if(std::abs(max-min) >= 1.0f) { m_min = 0.0f; m_max = 1.0f; diff --git a/engine/shared/library/sharedMessageDispatch/src/shared/FirstSharedMessageDispatch.h b/engine/shared/library/sharedMessageDispatch/src/shared/FirstSharedMessageDispatch.h index 0aa6d74f..4c69c929 100644 --- a/engine/shared/library/sharedMessageDispatch/src/shared/FirstSharedMessageDispatch.h +++ b/engine/shared/library/sharedMessageDispatch/src/shared/FirstSharedMessageDispatch.h @@ -16,7 +16,7 @@ #include "sharedMessageDispatch/Message.h" #include "sharedMessageDispatch/Receiver.h" #include -#include +#include // ====================================================================== diff --git a/engine/shared/library/sharedMessageDispatch/src/shared/MessageManager.cpp b/engine/shared/library/sharedMessageDispatch/src/shared/MessageManager.cpp index 6ce7c7da..cc7ac00c 100644 --- a/engine/shared/library/sharedMessageDispatch/src/shared/MessageManager.cpp +++ b/engine/shared/library/sharedMessageDispatch/src/shared/MessageManager.cpp @@ -7,7 +7,7 @@ #include "sharedMessageDispatch/Receiver.h" #include -#include +#include namespace MessageDispatch { @@ -15,8 +15,8 @@ MessageManager MessageManager::ms_instance; struct MessageManager::Data { - std::hash_map > receivers; - std::hash_map > staticCallbacks; + std::tr1::unordered_map > receivers; + std::tr1::unordered_map > staticCallbacks; }; //--------------------------------------------------------------------- @@ -72,7 +72,7 @@ void MessageManager::addReceiver(Receiver & target, const MessageBase & source) void MessageManager::addReceiver(Receiver & target, const unsigned long int messageType) { - std::hash_map >::iterator i = data->receivers.find(messageType); + std::tr1::unordered_map >::iterator i = data->receivers.find(messageType); if(i != data->receivers.end()) { target.setHasTargets(true); @@ -92,7 +92,7 @@ void MessageManager::addReceiver(Receiver & target, const unsigned long int mess void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const MessageBase &), const unsigned long int messageType) { - std::hash_map >::iterator f = data->staticCallbacks.find(messageType); + std::tr1::unordered_map >::iterator f = data->staticCallbacks.find(messageType); if(f != data->staticCallbacks.end()) { std::set & targets = f->second; @@ -121,7 +121,7 @@ void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const M void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & message) const { const unsigned long int messageType = message.getType(); - std::hash_map >::const_iterator i = data->receivers.find(messageType); + std::tr1::unordered_map >::const_iterator i = data->receivers.find(messageType); if(i != data->receivers.end()) { const std::set targets = (*i).second; @@ -136,7 +136,7 @@ void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & me } } - std::hash_map >::iterator f = data->staticCallbacks.find(messageType); + std::tr1::unordered_map >::iterator f = data->staticCallbacks.find(messageType); if(f != data->staticCallbacks.end()) { const std::set targets = f->second; @@ -160,7 +160,7 @@ void MessageManager::receiverDestroyed(const Receiver & target) return; } // find receiver - std::hash_map >::iterator i; + std::tr1::unordered_map >::iterator i; for(i = data->receivers.begin(); i != data->receivers.end(); ++i) { std::set & targets = (*i).second; @@ -200,7 +200,7 @@ void MessageManager::removeReceiver(const Receiver & target, const char * const void MessageManager::removeReceiver(const Receiver & target, const unsigned long int messageType) { - std::hash_map >::iterator i = data->receivers.find(messageType); + std::tr1::unordered_map >::iterator i = data->receivers.find(messageType); if(i != data->receivers.end()) { std::set & targets = (*i).second; diff --git a/engine/shared/library/sharedMessageDispatch/src/shared/Transceiver.h b/engine/shared/library/sharedMessageDispatch/src/shared/Transceiver.h index 3368ab66..42d301b5 100644 --- a/engine/shared/library/sharedMessageDispatch/src/shared/Transceiver.h +++ b/engine/shared/library/sharedMessageDispatch/src/shared/Transceiver.h @@ -157,6 +157,7 @@ */ //----------------------------------------------------------------------- +#include #include #include #include diff --git a/engine/shared/library/sharedNetwork/src/shared/NetworkHandler.cpp b/engine/shared/library/sharedNetwork/src/shared/NetworkHandler.cpp index c81cb7b8..c6358535 100644 --- a/engine/shared/library/sharedNetwork/src/shared/NetworkHandler.cpp +++ b/engine/shared/library/sharedNetwork/src/shared/NetworkHandler.cpp @@ -24,6 +24,7 @@ #include "TcpClient.h" +#include #include #include #include @@ -255,7 +256,7 @@ void NetworkHandler::onReceive(Connection * c, const unsigned char * d, int s) { if(c) { - services.inputQueue.push_back(); + services.inputQueue.push_back(IncomingData()); services.inputQueue.back().connection = c; services.inputQueue.back().byteStream.put(d, s); diff --git a/engine/shared/library/sharedNetwork/src/win32/Address.cpp b/engine/shared/library/sharedNetwork/src/win32/Address.cpp index 6e3b5065..a6338857 100644 --- a/engine/shared/library/sharedNetwork/src/win32/Address.cpp +++ b/engine/shared/library/sharedNetwork/src/win32/Address.cpp @@ -374,7 +374,7 @@ size_t Address::hashFunction() const Example: \code - typedef std::hash_map AddressMap; + typedef std::tr1::unordered_map AddressMap; \endcode @return true if the left hand side and right hand side are equal diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ClientMfdStatusUpdateMessage.cpp b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ClientMfdStatusUpdateMessage.cpp index b0304789..d9aa95e7 100644 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ClientMfdStatusUpdateMessage.cpp +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ClientMfdStatusUpdateMessage.cpp @@ -11,6 +11,8 @@ #include "sharedMathArchive/VectorArchive.h" #include "sharedNetworkMessages/ClientMfdStatusUpdateMessage.h" +#include + //----------------------------------------------------------------------- const char * const ClientMfdStatusUpdateMessage::MESSAGE_TYPE = "ClientMfdStatusUpdateMessage"; diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCraftExperiment.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCraftExperiment.h index 52b45613..921c3dba 100644 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCraftExperiment.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCraftExperiment.h @@ -24,8 +24,8 @@ public: struct ExperimentInfo { - const int attributeIndex; // which attribute is being experiemnted - const int experimentPoints; // how many experiment points are allocated + int attributeIndex; // which attribute is being experiemnted + int experimentPoints; // how many experiment points are allocated ExperimentInfo(int attribute, int points) : attributeIndex(attribute), @@ -33,8 +33,8 @@ public: { } - private: - ExperimentInfo & operator = (const ExperimentInfo &); + //private: + // ExperimentInfo & operator = (const ExperimentInfo &); }; public: diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCreateSaga.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCreateSaga.h index b6ca6055..d6c19455 100644 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCreateSaga.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueCreateSaga.h @@ -43,8 +43,8 @@ public: int numParameters; std::vector parameters; - private: - TaskInfo & operator = (const TaskInfo &); + //private: + // TaskInfo & operator = (const TaskInfo &); }; public: diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/common/GameNetworkMessage.cpp b/engine/shared/library/sharedNetworkMessages/src/shared/common/GameNetworkMessage.cpp index 3fbdeb5c..7f594ae4 100644 --- a/engine/shared/library/sharedNetworkMessages/src/shared/common/GameNetworkMessage.cpp +++ b/engine/shared/library/sharedNetworkMessages/src/shared/common/GameNetworkMessage.cpp @@ -13,7 +13,7 @@ #include "sharedFoundation/CrcString.h" #include "sharedNetworkMessages/NetworkMessageFactory.h" #include -#include +#include // ====================================================================== @@ -22,7 +22,7 @@ std::string const GameNetworkMessage::NetworkVersionId = "20100225-17:43"; namespace GameNetworkMessageNamespace { - std::hash_map gs_messageCount; + std::tr1::unordered_map gs_messageCount; // ---------------------------------------------------------------------- @@ -34,7 +34,7 @@ namespace GameNetworkMessageNamespace } }; - std::hash_map s_messageTypes; + std::tr1::unordered_map s_messageTypes; } using namespace GameNetworkMessageNamespace; @@ -105,7 +105,7 @@ std::vector > const GameNetworkMessage::getMessageCo { std::vector > result; - for (std::hash_map::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i) + for (std::tr1::unordered_map ::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i) result.push_back(std::make_pair(s_messageTypes[(*i).first], (*i).second)); std::sort(result.begin(), result.end(), SortPair()); diff --git a/engine/shared/library/sharedObject/src/shared/container/Container.cpp b/engine/shared/library/sharedObject/src/shared/container/Container.cpp index 9640a335..71fb9af3 100644 --- a/engine/shared/library/sharedObject/src/shared/container/Container.cpp +++ b/engine/shared/library/sharedObject/src/shared/container/Container.cpp @@ -15,6 +15,7 @@ #include "sharedObject/ContainedByProperty.h" #include "sharedObject/Object.h" +#include #include // ====================================================================== diff --git a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData.cpp b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData.cpp index d249819b..e27808f2 100644 --- a/engine/shared/library/sharedObject/src/shared/customization/CustomizationData.cpp +++ b/engine/shared/library/sharedObject/src/shared/customization/CustomizationData.cpp @@ -22,6 +22,7 @@ #include "sharedObject/Object.h" #include "UnicodeUtils.h" +#include #include #include #include diff --git a/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.cpp b/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.cpp index c12cf501..9e41ab00 100644 --- a/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.cpp +++ b/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.cpp @@ -10,7 +10,7 @@ #include "sharedFoundation/NetworkId.h" #include "sharedObject/Object.h" -#include +#include #include //----------------------------------------------------------------------- diff --git a/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.h b/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.h index c362042f..0749de97 100644 --- a/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.h +++ b/engine/shared/library/sharedObject/src/shared/object/NetworkIdManager.h @@ -16,7 +16,7 @@ class NetworkIdManager public: ~NetworkIdManager(); - typedef stdhash_map::fwd NetworkIdObjectHashMap; + typedef stdunordered_map::fwd NetworkIdObjectHashMap; static void addObject (Object & newObject); static Object * getObjectById (const NetworkId & source); diff --git a/engine/shared/library/sharedObject/src/shared/object/Object.cpp b/engine/shared/library/sharedObject/src/shared/object/Object.cpp index 589f2291..88a48309 100644 --- a/engine/shared/library/sharedObject/src/shared/object/Object.cpp +++ b/engine/shared/library/sharedObject/src/shared/object/Object.cpp @@ -559,7 +559,7 @@ void ObjectNamespace::deleteLocalTransform(Transform *transform) void ObjectNamespace::validatePosition(Object const & object, Vector const & position) { - if (abs(position.x) > 16000.0f || abs(position.y) > 16000.0f || abs(position.z) > 16000.0f) + if (std::abs(position.x) > 16000.0f || std::abs(position.y) > 16000.0f || std::abs(position.z) > 16000.0f) { Object const * parent = object.getAttachedTo(); diff --git a/engine/shared/library/sharedObject/src/shared/portal/PortalPropertyTemplate.cpp b/engine/shared/library/sharedObject/src/shared/portal/PortalPropertyTemplate.cpp index 5fda59b0..09d2e9e1 100644 --- a/engine/shared/library/sharedObject/src/shared/portal/PortalPropertyTemplate.cpp +++ b/engine/shared/library/sharedObject/src/shared/portal/PortalPropertyTemplate.cpp @@ -166,7 +166,7 @@ void PortalPropertyTemplateNamespace::validateCoplanar(IndexedTriangleList const for (uint i = 3; i < numberOfVertices; ++i) { float const distance = p.computeDistanceTo(vertexList[i]); - WARNING(abs(distance) > 0.001f, ("[%s]: portal is not planar, vertex %d is %8.6f from the plane", fileName, static_cast(i), distance)); + WARNING(std::abs(distance) > 0.001f, ("[%s]: portal is not planar, vertex %d is %8.6f from the plane", fileName, static_cast(i), distance)); } } #endif diff --git a/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.cpp b/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.cpp index 81eaf0c3..87ee2458 100644 --- a/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.cpp +++ b/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.cpp @@ -15,7 +15,7 @@ #include "sharedDebug/InstallTimer.h" #include -#include +#include #include SkillManager *SkillManager::ms_instance = NULL; diff --git a/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.h b/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.h index 3a38ec42..b5c5485f 100644 --- a/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.h +++ b/engine/shared/library/sharedSkillSystem/src/shared/SkillManager.h @@ -16,8 +16,8 @@ class DataTable; class SkillManager { public: - typedef stdhash_map::fwd SkillMap; - typedef stdhash_map::fwd XpLimitMap; + typedef stdunordered_map::fwd SkillMap; + typedef stdunordered_map::fwd XpLimitMap; virtual ~SkillManager (); diff --git a/engine/shared/library/sharedTemplateDefinition/src/shared/core/Filename.cpp b/engine/shared/library/sharedTemplateDefinition/src/shared/core/Filename.cpp index bd83f489..01bdb2b3 100644 --- a/engine/shared/library/sharedTemplateDefinition/src/shared/core/Filename.cpp +++ b/engine/shared/library/sharedTemplateDefinition/src/shared/core/Filename.cpp @@ -17,6 +17,8 @@ #include #endif +#include + const char WIN32_PATH_SEPARATOR = '\\'; const char LINUX_PATH_SEPARATOR = '/'; diff --git a/engine/shared/library/sharedTemplateDefinition/src/shared/core/TemplateData.h b/engine/shared/library/sharedTemplateDefinition/src/shared/core/TemplateData.h index f953098f..181ccce7 100644 --- a/engine/shared/library/sharedTemplateDefinition/src/shared/core/TemplateData.h +++ b/engine/shared/library/sharedTemplateDefinition/src/shared/core/TemplateData.h @@ -12,6 +12,8 @@ #include "sharedFoundation/Tag.h" #include "TemplateGlobals.h" +#include + class File; class TemplateDefinitionFile; class TpfTemplate; diff --git a/engine/shared/library/sharedTerrain/src/shared/appearance/ProceduralTerrainAppearance.cpp b/engine/shared/library/sharedTerrain/src/shared/appearance/ProceduralTerrainAppearance.cpp index e116cba9..c939bd53 100644 --- a/engine/shared/library/sharedTerrain/src/shared/appearance/ProceduralTerrainAppearance.cpp +++ b/engine/shared/library/sharedTerrain/src/shared/appearance/ProceduralTerrainAppearance.cpp @@ -33,6 +33,7 @@ #include "sharedRandom/RandomGenerator.h" #include "sharedRandom/FastRandomGenerator.h" +#include #include #include diff --git a/engine/shared/library/sharedTerrain/src/shared/appearance/SpaceTerrainAppearanceTemplate.h b/engine/shared/library/sharedTerrain/src/shared/appearance/SpaceTerrainAppearanceTemplate.h index a7ec57f8..2b7c7596 100644 --- a/engine/shared/library/sharedTerrain/src/shared/appearance/SpaceTerrainAppearanceTemplate.h +++ b/engine/shared/library/sharedTerrain/src/shared/appearance/SpaceTerrainAppearanceTemplate.h @@ -95,9 +95,9 @@ private: float m_haloScale; bool m_infiniteDistance; - private: + //private: - DistantAppearanceData operator=(DistantAppearanceData const & rhs); + // DistantAppearanceData operator=(DistantAppearanceData const & rhs); }; struct CelestialData @@ -108,9 +108,9 @@ private: float m_frontSize; Vector m_direction_w; - private: + //private: - CelestialData operator=(CelestialData const & rhs); + // CelestialData operator=(CelestialData const & rhs); }; private: diff --git a/engine/shared/library/sharedTerrain/src/shared/object/TerrainObject.cpp b/engine/shared/library/sharedTerrain/src/shared/object/TerrainObject.cpp index 30f74727..f48a7b5d 100644 --- a/engine/shared/library/sharedTerrain/src/shared/object/TerrainObject.cpp +++ b/engine/shared/library/sharedTerrain/src/shared/object/TerrainObject.cpp @@ -740,11 +740,11 @@ bool TerrainObject::isWithinTerrainBoundaries (Vector const &position_w) const { //-- check x and z float const maxCoordinate = getMapWidthInMeters () * 0.5f; - if ((abs (position_w.x) > maxCoordinate) || (abs (position_w.z) > maxCoordinate)) + if ((std::abs (position_w.x) > maxCoordinate) || (std::abs (position_w.z) > maxCoordinate)) return false; //-- check y - if (abs (position_w.y) > getMaximumValidHeightInMeters ()) + if (std::abs (position_w.y) > getMaximumValidHeightInMeters ()) return false; return true; diff --git a/engine/shared/library/sharedUtility/src/shared/DataTable.cpp b/engine/shared/library/sharedUtility/src/shared/DataTable.cpp index c0bf3ef0..933709e1 100644 --- a/engine/shared/library/sharedUtility/src/shared/DataTable.cpp +++ b/engine/shared/library/sharedUtility/src/shared/DataTable.cpp @@ -13,7 +13,7 @@ #include "sharedUtility/DataTableCell.h" #include -#include +#include //---------------------------------------------------------------------------- diff --git a/engine/shared/library/sharedUtility/src/shared/DataTable.h b/engine/shared/library/sharedUtility/src/shared/DataTable.h index eb986091..849d9fc9 100644 --- a/engine/shared/library/sharedUtility/src/shared/DataTable.h +++ b/engine/shared/library/sharedUtility/src/shared/DataTable.h @@ -15,6 +15,7 @@ #include #include +#include class Iff; @@ -83,7 +84,7 @@ private: void buildColumnIndexMap(); typedef std::vector DataTableColumnTypeVector; - typedef stdhash_map::fwd ColumnIndexMap; + typedef std::tr1::unordered_map ColumnIndexMap; int m_numRows; int m_numCols; diff --git a/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.cpp b/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.cpp index 136bf5f2..75b4eff9 100644 --- a/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.cpp +++ b/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include //=================================================================== @@ -710,7 +710,7 @@ WorldSnapshotReaderWriter::Node const *WorldSnapshotReaderWriter::addObject ( //-- find objectTemplateNameIndex uint objectTemplateNameIndex = 0; - std::hash_map::const_iterator i = m_objectTemplateCrcMap->find(objectTemplateName.getCrc()); + ObjectTemplateCrcMap::const_iterator i = m_objectTemplateCrcMap->find(objectTemplateName.getCrc()); if (i != m_objectTemplateCrcMap->end()) objectTemplateNameIndex = (*i).second; else diff --git a/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.h b/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.h index 5ae14511..091fdc86 100644 --- a/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.h +++ b/engine/shared/library/sharedUtility/src/shared/WorldSnapshotReaderWriter.h @@ -175,7 +175,7 @@ private: typedef stdvector::fwd ObjectTemplateNameList; ObjectTemplateNameList* const m_objectTemplateNameList; - typedef stdhash_map::fwd ObjectTemplateCrcMap; + typedef stdunordered_map::fwd ObjectTemplateCrcMap; ObjectTemplateCrcMap* const m_objectTemplateCrcMap; // map from crc to index in name list typedef stdmap::fwd NetworkIdNodeMap; diff --git a/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeBlocks.cpp b/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeBlocks.cpp index 0b8194b1..e0ed5f8e 100644 --- a/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeBlocks.cpp +++ b/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeBlocks.cpp @@ -10,6 +10,8 @@ #include "FirstUnicode.h" #include "UnicodeBlocks.h" +#include + // ====================================================================== #ifdef EXTERNAL_DISTRO namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeCharacterDataMap.cpp b/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeCharacterDataMap.cpp index 71e2c0c8..84c2381c 100644 --- a/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeCharacterDataMap.cpp +++ b/external/3rd/library/soePlatform/CSAssist/utils/Unicode/UnicodeCharacterDataMap.cpp @@ -13,6 +13,7 @@ #include "UnicodeBlocks.h" #include "UnicodeCharacterData.h" +#include #include #include #include diff --git a/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeBlocks.cpp b/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeBlocks.cpp index 0b8194b1..e0ed5f8e 100644 --- a/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeBlocks.cpp +++ b/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeBlocks.cpp @@ -10,6 +10,8 @@ #include "FirstUnicode.h" #include "UnicodeBlocks.h" +#include + // ====================================================================== #ifdef EXTERNAL_DISTRO namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeCharacterDataMap.cpp b/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeCharacterDataMap.cpp index 71e2c0c8..84c2381c 100644 --- a/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeCharacterDataMap.cpp +++ b/external/3rd/library/soePlatform/CTServiceGameAPI/Unicode/UnicodeCharacterDataMap.cpp @@ -13,6 +13,7 @@ #include "UnicodeBlocks.h" #include "UnicodeCharacterData.h" +#include #include #include #include diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp index fa769c71..f8d7d1cc 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp @@ -1,5 +1,7 @@ #include "Base64.h" -#include + +#include +#include #ifdef EXTERNAL_DISTRO namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/CmdLine.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/CmdLine.cpp index a9ffed0a..eee78250 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/CmdLine.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/CmdLine.cpp @@ -35,7 +35,8 @@ #include "CmdLine.h" //#include "crtdbg.h" -#include +#include +#include #ifdef EXTERNAL_DISTRO namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeBlocks.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeBlocks.cpp index 0b8194b1..e0ed5f8e 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeBlocks.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeBlocks.cpp @@ -10,6 +10,8 @@ #include "FirstUnicode.h" #include "UnicodeBlocks.h" +#include + // ====================================================================== #ifdef EXTERNAL_DISTRO namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeCharacterDataMap.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeCharacterDataMap.cpp index 71e2c0c8..84c2381c 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeCharacterDataMap.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Unicode/UnicodeCharacterDataMap.cpp @@ -13,6 +13,7 @@ #include "UnicodeBlocks.h" #include "UnicodeCharacterData.h" +#include #include #include #include diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiTypeNameValuePair.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiTypeNameValuePair.h index 22105160..0e5a2a0e 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiTypeNameValuePair.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiTypeNameValuePair.h @@ -1,6 +1,7 @@ #ifndef API_TYPE_NAME_VALUE_PAIR #define API_TYPE_NAME_VALUE_PAIR +#include #include #include #include "Base/serializeClasses.h" diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp index a2f504a5..3aba1fb2 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp @@ -1,5 +1,6 @@ #include "Base64.h" -#include +#include +#include #ifdef WIN32 #define snprintf _snprintf diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp index 7fe3361c..ae753234 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp @@ -2,7 +2,8 @@ #pragma warning( disable: 4786 ) #endif -#include +#include +#include #include "basicConfig.h" #include "profile.h" diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp index a90d602c..6d0aa26a 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp @@ -35,7 +35,8 @@ #include "cmdLine.h" //#include "crtdbg.h" -#include +#include +#include #ifdef NAMESPACE namespace NAMESPACE diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp index 0b8fc8c3..6097fd7b 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp @@ -8,6 +8,7 @@ extern int errno; #endif #include +#include #define NAME_SIZE 256 diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeClasses.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeClasses.h index b094efde..29257cae 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeClasses.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeClasses.h @@ -2,7 +2,8 @@ #define SOE__SERIALIZE_CLASSES_H -#include +#include +#include #include #include #include diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h index 5ee58233..4af421bb 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h @@ -4,6 +4,7 @@ #ifdef TRACK_READ_WRITE_FAILURES # include "trackMessageFailures.h" #endif +#include #include namespace soe diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/stringutils.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/stringutils.cpp index 1400bf5c..be0a4376 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/stringutils.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/stringutils.cpp @@ -7,26 +7,26 @@ #include #include -using namespace std; -#define transform std::transform +//using namespace std; +//#define transform std::transform namespace soe { void makeupper(std::string& str) { - transform(str.begin(), str.end(), str.begin(), toupper); + std::transform(str.begin(), str.end(), str.begin(), toupper); } std::string touppercase(const std::string& str) { std::string tmp = str; - transform(tmp.begin(), tmp.end(), tmp.begin(), toupper); + std::transform(tmp.begin(), tmp.end(), tmp.begin(), toupper); return tmp; } void makelower(std::string& str) { - transform(str.begin(), str.end(), str.begin(), tolower); + std::transform(str.begin(), str.end(), str.begin(), tolower); } std::string tolowercase(const std::string& str) diff --git a/external/ours/library/archive/src/shared/ByteStream.cpp b/external/ours/library/archive/src/shared/ByteStream.cpp index 97e0c8fe..de840820 100644 --- a/external/ours/library/archive/src/shared/ByteStream.cpp +++ b/external/ours/library/archive/src/shared/ByteStream.cpp @@ -3,6 +3,7 @@ #include "ByteStream.h" #include "ArchiveMutex.h" #include +#include // ====================================================================== diff --git a/external/ours/library/localization/src/shared/LocalizationManager.h b/external/ours/library/localization/src/shared/LocalizationManager.h index 70823546..ce9339ba 100644 --- a/external/ours/library/localization/src/shared/LocalizationManager.h +++ b/external/ours/library/localization/src/shared/LocalizationManager.h @@ -18,7 +18,7 @@ #pragma warning (disable:4786) #endif -#include +#include #include "Unicode.h" #include "UnicodeUtils.h" @@ -57,8 +57,8 @@ public: ~LocalizationManager (); typedef std::pair TimedStringTable; - typedef std::hash_map StringTableMap_t; - typedef std::hash_map LocalizationManagerHashMap; + typedef std::tr1::unordered_map StringTableMap_t; + typedef std::tr1::unordered_map LocalizationManagerHashMap; static void install (AbstractFileFactory * fileFactory, Unicode::UnicodeNarrowStringVector & localeNames, bool debugStrings, DebugBadStringsFunc debugBadStringsFunc = 0, bool displayBadStringIds = true); static void remove (); diff --git a/external/ours/library/localization/src/shared/LocalizedStringTable.cpp b/external/ours/library/localization/src/shared/LocalizedStringTable.cpp index a14f922f..10ab6c60 100644 --- a/external/ours/library/localization/src/shared/LocalizedStringTable.cpp +++ b/external/ours/library/localization/src/shared/LocalizedStringTable.cpp @@ -12,6 +12,8 @@ #include "LocalizedString.h" #include "UnicodeUtils.h" +#include + #include #include #include diff --git a/external/ours/library/localization/src/shared/StringId.cpp b/external/ours/library/localization/src/shared/StringId.cpp index 9e6345d5..cb1492e4 100644 --- a/external/ours/library/localization/src/shared/StringId.cpp +++ b/external/ours/library/localization/src/shared/StringId.cpp @@ -13,6 +13,7 @@ #include "UnicodeUtils.h" #include #include +#include //---------------------------------------------------------------------- diff --git a/external/ours/library/unicode/src/shared/Unicode.h b/external/ours/library/unicode/src/shared/Unicode.h index c20d6b78..f2ea1d18 100644 --- a/external/ours/library/unicode/src/shared/Unicode.h +++ b/external/ours/library/unicode/src/shared/Unicode.h @@ -18,6 +18,7 @@ #endif #include +#include //----------------------------------------------------------------- @@ -45,6 +46,26 @@ namespace Unicode const String emptyString; } +namespace std { +namespace tr1 { + + template<> + struct hash + { + std::size_t operator()(const Unicode::String& s) const + { + std::size_t hash = 0; + int offset = 'a' - 1; + for(Unicode::String::const_iterator it=s.begin(); it!=s.end(); ++it) { + hash = hash << 1 | (*it - offset); + } + + return hash; + } + }; + +}} + //----------------------------------------------------------------- #endif diff --git a/external/ours/library/unicode/src/shared/UnicodeBlocks.cpp b/external/ours/library/unicode/src/shared/UnicodeBlocks.cpp index feb26ae3..204aa6e8 100644 --- a/external/ours/library/unicode/src/shared/UnicodeBlocks.cpp +++ b/external/ours/library/unicode/src/shared/UnicodeBlocks.cpp @@ -10,6 +10,8 @@ #include "FirstUnicode.h" #include "UnicodeBlocks.h" +#include + // ====================================================================== using namespace Unicode::Blocks; diff --git a/external/ours/library/unicode/src/shared/UnicodeCharacterDataMap.cpp b/external/ours/library/unicode/src/shared/UnicodeCharacterDataMap.cpp index 2be6eab9..e5783d98 100644 --- a/external/ours/library/unicode/src/shared/UnicodeCharacterDataMap.cpp +++ b/external/ours/library/unicode/src/shared/UnicodeCharacterDataMap.cpp @@ -14,6 +14,7 @@ #include "UnicodeCharacterData.h" #include +#include #include #include diff --git a/external/ours/library/unicode/src/shared/UnicodeUtils.h b/external/ours/library/unicode/src/shared/UnicodeUtils.h index 48f88155..f2a722ae 100644 --- a/external/ours/library/unicode/src/shared/UnicodeUtils.h +++ b/external/ours/library/unicode/src/shared/UnicodeUtils.h @@ -17,6 +17,8 @@ #pragma warning (disable:4786) #endif +#include + #include "Unicode.h" #include "utf8.h" diff --git a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt index 65bc7e09..670902bd 100644 --- a/game/server/application/SwgDatabaseServer/src/CMakeLists.txt +++ b/game/server/application/SwgDatabaseServer/src/CMakeLists.txt @@ -340,6 +340,5 @@ target_link_libraries(SwgDatabaseServer localizationArchive unicode unicodeArchive - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h index f22b5754..843a5c57 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/IndexedTableBuffer.h @@ -11,7 +11,7 @@ // ====================================================================== -#include +#include #include "serverDatabase/TableBuffer.h" // ====================================================================== @@ -37,7 +37,7 @@ class IndexedNetworkTableBuffer : public TableBuffer IndexedNetworkTableBuffer(TableBufferMode mode, DB::ModeQuery *query); private: - typedef std::hash_map IndexType; + typedef std::tr1::unordered_map IndexType; /** * Index to locate rows. * diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h index 269731d8..5843f1a4 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h @@ -13,7 +13,7 @@ #include "SwgDatabaseServer/CommoditiesQuery.h" #include "SwgDatabaseServer/CommoditiesSchema.h" #include "serverDatabase/AbstractTableBuffer.h" -#include +#include #include // ====================================================================== @@ -47,10 +47,10 @@ private: void addRowToIndex (const NetworkId &itemId, DBSchema::MarketAuctionsRow *row); private: - typedef std::hash_map IndexType; + typedef std::tr1::unordered_map IndexType; IndexType m_rows; - typedef std::hash_map > > AttributesType; + typedef std::tr1::unordered_map > > AttributesType; AttributesType m_attributes; private: @@ -79,7 +79,7 @@ private: void addRowToIndex (const NetworkId &itemId, DBSchema::MarketAuctionsRowDelete *row); private: - typedef std::hash_map IndexType; + typedef std::tr1::unordered_map IndexType; IndexType m_rows; private: @@ -108,7 +108,7 @@ private: void addRowToIndex (const NetworkId &itemId, DBSchema::MarketAuctionsRowUpdate *row); private: - typedef std::hash_map IndexType; + typedef std::tr1::unordered_map IndexType; IndexType m_rows; private: diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.cpp b/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.cpp index 0226690b..f4e4c349 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.cpp @@ -10,7 +10,7 @@ #include "SwgDatabaseServer/TaskSaveObjvarNames.h" #include "sharedFoundation/ExitChain.h" -#include +#include #include #include diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.h b/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.h index 5c3c3531..fa2c989c 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.h +++ b/game/server/application/SwgDatabaseServer/src/shared/core/ObjvarNameManager.h @@ -34,10 +34,10 @@ class ObjvarNameManager DB::TaskRequest *saveNewNames(); private: - typedef stdhash_map::fwd NameToIdMapType; + typedef stdunordered_map::fwd NameToIdMapType; NameToIdMapType *m_nameToIdMap; - typedef stdhash_map::fwd IdToNameMapType; + typedef stdunordered_map::fwd IdToNameMapType; IdToNameMapType *m_idToNameMap; typedef stdvector >::fwd NewNamesType; diff --git a/game/server/application/SwgGameServer/src/CMakeLists.txt b/game/server/application/SwgGameServer/src/CMakeLists.txt index 2ef6e6f9..1bc63e22 100644 --- a/game/server/application/SwgGameServer/src/CMakeLists.txt +++ b/game/server/application/SwgGameServer/src/CMakeLists.txt @@ -150,6 +150,5 @@ target_link_libraries(SwgGameServer unicode unicodeArchive Base - ${STLPORT_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/game/server/application/SwgGameServer/src/shared/object/JediManagerObject.cpp b/game/server/application/SwgGameServer/src/shared/object/JediManagerObject.cpp index a2b4f882..42d7a279 100644 --- a/game/server/application/SwgGameServer/src/shared/object/JediManagerObject.cpp +++ b/game/server/application/SwgGameServer/src/shared/object/JediManagerObject.cpp @@ -31,6 +31,7 @@ #include "swgServerNetworkMessages/MessageQueueJediLocation.h" #include "swgServerNetworkMessages/MessageQueueRequestJediBounty.h" +#include static const int IGNORE_JEDI_STAT = INT_MAX;