mirror of
https://github.com/SWG-Source/src.git
synced 2026-09-11 23:45:01 -04:00
Fixed issues found in my own review.
This commit is contained in:
@@ -1804,7 +1804,7 @@ static void commandFuncSpatialChatInternal(Command const &, NetworkId const &act
|
||||
const int32_t chatSpamTimeEndInterval = playerObject->getChatSpamTimeEndInterval();
|
||||
if ((chatSpamTimeEndInterval > timeNow) && (timeNow >= playerObject->getChatSpamNextTimeToNotifyPlayerWhenLimited()))
|
||||
{
|
||||
GenericValueTypeMessage<uint32_t> csl("ChatSpamLimited", (chatSpamTimeEndInterval - timeNow));
|
||||
GenericValueTypeMessage<int32_t> csl("ChatSpamLimited", (chatSpamTimeEndInterval - timeNow));
|
||||
obj->getClient()->send(csl, true);
|
||||
|
||||
playerObject->setChatSpamNextTimeToNotifyPlayerWhenLimited((timeNow + ConfigServerGame::getChatSpamNotifyPlayerWhenLimitedIntervalSeconds()));
|
||||
|
||||
@@ -233,7 +233,6 @@
|
||||
#include "sharedFoundation/CrcConstexpr.hpp"
|
||||
|
||||
#include <limits>
|
||||
#include <iostream>
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ private:
|
||||
bool m_gameServerReadyObjectIds;
|
||||
bool m_gameServerReadyDatabaseConnected;
|
||||
bool m_gameServerReadyPlanetConnected;
|
||||
uint64_t m_connectionTimeout;
|
||||
uint32_t m_connectionTimeout;
|
||||
|
||||
ChatServerConnection * m_chatServerConnection;
|
||||
};
|
||||
|
||||
@@ -6115,7 +6115,7 @@ void PlayerObject::getByteStreamFromAutoVariable(const std::string & name, Archi
|
||||
{
|
||||
if(name == "quests")
|
||||
{
|
||||
Archive::AutoDeltaMap<unsigned int, PlayerQuestData>(m_quests).pack(target);
|
||||
Archive::AutoDeltaMap<uint32_t, PlayerQuestData>(m_quests).pack(target);
|
||||
}
|
||||
else if(name == "completedQuests")
|
||||
{
|
||||
@@ -6202,11 +6202,11 @@ void PlayerObject::setAutoVariableFromByteStream(const std::string & name, const
|
||||
Archive::ReadIterator ri(source);
|
||||
if(name == "quests")
|
||||
{
|
||||
typedef Archive::AutoDeltaMap<unsigned int, PlayerQuestData>::Command Commands;
|
||||
typedef Archive::AutoDeltaMap<uint32_t, PlayerQuestData>::Command Commands;
|
||||
std::vector<Commands> quests;
|
||||
|
||||
m_quests.clear();
|
||||
Archive::AutoDeltaMap<unsigned int, PlayerQuestData>(m_quests).unpack(ri, quests);
|
||||
Archive::AutoDeltaMap<uint32_t, PlayerQuestData>(m_quests).unpack(ri, quests);
|
||||
|
||||
for (std::vector<Commands>::const_iterator questIter = quests.begin(); questIter != quests.end(); ++questIter)
|
||||
{
|
||||
@@ -6337,14 +6337,14 @@ void PlayerObject::setPlayedTimeAccumOnly(float playedTimeAccum)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
uint32_t PlayerObject::getSessionPlayTimeDuration() const
|
||||
int32_t PlayerObject::getSessionPlayTimeDuration() const
|
||||
{
|
||||
uint32_t const sessionStartPlayTime = static_cast<uint32_t>(m_sessionStartPlayTime.get());
|
||||
int32_t const sessionStartPlayTime = m_sessionStartPlayTime.get();
|
||||
if (sessionStartPlayTime > 0)
|
||||
{
|
||||
uint32_t const now = ::time(nullptr);
|
||||
int32_t const now = ::time(nullptr);
|
||||
if (now > sessionStartPlayTime)
|
||||
return static_cast<uint32_t>(now - sessionStartPlayTime);
|
||||
return (now - sessionStartPlayTime);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -6352,16 +6352,16 @@ uint32_t PlayerObject::getSessionPlayTimeDuration() const
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
uint32_t PlayerObject::getSessionActivePlayTimeDuration() const
|
||||
int32_t PlayerObject::getSessionActivePlayTimeDuration() const
|
||||
{
|
||||
uint32_t activePlayTimeDuration = m_sessionActivePlayTimeDuration.get();
|
||||
int32_t activePlayTimeDuration = m_sessionActivePlayTimeDuration.get();
|
||||
|
||||
uint32_t const sessionLastActiveTime = static_cast<uint32_t>(m_sessionLastActiveTime.get());
|
||||
int32_t const sessionLastActiveTime = m_sessionLastActiveTime.get();
|
||||
if (sessionLastActiveTime > 0)
|
||||
{
|
||||
uint32_t const now = ::time(nullptr);
|
||||
int32_t const now = ::time(nullptr);
|
||||
if (now > sessionLastActiveTime)
|
||||
activePlayTimeDuration += static_cast<uint32_t>(now - sessionLastActiveTime);
|
||||
activePlayTimeDuration += (now - sessionLastActiveTime);
|
||||
}
|
||||
|
||||
return activePlayTimeDuration;
|
||||
|
||||
@@ -105,8 +105,8 @@ public:
|
||||
float getPlayedTimeAccumOnly() const;
|
||||
void setPlayedTimeAccumOnly(float playedTimeAccum);
|
||||
|
||||
uint32_t getSessionPlayTimeDuration() const;
|
||||
uint32_t getSessionActivePlayTimeDuration() const;
|
||||
int32_t getSessionPlayTimeDuration() const;
|
||||
int32_t getSessionActivePlayTimeDuration() const;
|
||||
int32 getSessionStartPlayTime() const;
|
||||
int32 getSessionLastActiveTime() const;
|
||||
void setSessionPlayTimeInfo(int32 sessionStartPlayTime, int32 sessionLastActiveTime, uint32_t sessionActivePlayTimeDuration);
|
||||
|
||||
+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 int32_t t) :
|
||||
const int64_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 int32_t timeSeconds);
|
||||
const int64_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 int32_t getTimeSeconds () const;
|
||||
const int64_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<int32_t> m_timeSeconds;
|
||||
Archive::AutoVariable<int64_t> m_timeSeconds;
|
||||
|
||||
|
||||
ControlAssumed();
|
||||
@@ -188,7 +188,7 @@ inline const std::string & ControlAssumed::getTemplateName() const
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const int32_t ControlAssumed::getTimeSeconds() const
|
||||
inline const int64_t ControlAssumed::getTimeSeconds() const
|
||||
{
|
||||
return m_timeSeconds.get();
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ void ServerConnection::onConnectionStalled(const unsigned long stallTimeMs)
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void ServerConnection::setProcessId(const uint32 newProcessId)
|
||||
void ServerConnection::setProcessId(const uint32_t newProcessId)
|
||||
{
|
||||
processId = newProcessId;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ public:
|
||||
static const unsigned long makeProcessId ();
|
||||
static bool isMessageForwardable (unsigned long int type);
|
||||
|
||||
const unsigned long getProcessId () const;
|
||||
const unsigned long getOsProcessId () const;
|
||||
const uint32_t getProcessId () const;
|
||||
const uint32_t getOsProcessId () const;
|
||||
virtual void onConnectionClosed ();
|
||||
virtual void onConnectionOpened ();
|
||||
virtual void onConnectionOverflowing (const unsigned int bytesPending);
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
virtual void onReceive (const Archive::ByteStream & message);
|
||||
virtual void reportReceive (const Archive::ByteStream & bs);
|
||||
virtual void reportSend (const Archive::ByteStream & bs);
|
||||
virtual void send (const GameNetworkMessage & message, const bool reliable);
|
||||
virtual void setProcessId (const uint32 newProcessId);
|
||||
virtual void send (const GameNetworkMessage & message, const bool reliable);
|
||||
virtual void setProcessId (const uint32_t newProcessId);
|
||||
|
||||
public:
|
||||
class MessageConnectionCallback: public MessageDispatch::MessageBase
|
||||
@@ -67,20 +67,20 @@ private:
|
||||
ServerConnection &operator=(const ServerConnection&); //disable
|
||||
|
||||
private:
|
||||
unsigned long processId;
|
||||
unsigned long osProcessId; // remote's operating system assigned PID
|
||||
uint32_t processId;
|
||||
uint32_t osProcessId; // remote's operating system assigned PID
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned long ServerConnection::getProcessId(void) const
|
||||
inline const uint32_t ServerConnection::getProcessId(void) const
|
||||
{
|
||||
return processId;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
inline const unsigned long ServerConnection::getOsProcessId() const
|
||||
inline const uint32_t ServerConnection::getOsProcessId() const
|
||||
{
|
||||
return osProcessId;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
SystemAssignedProcessId::SystemAssignedProcessId(const unsigned long id) :
|
||||
SystemAssignedProcessId::SystemAssignedProcessId(const uint32_t id) :
|
||||
GameNetworkMessage("SystemAssignedProcessId"),
|
||||
m_id(id)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ SystemAssignedProcessId::~SystemAssignedProcessId()
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
const unsigned long SystemAssignedProcessId::getId() const
|
||||
const uint32_t SystemAssignedProcessId::getId() const
|
||||
{
|
||||
return m_id.get();
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
class SystemAssignedProcessId : public GameNetworkMessage
|
||||
{
|
||||
public:
|
||||
explicit SystemAssignedProcessId(const unsigned long id);
|
||||
explicit SystemAssignedProcessId(const uint32_t id);
|
||||
explicit SystemAssignedProcessId(Archive::ReadIterator & source);
|
||||
~SystemAssignedProcessId();
|
||||
|
||||
const unsigned long getId () const;
|
||||
const uint32_t getId () const;
|
||||
|
||||
private:
|
||||
SystemAssignedProcessId & operator = (const SystemAssignedProcessId & rhs);
|
||||
|
||||
@@ -744,7 +744,7 @@ void Iff::insertForm(Tag name, bool shouldEnterForm)
|
||||
|
||||
void Iff::insertChunk(Tag name, bool shouldEnterChunk)
|
||||
{
|
||||
const int32 CHUNK_OVERHEAD = sizeof(Tag) + sizeof(uint32);
|
||||
const int32_t CHUNK_OVERHEAD = sizeof(Tag) + sizeof(uint32);
|
||||
|
||||
Tag t;
|
||||
int32 offset;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "sharedFoundation/ConstCharCrcString.h"
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -165,23 +164,6 @@ ConstCharCrcString const CrcStringTable::lookUp(uint32 crc) const
|
||||
high = mid - 1;
|
||||
}
|
||||
|
||||
low = 0;
|
||||
high = m_numberOfEntries - 1;
|
||||
|
||||
while (low <= high)
|
||||
{
|
||||
int const mid = (low + high) / 2;
|
||||
uint32 const entry = m_crcTable[mid];
|
||||
|
||||
if (crc == entry)
|
||||
return ConstCharCrcString(m_strings + m_stringsOffsetTable[mid], crc);
|
||||
else
|
||||
if (crc > entry)
|
||||
low = mid + 1;
|
||||
else
|
||||
high = mid - 1;
|
||||
}
|
||||
|
||||
return ConstCharCrcString("", 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ inline void *memmove(void *destination, const void *source, int length)
|
||||
{
|
||||
DEBUG_FATAL(!destination, ("nullptr destination arg"));
|
||||
DEBUG_FATAL(!source, ("nullptr source arg"));
|
||||
return memmove(destination, source, static_cast<size_t>(length));
|
||||
return memmove(destination, source, length);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -120,7 +120,7 @@ void TextManagerNamespace::getAppropriateWord(Unicode::String &text)
|
||||
// Sub-string search time for words that are listed for sub-string searches
|
||||
|
||||
Unicode::String lowerText(Unicode::toLower(text));
|
||||
size_t findStartPosition = 0;
|
||||
uint32_t findStartPosition = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ void TextManagerNamespace::getAppropriateWord(Unicode::String &text)
|
||||
continue;
|
||||
}
|
||||
|
||||
size_t index = lowerText.find(cussWord, findStartPosition);
|
||||
uint32_t index = lowerText.find(cussWord, findStartPosition);
|
||||
|
||||
if (index != Unicode::String::npos)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ PathSearchNode * PathSearchNode::createSearchNode( PathNode const * node )
|
||||
|
||||
PathSearchNode * searchNode = new PathSearchNode(m_search,m_graph,node);
|
||||
|
||||
node->setMark( 3, (int64)((void*)searchNode) );
|
||||
node->setMark( 3, (int64_t)((void*)searchNode) );
|
||||
|
||||
m_search->m_visitedNodes->push_back(node);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
typedef std::map<std::string, LocalizedString::id_type> NameMap_t;
|
||||
|
||||
// TODO: make this typedef platform dependent
|
||||
typedef uint32_t magic_type;
|
||||
typedef int32_t magic_type;
|
||||
static const magic_type ms_MAGIC;
|
||||
|
||||
explicit LocalizedStringTable (const std::string & filename);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Archive
|
||||
*/
|
||||
void get(ReadIterator & source, StringId & target)
|
||||
{
|
||||
int32_t index = 0;
|
||||
uint32_t index = 0;
|
||||
std::string table;
|
||||
std::string name;
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ bool TaskObjectTemplateListUpdater::process(DB::Session *session)
|
||||
int i_lines = 0;
|
||||
while(1)
|
||||
{
|
||||
uint32 i_id;
|
||||
int32 i_id;
|
||||
char s_name[4096];
|
||||
int i_retval = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user