mirror of
https://github.com/SWG-Source/src.git
synced 2026-09-11 23:45:01 -04:00
Adjusted a few more data types to fix communication issues.
This commit is contained in:
@@ -40,9 +40,9 @@
|
||||
|
||||
// ============================================================================
|
||||
|
||||
unsigned long CharacterMatchManager::ms_numberOfCharacterMatchRequests = 0;
|
||||
unsigned long CharacterMatchManager::ms_numberOfCharacterMatchResults = 0;
|
||||
unsigned long CharacterMatchManager::ms_timeSpentOnCharacterMatchRequestsMs = 0;
|
||||
uint32_t CharacterMatchManager::ms_numberOfCharacterMatchRequests = 0;
|
||||
uint32_t CharacterMatchManager::ms_numberOfCharacterMatchResults = 0;
|
||||
uint32_t CharacterMatchManager::ms_timeSpentOnCharacterMatchRequestsMs = 0;
|
||||
|
||||
// ============================================================================
|
||||
//
|
||||
@@ -639,14 +639,14 @@ void CharacterMatchManager::requestMatch(NetworkId const &networkId, MatchMaking
|
||||
requestCreatureObject->onCharacterMatchRetrieved(mmcr);
|
||||
}
|
||||
|
||||
const unsigned long endTimeMs = Clock::timeMs();
|
||||
const uint32_t endTimeMs = Clock::timeMs();
|
||||
if (endTimeMs >= startTimeMs)
|
||||
{
|
||||
ms_timeSpentOnCharacterMatchRequestsMs += (endTimeMs - startTimeMs);
|
||||
}
|
||||
else // time wrapped
|
||||
{
|
||||
static const unsigned long max = std::numeric_limits<unsigned long>::max();
|
||||
static const uint32_t max = std::numeric_limits<uint32_t>::max();
|
||||
ms_timeSpentOnCharacterMatchRequestsMs += (max - startTimeMs + endTimeMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ class CharacterMatchManager
|
||||
public:
|
||||
|
||||
static void requestMatch(NetworkId const &networkId, MatchMakingCharacterPreferenceId const &matchMakingCharacterPreferenceId);
|
||||
static void getMatchStatistics(unsigned long &numberOfCharacterMatchRequests, unsigned long &numberOfCharacterMatchResults, unsigned long &timeSpentOnCharacterMatchRequestsMs);
|
||||
static void getMatchStatistics(uint32_t &numberOfCharacterMatchRequests, uint32_t &numberOfCharacterMatchResults, uint32_t &timeSpentOnCharacterMatchRequestsMs);
|
||||
static void clearMatchStatistics();
|
||||
|
||||
private:
|
||||
|
||||
static unsigned long ms_numberOfCharacterMatchRequests;
|
||||
static unsigned long ms_numberOfCharacterMatchResults;
|
||||
static unsigned long ms_timeSpentOnCharacterMatchRequestsMs;
|
||||
static uint32_t ms_numberOfCharacterMatchRequests;
|
||||
static uint32_t ms_numberOfCharacterMatchResults;
|
||||
static uint32_t ms_timeSpentOnCharacterMatchRequestsMs;
|
||||
|
||||
// Disable
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline void CharacterMatchManager::getMatchStatistics(unsigned long &numberOfCharacterMatchRequests, unsigned long &numberOfCharacterMatchResults, unsigned long &timeSpentOnCharacterMatchRequestsMs)
|
||||
inline void CharacterMatchManager::getMatchStatistics(uint32_t &numberOfCharacterMatchRequests, uint32_t &numberOfCharacterMatchResults, uint32_t &timeSpentOnCharacterMatchRequestsMs)
|
||||
{
|
||||
numberOfCharacterMatchRequests = ms_numberOfCharacterMatchRequests;
|
||||
numberOfCharacterMatchResults = ms_numberOfCharacterMatchResults;
|
||||
|
||||
@@ -233,6 +233,7 @@
|
||||
#include "sharedFoundation/CrcConstexpr.hpp"
|
||||
|
||||
#include <limits>
|
||||
#include <iostream>
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -253,11 +254,11 @@ namespace GameServerNamespace
|
||||
const float IDLE_CLIENTS_CHECK_TIME_SEC = 30.0f;
|
||||
ServerCommandPermissionManager * s_permissionManager = 0;
|
||||
|
||||
unsigned long s_frameTime;
|
||||
uint64 s_totalObjectCreateMessagesReceived;
|
||||
uint64 s_totalObjectCreateMessagesSent;
|
||||
bool s_metricsManagerInstalled = false;
|
||||
uint32 s_lastTaskKeepaliveTime = 0;
|
||||
uint32_t s_frameTime;
|
||||
uint64 s_totalObjectCreateMessagesReceived;
|
||||
uint64 s_totalObjectCreateMessagesSent;
|
||||
bool s_metricsManagerInstalled = false;
|
||||
uint32 s_lastTaskKeepaliveTime = 0;
|
||||
|
||||
#ifdef _DEBUG
|
||||
int s_extraDelayPerFrameMs = 0; // to emulate long loop time
|
||||
@@ -266,11 +267,11 @@ namespace GameServerNamespace
|
||||
std::set<uint32> s_clusterStartupResidenceStructureListResponse;
|
||||
std::map<NetworkId, std::pair<int, NetworkId> > s_clusterStartupResidenceStructureListByStructure;
|
||||
|
||||
unsigned long getFrameRateLimit();
|
||||
uint32_t getFrameRateLimit();
|
||||
void broadCastHyperspaceOnWarp(ServerObject const * owner);
|
||||
ShipObject *getAttachedShip(CreatureObject *creature);
|
||||
|
||||
std::map<NetworkId, unsigned long> s_pendingLoadRequests;
|
||||
std::map<NetworkId, uint32_t> s_pendingLoadRequests;
|
||||
|
||||
struct CtsSourceCharacterInfo
|
||||
{
|
||||
@@ -745,7 +746,7 @@ void GameServer::dropClient(const NetworkId& oid, const bool immediate)
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
unsigned long GameServer::getFrameTime() const
|
||||
uint32_t GameServer::getFrameTime() const
|
||||
{
|
||||
return s_frameTime;
|
||||
}
|
||||
@@ -895,7 +896,7 @@ void GameServer::receiveMessage(const MessageDispatch::Emitter & source, const M
|
||||
if(Clock::timeMs() - s_lastTaskKeepaliveTime > 60000)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Sending keepalive message to taskmanager for process %i", Os::getProcessId()));
|
||||
static const GenericValueTypeMessage<unsigned long> gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
|
||||
static const GenericValueTypeMessage<uint32_t> gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
|
||||
getInstance().m_taskManagerConnection->send(gameServerTaskManagerKeepAlive, true);
|
||||
s_lastTaskKeepaliveTime = Clock::timeMs();
|
||||
}
|
||||
@@ -3583,14 +3584,14 @@ void GameServer::receiveMessage2(const MessageDispatch::Emitter & source, const
|
||||
GenericValueTypeMessage <uint8> const characterMatchStatisticsRequest(ri);
|
||||
UNREF(characterMatchStatisticsRequest);
|
||||
|
||||
unsigned long numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs;
|
||||
uint32_t numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs;
|
||||
CharacterMatchManager::getMatchStatistics(numberOfCharacterMatchRequests, numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs);
|
||||
|
||||
if (numberOfCharacterMatchRequests || numberOfCharacterMatchResults ||
|
||||
timeSpentOnCharacterMatchRequestsMs) {
|
||||
CharacterMatchManager::clearMatchStatistics();
|
||||
|
||||
const GenericValueTypeMessage <std::pair<unsigned long, std::pair<unsigned long, unsigned long> >> characterMatchStatisticsResponse("LfgStatRsp", std::make_pair(numberOfCharacterMatchRequests, std::make_pair(numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs)));
|
||||
const GenericValueTypeMessage <std::pair<uint32_t, std::pair<uint32_t, uint32_t> >> characterMatchStatisticsResponse("LfgStatRsp", std::make_pair(numberOfCharacterMatchRequests, std::make_pair(numberOfCharacterMatchResults, timeSpentOnCharacterMatchRequestsMs)));
|
||||
sendToCentralServer(characterMatchStatisticsResponse);
|
||||
}
|
||||
|
||||
@@ -4048,7 +4049,7 @@ bool GameServer::requestSceneWarpDelayed(const CachedNetworkId &objectId, const
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
unsigned long GameServerNamespace::getFrameRateLimit()
|
||||
uint32_t GameServerNamespace::getFrameRateLimit()
|
||||
{
|
||||
return ServerWorld::isSpaceScene() ? ConfigServerGame::getSpaceFrameRateLimit() : ConfigServerGame::getGroundFrameRateLimit();
|
||||
}
|
||||
@@ -4059,17 +4060,17 @@ void GameServer::run(void)
|
||||
{
|
||||
getInstance().initialize();
|
||||
|
||||
unsigned long lastFrameTime = 0;
|
||||
uint32_t lastFrameTime = 0;
|
||||
int oldFilesOpened = TreeFile::getNumberOfFilesOpenedTotal();
|
||||
int oldSizeOpened = TreeFile::getSizeOfFilesOpenedTotal();
|
||||
int newFilesOpened = 0;
|
||||
int newSizeOpened = 0;
|
||||
unsigned long startTime = Clock::timeMs();
|
||||
unsigned long lastFrameProcessStartTime = startTime;
|
||||
uint32_t startTime = Clock::timeMs();
|
||||
uint32_t lastFrameProcessStartTime = startTime;
|
||||
|
||||
const unsigned long targetFrameTime = static_cast<unsigned long>(1000.0f/getFrameRateLimit());
|
||||
const uint32_t targetFrameTime = static_cast<uint32_t>(1000.0f/getFrameRateLimit());
|
||||
|
||||
const GenericValueTypeMessage<unsigned long> gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
|
||||
const GenericValueTypeMessage<uint32_t> gameServerTaskManagerKeepAlive("GameServerTaskManagerKeepAlive", Os::getProcessId());
|
||||
|
||||
PROFILER_BLOCK_DEFINE(profileBlockMainLoop, "main loop");
|
||||
PROFILER_BLOCK_ENTER(profileBlockMainLoop);
|
||||
@@ -4186,7 +4187,7 @@ void GameServer::run(void)
|
||||
alreadyReported=false;
|
||||
}
|
||||
|
||||
unsigned long curTime = Clock::timeMs();
|
||||
uint32_t curTime = Clock::timeMs();
|
||||
lastFrameTime = curTime-startTime;
|
||||
if (!getInstance().getDone())
|
||||
ServerClock::getInstance().incrementServerFrame();
|
||||
@@ -5193,11 +5194,11 @@ int GameServer::getNumberOfPendingLoadRequests()
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
unsigned long GameServer::getOldestPendingLoadRequestTime(NetworkId & id)
|
||||
uint32_t GameServer::getOldestPendingLoadRequestTime(NetworkId & id)
|
||||
{
|
||||
unsigned long oldestTime = std::numeric_limits<unsigned long>::max();
|
||||
uint32_t oldestTime = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
std::map<NetworkId, unsigned long>::const_iterator i = s_pendingLoadRequests.begin();
|
||||
std::map<NetworkId, uint32_t>::const_iterator i = s_pendingLoadRequests.begin();
|
||||
for (; i != s_pendingLoadRequests.end(); ++i)
|
||||
if (i->second < oldestTime)
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
bool isGameServerConnected (uint32 processId) const;
|
||||
ConnectionServerConnection * getConnectionServerConnection (const std::string & connectionServerIp, const uint16 connectionServerPort);
|
||||
uint32 getFirstGameServerForPlanet ();
|
||||
unsigned long getFrameTime () const;
|
||||
uint32_t getFrameTime () const;
|
||||
int getNumClients() const;
|
||||
uint32 getProcessId () const;
|
||||
uint32 getPreloadAreaId () const;
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
static bool isAtPendingLoadRequestLimit();
|
||||
static int getPendingLoadRequestLimit();
|
||||
static int getNumberOfPendingLoadRequests();
|
||||
static unsigned long getOldestPendingLoadRequestTime(NetworkId & id);
|
||||
static uint32_t getOldestPendingLoadRequestTime(NetworkId & id);
|
||||
|
||||
static std::string getRetroactiveCtsHistory(std::string const & clusterName, NetworkId const & characterId);
|
||||
static std::vector<std::vector<std::pair<std::string, DynamicVariable> > const *> const & getRetroactiveCtsHistoryObjvars(NetworkId const & characterId);
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ TransferControlMessage::~TransferControlMessage()
|
||||
//-----------------------------------------------------------------------
|
||||
ControlAssumed::ControlAssumed(NetworkId oid, const std::string & newSceneName, const bool skipLoadScreen,
|
||||
const Vector &startPos, const float startYaw, const std::string & templateName,
|
||||
const int64 t) :
|
||||
const int32_t t) :
|
||||
GameNetworkMessage("ControlAssumed"),
|
||||
m_oid(oid),
|
||||
m_sceneName(newSceneName),
|
||||
|
||||
+4
-4
@@ -118,7 +118,7 @@ class ControlAssumed : public GameNetworkMessage
|
||||
public:
|
||||
explicit ControlAssumed(NetworkId oid, const std::string & newSceneName, const bool skipLoadScreen,
|
||||
const Vector &startPos, const float startYaw, const std::string & templateName,
|
||||
const int64 timeSeconds);
|
||||
const int32_t timeSeconds);
|
||||
ControlAssumed(Archive::ReadIterator & source);
|
||||
virtual ~ControlAssumed();
|
||||
|
||||
@@ -128,7 +128,7 @@ class ControlAssumed : public GameNetworkMessage
|
||||
const Vector & getStartPosition () const;
|
||||
const float getStartYaw () const;
|
||||
const std::string & getTemplateName () const;
|
||||
const int64 getTimeSeconds () const;
|
||||
const int32_t getTimeSeconds () const;
|
||||
|
||||
private:
|
||||
Archive::AutoVariable<NetworkId> m_oid;
|
||||
@@ -137,7 +137,7 @@ class ControlAssumed : public GameNetworkMessage
|
||||
Archive::AutoVariable<Vector> m_startPosition;
|
||||
Archive::AutoVariable<float> m_startYaw;
|
||||
Archive::AutoVariable<std::string> m_templateName;
|
||||
Archive::AutoVariable<int64> m_timeSeconds;
|
||||
Archive::AutoVariable<int32_t> m_timeSeconds;
|
||||
|
||||
|
||||
ControlAssumed();
|
||||
@@ -188,7 +188,7 @@ inline const std::string & ControlAssumed::getTemplateName() const
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const int64 ControlAssumed::getTimeSeconds() const
|
||||
inline const int32_t ControlAssumed::getTimeSeconds() const
|
||||
{
|
||||
return m_timeSeconds.get();
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
JF("_renameCharacterReleaseNameReservation", "(J)V", renameCharacterReleaseNameReservation),
|
||||
JF("_renameCharacter", "(JLjava/lang/String;)V", renameCharacter),
|
||||
JF("_getPlayerStationId", "(J)I", getPlayerStationId),
|
||||
//JF("_getPlayerUsernameDoNotUse", "(J)Ljava/lang/String;", getPlayerUsername),
|
||||
JF("_getPlayerUsernameDoNotUse", "(J)Ljava/lang/String;", getPlayerUsername),
|
||||
};
|
||||
|
||||
return JavaLibrary::registerNatives(NATIVES, sizeof(NATIVES)/sizeof(NATIVES[0]));
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace MessageDispatch
|
||||
|
||||
Returns an STL hash of the type name.
|
||||
*/
|
||||
const unsigned long int MessageBase::makeMessageTypeFromString(const char * const idString)
|
||||
const uint32_t MessageBase::makeMessageTypeFromString(const char * const idString)
|
||||
{
|
||||
unsigned long int result = 0;
|
||||
uint32_t result = 0;
|
||||
#if PRODUCTION == 0
|
||||
result = LabelHash::hashLabel("MessageDispatch", idString);
|
||||
#else
|
||||
@@ -59,7 +59,7 @@ type(0)
|
||||
|
||||
@author Justin Randall
|
||||
*/
|
||||
MessageBase::MessageBase(const unsigned long int newType) :
|
||||
MessageBase::MessageBase(const uint32_t newType) :
|
||||
type(newType)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,16 +26,16 @@ namespace MessageDispatch
|
||||
{
|
||||
public:
|
||||
explicit MessageBase(const char * const typeName);
|
||||
explicit MessageBase(const unsigned long int type);
|
||||
explicit MessageBase(const uint32_t type);
|
||||
virtual ~MessageBase();
|
||||
static const unsigned long int makeMessageTypeFromString(const char * const id);
|
||||
const unsigned long int getType() const;
|
||||
static const uint32_t makeMessageTypeFromString(const char * const id);
|
||||
const uint32_t getType() const;
|
||||
const bool isType(const char * const typeName) const;
|
||||
void setType(const unsigned long int newType);
|
||||
void setType(const uint32_t newType);
|
||||
void setType(const char * const typeName);
|
||||
private:
|
||||
MessageBase();
|
||||
unsigned long int type;
|
||||
uint32_t type;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -50,9 +50,9 @@ namespace MessageDispatch
|
||||
{
|
||||
public:
|
||||
explicit Message(const char * const typeName="");
|
||||
explicit Message(const unsigned long int type);
|
||||
explicit Message(const uint32_t type);
|
||||
Message(const char * const typeName, const ValueType & value);
|
||||
Message(const unsigned long int type, const ValueType & value);
|
||||
Message(const uint32_t type, const ValueType & value);
|
||||
explicit Message(const Message & source);
|
||||
virtual ~Message();
|
||||
Message & operator = (const Message & rhs);
|
||||
@@ -69,7 +69,7 @@ namespace MessageDispatch
|
||||
@return the type of the Message. The type is an STL hash of the
|
||||
type name.
|
||||
*/
|
||||
inline const unsigned long int MessageBase::getType() const
|
||||
inline const uint32_t MessageBase::getType() const
|
||||
{
|
||||
return type;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ namespace MessageDispatch
|
||||
/**
|
||||
@brief set or reset the type identifier
|
||||
*/
|
||||
inline void MessageBase::setType(const unsigned long newType)
|
||||
inline void MessageBase::setType(const uint32_t newType)
|
||||
{
|
||||
type = newType;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace MessageDispatch
|
||||
}
|
||||
|
||||
template<class ValueType>
|
||||
inline Message<ValueType>::Message(const unsigned long int type) :
|
||||
inline Message<ValueType>::Message(const uint32_t type) :
|
||||
MessageBase(type),
|
||||
value()
|
||||
{
|
||||
@@ -142,7 +142,7 @@ namespace MessageDispatch
|
||||
}
|
||||
|
||||
template<class ValueType>
|
||||
inline Message<ValueType>::Message(const unsigned long int type, const ValueType & newValue) :
|
||||
inline Message<ValueType>::Message(const uint32_t type, const ValueType & newValue) :
|
||||
MessageBase(type),
|
||||
value(newValue)
|
||||
{
|
||||
|
||||
@@ -626,7 +626,7 @@ int DataTable::searchColumnString( int column, const std::string & searchValue )
|
||||
int valueCrc = getIntValue(column,i);
|
||||
IGNORE_RETURN ( indexPair->second.insert(std::pair<int, int>(valueCrc, i)) );
|
||||
if (retval == -1 && valueString == searchValue)
|
||||
retval = i;
|
||||
retval = i; // don't return here because we're adding indexes for everything in this table as we've not indexed it before.
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -634,7 +634,7 @@ int DataTable::searchColumnString( int column, const std::string & searchValue )
|
||||
std::pair<std::multimap<const std::string, int>, std::multimap<int, int> > * indexPair = static_cast<std::pair<std::multimap<const std::string, int>, std::multimap<int, int> > *>(voidIndex);
|
||||
std::multimap<const std::string, int>::iterator iter = indexPair->first.find(searchValue);
|
||||
if (iter != indexPair->first.end())
|
||||
retval = iter->second;
|
||||
return iter->second; // if we find our value, return here instead of iterating through the rest of the table.
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
Reference in New Issue
Block a user