diff --git a/engine/shared/library/sharedFoundation/src/shared/NetworkId.h b/engine/shared/library/sharedFoundation/src/shared/NetworkId.h index 1f42fc60..18ada619 100755 --- a/engine/shared/library/sharedFoundation/src/shared/NetworkId.h +++ b/engine/shared/library/sharedFoundation/src/shared/NetworkId.h @@ -47,6 +47,7 @@ public: NetworkId& operator= (const NetworkId&); bool operator< (const NetworkId& rhs) const; + bool operator> (const NetworkId& rhs) const; bool operator== (const NetworkId& rhs) const; bool operator!= (const NetworkId& rhs) const; size_t getHashValue() const; @@ -94,6 +95,11 @@ inline bool NetworkId::operator< (const NetworkId& rhs) const return m_value < rhs.m_value; } +inline bool NetworkId::operator> (const NetworkId& rhs) const +{ + return m_value > rhs.m_value; +} + // ----------------------------------------------------------------------- inline bool NetworkId::operator== (const NetworkId& rhs) const diff --git a/engine/shared/library/sharedFoundationTypes/src/linux/FoundationTypesLinux.h b/engine/shared/library/sharedFoundationTypes/src/linux/FoundationTypesLinux.h index 386c4ffb..bd4bdc9d 100755 --- a/engine/shared/library/sharedFoundationTypes/src/linux/FoundationTypesLinux.h +++ b/engine/shared/library/sharedFoundationTypes/src/linux/FoundationTypesLinux.h @@ -10,6 +10,7 @@ #define PLATFORM_LINUX #include +#include // ====================================================================== // basic types that we assume to be around @@ -20,8 +21,8 @@ typedef unsigned long uint32; typedef signed char int8; typedef signed short int16; typedef signed long int32; -typedef signed long long int int64; -typedef unsigned long long int uint64; +typedef int64_t int64; +typedef uint64_t uint64; typedef float real; typedef FILE* FILE_HANDLE; diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp index 5fdd99e5..e30a8f0a 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp @@ -39,7 +39,6 @@ ObjvarBuffer::ObjvarBuffer(DB::ModeQuery::Mode mode, ObjectTableBuffer *objectTa ObjvarBuffer::~ObjvarBuffer() { m_data.clear(); - m_overrides.clear(); } bool ObjvarBuffer::load(DB::Session *session,const DB::TagSet &tags, const std::string &schema, bool usingGoldDatabase) @@ -109,7 +108,7 @@ bool ObjvarBuffer::load(DB::Session *session,const DB::TagSet &tags, const std:: value.m_detached=false; - m_overrides.insert(std::make_pair(key,value)); + m_data.insert(std::make_pair(key,value)); } } @@ -234,7 +233,7 @@ void ObjvarBuffer::getObjvarsForObject(const NetworkId &objectId, std::vectorfirst.m_objectId==objectId); ++i) + for (DataType::const_iterator i= m_data.lower_bound(IndexKey(objectId,0)); (i!=m_data.end()) && (i->first.m_objectId==objectId); ++i) { std::string name; bool foundName = false; diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h index 2ee2f91a..7e5ba082 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h @@ -16,7 +16,7 @@ #include "sharedFoundation/DynamicVariableList.h" #include #include -#include + // ====================================================================== class ObjectTableBuffer; @@ -63,6 +63,7 @@ public: IndexKey(const NetworkId &objectId, int nameId); bool operator==(const IndexKey &rhs) const; bool operator<(const IndexKey &rhs) const; + bool operator>(const IndexKey &rhs) const; }; struct ObjvarValue @@ -77,7 +78,6 @@ public: DB::ModeQuery::Mode m_mode; DataType m_data; - DataType m_overrides; ObjectTableBuffer *m_objectTableBuffer; bool m_useGoldNames; @@ -109,10 +109,22 @@ inline bool ObjvarBuffer::IndexKey::operator<(const IndexKey &rhs) const { if (m_objectId < rhs.m_objectId) return true; - else if (m_objectId == rhs.m_objectId) + + if (m_objectId == rhs.m_objectId) return (m_nameId < rhs.m_nameId); - else - return false; + + return false; +} + +inline bool ObjvarBuffer::IndexKey::operator>(const IndexKey &rhs) const +{ + if (m_objectId > rhs.m_objectId) + return true; + + if (m_objectId == rhs.m_objectId) + return (m_nameId > rhs.m_nameId); + + return false; } // ====================================================================== diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp index a27150f4..19885914 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp @@ -140,7 +140,6 @@ SwgSnapshot::SwgSnapshot(DB::ModeQuery::Mode mode, bool useGoldDatabase) : // ---------------------------------------------------------------------- SwgSnapshot::~SwgSnapshot(){ - m_bufferList.clear(); } // ----------------------------------------------------------------------