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

Public Member Functions

 NewsLogEntry (ObjectGuid::LowType guildId, uint32 guid, GuildNews type, ObjectGuid playerGuid, uint32 flags, uint32 value)
 
 NewsLogEntry (ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, GuildNews type, ObjectGuid playerGuid, uint32 flags, uint32 value)
 
 ~NewsLogEntry ()
 
GuildNews GetType () const
 
ObjectGuid GetPlayerGuid () const
 
uint32 GetValue () const
 
uint32 GetFlags () const
 
void SetSticky (bool sticky)
 
void SaveToDB (SQLTransaction &trans) const override
 
void WritePacket (WorldPackets::Guild::GuildNews &newsPacket) 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

GuildNews m_type
 
ObjectGuid m_playerGuid
 
uint32 m_flags
 
uint32 m_value
 

Additional Inherited Members

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

Constructor & Destructor Documentation

Guild::NewsLogEntry::NewsLogEntry ( ObjectGuid::LowType  guildId,
uint32  guid,
GuildNews  type,
ObjectGuid  playerGuid,
uint32  flags,
uint32  value 
)
inline
516  :
517  LogEntry(guildId, guid), m_type(type), m_playerGuid(playerGuid), m_flags(flags), m_value(value) { }
LogEntry(ObjectGuid::LowType guildId, uint32 guid)
Definition: Guild.h:435
ObjectGuid m_playerGuid
Definition: Guild.h:541
uint32 m_flags
Definition: Guild.h:542
uint32 m_value
Definition: Guild.h:543
GuildNews m_type
Definition: Guild.h:540
const FieldDescriptor value
Definition: descriptor.h:1522
uint8 flags
Definition: DisableMgr.cpp:44
Guild::NewsLogEntry::NewsLogEntry ( ObjectGuid::LowType  guildId,
uint32  guid,
time_t  timestamp,
GuildNews  type,
ObjectGuid  playerGuid,
uint32  flags,
uint32  value 
)
inline
519  :
520  LogEntry(guildId, guid, timestamp), m_type(type), m_playerGuid(playerGuid), m_flags(flags), m_value(value) { }
LogEntry(ObjectGuid::LowType guildId, uint32 guid)
Definition: Guild.h:435
ObjectGuid m_playerGuid
Definition: Guild.h:541
uint32 m_flags
Definition: Guild.h:542
uint32 m_value
Definition: Guild.h:543
GuildNews m_type
Definition: Guild.h:540
const FieldDescriptor value
Definition: descriptor.h:1522
uint8 flags
Definition: DisableMgr.cpp:44
Guild::NewsLogEntry::~NewsLogEntry ( )
inline
522 { }

Member Function Documentation

uint32 Guild::NewsLogEntry::GetFlags ( ) const
inline
527 { return m_flags; }
uint32 m_flags
Definition: Guild.h:542
ObjectGuid Guild::NewsLogEntry::GetPlayerGuid ( ) const
inline
525 { return m_playerGuid; }
ObjectGuid m_playerGuid
Definition: Guild.h:541
GuildNews Guild::NewsLogEntry::GetType ( ) const
inline
524 { return m_type; }
GuildNews m_type
Definition: Guild.h:540
uint32 Guild::NewsLogEntry::GetValue ( ) const
inline
526 { return m_value; }
uint32 m_value
Definition: Guild.h:543
void Guild::NewsLogEntry::SaveToDB ( SQLTransaction trans) const
overridevirtual

Implements Guild::LogEntry.

209 {
210  uint8 index = 0;
212  stmt->setUInt64( index, m_guildId);
213  stmt->setUInt32(++index, GetGUID());
214  stmt->setUInt8 (++index, GetType());
215  stmt->setUInt64(++index, GetPlayerGuid().GetCounter());
216  stmt->setUInt32(++index, GetFlags());
217  stmt->setUInt32(++index, GetValue());
218  stmt->setUInt64(++index, GetTimestamp());
219  CharacterDatabase.ExecuteOrAppend(trans, stmt);
220 }
Definition: CharacterDatabase.h:207
void ExecuteOrAppend(SQLTransaction &trans, PreparedStatement *stmt)
Definition: DatabaseWorkerPool.h:236
uint64 GetTimestamp() const
Definition: Guild.h:440
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:97
uint32 GetGUID() const
Definition: Guild.h:439
uint32 GetFlags() const
Definition: Guild.h:527
Definition: PreparedStatement.h:74
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
ObjectGuid::LowType m_guildId
Definition: Guild.h:445
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
uint8_t uint8
Definition: Define.h:152
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
GuildNews GetType() const
Definition: Guild.h:524
uint32 GetValue() const
Definition: Guild.h:526
ObjectGuid GetPlayerGuid() const
Definition: Guild.h:525

+ Here is the call graph for this function:

void Guild::NewsLogEntry::SetSticky ( bool  sticky)
inline
529  {
530  if (sticky)
531  m_flags |= 1;
532  else
533  m_flags &= ~1;
534  }
uint32 m_flags
Definition: Guild.h:542

+ Here is the caller graph for this function:

void Guild::NewsLogEntry::WritePacket ( WorldPackets::Guild::GuildNews newsPacket) const
223 {
225  newsEvent.Id = int32(GetGUID());
226  newsEvent.MemberGuid = GetPlayerGuid();
227  newsEvent.CompletedDate = uint32(GetTimestamp());
228  newsEvent.Flags = int32(GetFlags());
229  newsEvent.Type = int32(GetType());
230 
231  //for (uint8 i = 0; i < 2; i++)
232  // newsEvent.Data[i] =
233 
234  //newsEvent.MemberList.push_back(MemberGuid);
235 
237  {
239  itemInstance.ItemID = GetValue();
240  newsEvent.Item = itemInstance;
241  }
242 
243  newsPacket.NewsEvents.push_back(newsEvent);
244 }
Definition: GuildPackets.h:920
Optional< Item::ItemInstance > Item
Definition: GuildPackets.h:929
uint32 CompletedDate
Definition: GuildPackets.h:923
uint64 GetTimestamp() const
Definition: Guild.h:440
int32 Type
Definition: GuildPackets.h:924
uint32 GetGUID() const
Definition: Guild.h:439
uint32 GetFlags() const
Definition: Guild.h:527
int32 Id
Definition: GuildPackets.h:922
Definition: Guild.h:237
int32_t int32
Definition: g3dmath.h:167
int32 Flags
Definition: GuildPackets.h:925
Definition: Guild.h:238
Definition: ItemPackets.h:40
ObjectGuid MemberGuid
Definition: GuildPackets.h:927
GuildNews GetType() const
Definition: Guild.h:524
uint32_t uint32
Definition: g3dmath.h:168
std::vector< GuildNewsEvent > NewsEvents
Definition: GuildPackets.h:939
Definition: Guild.h:239
uint32 GetValue() const
Definition: Guild.h:526
uint32 ItemID
Definition: ItemPackets.h:46
ObjectGuid GetPlayerGuid() const
Definition: Guild.h:525

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 Guild::NewsLogEntry::m_flags
private
ObjectGuid Guild::NewsLogEntry::m_playerGuid
private
GuildNews Guild::NewsLogEntry::m_type
private
uint32 Guild::NewsLogEntry::m_value
private

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