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

#include <CharacterCache.h>

Public Member Functions

 CharacterCache ()
 
 ~CharacterCache ()
 
void LoadCharacterCacheStorage ()
 Loads several pieces of information on server startup with the GUID There is no further database query necessary. These are a number of methods that work into the calling function.
 
void AddCharacterCacheEntry (ObjectGuid const &guid, uint32 accountId, std::string const &name, uint8 gender, uint8 race, uint8 playerClass, uint8 level)
 
void DeleteCharacterCacheEntry (ObjectGuid const &guid, std::string const &name)
 
void UpdateCharacterData (ObjectGuid const &guid, std::string const &name, Optional< uint8 > gender={}, Optional< uint8 > race={})
 
void UpdateCharacterLevel (ObjectGuid const &guid, uint8 level)
 
void UpdateCharacterAccountId (ObjectGuid const &guid, uint32 accountId)
 
void UpdateCharacterGuildId (ObjectGuid const &guid, ObjectGuid::LowType guildId)
 
void UpdateCharacterArenaTeamId (ObjectGuid const &guid, uint8 slot, uint32 arenaTeamId)
 
bool HasCharacterCacheEntry (ObjectGuid const &guid) const
 
CharacterCacheEntry const * GetCharacterCacheByGuid (ObjectGuid const &guid) const
 
CharacterCacheEntry const * GetCharacterCacheByName (std::string const &name) const
 
ObjectGuid GetCharacterGuidByName (std::string const &name) const
 
bool GetCharacterNameByGuid (ObjectGuid guid, std::string &name) const
 
uint32 GetCharacterTeamByGuid (ObjectGuid guid) const
 
uint32 GetCharacterAccountIdByGuid (ObjectGuid guid) const
 
uint32 GetCharacterAccountIdByName (std::string const &name) const
 
uint8 GetCharacterLevelByGuid (ObjectGuid guid) const
 
ObjectGuid::LowType GetCharacterGuildIdByGuid (ObjectGuid guid) const
 
uint32 GetCharacterArenaTeamIdByGuid (ObjectGuid guid, uint8 type) const
 

Static Public Member Functions

static CharacterCacheinstance ()
 

Detailed Description

Definition at line 39 of file CharacterCache.h.

Constructor & Destructor Documentation

◆ CharacterCache()

CharacterCache::CharacterCache ( )

Definition at line 35 of file CharacterCache.cpp.

◆ ~CharacterCache()

CharacterCache::~CharacterCache ( )

Definition at line 39 of file CharacterCache.cpp.

Member Function Documentation

◆ AddCharacterCacheEntry()

void CharacterCache::AddCharacterCacheEntry ( ObjectGuid const &  guid,
uint32  accountId,
std::string const &  name,
uint8  gender,
uint8  race,
uint8  playerClass,
uint8  level 
)

Definition at line 95 of file CharacterCache.cpp.

+ Here is the caller graph for this function:

◆ DeleteCharacterCacheEntry()

void CharacterCache::DeleteCharacterCacheEntry ( ObjectGuid const &  guid,
std::string const &  name 
)

Definition at line 113 of file CharacterCache.cpp.

◆ GetCharacterAccountIdByGuid()

uint32 CharacterCache::GetCharacterAccountIdByGuid ( ObjectGuid  guid) const

Definition at line 233 of file CharacterCache.cpp.

◆ GetCharacterAccountIdByName()

uint32 CharacterCache::GetCharacterAccountIdByName ( std::string const &  name) const

Definition at line 242 of file CharacterCache.cpp.

◆ GetCharacterArenaTeamIdByGuid()

uint32 CharacterCache::GetCharacterArenaTeamIdByGuid ( ObjectGuid  guid,
uint8  type 
) const

Definition at line 269 of file CharacterCache.cpp.

+ Here is the call graph for this function:

◆ GetCharacterCacheByGuid()

CharacterCacheEntry const * CharacterCache::GetCharacterCacheByGuid ( ObjectGuid const &  guid) const

Definition at line 187 of file CharacterCache.cpp.

◆ GetCharacterCacheByName()

CharacterCacheEntry const * CharacterCache::GetCharacterCacheByName ( std::string const &  name) const

Definition at line 196 of file CharacterCache.cpp.

◆ GetCharacterGuidByName()

ObjectGuid CharacterCache::GetCharacterGuidByName ( std::string const &  name) const

Definition at line 205 of file CharacterCache.cpp.

◆ GetCharacterGuildIdByGuid()

ObjectGuid::LowType CharacterCache::GetCharacterGuildIdByGuid ( ObjectGuid  guid) const

Definition at line 260 of file CharacterCache.cpp.

◆ GetCharacterLevelByGuid()

uint8 CharacterCache::GetCharacterLevelByGuid ( ObjectGuid  guid) const

Definition at line 251 of file CharacterCache.cpp.

◆ GetCharacterNameByGuid()

bool CharacterCache::GetCharacterNameByGuid ( ObjectGuid  guid,
std::string &  name 
) const

Definition at line 214 of file CharacterCache.cpp.

◆ GetCharacterTeamByGuid()

uint32 CharacterCache::GetCharacterTeamByGuid ( ObjectGuid  guid) const

Definition at line 224 of file CharacterCache.cpp.

+ Here is the call graph for this function:

◆ HasCharacterCacheEntry()

bool CharacterCache::HasCharacterCacheEntry ( ObjectGuid const &  guid) const

Definition at line 182 of file CharacterCache.cpp.

◆ instance()

CharacterCache * CharacterCache::instance ( )
static

Definition at line 43 of file CharacterCache.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadCharacterCacheStorage()

void CharacterCache::LoadCharacterCacheStorage ( )

Loads several pieces of information on server startup with the GUID There is no further database query necessary. These are a number of methods that work into the calling function.

Parameters
guidRequires a guid to call
Returns
Name, Gender, Race, Class and Level of player character Example Usage:
CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByGuid(GUID);
if (!characterInfo)
return;
std::string playerName = characterInfo->Name;
uint8 playerGender = characterInfo->Sex;
uint8 playerRace = characterInfo->Race;
uint8 playerClass = characterInfo->Class;
uint8 playerLevel = characterInfo->Level;
#define sCharacterCache
uint8_t uint8
Definition Define.h:135

Definition at line 70 of file CharacterCache.cpp.

+ Here is the call graph for this function:

◆ UpdateCharacterAccountId()

void CharacterCache::UpdateCharacterAccountId ( ObjectGuid const &  guid,
uint32  accountId 
)

Definition at line 151 of file CharacterCache.cpp.

◆ UpdateCharacterArenaTeamId()

void CharacterCache::UpdateCharacterArenaTeamId ( ObjectGuid const &  guid,
uint8  slot,
uint32  arenaTeamId 
)

Definition at line 169 of file CharacterCache.cpp.

◆ UpdateCharacterData()

void CharacterCache::UpdateCharacterData ( ObjectGuid const &  guid,
std::string const &  name,
Optional< uint8 gender = {},
Optional< uint8 race = {} 
)

Definition at line 119 of file CharacterCache.cpp.

+ Here is the call graph for this function:

◆ UpdateCharacterGuildId()

void CharacterCache::UpdateCharacterGuildId ( ObjectGuid const &  guid,
ObjectGuid::LowType  guildId 
)

Definition at line 160 of file CharacterCache.cpp.

◆ UpdateCharacterLevel()

void CharacterCache::UpdateCharacterLevel ( ObjectGuid const &  guid,
uint8  level 
)

Definition at line 142 of file CharacterCache.cpp.


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