AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CalendarEvent Struct Reference

#include "CalendarMgr.h"

Public Member Functions

 CalendarEvent (CalendarEvent const &calendarEvent, uint64 eventId)
 
 CalendarEvent (uint64 eventId, ObjectGuid creatorGUID, uint32 guildId, CalendarEventType type, int32 dungeonId, time_t eventTime, uint32 flags, time_t timezoneTime, std::string title, std::string description)
 
 CalendarEvent ()
 
 ~CalendarEvent ()
 
void SetEventId (uint64 eventId)
 
uint64 GetEventId () const
 
void SetCreatorGUID (ObjectGuid guid)
 
ObjectGuid GetCreatorGUID () const
 
void SetGuildId (uint32 guildId)
 
uint32 GetGuildId () const
 
void SetTitle (const std::string &title)
 
std::string GetTitle () const
 
void SetDescription (const std::string &description)
 
std::string GetDescription () const
 
void SetType (CalendarEventType type)
 
CalendarEventType GetType () const
 
void SetDungeonId (int32 dungeonId)
 
int32 GetDungeonId () const
 
void SetEventTime (time_t eventTime)
 
time_t GetEventTime () const
 
void SetFlags (uint32 flags)
 
uint32 GetFlags () const
 
void SetTimeZoneTime (time_t timezoneTime)
 
time_t GetTimeZoneTime () const
 
bool IsGuildEvent () const
 
bool IsGuildAnnouncement () const
 
std::string BuildCalendarMailSubject (ObjectGuid remover) const
 
std::string BuildCalendarMailBody () const
 

Static Public Member Functions

static bool IsGuildEvent (uint32 flags)
 
static bool IsGuildAnnouncement (uint32 flags)
 

Private Attributes

uint64 _eventId
 
ObjectGuid _creatorGUID
 
uint32 _guildId
 
CalendarEventType _type
 
int32 _dungeonId
 
time_t _eventTime
 
uint32 _flags
 
time_t _timezoneTime
 
std::string _title
 
std::string _description
 

Detailed Description

Constructor & Destructor Documentation

◆ CalendarEvent() [1/3]

CalendarEvent::CalendarEvent ( CalendarEvent const &  calendarEvent,
uint64  eventId 
)
inline
198 {
199 _eventId = eventId;
200 _creatorGUID = calendarEvent.GetCreatorGUID();
201 _guildId = calendarEvent.GetGuildId();
202 _type = calendarEvent.GetType();
203 _dungeonId = calendarEvent.GetDungeonId();
204 _eventTime = calendarEvent.GetEventTime();
205 _flags = calendarEvent.GetFlags();
206 _timezoneTime = calendarEvent.GetTimeZoneTime();
207 _title = calendarEvent.GetTitle();
208 _description = calendarEvent.GetDescription();
209 }
uint64 _eventId
Definition: CalendarMgr.h:262
ObjectGuid _creatorGUID
Definition: CalendarMgr.h:263
std::string _description
Definition: CalendarMgr.h:271
CalendarEventType _type
Definition: CalendarMgr.h:265
int32 _dungeonId
Definition: CalendarMgr.h:266
time_t _eventTime
Definition: CalendarMgr.h:267
std::string _title
Definition: CalendarMgr.h:270
uint32 _guildId
Definition: CalendarMgr.h:264
uint32 _flags
Definition: CalendarMgr.h:268
time_t _timezoneTime
Definition: CalendarMgr.h:269

References _creatorGUID, _description, _dungeonId, _eventId, _eventTime, _flags, _guildId, _timezoneTime, _title, _type, GetCreatorGUID(), GetDescription(), GetDungeonId(), GetEventTime(), GetFlags(), GetGuildId(), GetTimeZoneTime(), GetTitle(), and GetType().

◆ CalendarEvent() [2/3]

CalendarEvent::CalendarEvent ( uint64  eventId,
ObjectGuid  creatorGUID,
uint32  guildId,
CalendarEventType  type,
int32  dungeonId,
time_t  eventTime,
uint32  flags,
time_t  timezoneTime,
std::string  title,
std::string  description 
)
inline
212 :
213 _eventId(eventId), _creatorGUID(creatorGUID), _guildId(guildId), _type(type), _dungeonId(dungeonId),
214 _eventTime(eventTime), _flags(flags), _timezoneTime(timezoneTime), _title(title),
215 _description(description) { }

◆ CalendarEvent() [3/3]

CalendarEvent::CalendarEvent ( )
inline
218 _flags(0), _timezoneTime(0), _title(""), _description("") { }
@ CALENDAR_TYPE_OTHER
Definition: CalendarMgr.h:63

◆ ~CalendarEvent()

CalendarEvent::~CalendarEvent ( )
39{
40 sCalendarMgr->FreeEventId(_eventId);
41}
#define sCalendarMgr
Definition: CalendarMgr.h:344

