TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Guild::EventLogEntry Class Reference

Public Member Functions

 EventLogEntry (ObjectGuid::LowType guildId, uint32 guid, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank)
 
 EventLogEntry (ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank)
 
 ~EventLogEntry ()
 
void SaveToDB (SQLTransaction &trans) const override
 
void WritePacket (WorldPackets::Guild::GuildEventLogQueryResults &packet) const
 
- Public Member Functions inherited from Guild::LogEntry
 LogEntry (ObjectGuid::LowType guildId, uint32 guid)
 
 LogEntry (ObjectGuid::LowType guildId, uint32 guid, time_t timestamp)
 
virtual ~LogEntry ()
 
uint32 GetGUID () const
 
uint64 GetTimestamp () const
 

Private Attributes

GuildEventLogTypes m_eventType
 
ObjectGuid::LowType m_playerGuid1
 
ObjectGuid::LowType m_playerGuid2
 
uint8 m_newRank
 

Additional Inherited Members

- Protected Attributes inherited from Guild::LogEntry
ObjectGuid::LowType m_guildId
 
uint32 m_guid
 
uint64 m_timestamp
 

Constructor & Destructor Documentation

Guild::EventLogEntry::EventLogEntry ( ObjectGuid::LowType  guildId,
uint32  guid,
GuildEventLogTypes  eventType,
ObjectGuid::LowType  playerGuid1,
ObjectGuid::LowType  playerGuid2,
uint8  newRank 
)
inline
454  :
455  LogEntry(guildId, guid), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
ObjectGuid::LowType m_playerGuid1
Definition: Guild.h:467
uint8 m_newRank
Definition: Guild.h:469
LogEntry(ObjectGuid::LowType guildId, uint32 guid)
Definition: Guild.h:435
GuildEventLogTypes m_eventType
Definition: Guild.h:466
ObjectGuid::LowType m_playerGuid2
Definition: Guild.h:468
Guild::EventLogEntry::EventLogEntry ( ObjectGuid::LowType  guildId,
uint32  guid,
time_t  timestamp,
GuildEventLogTypes  eventType,
ObjectGuid::LowType  playerGuid1,
ObjectGuid::LowType  playerGuid2,
uint8  newRank 
)
inline
457  :
458  LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
ObjectGuid::LowType m_playerGuid1
Definition: Guild.h:467
uint8 m_newRank
Definition: Guild.h:469
LogEntry(ObjectGuid::LowType guildId, uint32 guid)
Definition: Guild.h:435
GuildEventLogTypes m_eventType
Definition: Guild.h:466
ObjectGuid::LowType m_playerGuid2
Definition: Guild.h:468
Guild::EventLogEntry::~EventLogEntry ( )
inline
460 { }

Member Function Documentation

void Guild::EventLogEntry::SaveToDB ( SQLTransaction trans) const
overridevirtual

Implements Guild::LogEntry.

120 {
122  stmt->setUInt64(0, m_guildId);
123  stmt->setUInt32(1, m_guid);
124  CharacterDatabase.ExecuteOrAppend(trans, stmt);
125 
126  uint8 index = 0;
128  stmt->setUInt64( index, m_guildId);
129  stmt->setUInt32(++index, m_guid);
130  stmt->setUInt8 (++index, uint8(m_eventType));
131  stmt->setUInt64(++index, m_playerGuid1);
132  stmt->setUInt64(++index, m_playerGuid2);
133  stmt->setUInt8 (++index, m_newRank);
134  stmt->setUInt64(++index, m_timestamp);
135  CharacterDatabase.ExecuteOrAppend(trans, stmt);
136 }
void ExecuteOrAppend(SQLTransaction &trans, PreparedStatement *stmt)
Definition: DatabaseWorkerPool.h:236
ObjectGuid::LowType m_playerGuid1
Definition: Guild.h:467
uint32 m_guid
Definition: Guild.h:446
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:97
uint8 m_newRank
Definition: Guild.h:469
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:180
GuildEventLogTypes m_eventType
Definition: Guild.h:466
ObjectGuid::LowType m_playerGuid2
Definition: Guild.h:468
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
uint8_t uint8
Definition: g3dmath.h:164
ObjectGuid::LowType m_guildId
Definition: Guild.h:445
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
Definition: CharacterDatabase.h:181
uint8_t uint8
Definition: Define.h:152
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
uint64 m_timestamp
Definition: Guild.h:447

+ Here is the call graph for this function:

void Guild::EventLogEntry::WritePacket ( WorldPackets::Guild::GuildEventLogQueryResults packet) const
139 {
140  ObjectGuid playerGUID = ObjectGuid::Create<HighGuid::Player>(m_playerGuid1);
141  ObjectGuid otherGUID = ObjectGuid::Create<HighGuid::Player>(m_playerGuid2);
142 
144  eventEntry.PlayerGUID = playerGUID;
145  eventEntry.OtherGUID = otherGUID;
146  eventEntry.TransactionType = uint8(m_eventType);
147  eventEntry.TransactionDate = uint32(::time(NULL) - m_timestamp);
148  eventEntry.RankID = uint8(m_newRank);
149  packet.Entry.push_back(eventEntry);
150 }
ObjectGuid::LowType m_playerGuid1
Definition: Guild.h:467
arena_t NULL
Definition: jemalloc_internal.h:624
uint8 m_newRank
Definition: Guild.h:469
Definition: GuildPackets.h:301
GuildEventLogTypes m_eventType
Definition: Guild.h:466
ObjectGuid::LowType m_playerGuid2
Definition: Guild.h:468
uint8_t uint8
Definition: g3dmath.h:164
std::vector< GuildEventEntry > Entry
Definition: GuildPackets.h:325
uint64 m_timestamp
Definition: Guild.h:447
Definition: ObjectGuid.h:189
uint32_t uint32
Definition: g3dmath.h:168
ObjectGuid PlayerGUID
Definition: GuildPackets.h:303

+ Here is the caller graph for this function:

Member Data Documentation

GuildEventLogTypes Guild::EventLogEntry::m_eventType
private
uint8 Guild::EventLogEntry::m_newRank
private
ObjectGuid::LowType Guild::EventLogEntry::m_playerGuid1
private
ObjectGuid::LowType Guild::EventLogEntry::m_playerGuid2
private

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