TrinityCore
Loading...
Searching...
No Matches
CalendarMgr Class Reference

#include <CalendarMgr.h>

Public Member Functions

 CalendarMgr (CalendarMgr const &)=delete
 
 CalendarMgr (CalendarMgr &&)=delete
 
CalendarMgr & operator= (CalendarMgr const &)=delete
 
CalendarMgr & operator= (CalendarMgr &&)=delete
 
void LoadFromDB ()
 
CalendarEvent * GetEvent (uint64 eventId) const
 
CalendarEventStore const & GetEvents () const
 
CalendarEventStore GetEventsCreatedBy (ObjectGuid guid, bool includeGuildEvents=false) const
 
CalendarEventStore GetPlayerEvents (ObjectGuid guid) const
 
CalendarEventStore GetGuildEvents (ObjectGuid::LowType guildId) const
 
CalendarInvite * GetInvite (uint64 inviteId) const
 
CalendarEventInviteStore const & GetInvites () const
 
CalendarInviteStore GetEventInvites (uint64 eventId) const
 
CalendarInviteStore GetPlayerInvites (ObjectGuid guid) const
 
void FreeEventId (uint64 id)
 
uint64 GetFreeEventId ()
 
void FreeInviteId (uint64 id)
 
uint64 GetFreeInviteId ()
 
void DeleteOldEvents ()
 
uint32 GetPlayerNumPending (ObjectGuid guid)
 
void AddEvent (CalendarEvent *calendarEvent, CalendarSendEventType sendType)
 
void RemoveEvent (uint64 eventId, ObjectGuid remover)
 
void RemoveEvent (CalendarEvent *calendarEvent, ObjectGuid remover)
 
void UpdateEvent (CalendarEvent *calendarEvent)
 
void AddInvite (CalendarEvent *calendarEvent, CalendarInvite *invite, CharacterDatabaseTransaction trans=nullptr)
 
void RemoveInvite (uint64 inviteId, uint64 eventId, ObjectGuid remover)
 
void UpdateInvite (CalendarInvite *invite, CharacterDatabaseTransaction trans=nullptr)
 
void RemoveAllPlayerEventsAndInvites (ObjectGuid guid)
 
void RemovePlayerGuildEventsAndSignups (ObjectGuid guid, ObjectGuid::LowType guildId)
 
void SendCalendarEvent (ObjectGuid guid, CalendarEvent const &calendarEvent, CalendarSendEventType sendType) const
 
void SendCalendarEventInvite (CalendarInvite const &invite) const
 
void SendCalendarEventInviteAlert (CalendarEvent const &calendarEvent, CalendarInvite const &invite) const
 
void SendCalendarEventInviteRemove (CalendarEvent const &calendarEvent, CalendarInvite const &invite, uint32 flags) const
 
void SendCalendarEventInviteRemoveAlert (ObjectGuid guid, CalendarEvent const &calendarEvent, CalendarInviteStatus status) const
 
void SendCalendarEventUpdateAlert (CalendarEvent const &calendarEvent, time_t originalDate) const
 
void SendCalendarEventStatus (CalendarEvent const &calendarEvent, CalendarInvite const &invite) const
 
void SendCalendarEventRemovedAlert (CalendarEvent const &calendarEvent) const
 
void SendCalendarEventModeratorStatusAlert (CalendarEvent const &calendarEvent, CalendarInvite const &invite) const
 
void SendCalendarClearPendingAction (ObjectGuid guid) const
 
void SendCalendarCommandResult (ObjectGuid guid, CalendarError err, char const *param=nullptr) const
 
void SendPacketToAllEventRelatives (WorldPacket const *packet, CalendarEvent const &calendarEvent) const
 
std::vector< Player * > GetAllEventRelatives (CalendarEvent const &calendarEvent) const
 

Static Public Member Functions

static CalendarMgr * instance ()
 

Private Member Functions

 CalendarMgr ()
 
 ~CalendarMgr ()
 

Private Attributes

CalendarEventStore _events
 
CalendarEventInviteStore _invites
 
std::deque< uint64 > _freeEventIds
 
std::deque< uint64 > _freeInviteIds
 
uint64 _maxEventId
 
uint64 _maxInviteId
 

Detailed Description

Definition at line 282 of file CalendarMgr.h.

Constructor & Destructor Documentation

◆ CalendarMgr() [1/3]

