![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "CharacterCache.h"
Public Member Functions | |
| CharacterCache () noexcept=default | |
| ~CharacterCache () noexcept=default | |
| 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 | RefreshCacheEntry (uint32 lowGuid) |
| 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) |
| void | UpdateCharacterMailCount (ObjectGuid const &guid, int8 count, bool update=false) |
| void | DecreaseCharacterMailCount (ObjectGuid const &guid) |
| void | IncreaseCharacterMailCount (ObjectGuid const &guid) |
| bool | HasCharacterCacheEntry (ObjectGuid const &guid) const |
| CharacterCacheEntry const * | GetCharacterCacheByGuid (ObjectGuid const &guid) const |
| CharacterCacheEntry const * | GetCharacterCacheByName (std::string const &name) const |
| void | UpdateCharacterGroup (ObjectGuid const &guid, ObjectGuid groupGUID) |
| void | ClearCharacterGroup (ObjectGuid const &guid) |
| 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 |
| ObjectGuid | GetCharacterGroupGuidByGuid (ObjectGuid guid) const |
Static Public Member Functions | |
| static CharacterCache * | instance () |
|
defaultnoexcept |
|
defaultnoexcept |
| void CharacterCache::AddCharacterCacheEntry | ( | ObjectGuid const & | guid, |
| uint32 | accountId, | ||
| std::string const & | name, | ||
| uint8 | gender, | ||
| uint8 | race, | ||
| uint8 | playerClass, | ||
| uint8 | level | ||
| ) |
References CharacterCacheEntry::AccountId, CharacterCacheEntry::ArenaTeamId, CharacterCacheEntry::Class, CharacterCacheEntry::Guid, CharacterCacheEntry::GuildId, CharacterCacheEntry::Level, MAX_ARENA_SLOT, CharacterCacheEntry::Name, CharacterCacheEntry::Race, and CharacterCacheEntry::Sex.
Referenced by LoadCharacterCacheStorage(), and RefreshCacheEntry().
|
inline |
References ObjectGuid::Empty.
|
inline |
| void CharacterCache::DeleteCharacterCacheEntry | ( | ObjectGuid const & | guid, |
| std::string const & | name | ||
| ) |
Referenced by RefreshCacheEntry().
| uint32 CharacterCache::GetCharacterAccountIdByGuid | ( | ObjectGuid | guid | ) | const |
| uint32 CharacterCache::GetCharacterAccountIdByName | ( | std::string const & | name | ) | const |
| uint32 CharacterCache::GetCharacterArenaTeamIdByGuid | ( | ObjectGuid | guid, |
| uint8 | type | ||
| ) | const |
| CharacterCacheEntry const * CharacterCache::GetCharacterCacheByGuid | ( | ObjectGuid const & | guid | ) | const |
| CharacterCacheEntry const * CharacterCache::GetCharacterCacheByName | ( | std::string const & | name | ) | const |
| ObjectGuid CharacterCache::GetCharacterGroupGuidByGuid | ( | ObjectGuid | guid | ) | const |
References ObjectGuid::Empty.
| ObjectGuid CharacterCache::GetCharacterGuidByName | ( | std::string const & | name | ) | const |
References ObjectGuid::Empty.
| ObjectGuid::LowType CharacterCache::GetCharacterGuildIdByGuid | ( | ObjectGuid | guid | ) | const |
| uint8 CharacterCache::GetCharacterLevelByGuid | ( | ObjectGuid | guid | ) | const |
| bool CharacterCache::GetCharacterNameByGuid | ( | ObjectGuid | guid, |
| std::string & | name | ||
| ) | const |
| uint32 CharacterCache::GetCharacterTeamByGuid | ( | ObjectGuid | guid | ) | const |
References Player::TeamIdForRace().
| bool CharacterCache::HasCharacterCacheEntry | ( | ObjectGuid const & | guid | ) | const |
|
inline |
|
static |
| 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.
| guid | Requires a guid to call |
References AddCharacterCacheEntry(), CharacterDatabase, getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, Player, and UpdateCharacterMailCount().
| void CharacterCache::RefreshCacheEntry | ( | uint32 | lowGuid | ) |
References AddCharacterCacheEntry(), CharacterDatabase, DeleteCharacterCacheEntry(), Player, and UpdateCharacterMailCount().
| void CharacterCache::UpdateCharacterAccountId | ( | ObjectGuid const & | guid, |
| uint32 | accountId | ||
| ) |
| void CharacterCache::UpdateCharacterArenaTeamId | ( | ObjectGuid const & | guid, |
| uint8 | slot, | ||
| uint32 | arenaTeamId | ||
| ) |
| void CharacterCache::UpdateCharacterData | ( | ObjectGuid const & | guid, |
| std::string const & | name, | ||
| Optional< uint8 > | gender = {}, |
||
| Optional< uint8 > | race = {} |
||
| ) |
References CharacterCacheEntry::Name.
| void CharacterCache::UpdateCharacterGroup | ( | ObjectGuid const & | guid, |
| ObjectGuid | groupGUID | ||
| ) |
| void CharacterCache::UpdateCharacterGuildId | ( | ObjectGuid const & | guid, |
| ObjectGuid::LowType | guildId | ||
| ) |
| void CharacterCache::UpdateCharacterLevel | ( | ObjectGuid const & | guid, |
| uint8 | level | ||
| ) |
| void CharacterCache::UpdateCharacterMailCount | ( | ObjectGuid const & | guid, |
| int8 | count, | ||
| bool | update = false |
||
| ) |
Referenced by LoadCharacterCacheStorage(), and RefreshCacheEntry().