![]() |
TrinityCore
|
#include <CharacterCache.h>
Public Member Functions | |
| CharacterCache () | |
| CharacterCache (CharacterCache const &)=delete | |
| CharacterCache (CharacterCache &&)=delete | |
| CharacterCache & | operator= (CharacterCache const &)=delete |
| CharacterCache & | operator= (CharacterCache &&)=delete |
| ~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, bool isDeleted) |
| 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 | UpdateCharacterGender (ObjectGuid const &guid, uint8 gender) |
| 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 | UpdateCharacterInfoDeleted (ObjectGuid const &guid, bool deleted, std::string const &name) |
| 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 |
| Team | 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 |
| bool | GetCharacterNameAndClassByGUID (ObjectGuid guid, std::string &name, uint8 &_class) const |
Static Public Member Functions | |
| static CharacterCache * | instance () |
Definition at line 41 of file CharacterCache.h.
| CharacterCache::CharacterCache | ( | ) |
Definition at line 34 of file CharacterCache.cpp.
|
delete |
|
delete |
| CharacterCache::~CharacterCache | ( | ) |
Definition at line 38 of file CharacterCache.cpp.
| void CharacterCache::AddCharacterCacheEntry | ( | ObjectGuid const & | guid, |
| uint32 | accountId, | ||
| std::string const & | name, | ||
| uint8 | gender, | ||
| uint8 | race, | ||
| uint8 | playerClass, | ||
| uint8 | level, | ||
| bool | isDeleted | ||
| ) |
Definition at line 94 of file CharacterCache.cpp.
References CharacterCacheEntry::AccountId, CharacterCacheEntry::ArenaTeamId, CharacterCacheEntry::Class, CharacterCacheEntry::Guid, CharacterCacheEntry::GuildId, CharacterCacheEntry::IsDeleted, CharacterCacheEntry::Level, MAX_ARENA_SLOT, CharacterCacheEntry::Name, CharacterCacheEntry::Race, and CharacterCacheEntry::Sex.
Referenced by LoadCharacterCacheStorage().
| void CharacterCache::DeleteCharacterCacheEntry | ( | ObjectGuid const & | guid, |
| std::string const & | name | ||
| ) |
Definition at line 114 of file CharacterCache.cpp.
| uint32 CharacterCache::GetCharacterAccountIdByGuid | ( | ObjectGuid | guid | ) | const |
Definition at line 259 of file CharacterCache.cpp.
| uint32 CharacterCache::GetCharacterAccountIdByName | ( | std::string const & | name | ) | const |
Definition at line 268 of file CharacterCache.cpp.
| uint32 CharacterCache::GetCharacterArenaTeamIdByGuid | ( | ObjectGuid | guid, |
| uint8 | type | ||
| ) | const |
Definition at line 295 of file CharacterCache.cpp.
References ASSERT, and ArenaTeam::GetSlotByType().
| CharacterCacheEntry const * CharacterCache::GetCharacterCacheByGuid | ( | ObjectGuid const & | guid | ) | const |
Definition at line 213 of file CharacterCache.cpp.
| CharacterCacheEntry const * CharacterCache::GetCharacterCacheByName | ( | std::string const & | name | ) | const |
Definition at line 222 of file CharacterCache.cpp.
| ObjectGuid CharacterCache::GetCharacterGuidByName | ( | std::string const & | name | ) | const |
Definition at line 231 of file CharacterCache.cpp.
References ObjectGuid::Empty.
| ObjectGuid::LowType CharacterCache::GetCharacterGuildIdByGuid | ( | ObjectGuid | guid | ) | const |
Definition at line 286 of file CharacterCache.cpp.
| uint8 CharacterCache::GetCharacterLevelByGuid | ( | ObjectGuid | guid | ) | const |
Definition at line 277 of file CharacterCache.cpp.
| bool CharacterCache::GetCharacterNameAndClassByGUID | ( | ObjectGuid | guid, |
| std::string & | name, | ||
| uint8 & | _class | ||
| ) | const |
Definition at line 306 of file CharacterCache.cpp.
| bool CharacterCache::GetCharacterNameByGuid | ( | ObjectGuid | guid, |
| std::string & | name | ||
| ) | const |
Definition at line 240 of file CharacterCache.cpp.
| Team CharacterCache::GetCharacterTeamByGuid | ( | ObjectGuid | guid | ) | const |
Definition at line 250 of file CharacterCache.cpp.
References TEAM_OTHER, and Player::TeamForRace().
| bool CharacterCache::HasCharacterCacheEntry | ( | ObjectGuid const & | guid | ) | const |
Definition at line 208 of file CharacterCache.cpp.
|
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 |
Definition at line 69 of file CharacterCache.cpp.
References AddCharacterCacheEntry(), CharacterDatabase, getMSTime(), GetMSTimeDiffToNow(), and TC_LOG_INFO.
|
delete |
|
delete |
| void CharacterCache::UpdateCharacterAccountId | ( | ObjectGuid const & | guid, |
| uint32 | accountId | ||
| ) |
Definition at line 162 of file CharacterCache.cpp.
| void CharacterCache::UpdateCharacterArenaTeamId | ( | ObjectGuid const & | guid, |
| uint8 | slot, | ||
| uint32 | arenaTeamId | ||
| ) |
Definition at line 180 of file CharacterCache.cpp.
References ASSERT.
| void CharacterCache::UpdateCharacterData | ( | ObjectGuid const & | guid, |
| std::string const & | name, | ||
| Optional< uint8 > | gender = {}, |
||
| Optional< uint8 > | race = {} |
||
| ) |
Definition at line 120 of file CharacterCache.cpp.
References WorldPackets::Misc::InvalidatePlayer::Guid, CharacterCacheEntry::Name, sWorld, and WorldPackets::Misc::InvalidatePlayer::Write().
| void CharacterCache::UpdateCharacterGender | ( | ObjectGuid const & | guid, |
| uint8 | gender | ||
| ) |
Definition at line 144 of file CharacterCache.cpp.
| void CharacterCache::UpdateCharacterGuildId | ( | ObjectGuid const & | guid, |
| ObjectGuid::LowType | guildId | ||
| ) |
Definition at line 171 of file CharacterCache.cpp.
| void CharacterCache::UpdateCharacterInfoDeleted | ( | ObjectGuid const & | guid, |
| bool | deleted, | ||
| std::string const & | name | ||
| ) |
Definition at line 190 of file CharacterCache.cpp.
| void CharacterCache::UpdateCharacterLevel | ( | ObjectGuid const & | guid, |
| uint8 | level | ||
| ) |
Definition at line 153 of file CharacterCache.cpp.