References _eventId, and sCalendarMgr.

Member Function Documentation

◆ BuildCalendarMailBody()

std::string CalendarEvent::BuildCalendarMailBody ( ) const
467{
468 WorldPacket data;
469 uint32 time;
470 std::ostringstream strm;
471
472 // we are supposed to send PackedTime so i used WorldPacket to pack it
474 data >> time;
475 strm << time;
476 return strm.str();
477}
std::uint32_t uint32
Definition: Define.h:108
Definition: WorldPacket.h:27
void AppendPackedTime(time_t time)
Definition: ByteBuffer.cpp:138

References _eventTime, and ByteBuffer::AppendPackedTime().

Referenced by CalendarMgr::RemoveEvent().

◆ BuildCalendarMailSubject()

std::string CalendarEvent::BuildCalendarMailSubject ( ObjectGuid  remover) const
460{
461 std::ostringstream strm;
462 strm << remover.ToString().c_str() << ':' << _title;
463 return strm.str();
464}
std::string ToString() const
Definition: ObjectGuid.cpp:47

References _title, and ObjectGuid::ToString().

Referenced by CalendarMgr::RemoveEvent().

◆ GetCreatorGUID()

◆ GetDescription()

std::string CalendarEvent::GetDescription ( ) const
inline

◆ GetDungeonId()

◆ GetEventId()

◆ GetEventTime()

◆ GetFlags()

◆ GetGuildId()

◆ GetTimeZoneTime()

time_t CalendarEvent::GetTimeZoneTime ( ) const
inline

◆ GetTitle()

◆ GetType()

◆ IsGuildAnnouncement() [1/2]

bool CalendarEvent::IsGuildAnnouncement ( ) const
inline

◆ IsGuildAnnouncement() [2/2]

static bool CalendarEvent::IsGuildAnnouncement ( uint32  flags)
inlinestatic
256{ return (flags & CALENDAR_FLAG_WITHOUT_INVITES) != 0; }

References CALENDAR_FLAG_WITHOUT_INVITES.

◆ IsGuildEvent() [1/2]

◆ IsGuildEvent() [2/2]

static bool CalendarEvent::IsGuildEvent ( uint32  flags)
inlinestatic
255{ return (flags & CALENDAR_FLAG_GUILD_EVENT) != 0; }

References CALENDAR_FLAG_GUILD_EVENT.

◆ SetCreatorGUID()

void CalendarEvent::SetCreatorGUID ( ObjectGuid  guid)
inline
225{ _creatorGUID = guid; }

References _creatorGUID.

◆ SetDescription()

void CalendarEvent::SetDescription ( const std::string &  description)
inline
234{ _description = description; }

References _description.

◆ SetDungeonId()

void CalendarEvent::SetDungeonId ( int32  dungeonId)
inline
240{ _dungeonId = dungeonId; }

References _dungeonId.

◆ SetEventId()

void CalendarEvent::SetEventId ( uint64  eventId)
inline
222{ _eventId = eventId; }

References _eventId.

◆ SetEventTime()

void CalendarEvent::SetEventTime ( time_t  eventTime)
inline
243{ _eventTime = eventTime; }

References _eventTime.

Referenced by WorldSession::HandleCalendarCopyEvent().

◆ SetFlags()

void CalendarEvent::SetFlags ( uint32  flags)
inline
246{ _flags = flags; }

References _flags.

◆ SetGuildId()

void CalendarEvent::SetGuildId ( uint32  guildId)
inline
228{ _guildId = guildId; }

References _guildId.

Referenced by WorldSession::HandleCalendarAddEvent().

◆ SetTimeZoneTime()

void CalendarEvent::SetTimeZoneTime ( time_t  timezoneTime)
inline
249{ _timezoneTime = timezoneTime; }

References _timezoneTime.

◆ SetTitle()

void CalendarEvent::SetTitle ( const std::string &  title)
inline
231{ _title = title; }

References _title.

◆ SetType()

void CalendarEvent::SetType ( CalendarEventType  type)
inline
237{ _type = type; }

References _type.

Member Data Documentation

◆ _creatorGUID

ObjectGuid CalendarEvent::_creatorGUID
private

◆ _description

std::string CalendarEvent::_description
private

◆ _dungeonId

int32 CalendarEvent::_dungeonId
private

◆ _eventId

uint64 CalendarEvent::_eventId
private

◆ _eventTime

time_t CalendarEvent::_eventTime
private

◆ _flags

uint32 CalendarEvent::_flags
private

◆ _guildId

uint32 CalendarEvent::_guildId
private

◆ _timezoneTime

time_t CalendarEvent::_timezoneTime
private

◆ _title

std::string CalendarEvent::_title
private

◆ _type

CalendarEventType CalendarEvent::_type
private

Referenced by CalendarEvent(), GetType(), and SetType().