From d3ed5359cab5af88720a458e465b964704b6c1a4 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Tue, 13 Dec 2016 06:51:26 +0000 Subject: [PATCH] for completeness' sake --- .../library/sharedFoundation/src/shared/NetworkId.h | 6 ++++++ .../src/shared/buffers/ObjvarBuffer.h | 11 +++++++++++ 2 files changed, 17 insertions(+) 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/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h index 2ee2f91a..6b7c0b01 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h @@ -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 @@ -115,6 +116,16 @@ inline bool ObjvarBuffer::IndexKey::operator<(const IndexKey &rhs) const return false; } +inline bool ObjvarBuffer::IndexKey::operator>(const IndexKey &rhs) const +{ + if (m_objectId > rhs.m_objectId) + return true; + else if (m_objectId == rhs.m_objectId) + return (m_nameId > rhs.m_nameId); + else + return false; +} + // ====================================================================== #endif