CalendarMgr::CalendarMgr ( )
private

Definition at line 49 of file CalendarMgr.cpp.

◆ ~CalendarMgr()

CalendarMgr::~CalendarMgr ( )
private

Definition at line 51 of file CalendarMgr.cpp.

References _events, and _invites.

◆ CalendarMgr() [2/3]

CalendarMgr::CalendarMgr ( CalendarMgr const &  )
delete

◆ CalendarMgr() [3/3]

CalendarMgr::CalendarMgr ( CalendarMgr &&  )
delete

Member Function Documentation

◆ AddEvent()

void CalendarMgr::AddEvent ( CalendarEvent *  calendarEvent,
CalendarSendEventType  sendType 
)

◆ AddInvite()

◆ DeleteOldEvents()

void CalendarMgr::DeleteOldEvents ( )

◆ FreeEventId()

void CalendarMgr::FreeEventId ( uint64  id)

Definition at line 334 of file CalendarMgr.cpp.

References _freeEventIds, and _maxEventId.

◆ FreeInviteId()

void CalendarMgr::FreeInviteId ( uint64  id)

Definition at line 352 of file CalendarMgr.cpp.

References _freeInviteIds, and _maxInviteId.

◆ GetAllEventRelatives()

◆ GetEvent()

CalendarEvent * CalendarMgr::GetEvent ( uint64  eventId) const

◆ GetEventInvites()

CalendarInviteStore CalendarMgr::GetEventInvites ( uint64  eventId) const

Definition at line 427 of file CalendarMgr.cpp.

References _invites, and Trinity::Containers::MapGetValuePtr().

◆ GetEvents()

CalendarEventStore const & CalendarMgr::GetEvents ( ) const
inline

Definition at line 308 of file CalendarMgr.h.

◆ GetEventsCreatedBy()

CalendarEventStore CalendarMgr::GetEventsCreatedBy ( ObjectGuid  guid,
bool  includeGuildEvents = false 
) const

Definition at line 383 of file CalendarMgr.cpp.

References _events.

◆ GetFreeEventId()

uint64 CalendarMgr::GetFreeEventId ( )

Definition at line 342 of file CalendarMgr.cpp.

References _freeEventIds, and _maxEventId.

◆ GetFreeInviteId()

uint64 CalendarMgr::GetFreeInviteId ( )

Definition at line 360 of file CalendarMgr.cpp.

References _freeInviteIds, and _maxInviteId.

◆ GetGuildEvents()

CalendarEventStore CalendarMgr::GetGuildEvents ( ObjectGuid::LowType  guildId) const

Definition at line 393 of file CalendarMgr.cpp.

References _events.

◆ GetInvite()

CalendarInvite * CalendarMgr::GetInvite ( uint64  inviteId) const

Definition at line 323 of file CalendarMgr.cpp.

References _invites, and TC_LOG_DEBUG.

Referenced by LoadFromDB().

◆ GetInvites()

CalendarEventInviteStore const & CalendarMgr::GetInvites ( ) const
inline

Definition at line 314 of file CalendarMgr.h.

◆ GetPlayerEvents()

CalendarEventStore CalendarMgr::GetPlayerEvents ( ObjectGuid  guid) const

Definition at line 408 of file CalendarMgr.cpp.

References _events, _invites, ObjectAccessor::FindConnectedPlayer(), and GetEvent().

◆ GetPlayerInvites()

CalendarInviteStore CalendarMgr::GetPlayerInvites ( ObjectGuid  guid) const

◆ GetPlayerNumPending()

uint32 CalendarMgr::GetPlayerNumPending ( ObjectGuid  guid)

◆ instance()

CalendarMgr * CalendarMgr::instance ( )
static

Definition at line 61 of file CalendarMgr.cpp.

References instance().

Referenced by instance().

◆ LoadFromDB()

◆ operator=() [1/2]

CalendarMgr & CalendarMgr::operator= ( CalendarMgr &&  )
delete

◆ operator=() [2/2]

CalendarMgr & CalendarMgr::operator= ( CalendarMgr const &  )
delete

◆ RemoveAllPlayerEventsAndInvites()

void CalendarMgr::RemoveAllPlayerEventsAndInvites ( ObjectGuid  guid)

◆ RemoveEvent() [1/2]

◆ RemoveEvent() [2/2]

◆ RemoveInvite()

◆ RemovePlayerGuildEventsAndSignups()

