![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "CalendarMgr.h"
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 |
|
private |
|
private |
| void CalendarMgr::AddEvent | ( | CalendarEvent * | calendarEvent, |
| CalendarSendEventType | sendType | ||
| ) |
References _events, CalendarEvent::GetCreatorGUID(), SendCalendarEvent(), and UpdateEvent().
| void CalendarMgr::AddInvite | ( | CalendarEvent * | calendarEvent, |
| CalendarInvite * | invite, | ||
| CharacterDatabaseTransaction | trans = nullptr |
||
| ) |
References _invites, CalendarEvent::GetCreatorGUID(), CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), SendCalendarEventInvite(), SendCalendarEventInviteAlert(), and UpdateInvite().
| void CalendarMgr::DeleteOldEvents | ( | ) |
References _events, CALENDAR_OLD_EVENTS_DELETION_TIME, ObjectGuid::Empty, CalendarEvent::GetEventTime(), GameTime::GetGameTime(), and RemoveEvent().
| void CalendarMgr::FreeEventId | ( | uint64 | id | ) |
References _freeEventIds, and _maxEventId.
| void CalendarMgr::FreeInviteId | ( | uint64 | id | ) |
References _freeInviteIds, and _maxInviteId.
| CalendarEvent * CalendarMgr::GetEvent | ( | uint64 | eventId, |
| CalendarEventStore::iterator * | it = nullptr |
||
| ) |
References _events.
Referenced by GetPlayerEvents(), LoadFromDB(), RemoveEvent(), RemoveInvite(), RemovePlayerGuildEventsAndSignups(), and SendCalendarEventInvite().
| CalendarInviteStore const & CalendarMgr::GetEventInvites | ( | uint64 | eventId | ) |
|
inline |
| CalendarEventStore CalendarMgr::GetEventsCreatedBy | ( | ObjectGuid | guid, |
| bool | includeGuildEvents = false |
||
| ) |
References _events.
| uint64 CalendarMgr::GetFreeEventId | ( | ) |
References _freeEventIds, and _maxEventId.
| uint64 CalendarMgr::GetFreeInviteId | ( | ) |
References _freeInviteIds, and _maxInviteId.
| CalendarEventStore CalendarMgr::GetGuildEvents | ( | uint32 | guildId | ) |
References _events.
| CalendarInvite * CalendarMgr::GetInvite | ( | uint64 | inviteId | ) | const |
References _invites, and LOG_DEBUG.
Referenced by LoadFromDB().
|
inline |
| CalendarEventStore CalendarMgr::GetPlayerEvents | ( | ObjectGuid | guid | ) |
References _events, _invites, ObjectAccessor::FindConnectedPlayer(), and GetEvent().
| CalendarInviteStore CalendarMgr::GetPlayerInvites | ( | ObjectGuid | guid | ) |
References _invites.
Referenced by GetPlayerNumPending(), RemoveAllPlayerEventsAndInvites(), and RemovePlayerGuildEventsAndSignups().
| uint32 CalendarMgr::GetPlayerNumPending | ( | ObjectGuid | guid | ) |
References CALENDAR_STATUS_INVITED, CALENDAR_STATUS_NOT_SIGNED_UP, CALENDAR_STATUS_TENTATIVE, and GetPlayerInvites().
|
static |
| void CalendarMgr::LoadFromDB | ( | ) |
References _events, _freeEventIds, _freeInviteIds, _invites, _maxEventId, _maxInviteId, CALENDAR_FLAG_GUILD_EVENT, CALENDAR_FLAG_WITHOUT_INVITES, CharacterDatabase, Field::Get(), GetEvent(), GetInvite(), LOG_INFO, and sCharacterCache.
| void CalendarMgr::RemoveAllPlayerEventsAndInvites | ( | ObjectGuid | guid | ) |
References _events, ObjectGuid::Empty, CalendarEvent::GetCreatorGUID(), GetPlayerInvites(), RemoveEvent(), and RemoveInvite().
| CalendarEventStore::iterator CalendarMgr::RemoveEvent | ( | CalendarEvent * | calendarEvent, |
| ObjectGuid | remover, | ||
| CalendarEventStore::const_iterator * | currIt = nullptr |
||
| ) |
References _events, _invites, CalendarEvent::BuildCalendarMailBody(), CalendarEvent::BuildCalendarMailSubject(), CALENDAR_ERROR_EVENT_INVALID, CHAR_DEL_CALENDAR_EVENT, CHAR_DEL_CALENDAR_INVITE, CharacterDatabase, ObjectGuid::GetCounter(), CalendarEvent::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), MAIL_CHECK_MASK_COPIED, SendCalendarCommandResult(), SendCalendarEventRemovedAlert(), MailDraft::SendMailTo(), and PreparedStatementBase::SetData().
| CalendarEventStore::iterator CalendarMgr::RemoveEvent | ( | uint64 | eventId, |
| ObjectGuid | remover | ||
| ) |
References _events, CALENDAR_ERROR_EVENT_INVALID, GetEvent(), RemoveEvent(), and SendCalendarCommandResult().
Referenced by DeleteOldEvents(), RemoveAllPlayerEventsAndInvites(), RemoveEvent(), and RemovePlayerGuildEventsAndSignups().
| void CalendarMgr::RemoveInvite | ( | uint64 | inviteId, |
| uint64 | eventId, | ||
| ObjectGuid | remover | ||
| ) |
References _invites, CALENDAR_STATUS_REMOVED, CHAR_DEL_CALENDAR_INVITE, CharacterDatabase, GetEvent(), CalendarEvent::GetFlags(), CalendarEvent::IsGuildEvent(), SendCalendarEventInviteRemove(), SendCalendarEventInviteRemoveAlert(), and PreparedStatementBase::SetData().
Referenced by RemoveAllPlayerEventsAndInvites(), and RemovePlayerGuildEventsAndSignups().
| void CalendarMgr::RemovePlayerGuildEventsAndSignups | ( | ObjectGuid | guid, |
| uint32 | guildId | ||
| ) |
References _events, GetEvent(), GetPlayerInvites(), RemoveEvent(), and RemoveInvite().
| void CalendarMgr::SendCalendarClearPendingAction | ( | ObjectGuid | guid | ) |
References ObjectAccessor::FindConnectedPlayer(), and SMSG_CALENDAR_CLEAR_PENDING_ACTION.
| void CalendarMgr::SendCalendarCommandResult | ( | ObjectGuid | guid, |
| CalendarError | err, | ||
| char const * | param = nullptr |
||
| ) |
References CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S, CALENDAR_ERROR_IGNORING_YOU_S, CALENDAR_ERROR_OTHER_INVITES_EXCEEDED, ObjectAccessor::FindConnectedPlayer(), and SMSG_CALENDAR_COMMAND_RESULT.
Referenced by RemoveEvent(), and RemoveEvent().
| void CalendarMgr::SendCalendarEvent | ( | ObjectGuid | guid, |
| CalendarEvent const & | calendarEvent, | ||
| CalendarSendEventType | sendType | ||
| ) |
References _invites, ByteBuffer::AppendPackedTime(), CALENDAR_MAX_INVITES, CALENDAR_REPEAT_NEVER, ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetCreatorGUID(), CalendarEvent::GetDescription(), CalendarEvent::GetDungeonId(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), Player::GetGuildId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), Unit::GetLevel(), CalendarInvite::GetRank(), CalendarInvite::GetStatus(), CalendarInvite::GetStatusTime(), CalendarInvite::GetText(), CalendarEvent::GetTimeZoneTime(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), CalendarEvent::IsGuildEvent(), sCharacterCache, Player::SendDirectMessage(), SMSG_CALENDAR_SEND_EVENT, and ObjectGuid::WriteAsPacked().
Referenced by AddEvent().
| void CalendarMgr::SendCalendarEventInvite | ( | CalendarInvite const & | invite | ) |
References ByteBuffer::AppendPackedTime(), ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetCreatorGUID(), GetEvent(), CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), Unit::GetLevel(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), CalendarInvite::GetStatusTime(), sCharacterCache, Player::SendDirectMessage(), SendPacketToAllEventRelatives(), SMSG_CALENDAR_EVENT_INVITE, and ObjectGuid::WriteAsPacked().
Referenced by AddInvite().
| void CalendarMgr::SendCalendarEventInviteAlert | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) |
References ByteBuffer::AppendPackedTime(), ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetCreatorGUID(), CalendarEvent::GetDungeonId(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), CalendarEvent::GetGuildId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), CalendarInvite::GetRank(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), sGuildMgr, SMSG_CALENDAR_EVENT_INVITE_ALERT, and ObjectGuid::WriteAsPacked().
Referenced by AddInvite().
| void CalendarMgr::SendCalendarEventInviteRemove | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite, | ||
| uint32 | flags | ||
| ) |
References CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), SendPacketToAllEventRelatives(), SMSG_CALENDAR_EVENT_INVITE_REMOVED, and ObjectGuid::WriteAsPacked().
Referenced by RemoveInvite().
| void CalendarMgr::SendCalendarEventInviteRemoveAlert | ( | ObjectGuid | guid, |
| CalendarEvent const & | calendarEvent, | ||
| CalendarInviteStatus | status | ||
| ) |
References ByteBuffer::AppendPackedTime(), ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), and SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT.
Referenced by RemoveInvite().
| void CalendarMgr::SendCalendarEventModeratorStatusAlert | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) |
References CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetRank(), SendPacketToAllEventRelatives(), SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, and ObjectGuid::WriteAsPacked().
| void CalendarMgr::SendCalendarEventRemovedAlert | ( | CalendarEvent const & | calendarEvent | ) |
References ByteBuffer::AppendPackedTime(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), SendPacketToAllEventRelatives(), and SMSG_CALENDAR_EVENT_REMOVED_ALERT.
Referenced by RemoveEvent().
| void CalendarMgr::SendCalendarEventStatus | ( | CalendarEvent const & | calendarEvent, |
| CalendarInvite const & | invite | ||
| ) |
References ByteBuffer::AppendPackedTime(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetRank(), CalendarInvite::GetStatus(), CalendarInvite::GetStatusTime(), SendPacketToAllEventRelatives(), SMSG_CALENDAR_EVENT_STATUS, and ObjectGuid::WriteAsPacked().
| void CalendarMgr::SendCalendarEventUpdateAlert | ( | CalendarEvent const & | calendarEvent, |
| time_t | oldEventTime | ||
| ) |
References ByteBuffer::AppendPackedTime(), CALENDAR_MAX_INVITES, CALENDAR_REPEAT_NEVER, CalendarEvent::GetDescription(), CalendarEvent::GetDungeonId(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), SendPacketToAllEventRelatives(), and SMSG_CALENDAR_EVENT_UPDATED_ALERT.
| void CalendarMgr::SendPacketToAllEventRelatives | ( | WorldPacket | packet, |
| CalendarEvent const & | calendarEvent | ||
| ) |
References _invites, ObjectAccessor::FindConnectedPlayer(), CalendarEvent::GetEventId(), CalendarEvent::GetGuildId(), CalendarEvent::IsGuildAnnouncement(), CalendarEvent::IsGuildEvent(), and sGuildMgr.
Referenced by SendCalendarEventInvite(), SendCalendarEventInviteRemove(), SendCalendarEventModeratorStatusAlert(), SendCalendarEventRemovedAlert(), SendCalendarEventStatus(), and SendCalendarEventUpdateAlert().
| void CalendarMgr::UpdateEvent | ( | CalendarEvent * | calendarEvent | ) |
References CHAR_REP_CALENDAR_EVENT, CharacterDatabase, ObjectGuid::GetCounter(), CalendarEvent::GetCreatorGUID(), CalendarEvent::GetDescription(), CalendarEvent::GetDungeonId(), CalendarEvent::GetEventId(), CalendarEvent::GetEventTime(), CalendarEvent::GetFlags(), CalendarEvent::GetTimeZoneTime(), CalendarEvent::GetTitle(), CalendarEvent::GetType(), and PreparedStatementBase::SetData().
Referenced by AddEvent().
| void CalendarMgr::UpdateInvite | ( | CalendarInvite * | invite, |
| CharacterDatabaseTransaction | trans = nullptr |
||
| ) |
References CHAR_REP_CALENDAR_INVITE, CharacterDatabase, ObjectGuid::GetCounter(), CalendarInvite::GetEventId(), CalendarInvite::GetInviteeGUID(), CalendarInvite::GetInviteId(), CalendarInvite::GetRank(), CalendarInvite::GetSenderGUID(), CalendarInvite::GetStatus(), CalendarInvite::GetStatusTime(), CalendarInvite::GetText(), and PreparedStatementBase::SetData().
Referenced by AddInvite().
|
private |
|
private |
Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().
|
private |
Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().
|
private |
|
private |
Referenced by FreeEventId(), GetFreeEventId(), and LoadFromDB().
|
private |
Referenced by FreeInviteId(), GetFreeInviteId(), and LoadFromDB().