TrinityCore
SpellHistory::PersistenceHelper< Player > Struct Template Reference

Static Public Member Functions

static void SetIdentifier (PreparedStatementBase *stmt, uint8 index, Unit *owner)
 
static bool ReadCooldown (Field *fields, uint32 *spellId, CooldownEntry *cooldownEntry)
 
static bool ReadCharge (Field *fields, uint32 *categoryId, ChargeEntry *chargeEntry)
 
static void WriteCooldown (PreparedStatementBase *stmt, uint8 &index, CooldownStorageType::value_type const &cooldown)
 
static void WriteCharge (PreparedStatementBase *stmt, uint8 &index, uint32 chargeCategory, ChargeEntry const &charge)
 

Static Public Attributes

static CharacterDatabaseStatements const CooldownsDeleteStatement = CHAR_DEL_CHAR_SPELL_COOLDOWNS
 
static CharacterDatabaseStatements const CooldownsInsertStatement = CHAR_INS_CHAR_SPELL_COOLDOWN
 
static CharacterDatabaseStatements const ChargesDeleteStatement = CHAR_DEL_CHAR_SPELL_CHARGES
 
static CharacterDatabaseStatements const ChargesInsertStatement = CHAR_INS_CHAR_SPELL_CHARGES
 

Member Function Documentation

◆ ReadCharge()

static bool SpellHistory::PersistenceHelper< Player >::ReadCharge ( Field fields,
uint32 categoryId,
ChargeEntry chargeEntry 
)
inlinestatic
61  {
62  *categoryId = fields[0].GetUInt32();
63  if (!sSpellCategoryStore.LookupEntry(*categoryId))
64  return false;
65 
66  chargeEntry->RechargeStart = Clock::from_time_t(fields[1].GetInt64());
67  chargeEntry->RechargeEnd = Clock::from_time_t(fields[2].GetInt64());
68  return true;
69  }
uint32 GetUInt32() const
Definition: Field.cpp:105
DB2Storage< SpellCategoryEntry > sSpellCategoryStore("SpellCategory.db2", SpellCategoryLoadInfo::Instance())
+ Here is the call graph for this function:

◆ ReadCooldown()

static bool SpellHistory::PersistenceHelper< Player >::ReadCooldown ( Field fields,
uint32 spellId,
CooldownEntry cooldownEntry 
)
inlinestatic
47  {
48  *spellId = fields[0].GetUInt32();
49  if (!sSpellMgr->GetSpellInfo(*spellId, DIFFICULTY_NONE))
50  return false;
51 
52  cooldownEntry->SpellId = *spellId;
53  cooldownEntry->CooldownEnd = Clock::from_time_t(fields[2].GetInt64());
54  cooldownEntry->ItemId = fields[1].GetUInt32();
55  cooldownEntry->CategoryId = fields[3].GetUInt32();
56  cooldownEntry->CategoryEnd = Clock::from_time_t(fields[4].GetInt64());
57  return true;
58  }
Definition: DBCEnums.h:666
uint32 GetUInt32() const
Definition: Field.cpp:105
#define sSpellMgr
Definition: SpellMgr.h:825
+ Here is the call graph for this function:

◆ SetIdentifier()

static void SpellHistory::PersistenceHelper< Player >::SetIdentifier ( PreparedStatementBase stmt,
uint8  index,
Unit owner 
)
inlinestatic
44 { stmt->setUInt64(index, owner->GetGUID().GetCounter()); }
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:156
LowType GetCounter() const
Definition: ObjectGuid.h:284
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:54
+ Here is the call graph for this function:

◆ WriteCharge()

static void SpellHistory::PersistenceHelper< Player >::WriteCharge ( PreparedStatementBase stmt,
uint8 index,
uint32  chargeCategory,
ChargeEntry const &  charge 
)
inlinestatic
81  {
82  stmt->setUInt32(index++, chargeCategory);
83  stmt->setInt64(index++, Clock::to_time_t(charge.RechargeStart));
84  stmt->setInt64(index++, Clock::to_time_t(charge.RechargeEnd));
85  }
void setInt64(const uint8 index, const int64 value)
Definition: PreparedStatement.cpp:78
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:48
+ Here is the call graph for this function:

◆ WriteCooldown()

static void SpellHistory::PersistenceHelper< Player >::WriteCooldown ( PreparedStatementBase stmt,
uint8 index,
CooldownStorageType::value_type const &  cooldown 
)
inlinestatic
72  {
73  stmt->setUInt32(index++, cooldown.first);
74  stmt->setUInt32(index++, cooldown.second.ItemId);
75  stmt->setInt64(index++, Clock::to_time_t(cooldown.second.CooldownEnd));
76  stmt->setUInt32(index++, cooldown.second.CategoryId);
77  stmt->setInt64(index++, Clock::to_time_t(cooldown.second.CategoryEnd));
78  }
void setInt64(const uint8 index, const int64 value)
Definition: PreparedStatement.cpp:78
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:48
+ Here is the call graph for this function:

Member Data Documentation

◆ ChargesDeleteStatement

◆ ChargesInsertStatement

◆ CooldownsDeleteStatement

◆ CooldownsInsertStatement


The documentation for this struct was generated from the following file: