AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Guild::EventLogEntry Class Reference
Inheritance diagram for Guild::EventLogEntry:
Guild::LogEntry

Public Member Functions

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

Private Attributes

GuildEventLogTypes m_eventType
 
ObjectGuid m_playerGuid1
 
ObjectGuid m_playerGuid2
 
uint8 m_newRank
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ EventLogEntry() [1/2]

Guild::EventLogEntry::EventLogEntry ( uint32  guildId,
ObjectGuid::LowType  guid,
GuildEventLogTypes  eventType,
ObjectGuid  playerGuid1,
ObjectGuid  playerGuid2,
uint8  newRank 
)
inline
424 :
425 LogEntry(guildId, guid), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
LogEntry(uint32 guildId, ObjectGuid::LowType guid)
Definition: Guild.cpp:175
GuildEventLogTypes m_eventType
Definition: Guild.h:436
ObjectGuid m_playerGuid1
Definition: Guild.h:437
ObjectGuid m_playerGuid2
Definition: Guild.h:438
uint8 m_newRank
Definition: Guild.h:439

◆ EventLogEntry() [2/2]

Guild::EventLogEntry::EventLogEntry ( uint32  guildId,
ObjectGuid::LowType  guid,
time_t  timestamp,
GuildEventLogTypes  eventType,
ObjectGuid  playerGuid1,
ObjectGuid  playerGuid2,
uint8  newRank 
)
inline
427 :
428 LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }

◆ ~EventLogEntry()

Guild::EventLogEntry::~EventLogEntry ( )
inlineoverride
430{ }

Member Function Documentation

◆ SaveToDB()

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

Implements Guild::LogEntry.

180{
182 stmt->SetData(0, m_guildId);
183 stmt->SetData(1, m_guid);
184 CharacterDatabase.ExecuteOrAppend(trans, stmt);
185
186 uint8 index = 0;
187 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_EVENTLOG);
188 stmt->SetData( index, m_guildId);
189 stmt->SetData(++index, m_guid);
190 stmt->SetData (++index, uint8(m_eventType));
191 stmt->SetData(++index, m_playerGuid1.GetCounter());
192 stmt->SetData(++index, m_playerGuid2.GetCounter());
193 stmt->SetData (++index, m_newRank);
194 stmt->SetData(++index, m_timestamp);
195 CharacterDatabase.ExecuteOrAppend(trans, stmt);
196}
std::uint8_t uint8
Definition: Define.h:109
@ CHAR_INS_GUILD_EVENTLOG
Definition: CharacterDatabase.h:162
@ CHAR_DEL_GUILD_EVENTLOG
Definition: CharacterDatabase.h:163
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: PreparedStatement.h:157
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:77
LowType GetCounter() const
Definition: ObjectGuid.h:145
ObjectGuid::LowType m_guid
Definition: Guild.h:416
uint32 m_guildId
Definition: Guild.h:415
uint64 m_timestamp
Definition: Guild.h:417

References CHAR_DEL_GUILD_EVENTLOG, CHAR_INS_GUILD_EVENTLOG, CharacterDatabase, and PreparedStatementBase::SetData().

◆ WritePacket()

void Guild::EventLogEntry::WritePacket ( WorldPackets::Guild::GuildEventLogQueryResults packet) const
199{
200 ObjectGuid playerGUID = ObjectGuid::Create<HighGuid::Player>(m_playerGuid1.GetCounter());
201 ObjectGuid otherGUID = ObjectGuid::Create<HighGuid::Player>(m_playerGuid2.GetCounter());
202
204 eventEntry.PlayerGUID = playerGUID;
205 eventEntry.OtherGUID = otherGUID;
206 eventEntry.TransactionType = uint8(m_eventType);
208 eventEntry.RankID = uint8(m_newRank);
209 packet.Entry.push_back(eventEntry);
210}
std::uint32_t uint32
Definition: Define.h:107
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: ObjectGuid.h:118
Definition: GuildPackets.h:215
uint8 RankID
Definition: GuildPackets.h:219
ObjectGuid OtherGUID
Definition: GuildPackets.h:217
uint32 TransactionDate
Definition: GuildPackets.h:220
uint8 TransactionType
Definition: GuildPackets.h:218
ObjectGuid PlayerGUID
Definition: GuildPackets.h:216
std::vector< GuildEventEntry > Entry
Definition: GuildPackets.h:238

References WorldPackets::Guild::GuildEventLogQueryResults::Entry, GameTime::GetGameTime(), WorldPackets::Guild::GuildEventEntry::OtherGUID, WorldPackets::Guild::GuildEventEntry::PlayerGUID, WorldPackets::Guild::GuildEventEntry::RankID, WorldPackets::Guild::GuildEventEntry::TransactionDate, and WorldPackets::Guild::GuildEventEntry::TransactionType.

Member Data Documentation

◆ m_eventType

GuildEventLogTypes Guild::EventLogEntry::m_eventType
private

◆ m_newRank

uint8 Guild::EventLogEntry::m_newRank
private

◆ m_playerGuid1

ObjectGuid Guild::EventLogEntry::m_playerGuid1
private

◆ m_playerGuid2

ObjectGuid Guild::EventLogEntry::m_playerGuid2
private