From 3fad5178971293daea31531617015b9fbf9e9126 Mon Sep 17 00:00:00 2001 From: Cekis Date: Mon, 22 Nov 2021 00:28:35 -0500 Subject: [PATCH] Back port to 32 bit to take advantage of 64 bit adjustments --- CMakeLists.txt | 2 +- cmake/linux/FindOracle.cmake | 29 +----- .../src/shared/CentralServer.cpp | 2 +- .../ChatServer/src/shared/ChatInterface.cpp | 16 ++-- .../ChatServer/src/shared/ChatInterface.h | 2 +- .../src/shared/ClientConnection.cpp | 7 +- .../src/shared/UniverseLocator.cpp | 2 +- .../serverGame/src/shared/ai/HateList.cpp | 4 +- .../serverGame/src/shared/ai/HateList.h | 4 +- .../src/shared/command/CommandCppFuncs.cpp | 4 +- .../shared/console/ConsoleCommandParserAi.cpp | 8 +- .../ConsoleCommandParserCollection.cpp | 16 ++-- .../controller/AiCreatureController.cpp | 2 +- .../shared/controller/AiCreatureController.h | 4 +- .../serverGame/src/shared/core/Client.cpp | 3 +- .../src/shared/core/ReportManager.cpp | 14 +-- .../src/shared/object/CreatureObject.cpp | 20 ++--- .../src/shared/object/CreatureObject.h | 20 ++--- .../src/shared/object/PlayerObject.cpp | 74 +++++++-------- .../src/shared/object/PlayerObject.h | 32 +++---- .../src/shared/object/ServerObject.cpp | 42 ++++----- .../src/shared/object/ServerObject.h | 10 +-- .../src/shared/object/TangibleObject.cpp | 8 +- .../src/shared/object/TangibleObject.h | 8 +- .../ServerIntangibleObjectTemplate.h | 2 +- .../library/serverGame/src/shared/pvp/Pvp.cpp | 4 +- .../centralGameServer/MessageToPayloadImpl.h | 2 +- .../core/SetupServerNetworkMessages.cpp | 16 ++-- .../GameConnectionServerMessages.cpp | 4 +- .../src/shared/ScriptMethodsCollection.cpp | 2 +- .../src/shared/ChatLogManager.cpp | 28 +++--- .../serverUtility/src/shared/ChatLogManager.h | 8 +- .../src/shared/core/DbBindableLong.cpp | 8 +- .../src/shared/core/DbBindableLong.h | 75 ++++++++-------- .../src_oci/DbBindableVarray.cpp | 90 +++++++++---------- .../src_oci/DbBindableVarray.h | 12 +-- .../src/shared/chat/ChatOnRequestLog.h | 2 +- .../src/shared/clientGameServer/AuctionData.h | 4 +- .../BuffBuilderChangeMessage.cpp | 2 +- .../BuffBuilderChangeMessage.h | 6 +- .../ImageDesignChangeMessage.cpp | 2 +- .../ImageDesignChangeMessage.h | 6 +- .../MessageQueueSlowDownEffect.cpp | 2 +- .../MessageQueueSlowDownEffect.h | 6 +- .../src/shared/planetWatch/ServerInfo.h | 4 +- .../core/SetupSwgServerNetworkMessages.cpp | 20 ++--- .../core/SetupSwgSharedNetworkMessages.cpp | 6 +- 47 files changed, 310 insertions(+), 334 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16eb9f2f..f99dadfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ elseif (UNIX) set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE}") # our "always on" flags - build by default for the system we're on but include all instruction sets - set(CMAKE_CXX_FLAGS "-pipe -march=native -mtune=native \ + set(CMAKE_CXX_FLAGS "-m32 -pipe -march=native -mtune=native \ -Wformat -Wno-overloaded-virtual -Wno-missing-braces -Wno-format \ -Wno-write-strings -Wno-unknown-pragmas \ -Wno-uninitialized -Wno-reorder -Wno-tautological-constant-out-of-range-compare -Wno-address-of-packed-member") diff --git a/cmake/linux/FindOracle.cmake b/cmake/linux/FindOracle.cmake index 0cd0e944..20abfc38 100644 --- a/cmake/linux/FindOracle.cmake +++ b/cmake/linux/FindOracle.cmake @@ -22,34 +22,23 @@ # ############################################################################### - # If ORACLE_HOME not defined, assume Oracle libraries not available if(DEFINED ENV{ORACLE_HOME}) - set(ORACLE_HOME $ENV{ORACLE_HOME}) - message("ORACLE_HOME=${ORACLE_HOME}") - find_path(ORACLE_INCLUDE_DIR NAMES oci.h PATHS - /usr/include/oracle/19.12/client64 - /usr/include/oracle/19.12/client - /usr/lib/oracle/19.12/client64 - /usr/share/oracle/19.12/client64 - /usr/lib/oracle/19.12/client - /usr/share/oracle/19.12/client + /usr/include/oracle/21/client ${ORACLE_HOME}/rdbms/public ${ORACLE_HOME}/include ${ORACLE_HOME}/sdk/include # Oracle SDK ${ORACLE_HOME}/OCI/include) # Oracle XE on Windows - set(ORACLE_OCI_NAMES clntsh libclntsh oci) - set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 nnz12 libnnz12 nnz18 libnnz18 nnz19 libnnz19 ociw32) - set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11 oraocci12 libocci.so.19.1 oraocci19) - + set(ORACLE_NNZ_NAMES libnnz21 nnz21 ociw32) + set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11) set(ORACLE_LIB_DIR ${ORACLE_HOME}/lib @@ -57,24 +46,19 @@ if(DEFINED ENV{ORACLE_HOME}) ${ORACLE_HOME}/sdk/lib/msvc ${ORACLE_HOME}/OCI/lib/msvc) # Oracle XE on Windows - find_library(ORACLE_OCI_LIBRARY NAMES ${ORACLE_OCI_NAMES} PATHS ${ORACLE_LIB_DIR}) find_library(ORACLE_OCCI_LIBRARY NAMES ${ORACLE_OCCI_NAMES} PATHS ${ORACLE_LIB_DIR}) find_library(ORACLE_NNZ_LIBRARY NAMES ${ORACLE_NNZ_NAMES} PATHS ${ORACLE_LIB_DIR}) - set(ORACLE_LIBRARY ${ORACLE_OCI_LIBRARY} ${ORACLE_OCCI_LIBRARY} ${ORACLE_NNZ_LIBRARY}) - if(APPLE) set(ORACLE_OCIEI_NAMES libociei ociei) - find_library(ORACLE_OCIEI_LIBRARY NAMES libociei ociei PATHS ${ORACLE_LIB_DIR}) - if(ORACLE_OCIEI_LIBRARY) set(ORACLE_LIBRARY ${ORACLE_LIBRARY} ${ORACLE_OCIEI_LIBRARY}) else(ORACLE_OCIEI_LIBRARY) @@ -83,18 +67,13 @@ if(DEFINED ENV{ORACLE_HOME}) endif() endif() - set(ORACLE_LIBRARIES ${ORACLE_LIBRARY}) - endif(DEFINED ENV{ORACLE_HOME}) - # Handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE # if all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(ORACLE DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR) - -mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY) - +mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY) \ No newline at end of file diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp index 1cdb83bb..0ae86526 100755 --- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp +++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp @@ -2324,7 +2324,7 @@ void CentralServer::receiveMessage(const MessageDispatch::Emitter & source, cons } case constcrc("LfgStatRsp") : { Archive::ReadIterator ri = static_cast(message).getByteStream().begin(); - GenericValueTypeMessage >> const msg(ri); + GenericValueTypeMessage >> const msg(ri); m_numberOfCharacterMatchRequests += msg.getValue().first; m_numberOfCharacterMatchResults += msg.getValue().second.first; diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp index afc1b2f4..b75a7913 100755 --- a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp +++ b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp @@ -355,7 +355,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r ChatServer::putSystemAvatarInRoom(roomName); } std::string lowerRoomName = toLower(roomName); - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; std::unordered_map::iterator f = roomList.find(lowerRoomName); if (f != roomList.end() && room) { @@ -416,7 +416,7 @@ void ChatInterface::OnGetRoom(unsigned track, unsigned result, const ChatRoom *r //----------------------------------------------------------------------- -void ChatInterface::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const uint64_t sequence, const std::string & roomName) +void ChatInterface::queryRoom(const NetworkId & id, ConnectionServerConnection * connection, const uintptr_t sequence, const std::string & roomName) { UNREF(connection); ChatServer::fileLog(s_enableChatRoomLogs, "ChatInterface", "queryRoom() id(%s) connection(%s) sequence(%u) roomName(%s)", id.getValueString().c_str(), ChatServer::getConnectionAddress(connection).c_str(), sequence, roomName.c_str()); @@ -1579,7 +1579,7 @@ void ChatInterface::OnCreateRoom(unsigned track,unsigned result, const ChatRoom PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnCreateRoom"); UNREF(user); - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; static Unicode::String wideSWG = Unicode::narrowToWide("SOE+SWG"); static Unicode::String wideFilter = Unicode::narrowToWide(""); static ChatUnicodeString swgNode(wideSWG.data(), wideSWG.size()); @@ -1882,7 +1882,7 @@ void ChatInterface::OnEnterRoom(unsigned track, unsigned result, const ChatAvata return; } - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; ChatAvatarId srcId; if (srcAvatar) @@ -2559,7 +2559,7 @@ void ChatInterface::OnLeaveRoom(unsigned track, unsigned result, const ChatAvata return; } - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; ChatAvatarId id; if (srcAvatar) @@ -2913,7 +2913,7 @@ void ChatInterface::OnSendRoomMessage(unsigned track, unsigned result, const Cha } UNREF(srcAvatar); UNREF(destRoom); - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; ChatOnSendRoomMessage chat(sequence, result); IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat)); } @@ -2998,7 +2998,7 @@ void ChatInterface::OnSendInstantMessage(unsigned track, unsigned result, const } UNREF(srcAvatar); - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; ChatOnSendInstantMessage chat(sequence, result); IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat)); @@ -3053,7 +3053,7 @@ void ChatInterface::OnSendPersistentMessage(unsigned track, unsigned result, con DEBUG_WARNING(true, ("We received an OnSendPersistentMessage with a success result code but nullptr data. This is an error that the API should never give.")); return; } - uint64_t sequence = (uint64_t)user; + uintptr_t sequence = (uintptr_t)user; UNREF(srcAvatar); ChatOnSendPersistentMessage chat(sequence, result); IGNORE_RETURN(ChatServer::sendResponseForTrackId(track, chat)); diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.h b/engine/server/application/ChatServer/src/shared/ChatInterface.h index 3fc0f225..b9221207 100755 --- a/engine/server/application/ChatServer/src/shared/ChatInterface.h +++ b/engine/server/application/ChatServer/src/shared/ChatInterface.h @@ -68,7 +68,7 @@ public: std::string getChatName(const NetworkId &id); - void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const uint64_t sequenceId, const std::string & roomName); + void queryRoom (const NetworkId & id, ConnectionServerConnection * connection, const uintptr_t sequenceId, const std::string & roomName); void updateRoomForThisChatAPI(const ChatRoom *room, const ChatAvatar *additionalAvatar); void updateRooms(); diff --git a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp index 187997ed..9f0bdee5 100755 --- a/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/ConnectionServer/src/shared/ClientConnection.cpp @@ -198,8 +198,7 @@ std::string ClientConnection::getCurrentActivePlayTimeDuration() const { void ClientConnection::sendPlayTimeInfoToGameServer() const { if (m_client && m_client->getGameConnection()) { // update the game server with play time info - GenericValueTypeMessage < std::pair < int32, std::pair < int32, unsigned - long > > > + GenericValueTypeMessage < std::pair < int32, std::pair < int32, uint32_t > > > const msgPlayTimeInfo( "UpdateSessionPlayTimeInfo", std::make_pair(static_cast(m_startPlayTime), std::make_pair(static_cast(m_lastActiveTime), m_activePlayTimeDuration))); @@ -1369,9 +1368,7 @@ ClientConnection::onValidateClient(StationId suid, const std::string &username, } // tell client the server-side game and subscription feature bits and which ConnectionServer we are and the current server Epoch time - GenericValueTypeMessage < std::pair < std::pair < unsigned - long, unsigned - long > , std::pair < int, int32 > > > + GenericValueTypeMessage < std::pair < std::pair < uint32_t, uint32_t > , std::pair < int, int32 > > > const msgFeatureBits( "AccountFeatureBits", std::make_pair(std::make_pair(gameFeatures, subscriptionFeatures), std::make_pair(ConfigConnectionServer::getConnectionServerNumber(), static_cast(::time(nullptr))))); send(msgFeatureBits, true); diff --git a/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp b/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp index bad7a18c..0ee906b9 100755 --- a/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp +++ b/engine/server/library/serverDatabase/src/shared/UniverseLocator.cpp @@ -37,7 +37,7 @@ bool UniverseLocator::locateObjects(DB::Session *session, const std::string &sch void UniverseLocator::sendPostBaselinesCustomData(GameServerConnection &conn) const { DEBUG_REPORT_LOG(true,("Sending UniverseComplete.\n")); - GenericValueTypeMessage const universeCompleteMessage("UniverseCompleteMessage", DatabaseProcess::getInstance().getProcessId()); + GenericValueTypeMessage const universeCompleteMessage("UniverseCompleteMessage", DatabaseProcess::getInstance().getProcessId()); conn.send(universeCompleteMessage, true); SetUniverseAuthoritativeMessage const setUniverseAuthoritativeMessage(conn.getProcessId()); diff --git a/engine/server/library/serverGame/src/shared/ai/HateList.cpp b/engine/server/library/serverGame/src/shared/ai/HateList.cpp index 496fb2b9..2419100c 100755 --- a/engine/server/library/serverGame/src/shared/ai/HateList.cpp +++ b/engine/server/library/serverGame/src/shared/ai/HateList.cpp @@ -535,8 +535,8 @@ void HateList::addServerNpAutoDeltaVariables(Archive::AutoDeltaByteStream & stre // ---------------------------------------------------------------------- int HateList::getTimeSinceLastUpdate() const { - time_t const currentTime = Os::getRealSystemTime(); - time_t const timeSinceActivitiy = (currentTime - m_lastUpdateTime.get()); + uint32_t const currentTime = Os::getRealSystemTime(); + uint32_t const timeSinceActivitiy = (currentTime - m_lastUpdateTime.get()); return clamp(0, static_cast(timeSinceActivitiy), 1024); } diff --git a/engine/server/library/serverGame/src/shared/ai/HateList.h b/engine/server/library/serverGame/src/shared/ai/HateList.h index e6369041..ec9c0fa1 100755 --- a/engine/server/library/serverGame/src/shared/ai/HateList.h +++ b/engine/server/library/serverGame/src/shared/ai/HateList.h @@ -90,8 +90,8 @@ private: Archive::AutoDeltaMap m_hateList; Archive::AutoDeltaVariable m_target; Archive::AutoDeltaVariable m_maxHate; - Archive::AutoDeltaVariable m_lastUpdateTime; - Archive::AutoDeltaVariable m_autoExpireTargetDuration; + Archive::AutoDeltaVariable m_lastUpdateTime; + Archive::AutoDeltaVariable m_autoExpireTargetDuration; std::set m_recentHateList; // This is used for assist logic }; diff --git a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp index c0e08287..7fc71ebd 100755 --- a/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp +++ b/engine/server/library/serverGame/src/shared/command/CommandCppFuncs.cpp @@ -8277,7 +8277,7 @@ static void commandFuncSpammer(Command const &, NetworkId const &actor, NetworkI { // check warden permission first or if god const PlayerObject * gmPlayerObject = PlayerCreatureController::getPlayerObject(gm); - if (!gmPlayerObject || (!gmPlayerObject->isWarden()) && !gmClient->isGod()) + if (!gmPlayerObject || (!gmPlayerObject->isWarden() && !gmClient->isGod())) { Chat::sendSystemMessage(*gm, StringId("warden", "not_authorized"), Unicode::emptyString); return; @@ -8428,7 +8428,7 @@ static void commandFuncUnspammer(Command const &, NetworkId const &actor, Networ { // check warden permission first or if god const PlayerObject * gmPlayerObject = PlayerCreatureController::getPlayerObject(gm); - if (!gmPlayerObject || (!gmPlayerObject->isWarden()) && !gmClient->isGod()) + if (!gmPlayerObject || (!gmPlayerObject->isWarden() && !gmClient->isGod())) { Chat::sendSystemMessage(*gm, StringId("warden", "not_authorized"), Unicode::emptyString); return; diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp index ade32b45..fadec301 100755 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserAi.cpp @@ -272,12 +272,12 @@ bool ConsoleCommandParserAi::performParsing(const NetworkId & userId, const Stri // Hate Over Time List { - std::map > > const & hateOverTime = aiCreatureController->getCreature()->getHateOverTime(); + std::map > > const & hateOverTime = aiCreatureController->getCreature()->getHateOverTime(); if (!hateOverTime.empty()) { result += Unicode::narrowToWide(fs.sprintf("* HATE OVER TIME LIST currentGameTime=(%lu)*\n", ServerClock::getInstance().getGameTimeSeconds())); - for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter) + for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter) { CachedNetworkId const hateTarget(iter->first); TangibleObject const * const hateTargetTangibleObject = TangibleObject::asTangibleObject(hateTarget.getObject()); @@ -369,12 +369,12 @@ bool ConsoleCommandParserAi::performParsing(const NetworkId & userId, const Stri // Hate Over Time List { - std::map > > const & hateOverTime = to->getHateOverTime(); + std::map > > const & hateOverTime = to->getHateOverTime(); if (!hateOverTime.empty()) { result += Unicode::narrowToWide(fs.sprintf("* HATE OVER TIME LIST currentGameTime=(%lu)*\n", ServerClock::getInstance().getGameTimeSeconds())); - for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter) + for (std::map > >::const_iterator iter = hateOverTime.begin(); iter != hateOverTime.end(); ++iter) { CachedNetworkId const hateTarget(iter->first); TangibleObject const * const hateTargetTangibleObject = TangibleObject::asTangibleObject(hateTarget.getObject()); diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp index a8ef94a9..55c98d6d 100755 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserCollection.cpp @@ -167,7 +167,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c } } - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(*slot, currentValue)); result += Unicode::narrowToWide(FormattedString<512>().sprintf("modifying collection slot %s/%s/%s/%s value of %lu by %s for character object %s (%s)\n", slot->collection.page.book.name.c_str(), slot->collection.page.name.c_str(), slot->collection.name.c_str(), Unicode::wideToNarrow(argv[2]).c_str(), currentValue, adjustment.getValueString().c_str(), oid.getValueString().c_str(), Unicode::wideToNarrow(o->getAssignedObjectName()).c_str())); @@ -239,7 +239,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // grant counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -316,7 +316,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // grant counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -393,7 +393,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // grant counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -456,7 +456,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // revoke counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -519,7 +519,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // revoke counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -582,7 +582,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c else { // revoke counter-type slot - unsigned long currentValue; + uint32_t currentValue; IGNORE_RETURN(p->getCollectionSlotValue(**iter, currentValue)); // quickie way to convert to an int64 @@ -651,7 +651,7 @@ bool ConsoleCommandParserCollection::performParsing (const NetworkId & userId, c } else { - unsigned long value; + uint32_t value; IGNORE_RETURN(p->getCollectionSlotValue(**iterSlot, value)); if (value == 0) continue; diff --git a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp index 121e6383..4486f242 100755 --- a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp +++ b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.cpp @@ -2960,7 +2960,7 @@ PersistentCrcString const & AICreatureController::getCombatAction() } //----------------------------------------------------------------------- -time_t AICreatureController::getKnockDownRecoveryTime() const +uint32_t AICreatureController::getKnockDownRecoveryTime() const { AiCreatureCombatProfile const * const combatProfile = AiCreatureCombatProfile::getCombatProfile(m_aiCreatureData->m_primarySpecials); diff --git a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h index 83aa7a07..5b0dc038 100755 --- a/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h +++ b/engine/server/library/serverGame/src/shared/controller/AiCreatureController.h @@ -186,7 +186,7 @@ public: AiMovementType getPendingMovementType() const; PersistentCrcString const & getCombatAction(); - time_t getKnockDownRecoveryTime() const; + uint32_t getKnockDownRecoveryTime() const; std::string const getCombatActionsString(); @@ -245,7 +245,7 @@ private: Archive::AutoDeltaVariable m_frozen; Archive::AutoDeltaVariable m_combatStartLocation; Archive::AutoDeltaVariable m_retreating; - Archive::AutoDeltaVariable m_retreatingStartTime; + Archive::AutoDeltaVariable m_retreatingStartTime; Archive::AutoDeltaVariable m_logging; Archive::AutoDeltaVariableCallback m_creatureName; Archive::AutoDeltaVariable m_hibernationDelay; diff --git a/engine/server/library/serverGame/src/shared/core/Client.cpp b/engine/server/library/serverGame/src/shared/core/Client.cpp index 78f2c8ca..23dd89bd 100755 --- a/engine/server/library/serverGame/src/shared/core/Client.cpp +++ b/engine/server/library/serverGame/src/shared/core/Client.cpp @@ -1613,8 +1613,7 @@ void Client::receiveClientMessage(const GameNetworkMessage &message) { } case constcrc("UpdateSessionPlayTimeInfo") : { Archive::ReadIterator readIterator = static_cast (message).getByteStream().begin(); - GenericValueTypeMessage < std::pair < int32, std::pair < int32, unsigned - long > > > + GenericValueTypeMessage < std::pair < int32, std::pair < int32, uint32_t > > > const msgPlayTimeInfo(readIterator); PlayerObject *playerObject = PlayerCreatureController::getPlayerObject(safe_cast(getCharacterObject())); diff --git a/engine/server/library/serverGame/src/shared/core/ReportManager.cpp b/engine/server/library/serverGame/src/shared/core/ReportManager.cpp index 843373c7..074fb483 100755 --- a/engine/server/library/serverGame/src/shared/core/ReportManager.cpp +++ b/engine/server/library/serverGame/src/shared/core/ReportManager.cpp @@ -54,12 +54,12 @@ namespace ReportManagerNamespace typedef std::map ReportList; ReportList s_reportList; - typedef std::map ReportThrottle; + typedef std::map ReportThrottle; ReportThrottle s_reportThrottle; - time_t const s_throttleTime = 10; // seconds - time_t const s_throttleCleanupTime = 60; // seconds - time_t s_throttleCleanupTimer = 0; // seconds + uint32_t const s_throttleTime = 10; // seconds + uint32_t const s_throttleCleanupTime = 60; // seconds + uint32_t s_throttleCleanupTimer = 0; // seconds } using namespace ReportManagerNamespace; @@ -114,7 +114,7 @@ void ReportManager::addReport(Unicode::String const &reportingName, NetworkId co { // Remove any expired throttling - time_t const systemTime = Os::getRealSystemTime(); + uint32_t const systemTime = Os::getRealSystemTime(); if ((systemTime - s_throttleCleanupTimer) > s_throttleCleanupTime) { @@ -223,7 +223,7 @@ void ReportManager::handleMessage(ChatOnRequestLog const &chatOnRequestLog) report.append(header); - typedef std::multimap SortedChatLog; + typedef std::multimap SortedChatLog; typedef std::set SortedFromPlayers; SortedChatLog sortedChatLog; SortedFromPlayers sortedFromPlayers; @@ -266,7 +266,7 @@ void ReportManager::handleMessage(ChatOnRequestLog const &chatOnRequestLog) Unicode::String toPlayer; Unicode::String text; Unicode::String channel; - time_t time; + uint32_t time; for (; iterChatLog != chatLog.end(); ++iterChatLog) { diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index aaf8affd..151130db 100755 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -6231,7 +6231,7 @@ void CreatureObject::setMood(uint32 mood) } else { - sendControllerMessageToAuthServer(CM_setMood, new MessageQueueGenericValueType(mood)); + sendControllerMessageToAuthServer(CM_setMood, new MessageQueueGenericValueType(mood)); } } @@ -6656,7 +6656,7 @@ void CreatureObject::setSayMode(uint32 sayMode) } else { - sendControllerMessageToAuthServer(CM_setSayMode, new MessageQueueGenericValueType(sayMode)); + sendControllerMessageToAuthServer(CM_setSayMode, new MessageQueueGenericValueType(sayMode)); } } @@ -8723,7 +8723,7 @@ void CreatureObject::setGuildId(int guildId) //----------------------------------------------------------------------- -void CreatureObject::setTimeToUpdateGuildWarPvpStatus(unsigned long timeToUpdateGuildWarPvpStatus) +void CreatureObject::setTimeToUpdateGuildWarPvpStatus(uint32_t timeToUpdateGuildWarPvpStatus) { FATAL(!isAuthoritative(), ("setTimeToUpdateGuildWarPvpStatus called on nonauthoritative object")); m_timeToUpdateGuildWarPvpStatus = timeToUpdateGuildWarPvpStatus; @@ -13511,7 +13511,7 @@ void CreatureObject::pushedMe(const NetworkId & attackerId, * @param slopeAngle the angle of the "hill", in radians * @param expireTime the game time when the effect expires */ -void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime) +void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime) { if (isAuthoritative()) { @@ -13554,7 +13554,7 @@ void CreatureObject::addSlowDownEffect(const TangibleObject & defender, float co * * @return true if the effect was added, false if the creature already had a slow down effect */ -bool CreatureObject::addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime) +bool CreatureObject::addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime) { // if we already are doing a slowdown, don't do another Property * property = getProperty(SlowDownProperty::getClassPropertyId()); @@ -14236,7 +14236,7 @@ void CreatureObject::setRegenRate(Attributes::Enumerator poolAttrib, float value // ---------------------------------------------------------------------- -void CreatureObject::setLastWaterDamageTime(unsigned long newTime) +void CreatureObject::setLastWaterDamageTime(uint32_t newTime) { m_lastWaterDamageTime = newTime; } @@ -15346,7 +15346,7 @@ void CreatureObject::addPackedAppearanceWearable(std::string const &appearanceDa void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject, int saveSlotNumber, std::string const & description) { int debugNumItems = 0; - const unsigned long debugStartTimeMs = Clock::timeMs(); + const uint32_t debugStartTimeMs = Clock::timeMs(); if (!isAuthoritative()) return; @@ -15540,7 +15540,7 @@ void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject, if ((debugNumItems > 0) && getClient()->isGod()) { - const unsigned long debugEndTimeMs = Clock::timeMs(); + const uint32_t debugEndTimeMs = Clock::timeMs(); Chat::sendSystemMessage(*this, Unicode::narrowToWide(FormattedString<256>().sprintf("!!!GOD MODE STATISTICS!!! %d items saved in %lums", debugNumItems, (debugEndTimeMs - debugStartTimeMs))), Unicode::emptyString); } } @@ -15549,7 +15549,7 @@ void CreatureObject::saveDecorationLayout(ServerObject const & pobSourceObject, void CreatureObject::restoreDecorationLayout(ServerObject const & pobTargetObject, int saveSlotNumber) { - const unsigned long debugStartTimeMs = Clock::timeMs(); + const uint32_t debugStartTimeMs = Clock::timeMs(); if (!isAuthoritative()) return; @@ -15885,7 +15885,7 @@ void CreatureObject::restoreDecorationLayout(ServerObject const & pobTargetObjec if ((debugNumItems > 0) && getClient()->isGod()) { - const unsigned long debugEndTimeMs = Clock::timeMs(); + const uint32_t debugEndTimeMs = Clock::timeMs(); Chat::sendSystemMessage(*this, Unicode::narrowToWide(FormattedString<256>().sprintf("!!!GOD MODE STATISTICS!!! %d items read (%d will be moved) in %lums", debugNumItems, numItemsToBeMoved, (debugEndTimeMs - debugStartTimeMs))), Unicode::emptyString); } } diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.h b/engine/server/library/serverGame/src/shared/object/CreatureObject.h index c1161c70..0716c119 100755 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.h +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.h @@ -385,8 +385,8 @@ public: void setPerformanceWatchTarget(NetworkId const &who); int getGuildId() const; void setGuildId(int guildId); - unsigned long getTimeToUpdateGuildWarPvpStatus() const; - void setTimeToUpdateGuildWarPvpStatus(unsigned long timeToUpdateGuildWarPvpStatus); + uint32_t getTimeToUpdateGuildWarPvpStatus() const; + void setTimeToUpdateGuildWarPvpStatus(uint32_t timeToUpdateGuildWarPvpStatus); bool getGuildWarEnabled() const; void setGuildWarEnabled(bool guildWarEnabled); int getMilitiaOfCityId() const; @@ -546,8 +546,8 @@ public: int loadPackedHouses(); void setClientUsesAnimationLocomotion(bool const enabled); - void addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime); - bool addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, unsigned long expireTime); + void addSlowDownEffect(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime); + bool addSlowDownEffectProxy(const TangibleObject & defender, float coneLength, float coneAngle, float slopeAngle, uint32_t expireTime); void removeSlowDownEffect(); void removeSlowDownEffectProxy(); void addTerrainSlopeEffect(const Vector & normal); @@ -645,8 +645,8 @@ public: void setRegenRate(Attributes::Enumerator poolAttrib, float value); float getLavaResistance() const; - unsigned long getLastWaterDamageTime() const; - void setLastWaterDamageTime(unsigned long newTime); + uint32_t getLastWaterDamageTime() const; + void setLastWaterDamageTime(uint32_t newTime); std::map const & getCommandList() const; void clearCommands(); @@ -862,7 +862,7 @@ private: // when switching guild war pvp status using the guild war exemption/exclusive list, // add a delay to when the actually switch takes place, to prevent exploit of quickly // switching in and out guiild war pvp using the guild war exemption/exclusive list - Archive::AutoDeltaVariable m_timeToUpdateGuildWarPvpStatus; + Archive::AutoDeltaVariable m_timeToUpdateGuildWarPvpStatus; Archive::AutoDeltaVariableObserver m_guildWarEnabled; Archive::AutoDeltaVariableObserver m_militiaOfCityId; @@ -1000,7 +1000,7 @@ private: bool m_fixedupPersistentBuffsAfterLoading; bool m_fixedupLevelXpAfterLoading; float m_lavaResistance; - unsigned long m_lastWaterDamageTime; // used for timing last damage taken by lava (and other future harmful water types) + uint32_t m_lastWaterDamageTime; // used for timing last damage taken by lava (and other future harmful water types) float m_attribRegenMultipliers[AR_count]; Archive::AutoDeltaMap m_commands; // game commands a creature may execute @@ -1347,7 +1347,7 @@ inline float CreatureObject::getLavaResistance() const //----------------------------------------------------------------------- -inline unsigned long CreatureObject::getLastWaterDamageTime() const +inline uint32_t CreatureObject::getLastWaterDamageTime() const { return m_lastWaterDamageTime; } @@ -1409,7 +1409,7 @@ inline int CreatureObject::getGuildId() const //----------------------------------------------------------------------- -inline unsigned long CreatureObject::getTimeToUpdateGuildWarPvpStatus() const +inline uint32_t CreatureObject::getTimeToUpdateGuildWarPvpStatus() const { return m_timeToUpdateGuildWarPvpStatus.get(); } diff --git a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp index 2c1df6ae..8a098bf0 100755 --- a/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/PlayerObject.cpp @@ -511,11 +511,11 @@ int PlayerObject::getCurrentBornDate() baseTimeData.tm_wday = 0; baseTimeData.tm_yday = 0; baseTimeData.tm_year = 101; - time_t baseTime = mktime(&baseTimeData); + uint32_t baseTime = mktime(&baseTimeData); // get the current time and compute the birth date - time_t currentTime = time(nullptr); - time_t delta = (currentTime - baseTime) / (60 * 60 * 24); + uint32_t currentTime = time(nullptr); + uint32_t delta = (currentTime - baseTime) / (60 * 60 * 24); delta += ((currentTime - baseTime) % (60 * 60 * 24) != 0 ? 1 : 0); return int(delta); } // PlayerObject::getCurrentBornDate @@ -859,7 +859,7 @@ int PlayerObject::grantExperiencePoints(const std::string & experienceType, int if (ConfigServerScript::getLogBalance() && (total != current)) { // log the grant - unsigned long time = ServerClock::getInstance().getGameTimeSeconds(); + uint32_t time = ServerClock::getInstance().getGameTimeSeconds(); LOG("GameBalance", ("balancelog:%d:XP;%lu;%s;%s;%d;%d;%d;%d", static_cast(GameServer::getInstance().getProcessId()), time, owner->getNetworkId().getValueString().c_str(), experienceType.c_str(), @@ -4231,7 +4231,7 @@ void PlayerObject::handleCMessageTo(const MessageToPayload &message) { // see if guild war pvp status has changed, and if yes, start countdown timer to change the status if (GuildInterface::getGuildMemberGuildWarEnabled(owner->getGuildId(), owner->getNetworkId()) != owner->getGuildWarEnabled()) - owner->setTimeToUpdateGuildWarPvpStatus(ServerClock::getInstance().getGameTimeSeconds() + static_cast(ConfigServerGame::getPvpGuildWarExemptionExclusiveDelaySeconds())); + owner->setTimeToUpdateGuildWarPvpStatus(ServerClock::getInstance().getGameTimeSeconds() + static_cast(ConfigServerGame::getPvpGuildWarExemptionExclusiveDelaySeconds())); } else if (owner->getGuildWarEnabled()) { @@ -4770,7 +4770,7 @@ void PlayerObject::logChat(int const logIndex) { if (m_chatLog != nullptr) { - time_t const logTime = Os::getRealSystemTime(); + uint32_t const logTime = Os::getRealSystemTime(); ChatLogEntry chatLogEntry; @@ -4834,13 +4834,13 @@ void PlayerObject::cleanChatLog() // See if anything needs to be purged from the front of the logs - time_t const chatLogTime = ConfigServerUtility::getChatLogMinutes() * 60; + uint32_t const chatLogTime = ConfigServerUtility::getChatLogMinutes() * 60; int chatLogCount = static_cast(m_chatLog->size()); ChatLog::iterator iterChatLog = m_chatLog->begin(); while (!m_chatLog->empty()) { - const time_t messageTime = iterChatLog->m_time; + const uint32_t messageTime = iterChatLog->m_time; if (messageTime < (currentTime - chatLogTime) || (chatLogCount > ConfigServerUtility::getPlayerMaxChatLogLines())) { @@ -6337,14 +6337,14 @@ void PlayerObject::setPlayedTimeAccumOnly(float playedTimeAccum) // ---------------------------------------------------------------------- -unsigned long PlayerObject::getSessionPlayTimeDuration() const +uint32_t PlayerObject::getSessionPlayTimeDuration() const { - time_t const sessionStartPlayTime = static_cast(m_sessionStartPlayTime.get()); + uint32_t const sessionStartPlayTime = static_cast(m_sessionStartPlayTime.get()); if (sessionStartPlayTime > 0) { - time_t const now = ::time(nullptr); + uint32_t const now = ::time(nullptr); if (now > sessionStartPlayTime) - return static_cast(now - sessionStartPlayTime); + return static_cast(now - sessionStartPlayTime); } return 0; @@ -6352,16 +6352,16 @@ unsigned long PlayerObject::getSessionPlayTimeDuration() const // ---------------------------------------------------------------------- -unsigned long PlayerObject::getSessionActivePlayTimeDuration() const +uint32_t PlayerObject::getSessionActivePlayTimeDuration() const { - unsigned long activePlayTimeDuration = m_sessionActivePlayTimeDuration.get(); + uint32_t activePlayTimeDuration = m_sessionActivePlayTimeDuration.get(); - time_t const sessionLastActiveTime = static_cast(m_sessionLastActiveTime.get()); + uint32_t const sessionLastActiveTime = static_cast(m_sessionLastActiveTime.get()); if (sessionLastActiveTime > 0) { - time_t const now = ::time(nullptr); + uint32_t const now = ::time(nullptr); if (now > sessionLastActiveTime) - activePlayTimeDuration += static_cast(now - sessionLastActiveTime); + activePlayTimeDuration += static_cast(now - sessionLastActiveTime); } return activePlayTimeDuration; @@ -6369,7 +6369,7 @@ unsigned long PlayerObject::getSessionActivePlayTimeDuration() const // ---------------------------------------------------------------------- -void PlayerObject::setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, unsigned long sessionActivePlayTimeDuration) +void PlayerObject::setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, uint32_t sessionActivePlayTimeDuration) { // shouldn't be calling this on a non-auth object if (!isAuthoritative()) @@ -6447,7 +6447,7 @@ int PlayerObject::getRoleIconChoice() const void PlayerObject::setAggroImmuneDuration(int const time) { - m_aggroImmuneDuration = static_cast(time); + m_aggroImmuneDuration = static_cast(time); m_aggroImmuneStartTime = Os::getRealSystemTime(); } @@ -6455,7 +6455,7 @@ void PlayerObject::setAggroImmuneDuration(int const time) bool PlayerObject::isAggroImmune() const { - time_t const elapsedTime = Os::getRealSystemTime() - m_aggroImmuneStartTime.get(); + uint32_t const elapsedTime = Os::getRealSystemTime() - m_aggroImmuneStartTime.get(); return (elapsedTime < m_aggroImmuneDuration.get()); } @@ -7185,7 +7185,7 @@ void PlayerObject::setNextGcwRatingCalcTime(bool const alwaysSendMessageToForRec { if (m_nextGcwRatingCalcTime.get() <= 0) { - time_t const nextCalcTime = CalendarTime::getNextGMTTimeOcurrence(static_cast(now), ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond()); + uint32_t const nextCalcTime = CalendarTime::getNextGMTTimeOcurrence(static_cast(now), ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond()); if (nextCalcTime > 0) { m_nextGcwRatingCalcTime = static_cast(nextCalcTime); @@ -7250,14 +7250,14 @@ void PlayerObject::handleRecalculateGcwRating() totalRatingAdjustment = Pvp::calculateRatingAdjustment(static_cast(points), static_cast(currentRating), totalEarnedRating, totalEarnedRatingAfterDecay, cappedRatingAdjustment); // don't apply rating loss if we are in a "rating loss exclusion interval" - if ((totalRatingAdjustment < 0) && (Pvp::isInGcwRankDecayExclusionInterval(static_cast(nextCalcInterval)))) + if ((totalRatingAdjustment < 0) && (Pvp::isInGcwRankDecayExclusionInterval(static_cast(nextCalcInterval)))) { // CS log LOG("CustomerService", ("PvP_Ranking:%s|NOT APPLYING RATING LOSS|interval %ld (%s) (%s)|current rating=%ld|points=%ld|total earned rating=%ld|total earned rating after decay=%ld|capped rating adjustment=%ld|final rating adjustment=%ld", getAccountDescription().c_str(), nextCalcInterval, - CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(), - CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(), + CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(), + CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(), currentRating, points, totalEarnedRating, @@ -7279,8 +7279,8 @@ void PlayerObject::handleRecalculateGcwRating() LOG("CustomerService", ("PvP_Ranking:%s|interval %ld (%s) (%s)|current rating=%ld|new rating=%ld|points=%ld|total earned rating=%ld|total earned rating after decay=%ld|capped rating adjustment=%ld|final rating adjustment=%ld", getAccountDescription().c_str(), nextCalcInterval, - CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(), - CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(), + CalendarTime::convertEpochToTimeStringGMT(static_cast(nextCalcInterval)).c_str(), + CalendarTime::convertEpochToTimeStringLocal(static_cast(nextCalcInterval)).c_str(), previousRating, currentRating, points, @@ -7294,7 +7294,7 @@ void PlayerObject::handleRecalculateGcwRating() points = 0; // check to see if we need to do another calculation for the next interval - nextCalcInterval = static_cast(CalendarTime::getNextGMTTimeOcurrence(static_cast(nextCalcInterval)+1, ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond())); + nextCalcInterval = static_cast(CalendarTime::getNextGMTTimeOcurrence(static_cast(nextCalcInterval)+1, ConfigServerGame::getGcwRecalcTimeDayOfWeek(), ConfigServerGame::getGcwRecalcTimeHour(), ConfigServerGame::getGcwRecalcTimeMinute(), ConfigServerGame::getGcwRecalcTimeSecond())); if (nextCalcInterval <= 0) break; @@ -7406,7 +7406,7 @@ void PlayerObject::addSessionActivity(uint32 activity) { CreatureObject * const owner = getCreatureObject(); if (owner) - owner->sendControllerMessageToAuthServer(CM_addSessionActivity, new MessageQueueGenericValueType(static_cast(activity))); + owner->sendControllerMessageToAuthServer(CM_addSessionActivity, new MessageQueueGenericValueType(static_cast(activity))); } } @@ -7618,7 +7618,7 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64 if (currentSlotValue != newSlotValue) { BitArray b = collections->get(); - b.setValue(slotInfo->beginSlotId, slotInfo->endSlotId, static_cast(newSlotValue)); + b.setValue(slotInfo->beginSlotId, slotInfo->endSlotId, static_cast(newSlotValue)); collections->set(b); LOG("CustomerService", ("Collection:%s modified collection %d-%d (%s/%s/%s/%s) from %lu to %lu", @@ -7629,10 +7629,10 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64 slotInfo->collection.page.name.c_str(), slotInfo->collection.name.c_str(), slotInfo->name.c_str(), - static_cast(currentSlotValue), - static_cast(newSlotValue))); + static_cast(currentSlotValue), + static_cast(newSlotValue))); - bool const completedCollectionSlot = hasCompletedCollectionSlot(*slotInfo, static_cast(newSlotValue)); + bool const completedCollectionSlot = hasCompletedCollectionSlot(*slotInfo, static_cast(newSlotValue)); // for "server first" tracking, we need to check if the collection // is completed *BEFORE* triggering script, because script may clear @@ -7692,7 +7692,7 @@ bool PlayerObject::modifyCollectionSlotValue(std::string const & slotName, int64 // ---------------------------------------------------------------------- -bool PlayerObject::getCollectionSlotValue(std::string const & slotName, unsigned long & value) const +bool PlayerObject::getCollectionSlotValue(std::string const & slotName, uint32_t & value) const { value = 0; @@ -7708,7 +7708,7 @@ bool PlayerObject::getCollectionSlotValue(std::string const & slotName, unsigned // ---------------------------------------------------------------------- -bool PlayerObject::getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long & value) const +bool PlayerObject::getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t & value) const { // bit-type slot if (!slotInfo.counterTypeSlot) @@ -7795,7 +7795,7 @@ bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionIn // ---------------------------------------------------------------------- -bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long slotValue) +bool PlayerObject::hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t slotValue) { // bit-type slot if (!slotInfo.counterTypeSlot) @@ -8123,7 +8123,7 @@ void PlayerObject::updateChatSpamSpatialNumCharacters(NetworkId const & characte // sync chat character count with chat server if ((syncChatServer) || (timeNow > m_chatSpamNextTimeToSyncWithChatServer.get())) { - time_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched()); + uint32_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched()); if (timeUnsquelch > 0) timeUnsquelch += ::time(nullptr); @@ -8166,7 +8166,7 @@ void PlayerObject::handleChatStatisticsFromChatServer(NetworkId const & characte // sync chat character count with chat server if (syncChatServer || ((spatialNumCharacters != m_chatSpamSpatialNumCharacters.get()) && (timeNow > m_chatSpamNextTimeToSyncWithChatServer.get()))) { - time_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched()); + uint32_t timeUnsquelch = static_cast(getSecondsUntilUnsquelched()); if (timeUnsquelch > 0) timeUnsquelch += ::time(nullptr); diff --git a/engine/server/library/serverGame/src/shared/object/PlayerObject.h b/engine/server/library/serverGame/src/shared/object/PlayerObject.h index eab82de3..b2f30808 100755 --- a/engine/server/library/serverGame/src/shared/object/PlayerObject.h +++ b/engine/server/library/serverGame/src/shared/object/PlayerObject.h @@ -60,7 +60,7 @@ public: ChatLogEntry(); int m_index; - time_t m_time; + uint32_t m_time; }; typedef std::list ChatLog; @@ -105,11 +105,11 @@ public: float getPlayedTimeAccumOnly() const; void setPlayedTimeAccumOnly(float playedTimeAccum); - unsigned long getSessionPlayTimeDuration() const; - unsigned long getSessionActivePlayTimeDuration() const; + uint32_t getSessionPlayTimeDuration() const; + uint32_t getSessionActivePlayTimeDuration() const; int32 getSessionStartPlayTime() const; int32 getSessionLastActiveTime() const; - void setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, unsigned long sessionActivePlayTimeDuration); + void setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, uint32_t sessionActivePlayTimeDuration); void setStationId(StationId account); void setCheaterLevel(float level); @@ -358,15 +358,15 @@ public: bool modifyCollectionSlotValue(std::string const & slotName, int64 delta); - bool getCollectionSlotValue(std::string const & slotName, unsigned long & value) const; - bool getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long & value) const; + bool getCollectionSlotValue(std::string const & slotName, uint32_t & value) const; + bool getCollectionSlotValue(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t & value) const; bool hasCompletedCollectionSlotPrereq(std::string const & slotName, std::vector * collectionInfo = nullptr) const; bool hasCompletedCollectionSlotPrereq(CollectionsDataTable::CollectionInfoSlot const & slotInfo, std::vector * collectionInfo = nullptr) const; bool hasCompletedCollectionSlot(std::string const & slotName) const; bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo) const; - static bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, unsigned long slotValue); + static bool hasCompletedCollectionSlot(CollectionsDataTable::CollectionInfoSlot const & slotInfo, uint32_t slotValue); bool hasCompletedCollection(std::string const & collectionName) const; @@ -395,8 +395,8 @@ public: int getChatSpamTimeEndInterval() const; - time_t getChatSpamNextTimeToNotifyPlayerWhenLimited() const; - void setChatSpamNextTimeToNotifyPlayerWhenLimited(time_t chatSpamNextTimeToNotifyPlayerWhenLimited); + uint32_t getChatSpamNextTimeToNotifyPlayerWhenLimited() const; + void setChatSpamNextTimeToNotifyPlayerWhenLimited(uint32_t chatSpamNextTimeToNotifyPlayerWhenLimited); // citizenship info void updateCitizenshipInfo(); @@ -554,7 +554,7 @@ private: // cached here for use by the game server Archive::AutoDeltaVariable m_sessionStartPlayTime; // time when the player started playing the character Archive::AutoDeltaVariable m_sessionLastActiveTime; // the client will detect when the player is "active" or "inactive"; this keeps track of the last time that the client said the player was "active"; if 0, it means the client is currently "inactive" - Archive::AutoDeltaVariable m_sessionActivePlayTimeDuration; // total amount of play time player was active (i.e. at the mouse/keyboard/joystick) + Archive::AutoDeltaVariable m_sessionActivePlayTimeDuration; // total amount of play time player was active (i.e. at the mouse/keyboard/joystick) Archive::AutoDeltaVariable m_food; Archive::AutoDeltaVariable m_maxFood; @@ -581,11 +581,11 @@ private: Archive::AutoDeltaVariable m_theaterId; Archive::AutoDeltaVariable m_theaterLocationType; Archive::AutoDeltaVariable m_roleIconChoice; - Archive::AutoDeltaVariable m_aggroImmuneDuration; - Archive::AutoDeltaVariable m_aggroImmuneStartTime; + Archive::AutoDeltaVariable m_aggroImmuneDuration; + Archive::AutoDeltaVariable m_aggroImmuneStartTime; ChatLog * const m_chatLog; - time_t m_chatLogPurgeTime; + uint32_t m_chatLogPurgeTime; bool m_isUnsticking; //when asking a player to accept or complete a quest, remember the quest that we asked them about @@ -641,7 +641,7 @@ private: Archive::AutoDeltaVariable m_chatSpamNonSpatialNumCharacters; Archive::AutoDeltaVariable m_chatSpamTimeEndInterval; Archive::AutoDeltaVariable m_chatSpamNextTimeToSyncWithChatServer; - time_t m_chatSpamNextTimeToNotifyPlayerWhenLimited; + uint32_t m_chatSpamNextTimeToNotifyPlayerWhenLimited; // citizenship info Archive::AutoDeltaVariable m_citizenshipCity; @@ -1053,14 +1053,14 @@ inline int PlayerObject::getChatSpamTimeEndInterval() const // ---------------------------------------------------------------------- -inline time_t PlayerObject::getChatSpamNextTimeToNotifyPlayerWhenLimited() const +inline uint32_t PlayerObject::getChatSpamNextTimeToNotifyPlayerWhenLimited() const { return m_chatSpamNextTimeToNotifyPlayerWhenLimited; } // ---------------------------------------------------------------------- -inline void PlayerObject::setChatSpamNextTimeToNotifyPlayerWhenLimited(time_t chatSpamNextTimeToNotifyPlayerWhenLimited) +inline void PlayerObject::setChatSpamNextTimeToNotifyPlayerWhenLimited(uint32_t chatSpamNextTimeToNotifyPlayerWhenLimited) { m_chatSpamNextTimeToNotifyPlayerWhenLimited = chatSpamNextTimeToNotifyPlayerWhenLimited; } diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp index 585cd19f..3625e9dc 100755 --- a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp @@ -241,7 +241,7 @@ namespace ServerObjectNamespace const std::string OBJVAR_OPEN_BANK_TERMINAL_ID("open_bank_location"); - unsigned long gs_objectCount = 0; + uint32_t gs_objectCount = 0; const char * const portalPropertyCrcObjectVariableName = "portalProperty.crc"; @@ -262,7 +262,7 @@ namespace ServerObjectNamespace // sentinel to keep the messageTo current being // handled from getting removed from m_messageTos - std::pair, MessageToId> s_currentMessageToBeingHandled = std::make_pair(std::make_pair(0, 0), MessageToId::cms_invalid); + std::pair, MessageToId> s_currentMessageToBeingHandled = std::make_pair(std::make_pair(0, 0), MessageToId::cms_invalid); // ---------------------------------------------------------------------- @@ -1295,7 +1295,7 @@ static const ConstCharCrcLowerString templateName("object/object/base/shared_obj //----------------------------------------------------------------------- -const unsigned long ServerObject::getObjectCount() +const uint32_t ServerObject::getObjectCount() { return gs_objectCount; } @@ -2320,9 +2320,9 @@ bool ServerObject::handleContentsSetup() //----------------------------------------------------------------------- -unsigned long ServerObject::getAndIncrementMoveSequenceNumber() +uint32_t ServerObject::getAndIncrementMoveSequenceNumber() { - unsigned long newValue = m_transformSequence.get(); + uint32_t newValue = m_transformSequence.get(); newValue++; m_transformSequence = newValue; return newValue; @@ -3401,7 +3401,7 @@ void ServerObject::sendToClientsInUpdateRange(const GameNetworkMessage & message Vector combatSpamAttackerPosition_w, combatSpamDefenderPosition_w; if (!clients.empty()) { - static unsigned long int const controllerMessageCrc = MessageDispatch::MessageBase::makeMessageTypeFromString("ObjControllerMessage"); + static uint32_t const controllerMessageCrc = MessageDispatch::MessageBase::makeMessageTypeFromString("ObjControllerMessage"); if (controllerMessageCrc == message.getType()) { ObjControllerMessage const & ocm = static_cast(message); @@ -5083,10 +5083,10 @@ bool ServerObject::setPackedObjVars(std::string const &packedVarString) std::string ServerObject::debugGetMessageToList() const { - unsigned long const now = ServerClock::getInstance().getGameTimeSeconds(); + uint32_t const now = ServerClock::getInstance().getGameTimeSeconds(); std::string result; - time_t const timeNow = ::time(nullptr); - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) + uint32_t const timeNow = ::time(nullptr); + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) { char temp[256]; @@ -5114,14 +5114,14 @@ std::string ServerObject::debugGetMessageToList() const * @return The delivery time of the next message, or 0 if there are no more messages */ -unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessageToTime) +uint32_t ServerObject::processQueuedMessageTos(uint32_t effectiveMessageToTime) { PROFILER_AUTO_BLOCK_DEFINE("ServerObject::processQueuedMessageTos"); if (isAuthoritative()) { int handledMessageCount = 0; - unsigned long startTime = Clock::timeMs(); + uint32_t startTime = Clock::timeMs(); while (!m_messageTos.empty() && m_messageTos.begin()->second.getCallTime() <= effectiveMessageToTime) { ++handledMessageCount; @@ -5131,7 +5131,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa std::string nextTenMessages; { int count = 1; - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator iter = m_messageTos.begin(); ((iter != m_messageTos.end()) && (count <= 10)); ++iter, ++count) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator iter = m_messageTos.begin(); ((iter != m_messageTos.end()) && (count <= 10)); ++iter, ++count) { nextTenMessages += iter->second.getMethod(); nextTenMessages += ", "; @@ -5150,7 +5150,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa break; } - Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator message = m_messageTos.begin(); + Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator message = m_messageTos.begin(); // if the message is going to be recurring, create a // new messageTo to reschedule the recurring message @@ -5162,7 +5162,7 @@ unsigned long ServerObject::processQueuedMessageTos(unsigned long effectiveMessa message->second.getMessageId(), message->second.getMethod(), message->second.getPackedDataVector(), - ServerClock::getInstance().getGameTimeSeconds() + static_cast(message->second.getRecurringTime()), + ServerClock::getInstance().getGameTimeSeconds() + static_cast(message->second.getRecurringTime()), false, message->second.getDeliveryType(), NetworkId::cms_invalid, @@ -5378,7 +5378,7 @@ void ServerObject::handleCMessageTo(const MessageToPayload &message) else if (message.getMethod() == "CancelRecurringMessageTo") { std::string const & methodName = message.getDataAsString(); - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) { if ((i->second.getRecurringTime() != 0) && (i->second.getMethod() == methodName) && (i->first != s_currentMessageToBeingHandled)) { @@ -7718,7 +7718,7 @@ void ServerObject::deliverMessageTo(MessageToPayload & message) { // Recurring messages can have only one instance each. Ignore // this message if there is already a recurring one with the same method name. - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) { if ((i->second.getRecurringTime() != 0) && (i->second.getMethod() == message.getMethod())) return; @@ -7778,7 +7778,7 @@ int ServerObject::cancelMessageTo(std::string const & messageName) { removeCount = 0; - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();) { if ((i->second.getMethod() == messageName) && (i->first != s_currentMessageToBeingHandled)) { @@ -7812,7 +7812,7 @@ int ServerObject::cancelMessageToByMessageId(NetworkId const & messageId) { removeCount = 0; - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end();) { if ((i->second.getMessageId() == messageId) && (i->first != s_currentMessageToBeingHandled)) { @@ -7842,14 +7842,14 @@ int ServerObject::cancelMessageToByMessageId(NetworkId const & messageId) // returns -1 if object doesn't have the messageTo int ServerObject::timeUntilMessageTo(std::string const & messageName) const { - for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) + for (Archive::AutoDeltaMap, MessageToId>, MessageToPayload>::const_iterator i=m_messageTos.begin(); i!=m_messageTos.end(); ++i) { if (i->second.getMethod() == messageName) { if ((i->first != s_currentMessageToBeingHandled) || (i->second.getRecurringTime() > 0)) { - unsigned long const now = ServerClock::getInstance().getGameTimeSeconds(); - unsigned long const callTime = i->second.getCallTime(); + uint32_t const now = ServerClock::getInstance().getGameTimeSeconds(); + uint32_t const callTime = i->second.getCallTime(); if (callTime > now) return static_cast(callTime - now); diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.h b/engine/server/library/serverGame/src/shared/object/ServerObject.h index 90437a5c..7f8f9fa6 100755 --- a/engine/server/library/serverGame/src/shared/object/ServerObject.h +++ b/engine/server/library/serverGame/src/shared/object/ServerObject.h @@ -260,7 +260,7 @@ public: int getConversionId () const; void setConversionId (int newConversionId); - static const unsigned long getObjectCount (); + static const uint32_t getObjectCount (); const bool getPositionChanged () const; const Sphere getLocalSphere () const; const Sphere & getSphereExtent () const; @@ -485,7 +485,7 @@ public: void attachStartupScripts (); void customize (const std::string & customName, int value); void serverObjectEndBaselines (bool fromDatabase); - unsigned long getAndIncrementMoveSequenceNumber (); + uint32_t getAndIncrementMoveSequenceNumber (); uint32 getAuthServerProcessId () const; const int getCacheVersion () const; Client * getClient () const; @@ -540,7 +540,7 @@ public: int cancelMessageTo (std::string const & messageName); int cancelMessageToByMessageId (NetworkId const & messageId); int timeUntilMessageTo (std::string const & messageName) const; - unsigned long processQueuedMessageTos (unsigned long effectiveMessageToTime); + uint32_t processQueuedMessageTos (uint32_t effectiveMessageToTime); std::string debugGetMessageToList () const; bool handleTeleportFixup (bool force); bool serverObjectInitializeFirstTimeObject(ServerObject *cell, Transform const &transform); @@ -798,7 +798,7 @@ private: Archive::AutoDeltaVariableCallback m_authServerProcessId; Archive::AutoDeltaSet m_proxyServerProcessIds; - Archive::AutoDeltaVariable m_transformSequence; + Archive::AutoDeltaVariable m_transformSequence; Archive::AutoDeltaVariable m_cacheVersion; Archive::AutoDeltaVariable m_loadContents; @@ -844,7 +844,7 @@ protected: private: Archive::AutoDeltaVector m_triggerVolumeInfo; - Archive::AutoDeltaMap, MessageToId>, MessageToPayload> m_messageTos; + Archive::AutoDeltaMap, MessageToId>, MessageToPayload> m_messageTos; Sphere m_worldSphere; diff --git a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp index a547127b..eba9e915 100755 --- a/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/TangibleObject.cpp @@ -2341,8 +2341,8 @@ void TangibleObject::addHateOverTime(NetworkId const & target, float const hate, if (isAuthoritative()) { - unsigned long const currentGameTime = ServerClock::getInstance().getGameTimeSeconds(); - unsigned long const endGameTime = currentGameTime + seconds; + uint32_t const currentGameTime = ServerClock::getInstance().getGameTimeSeconds(); + uint32_t const endGameTime = currentGameTime + seconds; IGNORE_RETURN(addHate(target, hate)); @@ -5149,9 +5149,9 @@ void TangibleObject::handleCMessageTo(const MessageToPayload &message) if (!m_hateOverTime.empty()) { std::list expired; - unsigned long const currentGameTime = ServerClock::getInstance().getGameTimeSeconds(); + uint32_t const currentGameTime = ServerClock::getInstance().getGameTimeSeconds(); - for (std::map > >::const_iterator iter = m_hateOverTime.begin(); iter != m_hateOverTime.end(); ++iter) + for (std::map > >::const_iterator iter = m_hateOverTime.begin(); iter != m_hateOverTime.end(); ++iter) { if (iter->second.second.first < currentGameTime) { diff --git a/engine/server/library/serverGame/src/shared/object/TangibleObject.h b/engine/server/library/serverGame/src/shared/object/TangibleObject.h index 338cc71a..035fed01 100755 --- a/engine/server/library/serverGame/src/shared/object/TangibleObject.h +++ b/engine/server/library/serverGame/src/shared/object/TangibleObject.h @@ -153,7 +153,7 @@ public: void addHateOverTime(NetworkId const & target, float const hate, int const seconds); bool setHate(NetworkId const & target, float const hate); float getHate(NetworkId const & target) const; - std::map > > const & getHateOverTime() const; + std::map > > const & getHateOverTime() const; float getMaxHate() const; CachedNetworkId const & getHateTarget() const; void removeHateTarget(NetworkId const & target); @@ -576,10 +576,10 @@ private: HateList m_hateList; // for applying "hate over time" - Archive::AutoDeltaMap > > m_hateOverTime; + Archive::AutoDeltaMap > > m_hateOverTime; Archive::AutoDeltaVariableCallback m_inCombat; - Archive::AutoDeltaVariable m_combatStartTime; + Archive::AutoDeltaVariable m_combatStartTime; // allows script to make an object (i.e. like a turret) attackable Archive::AutoDeltaVariableCallback m_attackableOverride; @@ -813,7 +813,7 @@ inline std::set const & TangibleObject::getPassiveRevealPlayerCharact //---------------------------------------------------------------------- -inline std::map > > const & TangibleObject::getHateOverTime() const +inline std::map > > const & TangibleObject::getHateOverTime() const { return m_hateOverTime.getMap(); } diff --git a/engine/server/library/serverGame/src/shared/objectTemplate/ServerIntangibleObjectTemplate.h b/engine/server/library/serverGame/src/shared/objectTemplate/ServerIntangibleObjectTemplate.h index f4720ff0..a0e4d6e8 100644 --- a/engine/server/library/serverGame/src/shared/objectTemplate/ServerIntangibleObjectTemplate.h +++ b/engine/server/library/serverGame/src/shared/objectTemplate/ServerIntangibleObjectTemplate.h @@ -67,7 +67,7 @@ public: struct Ingredient { - enum IngredientType ingredientType; + enum IngredientType ingredientType; std::vector ingredients; float complexity; std::string skillCommand; diff --git a/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp b/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp index 5cd42a72..d6e291ae 100755 --- a/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp +++ b/engine/server/library/serverGame/src/shared/pvp/Pvp.cpp @@ -843,14 +843,14 @@ int Pvp::calculateGcwImperialScorePercentile(std::string const & gcwCategory, st { std::map >::const_iterator const iterImperial = gcwImperialScore.find(gcwCategory); if (iterImperial != gcwImperialScore.end()) - totalImperial = static_cast(std::max(0l, iterImperial->second.first)) + static_cast(std::max(0l, iterImperial->second.second)); + totalImperial = static_cast(std::max(0ll, iterImperial->second.first)) + static_cast(std::max(0ll, iterImperial->second.second)); } uint64 total = totalImperial; { std::map >::const_iterator const iterRebel = gcwRebelScore.find(gcwCategory); if (iterRebel != gcwRebelScore.end()) - total += (static_cast(std::max(0l, iterRebel->second.first)) + static_cast(std::max(0l, iterRebel->second.second))); + total += (static_cast(std::max(0ll, iterRebel->second.first)) + static_cast(std::max(0ll, iterRebel->second.second))); } // if the score is less than 1, treat it as a tie; note that score is scaled by 1000 diff --git a/engine/server/library/serverNetworkMessages/src/shared/centralGameServer/MessageToPayloadImpl.h b/engine/server/library/serverNetworkMessages/src/shared/centralGameServer/MessageToPayloadImpl.h index 98754843..5da198c7 100755 --- a/engine/server/library/serverNetworkMessages/src/shared/centralGameServer/MessageToPayloadImpl.h +++ b/engine/server/library/serverNetworkMessages/src/shared/centralGameServer/MessageToPayloadImpl.h @@ -68,7 +68,7 @@ private: MessageToId m_messageId; std::string m_method; std::vector m_packedData; - unsigned long m_callTime; + uint32_t m_callTime; bool m_guaranteed; bool m_persisted; MessageToPayload::DeliveryType m_deliveryType; diff --git a/engine/server/library/serverNetworkMessages/src/shared/core/SetupServerNetworkMessages.cpp b/engine/server/library/serverNetworkMessages/src/shared/core/SetupServerNetworkMessages.cpp index 007706a8..67af827e 100755 --- a/engine/server/library/serverNetworkMessages/src/shared/core/SetupServerNetworkMessages.cpp +++ b/engine/server/library/serverNetworkMessages/src/shared/core/SetupServerNetworkMessages.cpp @@ -217,20 +217,20 @@ namespace SetupServerNetworkMessagesNamespace return result; } - void packUnsignedLong(const MessageQueue::Data * data, Archive::ByteStream & target) + void packUnsignedInt(const MessageQueue::Data * data, Archive::ByteStream & target) { - const MessageQueueGenericValueType * msg = safe_cast *>(data); + const MessageQueueGenericValueType * msg = safe_cast *>(data); if(msg) { Archive::put(target, msg->getValue()); } } - MessageQueue::Data * unpackUnsignedLong(Archive::ReadIterator & source) + MessageQueue::Data * unpackUnsignedInt(Archive::ReadIterator & source) { - unsigned long v; + uint32_t v; Archive::get(source, v); - return new MessageQueueGenericValueType(v); + return new MessageQueueGenericValueType(v); } void packUnicodeString(const MessageQueue::Data * data, Archive::ByteStream & target) @@ -1391,9 +1391,9 @@ void SetupServerNetworkMessages::internalInstall () ControllerMessageFactory::registerControllerMessageHandler(CM_setCombatTargets, packNetworkIdArray, unpackNetworkIdArray); ControllerMessageFactory::registerControllerMessageHandler(CM_setCurrentWeapon, packNetworkId, unpackNetworkId); ControllerMessageFactory::registerControllerMessageHandler(CM_setGroup, packBoolNetworkId, unpackBoolNetworkId); - ControllerMessageFactory::registerControllerMessageHandler(CM_setMood, packUnsignedLong, unpackUnsignedLong); + ControllerMessageFactory::registerControllerMessageHandler(CM_setMood, packUnsignedInt, unpackUnsignedInt); ControllerMessageFactory::registerControllerMessageHandler(CM_setIncapacitated, packBoolNetworkId, unpackBoolNetworkId); - ControllerMessageFactory::registerControllerMessageHandler(CM_setSayMode, packUnsignedLong, unpackUnsignedLong); + ControllerMessageFactory::registerControllerMessageHandler(CM_setSayMode, packUnsignedInt, unpackUnsignedInt); ControllerMessageFactory::registerControllerMessageHandler(CM_setAnimationMood, packString, unpackString); ControllerMessageFactory::registerControllerMessageHandler(CM_setScaleFactor, packFloat, unpackFloat); ControllerMessageFactory::registerControllerMessageHandler(CM_setShockWounds, packInt, unpackInt); @@ -1550,7 +1550,7 @@ void SetupServerNetworkMessages::internalInstall () ControllerMessageFactory::registerControllerMessageHandler(CM_modifyNextGcwRatingCalcTime, packInt, unpackInt); ControllerMessageFactory::registerControllerMessageHandler(CM_cancelMessageTo, packString, unpackString); ControllerMessageFactory::registerControllerMessageHandler(CM_clearSessionActivity, packNothing, unpackNothing); - ControllerMessageFactory::registerControllerMessageHandler(CM_addSessionActivity, packUnsignedLong, unpackUnsignedLong); + ControllerMessageFactory::registerControllerMessageHandler(CM_addSessionActivity, packUnsignedInt, unpackUnsignedInt); ControllerMessageFactory::registerControllerMessageHandler(CM_incrementKillMeter, packInt, unpackInt); ControllerMessageFactory::registerControllerMessageHandler(CM_addPassiveReveal, packIntIntNetworkId, unpackIntIntNetworkId); ControllerMessageFactory::registerControllerMessageHandler(CM_removePassiveReveal, packNetworkId, unpackNetworkId); diff --git a/engine/server/library/serverNetworkMessages/src/shared/gameConnectionServer/GameConnectionServerMessages.cpp b/engine/server/library/serverNetworkMessages/src/shared/gameConnectionServer/GameConnectionServerMessages.cpp index e274f15a..40b0e0c1 100755 --- a/engine/server/library/serverNetworkMessages/src/shared/gameConnectionServer/GameConnectionServerMessages.cpp +++ b/engine/server/library/serverNetworkMessages/src/shared/gameConnectionServer/GameConnectionServerMessages.cpp @@ -223,7 +223,7 @@ GameClientMessage::GameClientMessage(const std::vector & d, bool newR if (reportMessages) { Archive::ReadIterator ri = byteStream.get().begin(); - unsigned long cmdCrc; + uint32_t cmdCrc; Archive::get(ri, cmdCrc); NetworkHandler::reportMessage("send.GameClientMessage." + GameNetworkMessage::getCmdName(cmdCrc), byteStream.get().getSize()); } @@ -246,7 +246,7 @@ GameClientMessage::GameClientMessage(Archive::ReadIterator & source) : if (reportMessages) { Archive::ReadIterator ri = byteStream.get().begin(); - unsigned long cmdCrc; + uint32_t cmdCrc; Archive::get(ri, cmdCrc); NetworkHandler::reportMessage("send.GameClientMessage." + GameNetworkMessage::getCmdName(cmdCrc), byteStream.get().getSize()); } diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsCollection.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsCollection.cpp index 396e6d90..2e6ded6d 100755 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsCollection.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsCollection.cpp @@ -150,7 +150,7 @@ jlong JNICALL ScriptMethodsCollectionNamespace::getCollectionSlotValue(JNIEnv *e std::string slotNameString; JavaLibrary::convert(localSlotName, slotNameString); - unsigned long value; + uint32_t value; if (!playerObject->getCollectionSlotValue(slotNameString, value)) return static_cast(-1); diff --git a/engine/server/library/serverUtility/src/shared/ChatLogManager.cpp b/engine/server/library/serverUtility/src/shared/ChatLogManager.cpp index c883063e..da6a508a 100755 --- a/engine/server/library/serverUtility/src/shared/ChatLogManager.cpp +++ b/engine/server/library/serverUtility/src/shared/ChatLogManager.cpp @@ -33,7 +33,7 @@ namespace ChatLogManagerNamespace { public: - ChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const *text, Unicode::String const &channel, time_t const time) + ChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const *text, Unicode::String const &channel, uint32_t const time) : m_fromPlayer(Unicode::toLower(fromPlayer)) , m_toPlayer(Unicode::toLower(toPlayer)) , m_text(text) @@ -62,7 +62,7 @@ namespace ChatLogManagerNamespace return m_channel; } - time_t getTime() const + uint32_t getTime() const { return m_time; } @@ -73,14 +73,14 @@ namespace ChatLogManagerNamespace Unicode::String m_toPlayer; Unicode::String const *m_text; Unicode::String m_channel; - time_t m_time; + uint32_t m_time; // Disabled ChatLogEntry(); }; - typedef std::list > TimeLog; + typedef std::list > TimeLog; typedef std::map ChatLog; typedef std::map PlayerLog; typedef std::map MessageList; // Second parameter is the reference count @@ -89,14 +89,14 @@ namespace ChatLogManagerNamespace ChatLog s_chatLog; PlayerLog s_playerLog; MessageList s_chatMessageList; - time_t s_purgeTime = 0; + uint32_t s_purgeTime = 0; int s_currentIndex = 0; - time_t s_chatLogMemoryTimer = 0; + uint32_t s_chatLogMemoryTimer = 0; int s_cacheHits = 0; int s_cacheMisses = 0; void printPlayerLog(); - void addChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, time_t const time); + void addChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, uint32_t const time); bool removeChatLogEntry(int const messageIndex); void purgeChatLog(); std::string getTimeString(time_t const time); @@ -120,7 +120,7 @@ void ChatLogManagerNamespace::printPlayerLog() } //----------------------------------------------------------------------------- -void ChatLogManagerNamespace::addChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, time_t const time) +void ChatLogManagerNamespace::addChatLogEntry(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, uint32_t const time) { ChatLog::const_iterator iterChatLog = s_chatLog.find(messageIndex); @@ -238,20 +238,20 @@ void ChatLogManagerNamespace::purgeChatLog() { // This purges the list of old data once a second - time_t const systemTime = Os::getRealSystemTime(); + uint32_t const systemTime = Os::getRealSystemTime(); if (s_purgeTime != systemTime) { s_purgeTime = systemTime; - time_t const chatLogPurgeTime = static_cast(ConfigServerUtility::getChatLogMinutes() * 60); + uint32_t const chatLogPurgeTime = static_cast(ConfigServerUtility::getChatLogMinutes() * 60); TimeLog::iterator iterTimeLog = s_timeLog.begin(); int chatLogCount = static_cast(s_timeLog.size()); int purgedMessages = 0; for (; iterTimeLog != s_timeLog.end(); ++iterTimeLog) { - time_t const time = iterTimeLog->first; + uint32_t const time = iterTimeLog->first; if ( (time < (systemTime - chatLogPurgeTime)) || (static_cast(s_chatMessageList.size()) > ConfigServerUtility::getServerMaxChatLogLines())) @@ -346,7 +346,7 @@ void ChatLogManager::remove() } //----------------------------------------------------------------------------- -void ChatLogManager::logChat(Unicode::String const & fromPlayer, Unicode::String const & toPlayer, Unicode::String const & message, Unicode::String const & channel, int const messageIndex, time_t const time) +void ChatLogManager::logChat(Unicode::String const & fromPlayer, Unicode::String const & toPlayer, Unicode::String const & message, Unicode::String const & channel, int const messageIndex, uint32_t const time) { addChatLogEntry(fromPlayer, toPlayer, message, channel, messageIndex, time); purgeChatLog(); @@ -386,7 +386,7 @@ bool ChatLogManager::getChatMessage(int const messageIndex, Unicode::String &cha } //----------------------------------------------------------------------------- -bool ChatLogManager::getChatMessage(int const messageIndex, Unicode::String &fromPlayer, Unicode::String &toPlayer, Unicode::String &text, Unicode::String &channel, time_t &time) +bool ChatLogManager::getChatMessage(int const messageIndex, Unicode::String &fromPlayer, Unicode::String &toPlayer, Unicode::String &text, Unicode::String &channel, uint32_t &time) { bool result = false; @@ -412,7 +412,7 @@ bool ChatLogManager::getChatMessage(int const messageIndex, Unicode::String &fro } //----------------------------------------------------------------------------- -void ChatLogManager::buildLogEntry(Unicode::String &result, Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, time_t const time) +void ChatLogManager::buildLogEntry(Unicode::String &result, Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, uint32_t const time) { result.clear(); result.append(Unicode::narrowToWide(getTimeStringShort(time))); diff --git a/engine/server/library/serverUtility/src/shared/ChatLogManager.h b/engine/server/library/serverUtility/src/shared/ChatLogManager.h index 62ab60ad..978fe3ca 100755 --- a/engine/server/library/serverUtility/src/shared/ChatLogManager.h +++ b/engine/server/library/serverUtility/src/shared/ChatLogManager.h @@ -18,11 +18,11 @@ public: static void install(); static void remove(); - static void logChat(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, time_t const time); - static bool getChatMessage(int const messageIndex, Unicode::String &fromPlayer, Unicode::String &toPlayer, Unicode::String &text, Unicode::String &channel, time_t &time); + static void logChat(Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, int const messageIndex, uint32_t const time); + static bool getChatMessage(int const messageIndex, Unicode::String &fromPlayer, Unicode::String &toPlayer, Unicode::String &text, Unicode::String &channel, uint32_t &time); static bool getChatMessage(int const messageIndex, Unicode::String &chatMessage); - static int getNextMessageIndex(); - static void buildLogEntry(Unicode::String &result, Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, time_t const time); + static int getNextMessageIndex(); + static void buildLogEntry(Unicode::String &result, Unicode::String const &fromPlayer, Unicode::String const &toPlayer, Unicode::String const &message, Unicode::String const &channel, uint32_t const time); static bool isPlayerInLogs(Unicode::String const &player); static void getReportHeader(Unicode::String & header, std::string const &reportingPlayer, NetworkId const &reportingPlayerNetworkId, std::string const &reportingPlayerStationName, uint32 reportingPlayerStationId, std::string const &harassingPlayer, NetworkId const &harassingPlayerNetworkId, std::string const &harassingPlayerStationName, uint32 harassingPlayerStationId); diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.cpp b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.cpp index 2aa0818e..8693cdb4 100755 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.cpp +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.cpp @@ -18,7 +18,7 @@ BindableLong::BindableLong() : Bindable(), value(-999) { } -BindableLong::BindableLong(long int _value) : Bindable(sizeof(value)), value(_value) +BindableLong::BindableLong(int32_t _value) : Bindable(sizeof(value)), value(_value) { } @@ -29,14 +29,14 @@ void *BindableLong::getBuffer() // ---------------------------------------------------------------------- -long int BindableLong::getValue() const +int32_t BindableLong::getValue() const { return value; } // ---------------------------------------------------------------------- -BindableLong &BindableLong::operator=(long int rhs) +BindableLong &BindableLong::operator=(int32_t rhs) { indicator=sizeof(value); value=rhs; @@ -45,7 +45,7 @@ BindableLong &BindableLong::operator=(long int rhs) // ---------------------------------------------------------------------- -void BindableLong::setValue(long int rhs) +void BindableLong::setValue(int32_t rhs) { indicator=sizeof(value); value=rhs; diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h index c76c2621..b0d8651d 100755 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h @@ -23,61 +23,33 @@ namespace DB { { public: BindableLong(); - explicit BindableLong(long int _value); + explicit BindableLong(int32_t _value); - long int getValue() const; - void setValue(const long int rhs); - BindableLong &operator=(const long int rhs); + int32_t getValue() const; + void setValue(const int32_t rhs); + BindableLong &operator=(const int32_t rhs); // following alternate getValue's are provided for convenience, particularly in // the auto-generated code: - void getValue(unsigned int &buffer) const; -// void getValue(uint32 &buffer) const; // for some reason, our compiler is convinced that uint32 != unsigned int - void getValue(long int &buffer) const; - void getValue(int &buffer) const; void getValue(int8 &buffer) const; void getValue(uint8 &buffer) const; + void getValue(int16_t &buffer) const; + void getValue(uint16_t &buffer) const; + void getValue(int32_t &buffer) const; + void getValue(uint32_t &buffer) const; void *getBuffer(); virtual std::string outputValue() const; private: - long int value; + int32_t value; }; //lint !e1721 !e1509 // no virtual destructor, unusual operator = } // ---------------------------------------------------------------------- -inline void DB::BindableLong::getValue(unsigned int &buffer) const -{ - buffer=static_cast(getValue()); -} - -// ---------------------------------------------------------------------- - -//inline void DB::BindableLong::getValue(uint32 &buffer) const -//{ -// buffer=static_cast(getValue()); -//} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(long int &buffer) const -{ - buffer=getValue(); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(int &buffer) const -{ - buffer=getValue(); -} - -// ---------------------------------------------------------------------- - inline void DB::BindableLong::getValue(int8 &buffer) const { buffer=static_cast(getValue()); @@ -89,6 +61,35 @@ inline void DB::BindableLong::getValue(uint8 &buffer) const { buffer=static_cast(getValue()); } +// ---------------------------------------------------------------------- + +inline void DB::BindableLong::getValue(int16_t &buffer) const +{ + buffer=getValue(); +} + +// ---------------------------------------------------------------------- + +inline void DB::BindableLong::getValue(uint16_t &buffer) const +{ + buffer=static_cast(getValue()); +} + +// ---------------------------------------------------------------------- + +inline void DB::BindableLong::getValue(int32_t &buffer) const +{ + buffer=getValue(); +} + +// ---------------------------------------------------------------------- + +inline void DB::BindableLong::getValue(uint32 &buffer) const +{ + buffer=static_cast(getValue()); +} + + // ====================================================================== diff --git a/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.cpp b/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.cpp index 39e3303a..feb1e7cb 100755 --- a/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.cpp +++ b/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.cpp @@ -120,7 +120,7 @@ OCIType* BindableVarray::getTDO() // ---------------------------------------------------------------------- -bool BindableVarrayNumber::push_back(int value) +bool BindableVarrayNumber::push_back(int16_t value) { OCINumber buffer; @@ -138,7 +138,7 @@ bool BindableVarrayNumber::push_back(int value) // ---------------------------------------------------------------------- -bool BindableVarrayNumber::push_back(long int value) +bool BindableVarrayNumber::push_back(int32_t value) { OCINumber buffer; @@ -154,22 +154,22 @@ bool BindableVarrayNumber::push_back(long int value) return true; } // ---------------------------------------------------------------------- -// -//bool BindableVarrayNumber::push_back(int64 value) -//{ -// OCINumber buffer; -// -// OCIInd buffer_indicator (OCI_IND_NOTNULL); -// -// OCISession *localSession = safe_cast(m_session); -// -// if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer)))) -// return false; -// if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data)))) -// return false; -// -// return true; -//} + +bool BindableVarrayNumber::push_back(int64 value) +{ + OCINumber buffer; + + OCIInd buffer_indicator (OCI_IND_NOTNULL); + + OCISession *localSession = safe_cast(m_session); + + if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer)))) + return false; + if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data)))) + return false; + + return true; +} // ---------------------------------------------------------------------- @@ -204,7 +204,7 @@ bool BindableVarrayNumber::push_back(double value) // ---------------------------------------------------------------------- -bool BindableVarrayNumber::push_back(bool IsNULL, int value) +bool BindableVarrayNumber::push_back(bool IsNULL, int16_t value) { OCINumber buffer; @@ -230,7 +230,7 @@ bool BindableVarrayNumber::push_back(bool IsNULL, int value) // ---------------------------------------------------------------------- -bool BindableVarrayNumber::push_back(bool IsNULL, long int value) +bool BindableVarrayNumber::push_back(bool IsNULL, int32_t value) { OCINumber buffer; @@ -255,31 +255,31 @@ bool BindableVarrayNumber::push_back(bool IsNULL, long int value) return true; } // ---------------------------------------------------------------------- -// -//bool BindableVarrayNumber::push_back(bool IsNULL, int64 value) -//{ -// OCINumber buffer; -// -// OCIInd buffer_indicator; -// -// if ( IsNULL ) -// { -// buffer_indicator = OCI_IND_NULL; -// } -// else -// { -// buffer_indicator = OCI_IND_NOTNULL; -// } -// -// OCISession *localSession = safe_cast(m_session); -// -// if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer)))) -// return false; -// if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data)))) -// return false; -// -// return true; -//} + +bool BindableVarrayNumber::push_back(bool IsNULL, int64 value) +{ + OCINumber buffer; + + OCIInd buffer_indicator; + + if ( IsNULL ) + { + buffer_indicator = OCI_IND_NULL; + } + else + { + buffer_indicator = OCI_IND_NOTNULL; + } + + OCISession *localSession = safe_cast(m_session); + + if (! (localSession->m_server->checkerr(*localSession, OCINumberFromInt(localSession->errhp, &value, sizeof(value), OCI_NUMBER_SIGNED, &buffer)))) + return false; + if (! (localSession->m_server->checkerr(*localSession, OCICollAppend(localSession->envhp, localSession->errhp, &buffer, &buffer_indicator, m_data)))) + return false; + + return true; +} // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.h b/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.h index 29737005..2b3de380 100755 --- a/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.h +++ b/engine/shared/library/sharedDatabaseInterface/src_oci/DbBindableVarray.h @@ -57,14 +57,14 @@ namespace DB class BindableVarrayNumber : public BindableVarray { public: - bool push_back(bool IsNULL, int value); + bool push_back(bool IsNULL, int16_t value); bool push_back(bool IsNULL, double value); - bool push_back(bool IsNULL, long int value); -// bool push_back(bool IsNULL, int64 value); - bool push_back(int value); + bool push_back(bool IsNULL, int32_t value); + bool push_back(bool IsNULL, int64 value); + bool push_back(int16_t value); bool push_back(double value); - bool push_back(long int value); -// bool push_back(int64 value); + bool push_back(int32_t value); + bool push_back(int64 value); virtual std::string outputValue() const; }; diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/chat/ChatOnRequestLog.h b/engine/shared/library/sharedNetworkMessages/src/shared/chat/ChatOnRequestLog.h index 776ac485..01eceb9b 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/chat/ChatOnRequestLog.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/chat/ChatOnRequestLog.h @@ -38,7 +38,7 @@ struct ChatLogEntry Unicode::String m_to; Unicode::String m_channel; Unicode::String m_message; - time_t m_time; + uint32_t m_time; }; namespace Archive diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/AuctionData.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/AuctionData.h index 58021cc6..7226d310 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/AuctionData.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/AuctionData.h @@ -56,7 +56,7 @@ namespace Auction uint16 highBidderNameKey; int32 maxProxyBid; int32 myBid; - long itemType; + uint32_t itemType; int resourceContainerClassCrc; int32 flags; int32 entranceCharge; @@ -97,7 +97,7 @@ namespace Auction std::string highBidderName; int32 maxProxyBid; int32 myBid; - long itemType; + uint32_t itemType; int resourceContainerClassCrc; int32 flags; int32 entranceCharge; diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.cpp b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.cpp index bb737fde..b253fe03 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.cpp +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.cpp @@ -85,7 +85,7 @@ MessageQueue::Data* BuffBuilderChangeMessage::unpack(Archive::ReadIterator & sou NetworkId tempId; bool tempBool = false; int tempInt = 0; - time_t tempTime = 0; + uint32_t tempTime = 0; Archive::get(source, tempId); msg->setBufferId(tempId); diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.h index 824febe4..2a981cdf 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/BuffBuilderChangeMessage.h @@ -33,7 +33,7 @@ public: //accessors NetworkId const & getBufferId() const; NetworkId const & getRecipientId() const; - time_t getStartingTime() const; + uint32_t getStartingTime() const; int getBufferRequiredCredits() const; bool getAccepted() const; Origin getOrigin() const; @@ -56,7 +56,7 @@ private: private: NetworkId m_bufferId; NetworkId m_recipientId; - time_t m_startingTime; + uint32_t m_startingTime; int m_bufferRequiredCredits; bool m_accepted; Origin m_origin; @@ -79,7 +79,7 @@ inline NetworkId const & BuffBuilderChangeMessage::getRecipientId() const //----------------------------------------------------------------------- -inline time_t BuffBuilderChangeMessage::getStartingTime() const +inline uint32_t BuffBuilderChangeMessage::getStartingTime() const { return m_startingTime; } diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.cpp b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.cpp index a4c05ea5..89f96c21 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.cpp +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.cpp @@ -157,7 +157,7 @@ MessageQueue::Data* ImageDesignChangeMessage::unpack(Archive::ReadIterator & sou bool tempBool = false; std::string tempStr; int tempInt = 0; - time_t tempTime = 0; + int32_t tempTime = 0; Archive::get(source, tempId); msg->setDesignerId(tempId); diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.h index 07c176e0..c727efc4 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/ImageDesignChangeMessage.h @@ -47,7 +47,7 @@ public: std::string const & getNewHairAsset() const; std::string const & getHairCustomizationData() const; DesignType getDesignType() const; - time_t getStartingTime() const; + int32_t getStartingTime() const; int getDesignerRequiredCredits() const; int getRecipientPaidCredits() const; bool getAccepted() const; @@ -95,7 +95,7 @@ private: std::string m_newHairAsset; std::string m_hairCustomizationData; DesignType m_designType; - time_t m_startingTime; + int32_t m_startingTime; int m_designerRequiredCredits; int m_recipientPaidCredits; bool m_accepted; @@ -160,7 +160,7 @@ inline ImageDesignChangeMessage::DesignType ImageDesignChangeMessage::getDesignT //----------------------------------------------------------------------- -inline time_t ImageDesignChangeMessage::getStartingTime() const +inline int32_t ImageDesignChangeMessage::getStartingTime() const { return m_startingTime; } diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.cpp b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.cpp index 8089e4b2..7557ca3d 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.cpp +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.cpp @@ -68,7 +68,7 @@ MessageQueue::Data * MessageQueueSlowDownEffect::unpack(Archive::ReadIterator & float coneLength; float coneAngle; float slopeAngle; - unsigned long expireTime; + uint32_t expireTime; Archive::get(source, target); Archive::get(source, coneLength); diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.h b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.h index fc4e9a67..3511063c 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/clientGameServer/MessageQueueSlowDownEffect.h @@ -32,7 +32,7 @@ public: float getConeLength() const; float getConeAngle() const; float getSlopeAngle() const; - unsigned long getExpireTime() const; + uint32_t getExpireTime() const; private: MessageQueueSlowDownEffect(); @@ -42,7 +42,7 @@ private: float m_coneLength; float m_coneAngle; float m_slopeAngle; - unsigned long m_expireTime; + uint32_t m_expireTime; }; // ---------------------------------------------------------------------- @@ -67,7 +67,7 @@ inline float MessageQueueSlowDownEffect::getSlopeAngle() const return m_slopeAngle; } -inline unsigned long MessageQueueSlowDownEffect::getExpireTime() const +inline uint32_t MessageQueueSlowDownEffect::getExpireTime() const { return m_expireTime; } diff --git a/engine/shared/library/sharedNetworkMessages/src/shared/planetWatch/ServerInfo.h b/engine/shared/library/sharedNetworkMessages/src/shared/planetWatch/ServerInfo.h index ca3b6b1e..1640c0bf 100755 --- a/engine/shared/library/sharedNetworkMessages/src/shared/planetWatch/ServerInfo.h +++ b/engine/shared/library/sharedNetworkMessages/src/shared/planetWatch/ServerInfo.h @@ -10,8 +10,8 @@ struct ServerInfo { std::string ipAddress; - unsigned long serverId; - unsigned long systemPid; + uint32_t serverId; + uint32_t systemPid; std::string sceneId; }; diff --git a/game/server/library/swgServerNetworkMessages/src/shared/core/SetupSwgServerNetworkMessages.cpp b/game/server/library/swgServerNetworkMessages/src/shared/core/SetupSwgServerNetworkMessages.cpp index 864e2645..8621f0b1 100755 --- a/game/server/library/swgServerNetworkMessages/src/shared/core/SetupSwgServerNetworkMessages.cpp +++ b/game/server/library/swgServerNetworkMessages/src/shared/core/SetupSwgServerNetworkMessages.cpp @@ -198,20 +198,20 @@ namespace SetupSwgServerNetworkMessagesNamespace return unpackGenericMessage > > >(source); } - void packUnsignedLong(const MessageQueue::Data * data, Archive::ByteStream & target) + void packUnsignedInt(const MessageQueue::Data * data, Archive::ByteStream & target) { - const MessageQueueGenericValueType * msg = safe_cast *>(data); + const MessageQueueGenericValueType * msg = safe_cast *>(data); if(msg) { Archive::put(target, msg->getValue()); } } - MessageQueue::Data * unpackUnsignedLong(Archive::ReadIterator & source) + MessageQueue::Data * unpackUnsignedInt(Archive::ReadIterator & source) { - unsigned long v; + uint32_t v; Archive::get(source, v); - return new MessageQueueGenericValueType(v); + return new MessageQueueGenericValueType(v); } void packUnicodeString(const MessageQueue::Data * data, Archive::ByteStream & target) @@ -594,20 +594,20 @@ namespace SetupSwgServerNetworkMessagesNamespace return new MessageQueueGenericValueType >(v); } - void packULongBool(const MessageQueue::Data * data, Archive::ByteStream & target) + void packUIntBool(const MessageQueue::Data * data, Archive::ByteStream & target) { - const MessageQueueGenericValueType > * msg = safe_cast > *>(data); + const MessageQueueGenericValueType > * msg = safe_cast > *>(data); if(msg) { Archive::put(target, msg->getValue()); } } - MessageQueue::Data * unpackULongBool(Archive::ReadIterator & source) + MessageQueue::Data * unpackUIntBool(Archive::ReadIterator & source) { - std::pair v; + std::pair v; Archive::get(source, v); - return new MessageQueueGenericValueType >(v); + return new MessageQueueGenericValueType >(v); } void packStringNetworkIdNetworkId(const MessageQueue::Data * data, Archive::ByteStream & target) diff --git a/game/shared/library/swgSharedNetworkMessages/src/shared/core/SetupSwgSharedNetworkMessages.cpp b/game/shared/library/swgSharedNetworkMessages/src/shared/core/SetupSwgSharedNetworkMessages.cpp index 399a513c..88def1ca 100755 --- a/game/shared/library/swgSharedNetworkMessages/src/shared/core/SetupSwgSharedNetworkMessages.cpp +++ b/game/shared/library/swgSharedNetworkMessages/src/shared/core/SetupSwgSharedNetworkMessages.cpp @@ -191,7 +191,7 @@ namespace SetupSwgSharedNetworkMessagesNamespace void packAddToPlayerSpawnQueueMessage(const MessageQueue::Data * data, Archive::ByteStream & target) { - const MessageQueueGenericValueType > * const msg = dynamic_cast > *>(data); + const MessageQueueGenericValueType > * const msg = dynamic_cast > *>(data); if(msg) { Archive::put(target, msg->getValue()); @@ -200,9 +200,9 @@ namespace SetupSwgSharedNetworkMessagesNamespace MessageQueue::Data* unpackAddToPlayerSpawnQueueMessage(Archive::ReadIterator & source) { - std::pair v; + std::pair v; Archive::get(source, v); - MessageQueueGenericValueType > * result = new MessageQueueGenericValueType >(v); + MessageQueueGenericValueType > * result = new MessageQueueGenericValueType >(v); return result; }