AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectGuidGeneratorBase Class Referenceabstract

#include "ObjectGuid.h"

Inheritance diagram for ObjectGuidGeneratorBase:
ObjectGuidGenerator< high >

Public Member Functions

 ObjectGuidGeneratorBase (ObjectGuid::LowType start=1)
 
virtual void Set (ObjectGuid::LowType val)
 
virtual ObjectGuid::LowType Generate (uint16 realmId=DEFAULT_NON_CROSSREALM_REALM_ID)=0
 
ObjectGuid::LowType GetNextAfterMaxUsed () const
 
virtual ~ObjectGuidGeneratorBase ()=default
 

Static Protected Member Functions

static void HandleCounterOverflow (HighGuid high)
 
static bool GetClusterGuid (HighGuid high, uint16 realmId, ObjectGuid::LowType &clusterGuid)
 

Protected Attributes

ObjectGuid::LowType _nextGuid
 

Detailed Description

Constructor & Destructor Documentation

◆ ObjectGuidGeneratorBase()

ObjectGuidGeneratorBase::ObjectGuidGeneratorBase ( ObjectGuid::LowType  start = 1)
inline
287: _nextGuid(start) { }
ObjectGuid::LowType _nextGuid
Definition ObjectGuid.h:297

◆ ~ObjectGuidGeneratorBase()

virtual ObjectGuidGeneratorBase::~ObjectGuidGeneratorBase ( )
virtualdefault

Member Function Documentation

◆ Generate()

virtual ObjectGuid::LowType ObjectGuidGeneratorBase::Generate ( uint16  realmId = DEFAULT_NON_CROSSREALM_REALM_ID)
pure virtual

Implemented in ObjectGuidGenerator< high >.

◆ GetClusterGuid()

bool ObjectGuidGeneratorBase::GetClusterGuid ( HighGuid  high,
uint16  realmId,
ObjectGuid::LowType clusterGuid 
)
staticprotected
101{
102 if (!sToCloud9Sidecar->ClusterModeEnabled())
103 return false;
104
105 if (high == HighGuid::Player)
106 clusterGuid = ObjectGuid::LowType(sToCloud9Sidecar->GenerateCharacterGuid(realmId));
107 else if (high == HighGuid::Item)
108 clusterGuid = ObjectGuid::LowType(sToCloud9Sidecar->GenerateItemGuid(realmId));
109 else
110 return false;
111
112 return true;
113}
#define sToCloud9Sidecar
Definition TC9Sidecar.h:76
uint32 LowType
Definition ObjectGuid.h:125

References Item, Player, and sToCloud9Sidecar.

Referenced by ObjectGuidGenerator< high >::Generate().

◆ GetNextAfterMaxUsed()

ObjectGuid::LowType ObjectGuidGeneratorBase::GetNextAfterMaxUsed ( ) const
inline
291{ return _nextGuid; }

References _nextGuid.

◆ HandleCounterOverflow()

void ObjectGuidGeneratorBase::HandleCounterOverflow ( HighGuid  high)
staticprotected
95{
96 LOG_ERROR("entities.object", "{} guid overflow!! Can't continue, shutting down server. ", ObjectGuid::GetTypeName(high));
98}
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
char const * GetTypeName() const
Definition ObjectGuid.h:215
static void StopNow(uint8 exitcode)
Definition World.h:188
@ ERROR_EXIT_CODE
Definition World.h:54

References ERROR_EXIT_CODE, ObjectGuid::GetTypeName(), LOG_ERROR, and World::StopNow().

Referenced by ObjectGuidGenerator< high >::Generate().

◆ Set()

virtual void ObjectGuidGeneratorBase::Set ( ObjectGuid::LowType  val)
inlinevirtual
289{ _nextGuid = val; }

References _nextGuid.

Member Data Documentation

◆ _nextGuid

ObjectGuid::LowType ObjectGuidGeneratorBase::_nextGuid
protected

The documentation for this class was generated from the following files: