18 #ifndef TRINITY_CALENDARMGR_H
19 #define TRINITY_CALENDARMGR_H
126 #define CALENDAR_MAX_EVENTS 30
127 #define CALENDAR_MAX_GUILD_EVENTS 100
128 #define CALENDAR_MAX_INVITES 100
129 #define CALENDAR_DEFAULT_RESPONSE_TIME 946684800 // 01/01/2000 00:00:00
136 _inviteId = inviteId;
142 _rank = calendarInvite.
GetRank();
143 _note = calendarInvite.
GetNote();
146 CalendarInvite() : _inviteId(1), _eventId(0), _invitee(), _senderGUID(), _responseTime(0),
151 _inviteId(inviteId), _eventId(eventId), _invitee(invitee), _senderGUID(senderGUID), _responseTime(responseTime),
152 _status(status), _rank(rank), _note(note) { }
171 void SetNote(std::string
const& note) { _note = note; }
199 _eventType = calendarEvent.
GetType();
201 _date = calendarEvent.
GetDate();
209 time_t date,
uint32 flags, std::string title, std::string description, time_t lockDate) :
210 _eventId(eventId), _ownerGUID(ownerGUID), _eventGuildId(guildId), _eventType(type), _textureId(textureId),
211 _date(date), _flags(flags), _title(title), _description(description), _lockDate(lockDate) { }
214 _flags(0), _title(
""), _description(
""), _lockDate(0) { }
227 void SetTitle(std::string
const& title) { _title = title; }
230 void SetDescription(std::string
const& description) { _description = description; }
252 std::string BuildCalendarMailSubject(
ObjectGuid remover)
const;
253 std::string BuildCalendarMailBody()
const;
299 void FreeEventId(
uint64 id);
301 void FreeInviteId(
uint64 id);
316 void RemoveAllPlayerEventsAndInvites(
ObjectGuid guid);
324 void SendCalendarEventUpdateAlert(
CalendarEvent const& calendarEvent, time_t originalDate);
326 void SendCalendarEventRemovedAlert(
CalendarEvent const& calendarEvent);
328 void SendCalendarClearPendingAction(
ObjectGuid guid);
334 #define sCalendarMgr CalendarMgr::instance()
std::string _note
Definition: CalendarMgr.h:188
Definition: CalendarMgr.h:36
ObjectGuid GetInviteeGUID() const
Definition: CalendarMgr.h:166
Definition: CalendarMgr.h:63
Definition: CalendarMgr.h:69
Definition: CalendarMgr.h:98
Definition: CalendarMgr.h:84
time_t _date
Definition: CalendarMgr.h:261
CalendarEvent(CalendarEvent const &calendarEvent, uint64 eventId)
Definition: CalendarMgr.h:194
CalendarError
Definition: CalendarMgr.h:88
Definition: CalendarMgr.h:271
uint32 _flags
Definition: CalendarMgr.h:262
CalendarModerationRank _rank
Definition: CalendarMgr.h:187
ObjectGuid _ownerGUID
Definition: CalendarMgr.h:257
Definition: CalendarMgr.h:29
Definition: CalendarMgr.h:45
uint64 _maxInviteId
Definition: CalendarMgr.h:283
std::deque< uint64 > _freeInviteIds
Definition: CalendarMgr.h:281
Definition: CalendarMgr.h:117
Definition: CalendarMgr.h:53
void SetLockDate(time_t lockDate)
Definition: CalendarMgr.h:249
Definition: CalendarMgr.h:38
std::string _description
Definition: CalendarMgr.h:264
std::string GetTitle() const
Definition: CalendarMgr.h:228
Definition: CalendarMgr.h:99
void SetStatus(CalendarInviteStatus status)
Definition: CalendarMgr.h:174
uint64 _eventId
Definition: CalendarMgr.h:182
void LoadFromDB()
Definition: AddonMgr.cpp:40
Definition: CalendarMgr.h:101
CalendarEventType
Definition: CalendarMgr.h:56
time_t _lockDate
Definition: CalendarMgr.h:265
CalendarFlags
Definition: CalendarMgr.h:34
Definition: CalendarMgr.h:104
Definition: CalendarMgr.h:114
Definition: CalendarMgr.h:90
Definition: CalendarMgr.h:103
Definition: CalendarMgr.h:119
Definition: CalendarMgr.h:121
#define UI64LIT(N)
Definition: Define.h:138
Definition: CalendarMgr.h:93
Definition: CalendarMgr.h:111
arena_t NULL
Definition: jemalloc_internal.h:624
std::deque< uint64 > _freeEventIds
Definition: CalendarMgr.h:280
Definition: CalendarMgr.h:108
CalendarEventStore _events
Definition: CalendarMgr.h:277
CalendarEventType GetType() const
Definition: CalendarMgr.h:234
Definition: CalendarMgr.h:106
time_t _responseTime
Definition: CalendarMgr.h:185
CalendarRepeatType
Definition: CalendarMgr.h:66
uint64 LowType
Definition: ObjectGuid.h:199
void SetOwnerGUID(ObjectGuid guid)
Definition: CalendarMgr.h:221
Definition: CalendarMgr.h:62
CalendarModerationRank
Definition: CalendarMgr.h:42
time_t GetResponseTime() const
Definition: CalendarMgr.h:169
ObjectGuid::LowType _eventGuildId
Definition: CalendarMgr.h:258
ObjectGuid::LowType GetGuildId() const
Definition: CalendarMgr.h:225
CalendarInvite(uint64 inviteId, uint64 eventId, ObjectGuid invitee, ObjectGuid senderGUID, time_t responseTime, CalendarInviteStatus status, CalendarModerationRank rank, std::string note)
Definition: CalendarMgr.h:149
Definition: CalendarMgr.h:82
Definition: CalendarMgr.h:83
int32 GetTextureId() const
Definition: CalendarMgr.h:237
uint64 _eventId
Definition: CalendarMgr.h:256
Definition: CalendarMgr.h:97
Definition: CalendarMgr.h:60
std::set< CalendarEvent * > CalendarEventStore
Definition: CalendarMgr.h:268
Definition: CalendarMgr.h:70
CalendarInvite()
Definition: CalendarMgr.h:146
Definition: CalendarMgr.h:109
Definition: CalendarMgr.h:110
void SetTitle(std::string const &title)
Definition: CalendarMgr.h:227
uint64 GetEventId() const
Definition: CalendarMgr.h:219
CalendarInviteStatus _status
Definition: CalendarMgr.h:186
Definition: CalendarMgr.h:58
std::vector< CalendarInvite * > CalendarInviteStore
Definition: CalendarMgr.h:267
Definition: CalendarMgr.h:39
std::string GetNote() const
Definition: CalendarMgr.h:172
Definition: CalendarMgr.h:79
Definition: CalendarMgr.h:77
uint64 GetInviteId() const
Definition: CalendarMgr.h:157
void SetSenderGUID(ObjectGuid guid)
Definition: CalendarMgr.h:162
std::string GetDescription() const
Definition: CalendarMgr.h:231
Definition: CalendarMgr.h:46
void SetGuildId(ObjectGuid::LowType guildId)
Definition: CalendarMgr.h:224
Definition: CalendarMgr.h:80
CalendarEventType _eventType
Definition: CalendarMgr.h:259
Definition: CalendarMgr.h:191
Definition: CalendarMgr.h:68
Definition: CalendarMgr.h:113
Definition: CalendarMgr.h:71
Definition: CalendarMgr.h:96
uint64 _maxEventId
Definition: CalendarMgr.h:282
Definition: CalendarMgr.h:100
Definition: CalendarMgr.h:59
uint64 GetEventId() const
Definition: CalendarMgr.h:160
CalendarEventStore const & GetEvents() const
Definition: CalendarMgr.h:291
void SetResponseTime(time_t responseTime)
Definition: CalendarMgr.h:168
int32_t int32
Definition: Define.h:146
void SetNote(std::string const ¬e)
Definition: CalendarMgr.h:171
uint32_t uint32
Definition: Define.h:150
void SetInvitee(ObjectGuid guid)
Definition: CalendarMgr.h:165
uint64_t uint64
Definition: Define.h:149
std::string _title
Definition: CalendarMgr.h:263
Definition: CalendarMgr.h:122
void SetEventId(uint64 eventId)
Definition: CalendarMgr.h:159
Definition: CalendarMgr.h:123
void SetFlags(uint32 flags)
Definition: CalendarMgr.h:242
ObjectGuid GetSenderGUID() const
Definition: CalendarMgr.h:163
Definition: CalendarMgr.h:115
bool IsGuildAnnouncement() const
Definition: CalendarMgr.h:246
CalendarEvent()
Definition: CalendarMgr.h:213
ObjectGuid _senderGUID
Definition: CalendarMgr.h:184
CalendarMailAnswers
Definition: CalendarMgr.h:26
ObjectGuid _invitee
Definition: CalendarMgr.h:183
void SetDate(time_t date)
Definition: CalendarMgr.h:239
Definition: CalendarMgr.h:81
Definition: CalendarMgr.h:94
void SetDescription(std::string const &description)
Definition: CalendarMgr.h:230
void SetType(CalendarEventType eventType)
Definition: CalendarMgr.h:233
#define TC_GAME_API
Definition: Define.h:134
time_t GetDate() const
Definition: CalendarMgr.h:240
Definition: CalendarMgr.h:120
void SetRank(CalendarModerationRank rank)
Definition: CalendarMgr.h:177
Definition: CalendarMgr.h:37
bool IsGuildEvent() const
Definition: CalendarMgr.h:245
CalendarEventInviteStore _invites
Definition: CalendarMgr.h:278
Definition: CalendarMgr.h:102
CalendarEvent(uint64 eventId, ObjectGuid ownerGUID, ObjectGuid::LowType guildId, CalendarEventType type, int32 textureId, time_t date, uint32 flags, std::string title, std::string description, time_t lockDate)
Definition: CalendarMgr.h:208
Definition: CalendarMgr.h:52
Definition: CalendarMgr.h:116
Definition: CalendarMgr.h:76
bool IsLocked() const
Definition: CalendarMgr.h:247
Definition: CalendarMgr.h:105
Definition: CalendarMgr.h:112
CalendarInviteStatus
Definition: CalendarMgr.h:74
CalendarEventInviteStore const & GetInvites() const
Definition: CalendarMgr.h:295
Definition: CalendarMgr.h:61
std::map< uint64, CalendarInviteStore > CalendarEventInviteStore
Definition: CalendarMgr.h:269
Definition: ObjectGuid.h:189
uint8 flags
Definition: DisableMgr.cpp:44
Definition: CalendarMgr.h:44
void SetInviteId(uint64 inviteId)
Definition: CalendarMgr.h:156
CalendarInviteStatus GetStatus() const
Definition: CalendarMgr.h:175
CalendarSendEventType
Definition: CalendarMgr.h:49
Definition: CalendarMgr.h:51
Definition: CalendarMgr.h:131
Definition: CalendarMgr.h:78
uint64 _inviteId
Definition: CalendarMgr.h:181
void SetTextureId(int32 textureId)
Definition: CalendarMgr.h:236
time_t GetLockDate() const
Definition: CalendarMgr.h:250
Definition: CalendarMgr.h:85
CalendarInvite(CalendarInvite const &calendarInvite, uint64 inviteId, uint64 eventId)
Definition: CalendarMgr.h:134
Definition: CalendarMgr.h:92
Definition: CalendarMgr.h:31
CalendarModerationRank GetRank() const
Definition: CalendarMgr.h:178
Definition: WorldPacket.h:26
int32 _textureId
Definition: CalendarMgr.h:260
uint32 GetFlags() const
Definition: CalendarMgr.h:243
Definition: CalendarMgr.h:95
Definition: CalendarMgr.h:91
ObjectGuid GetOwnerGUID() const
Definition: CalendarMgr.h:222
void SetEventId(uint64 eventId)
Definition: CalendarMgr.h:218
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58