void CalendarMgr::RemovePlayerGuildEventsAndSignups ( ObjectGuid  guid,
ObjectGuid::LowType  guildId 
)

Definition at line 300 of file CalendarMgr.cpp.

References _events, GetEvent(), GetPlayerInvites(), RemoveEvent(), and RemoveInvite().

◆ SendCalendarClearPendingAction()

void CalendarMgr::SendCalendarClearPendingAction ( ObjectGuid  guid) const

Definition at line 708 of file CalendarMgr.cpp.

References ObjectAccessor::FindConnectedPlayer().

◆ SendCalendarCommandResult()

◆ SendCalendarEvent()

void CalendarMgr::SendCalendarEvent ( ObjectGuid  guid,
CalendarEvent const &  calendarEvent,
CalendarSendEventType  sendType 
) const

Definition at line 643 of file CalendarMgr.cpp.

References _invites, WorldPackets::Calendar::CalendarSendEvent::Date, WorldPackets::Calendar::CalendarSendEvent::Description, WorldPackets::Calendar::CalendarSendEvent::EventClubID, WorldPackets::Calendar::CalendarSendEvent::EventID, WorldPackets::Calendar::CalendarSendEvent::EventName, WorldPackets::Calendar::CalendarSendEvent::EventType, ObjectAccessor::FindConnectedPlayer(), ObjectAccessor::FindPlayer(), WorldPackets::Calendar::CalendarSendEvent::Flags, CalendarEvent::GetDate(), CalendarEvent::GetDescription(), CalendarEvent::GetEventId(), WorldPackets::Calendar::CalendarSendEvent::GetEventType, CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), Player::GetGuildId(), Unit::GetLevel(), CalendarEvent::GetLockDate(), CalendarEvent::GetOwnerGUID(), Player::GetSession(), CalendarEvent::GetTextureId(), WorldSession::GetTimezoneOffset(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), WorldPackets::Calendar::CalendarEventInviteInfo::Guid, WorldPackets::Calendar::CalendarEventInviteInfo::InviteID, WorldPackets::Calendar::CalendarSendEvent::Invites, WorldPackets::Calendar::CalendarEventInviteInfo::InviteType, CalendarEvent::IsGuildEvent(), WorldPackets::Calendar::CalendarEventInviteInfo::Level, WorldPackets::Calendar::CalendarSendEvent::LockDate, Trinity::Containers::MapGetValuePtr(), WorldPackets::Calendar::CalendarEventInviteInfo::Moderator, WorldPackets::Calendar::CalendarEventInviteInfo::Notes, WorldPackets::Calendar::CalendarSendEvent::OwnerGuid, WorldPackets::Calendar::CalendarEventInviteInfo::ResponseTime, sCharacterCache, Player::SendDirectMessage(), WowTime::SetUtcTimeFromUnixTime(), WorldPackets::Calendar::CalendarEventInviteInfo::Status, WorldPackets::Calendar::CalendarSendEvent::TextureID, and WorldPackets::Calendar::CalendarSendEvent::Write().

Referenced by AddEvent().

◆ SendCalendarEventInvite()

◆ SendCalendarEventInviteAlert()

◆ SendCalendarEventInviteRemove()

◆ SendCalendarEventInviteRemoveAlert()

◆ SendCalendarEventModeratorStatusAlert()

◆ SendCalendarEventRemovedAlert()

◆ SendCalendarEventStatus()

◆ SendCalendarEventUpdateAlert()

◆ SendPacketToAllEventRelatives()

void CalendarMgr::SendPacketToAllEventRelatives ( WorldPacket const *  packet,
CalendarEvent const &  calendarEvent 
) const

◆ UpdateEvent()

◆ UpdateInvite()

Member Data Documentation

◆ _events

◆ _freeEventIds

std::deque<uint64> CalendarMgr::_freeEventIds
private

Definition at line 291 of file CalendarMgr.h.

Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().

◆ _freeInviteIds

std::deque<uint64> CalendarMgr::_freeInviteIds
private

Definition at line 292 of file CalendarMgr.h.

Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().

◆ _invites

◆ _maxEventId

uint64 CalendarMgr::_maxEventId
private

Definition at line 293 of file CalendarMgr.h.

Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().

◆ _maxInviteId

uint64 CalendarMgr::_maxInviteId
private

Definition at line 294 of file CalendarMgr.h.

Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().


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