TrinityCore
Loading...
Searching...
No Matches
ObjectGuidGenerator Class Reference

#include <ObjectGuid.h>

Public Member Functions

 ObjectGuidGenerator (HighGuid high, ObjectGuid::LowType start=UI64LIT(1))
 
 ~ObjectGuidGenerator ()=default
 
void Set (ObjectGuid::LowType val)
 
ObjectGuid::LowType Generate ()
 
ObjectGuid::LowType GetNextAfterMaxUsed () const
 

Protected Member Functions

void HandleCounterOverflow ()
 
void CheckGuidTrigger ()
 

Protected Attributes

HighGuid _high
 
ObjectGuid::LowType _nextGuid
 

Detailed Description

Definition at line 396 of file ObjectGuid.h.

Constructor & Destructor Documentation

◆ ObjectGuidGenerator()

ObjectGuidGenerator::ObjectGuidGenerator ( HighGuid  high,
ObjectGuid::LowType  start = UI64LIT(1) 
)
inlineexplicit

Definition at line 399 of file ObjectGuid.h.

399: _high(high), _nextGuid(start) { }
ObjectGuid::LowType _nextGuid
Definition: ObjectGuid.h:410

◆ ~ObjectGuidGenerator()

ObjectGuidGenerator::~ObjectGuidGenerator ( )
default

Member Function Documentation

◆ CheckGuidTrigger()

void ObjectGuidGenerator::CheckGuidTrigger ( )
protected

Definition at line 805 of file ObjectGuid.cpp.

806{
807 if (!sWorld->IsGuidAlert() && _nextGuid > sWorld->getIntConfig(CONFIG_RESPAWN_GUIDALERTLEVEL))
808 sWorld->TriggerGuidAlert();
809 else if (!sWorld->IsGuidWarning() && _nextGuid > sWorld->getIntConfig(CONFIG_RESPAWN_GUIDWARNLEVEL))
810 sWorld->TriggerGuidWarning();
811}
#define sWorld
Definition: World.h:962
@ CONFIG_RESPAWN_GUIDALERTLEVEL
Definition: World.h:427
@ CONFIG_RESPAWN_GUIDWARNLEVEL
Definition: World.h:426
+ Here is the caller graph for this function:

◆ Generate()

ObjectGuid::LowType ObjectGuidGenerator::Generate ( )

Definition at line 788 of file ObjectGuid.cpp.

789{
792
793 if (_high == HighGuid::Creature || _high == HighGuid::Vehicle || _high == HighGuid::GameObject || _high == HighGuid::Transport)
795
796 return _nextGuid++;
797}
void HandleCounterOverflow()
Definition: ObjectGuid.cpp:799
LowType GetMaxCounter() const
Definition: ObjectGuid.h:315
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNextAfterMaxUsed()

ObjectGuid::LowType ObjectGuidGenerator::GetNextAfterMaxUsed ( ) const
inline

Definition at line 404 of file ObjectGuid.h.

404{ return _nextGuid; }

◆ HandleCounterOverflow()

void ObjectGuidGenerator::HandleCounterOverflow ( )
protected

Definition at line 799 of file ObjectGuid.cpp.

800{
801 TC_LOG_ERROR("misc", "{} guid overflow!! Can't continue, shutting down server. ", ObjectGuid::GetTypeName(_high));
803}
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
char const * GetTypeName() const
Definition: ObjectGuid.h:351
static void StopNow(uint8 exitcode)
Definition: World.h:701
@ ERROR_EXIT_CODE
Definition: World.h:74
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Set()

void ObjectGuidGenerator::Set ( ObjectGuid::LowType  val)
inline

Definition at line 402 of file ObjectGuid.h.

402{ _nextGuid = val; }
+ Here is the caller graph for this function:

Member Data Documentation

◆ _high

HighGuid ObjectGuidGenerator::_high
protected

Definition at line 409 of file ObjectGuid.h.

◆ _nextGuid

ObjectGuid::LowType ObjectGuidGenerator::_nextGuid
protected

Definition at line 410 of file ObjectGuid.h.


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