diff options
-rwxr-xr-x | src/server/game/Calendar/Calendar.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Calendar/Calendar.h | 100 | ||||
-rw-r--r-- | src/server/game/Calendar/CalendarMgr.cpp | 30 | ||||
-rw-r--r-- | src/server/game/Calendar/CalendarMgr.h | 10 | ||||
-rwxr-xr-x | src/server/game/Handlers/CalendarHandler.cpp | 43 | ||||
-rwxr-xr-x | src/server/game/Miscellaneous/SharedDefines.h | 101 | ||||
-rwxr-xr-x | src/server/game/Server/WorldSession.h | 46 |
7 files changed, 170 insertions, 166 deletions
diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 22578ef2dcc..ad0d4b4ac2e 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -40,8 +40,8 @@ void CalendarInvite::Init() _invitee = 0; _senderGUID = 0; _statusTime = 0; - _status = 0; - _rank = 0; + _status = CALENDAR_STATUS_INVITED; // default (0)? + _rank = CALENDAR_RANK_PLAYER; _text = ""; } @@ -74,7 +74,7 @@ void CalendarEvent::Init() _dungeonId = -1; _maxInvites = 0; _eventTime = 0; - _flags = 0; + _flags = (CalendarFlags) 0; _repeatable = false; _timezoneTime = 0; _title = ""; diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index 0caf4fca0dc..440a241652d 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -20,67 +20,9 @@ #define TRINITY_CALENDAR_H #include "Errors.h" +#include "SharedDefines.h" #include <map> -enum CalendarFlags -{ - CALENDAR_FLAG_ALL_ALLOWED = 0x001, - CALENDAR_FLAG_INVITES_LOCKED = 0x010, - CALENDAR_FLAG_WITHOUT_INVITES = 0x040, - CALENDAR_FLAG_GUILD_ONLY = 0x400, -}; - -enum CalendarActionData -{ - CALENDAR_ACTION_NONE, - CALENDAR_ACTION_ADD_EVENT, - CALENDAR_ACTION_MODIFY_EVENT, - CALENDAR_ACTION_REMOVE_EVENT, - CALENDAR_ACTION_COPY_EVENT, - CALENDAR_ACTION_ADD_EVENT_INVITE, - CALENDAR_ACTION_MODIFY_EVENT_INVITE, - CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, - CALENDAR_ACTION_REMOVE_EVENT_INVITE, - CALENDAR_ACTION_SIGNUP_TO_EVENT, -}; - -enum CalendarRanks -{ - CALENDAR_RANK_PLAYER, - CALENDAR_RANK_MODERATOR, - CALENDAR_RANK_OWNER, -}; - -enum CalendarSendEventType -{ - CALENDAR_SENDTYPE_GET, - CALENDAR_SENDTYPE_ADD, - CALENDAR_SENDTYPE_COPY, -}; - -enum CalendarEventType -{ - CALENDAR_TYPE_RAID, - CALENDAR_TYPE_DUNGEON, - CALENDAR_TYPE_PVP, - CALENDAR_TYPE_MEETING, - CALENDAR_TYPE_OTHER, -}; - -enum CalendarInviteStatus -{ - CALENDAR_STATUS_INVITED, - CALENDAR_STATUS_ACCEPTED, - CALENDAR_STATUS_DECLINED, - CALENDAR_STATUS_TENTATIVE, - CALENDAR_STATUS_OUT, - CALENDAR_STATUS_STANDBY, - CALENDAR_STATUS_CONFIRMED, - CALENDAR_STATUS_NO_OWNER, - CALENDAR_STATUS_8, - CALENDAR_STATUS_9, -}; - class CalendarInvite { public: @@ -107,11 +49,11 @@ class CalendarInvite void SetText(std::string text) { _text = text; } std::string GetText() const { return _text; } - void SetStatus(uint8 status) { _status = status; } - uint8 GetStatus() const { return _status; } + void SetStatus(CalendarInviteStatus status) { _status = status; } + CalendarInviteStatus GetStatus() const { return _status; } - void SetRank(uint8 rank) { _rank = rank; } - uint8 GetRank() const { return _rank; } + void SetRank(CalendarModerationRank rank) { _rank = rank; } + CalendarModerationRank GetRank() const { return _rank; } std::string GetDebugString() const; @@ -123,12 +65,12 @@ class CalendarInvite uint64 _invitee; uint64 _senderGUID; uint32 _statusTime; - uint8 _status; - uint8 _rank; + CalendarInviteStatus _status; + CalendarModerationRank _rank; std::string _text; }; -typedef std::set<uint64> CalendarinviteIdList; +typedef std::set<uint64> CalendarInviteIdList; class CalendarEvent { @@ -153,8 +95,8 @@ class CalendarEvent void SetDescription(std::string description) { _description = description; } std::string GetDescription() const { return _description; } - void SetType(uint8 type) { _type = type; } - uint8 GetType() const { return _type; } + void SetType(CalendarEventType type) { _type = type; } + CalendarEventType GetType() const { return _type; } void SetMaxInvites(uint32 limit) { _maxInvites = limit; } uint32 GetMaxInvites() const { return _maxInvites; } @@ -165,11 +107,11 @@ class CalendarEvent void SetTime(uint32 eventTime) { _eventTime = eventTime; } uint32 GetTime() const { return _eventTime; } - void SetFlags(uint32 flags) { _flags = flags; } - uint32 GetFlags() const { return _flags; } + void SetFlags(CalendarFlags flags) { _flags = flags; } + CalendarFlags GetFlags() const { return _flags; } void SetRepeatable(bool repeatable) { _repeatable = repeatable; } - uint8 GetRepeatable() const { return _repeatable; } + bool GetRepeatable() const { return _repeatable; } void SetTimeZoneTime(uint32 timezoneTime) { _timezoneTime = timezoneTime; } uint32 GetTimeZoneTime() const { return _timezoneTime; } @@ -182,8 +124,8 @@ class CalendarEvent void RemoveInvite(uint64 inviteId) { _invites.erase(inviteId); } bool HasInvite(uint64 inviteId) const { return _invites.find(inviteId) != _invites.end(); } - CalendarinviteIdList const& GetInviteIdList() const { return _invites; } - void SetInviteIdList(CalendarinviteIdList const& list) { _invites = list; } + CalendarInviteIdList const& GetInviteIdList() const { return _invites; } + void SetInviteIdList(CalendarInviteIdList const& list) { _invites = list; } void ClearInviteIdList() { _invites.clear(); } std::string GetDebugString() const; @@ -194,20 +136,20 @@ class CalendarEvent uint64 _eventId; uint64 _creatorGUID; uint32 _guildId; - uint8 _type; + CalendarEventType _type; int32 _dungeonId; uint32 _maxInvites; uint32 _eventTime; - uint32 _flags; - uint8 _repeatable; + CalendarFlags _flags; + bool _repeatable; uint32 _timezoneTime; std::string _title; std::string _description; - CalendarinviteIdList _invites; + CalendarInviteIdList _invites; }; typedef std::set<uint64> CalendarEventIdList; -typedef std::map<uint64, CalendarinviteIdList> CalendarPlayerinviteIdMap; +typedef std::map<uint64, CalendarInviteIdList> CalendarPlayerInviteIdMap; typedef std::map<uint64, CalendarEventIdList> CalendarPlayerEventIdMap; typedef std::map<uint64, CalendarInvite> CalendarInviteMap; typedef std::map<uint64, CalendarEvent> CalendarEventMap; @@ -216,7 +158,7 @@ class Player; struct CalendarAction { - CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _guid(0), _inviteId(0), _data(0) + CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _inviteId(0), _data(0) { } diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index aac26578c3e..9b8ef5614f0 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -67,12 +67,12 @@ uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) if (!guid) return 0; - CalendarPlayerinviteIdMap::const_iterator itr = _playerInvites.find(guid); + CalendarPlayerInviteIdMap::const_iterator itr = _playerInvites.find(guid); if (itr == _playerInvites.end()) return 0; uint32 pendingNum = 0; - for (CalendarinviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) + for (CalendarInviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) if (CalendarInvite* invite = GetInvite(*it)) if (invite->GetRank() != CALENDAR_RANK_OWNER && invite->GetStatus() != CALENDAR_STATUS_CONFIRMED @@ -83,7 +83,7 @@ uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) return pendingNum; } -CalendarinviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) +CalendarInviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) { return _playerInvites[guid]; } @@ -180,7 +180,7 @@ void CalendarMgr::LoadFromDB() */ } -CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank) +CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank) { if (!player) return NULL; // CALENDAR_ERROR_INTERNAL @@ -251,8 +251,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) calendarEvent->SetDescription(action.Event.GetDescription()); calendarEvent->SetMaxInvites(action.Event.GetMaxInvites()); - CalendarinviteIdList const& invites = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const& invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) if (CalendarInvite* invite = GetInvite(*itr)) SendCalendarEventUpdateAlert(invite->GetInvitee(), *calendarEvent, CALENDAR_SENDTYPE_ADD); @@ -279,8 +279,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) newEvent.SetCreatorGUID(calendarEvent->GetCreatorGUID()); newEvent.SetGuildId(calendarEvent->GetGuildId()); - CalendarinviteIdList const invites = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) { if (CalendarInvite* invite = GetInvite(*itr)) { @@ -316,8 +316,8 @@ void CalendarMgr::AddAction(CalendarAction const& action) if (!calendarEvent) return; - CalendarinviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); - for (CalendarinviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) + CalendarInviteIdList const& inviteIds = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator it = inviteIds.begin(); it != inviteIds.end(); ++it) if (uint64 invitee = RemoveInvite(*it)) SendCalendarEventRemovedAlert(invitee, *calendarEvent); @@ -351,7 +351,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) return; - uint8 status = action.Invite.GetStatus(); + CalendarInviteStatus status = action.Invite.GetStatus(); if (status == CALENDAR_STATUS_INVITED) status = CALENDAR_STATUS_CONFIRMED; @@ -465,8 +465,8 @@ bool CalendarMgr::RemoveEvent(uint64 eventId) bool val = true; - CalendarinviteIdList const& invites = itr->second.GetInviteIdList(); - for (CalendarinviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + CalendarInviteIdList const& invites = itr->second.GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) { CalendarInvite* invite = GetInvite(*itr); if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) @@ -573,13 +573,13 @@ void CalendarMgr::SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const player->GetSession()->SendCalendarEventRemovedAlert(calendarEvent); } -void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status) +void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status) { if (Player* player = ObjectAccessor::FindPlayer(guid)) player->GetSession()->SendCalendarEventInviteRemoveAlert(calendarEvent, status); } -void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags) +void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags) { if (Player* player = ObjectAccessor::FindPlayer(guid)) player->GetSession()->SendCalendarEventInviteRemove(invite, flags); diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index 0fb4362bc95..bfc0fd9d1cf 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -34,7 +34,7 @@ class CalendarMgr CalendarInvite* GetInvite(uint64 inviteId); CalendarEvent* GetEvent(uint64 eventId); - CalendarinviteIdList const& GetPlayerInvites(uint64 guid); + CalendarInviteIdList const& GetPlayerInvites(uint64 guid); CalendarEventIdList const& GetPlayerEvents(uint64 guid); uint32 GetPlayerNumPending(uint64 guid); @@ -46,15 +46,15 @@ class CalendarMgr void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite); - void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags); - void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type); void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); private: - CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarRanks minRank); + CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank); bool AddEvent(CalendarEvent const& calendarEvent); bool RemoveEvent(uint64 eventId); @@ -68,7 +68,7 @@ class CalendarMgr CalendarEventMap _events; CalendarInviteMap _invites; - CalendarPlayerinviteIdMap _playerInvites; + CalendarPlayerInviteIdMap _playerInvites; CalendarPlayerEventIdMap _playerEvents; uint64 _eventNum; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 01838f815fb..f9e74b60c58 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -21,7 +21,6 @@ SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaildLockoutUpdated(InstanceSave const* save) <--- Structure unknown, using LOCKOUT_ADDED -SMSG_CALENDAR_COMMAND_RESULT SendCalendarCommandResult(uint32 value) <--- Structure meanings not known using in a Hack way ----- Opcodes without Sniffs ----- SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] @@ -56,9 +55,9 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR [" UI64FMTD "]", guid); WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Impossible to get the correct size without doing a double iteration of some elements - CalendarinviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); + CalendarInviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); data << uint32(invites.size()); - for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { CalendarInvite* invite = sCalendarMgr->GetInvite(*it); CalendarEvent* calendarEvent = invite ? sCalendarMgr->GetEvent(invite->GetEventId()) : NULL; @@ -261,8 +260,8 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); action.Event.SetCreatorGUID(guid); - action.Event.SetType(type); - action.Event.SetFlags(flags); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags((CalendarFlags) flags); action.Event.SetTime(eventPackedTime); action.Event.SetTimeZoneTime(unkPackedTime); action.Event.SetRepeatable(repeatable); @@ -275,8 +274,8 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) action.Invite.SetEventId(action.Event.GetEventId()); action.Invite.SetInviteId(inviteId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); - action.Invite.SetRank(rank); + action.Invite.SetStatus((CalendarInviteStatus) status); + action.Invite.SetRank((CalendarModerationRank) rank); action.Invite.SetSenderGUID(guid); sCalendarMgr->AddAction(action); @@ -313,8 +312,8 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); - action.Event.SetType(type); - action.Event.SetFlags(flags); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags((CalendarFlags) flags); action.Event.SetTime(eventPackedTime); action.Event.SetTimeZoneTime(timeZoneTime); action.Event.SetRepeatable(repeatable); @@ -342,7 +341,7 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) action.SetPlayer(_player); action.SetInviteId(inviteId); action.Event.SetEventId(eventId); - action.Event.SetFlags(flags); + action.Event.SetFlags((CalendarFlags) flags); sCalendarMgr->AddAction(action); } @@ -423,8 +422,8 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) action.Invite.SetInviteId(sCalendarMgr->GetFreeInviteId()); action.Invite.SetSenderGUID(_player->GetGUID()); action.Invite.SetInvitee(invitee); - action.Invite.SetRank(rank); - action.Invite.SetStatus(status); + action.Invite.SetRank((CalendarModerationRank) rank); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -444,7 +443,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recv_data) action.SetPlayer(_player); action.SetExtraData(GetPlayer()->GetGuildId()); action.Event.SetEventId(eventId); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -466,7 +465,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) action.SetInviteId(inviteId); action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -520,7 +519,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -547,7 +546,7 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) action.Invite.SetInviteId(inviteId); action.Invite.SetEventId(eventId); action.Invite.SetInvitee(invitee); - action.Invite.SetStatus(status); + action.Invite.SetStatus((CalendarInviteStatus) status); sCalendarMgr->AddAction(action); } @@ -578,7 +577,7 @@ void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) // ----------------------------------- SEND ------------------------------------ -void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType) +void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -601,9 +600,9 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 s data << uint32(calendarEvent.GetTimeZoneTime()); data << uint32(calendarEvent.GetGuildId()); - CalendarinviteIdList const& invites = calendarEvent.GetInviteIdList(); + CalendarInviteIdList const& invites = calendarEvent.GetInviteIdList(); data << uint32(invites.size()); - for (CalendarinviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { if (CalendarInvite* invite = sCalendarMgr->GetInvite(*it)) { @@ -687,7 +686,7 @@ void WorldSession::SendCalendarEventInviteAlert(CalendarEvent const& calendarEve SendPacket(&data); } -void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType) +void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -780,7 +779,7 @@ void WorldSession::SendCalendarEventModeratorStatusAlert(CalendarInvite const& i SendPacket(&data); } -void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status) +void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status) { uint64 guid = _player->GetGUID(); uint64 eventId = calendarEvent.GetEventId(); @@ -799,7 +798,7 @@ void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calen SendPacket(&data); } -void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags) +void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags) { uint64 guid = _player->GetGUID(); uint64 eventId = invite.GetEventId(); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index fbc84b85a80..c404277f61f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3422,4 +3422,105 @@ enum ActivateTaxiReply ERR_TAXINOTSTANDING = 12 }; +// Calendar - start + +enum CalendarFlags +{ + CALENDAR_FLAG_ALL_ALLOWED = 0x001, + CALENDAR_FLAG_INVITES_LOCKED = 0x010, + CALENDAR_FLAG_WITHOUT_INVITES = 0x040, + CALENDAR_FLAG_GUILD_ONLY = 0x400, +}; + +enum CalendarActionData +{ + CALENDAR_ACTION_NONE, + CALENDAR_ACTION_ADD_EVENT, + CALENDAR_ACTION_MODIFY_EVENT, + CALENDAR_ACTION_REMOVE_EVENT, + CALENDAR_ACTION_COPY_EVENT, + CALENDAR_ACTION_ADD_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, + CALENDAR_ACTION_REMOVE_EVENT_INVITE, + CALENDAR_ACTION_SIGNUP_TO_EVENT, +}; + +enum CalendarModerationRank +{ + CALENDAR_RANK_PLAYER, + CALENDAR_RANK_MODERATOR, + CALENDAR_RANK_OWNER, +}; + +enum CalendarSendEventType +{ + CALENDAR_SENDTYPE_GET, + CALENDAR_SENDTYPE_ADD, + CALENDAR_SENDTYPE_COPY, +}; + +enum CalendarEventType +{ + CALENDAR_TYPE_RAID, + CALENDAR_TYPE_DUNGEON, + CALENDAR_TYPE_PVP, + CALENDAR_TYPE_MEETING, + CALENDAR_TYPE_OTHER, +}; + +enum CalendarInviteStatus +{ + CALENDAR_STATUS_INVITED, + CALENDAR_STATUS_ACCEPTED, + CALENDAR_STATUS_DECLINED, + CALENDAR_STATUS_TENTATIVE, + CALENDAR_STATUS_OUT, + CALENDAR_STATUS_STANDBY, + CALENDAR_STATUS_CONFIRMED, + CALENDAR_STATUS_NO_OWNER, + CALENDAR_STATUS_8, + CALENDAR_STATUS_9, +}; + +enum CalendarError +{ + CALENDAR_OK = 0, + CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, + CALENDAR_ERROR_EVENTS_EXCEEDED = 2, + CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, + CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, + CALENDAR_ERROR_PERMISSIONS = 5, + CALENDAR_ERROR_EVENT_INVALID = 6, + CALENDAR_ERROR_NOT_INVITED = 7, + CALENDAR_ERROR_INTERNAL = 8, + CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, + CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, + CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, + CALENDAR_ERROR_NOT_ALLIED = 12, + CALENDAR_ERROR_IGNORING_YOU_S = 13, + CALENDAR_ERROR_INVITES_EXCEEDED = 14, + CALENDAR_ERROR_INVALID_DATE = 16, + CALENDAR_ERROR_INVALID_TIME = 17, + + CALENDAR_ERROR_NEEDS_TITLE = 19, + CALENDAR_ERROR_EVENT_PASSED = 20, + CALENDAR_ERROR_EVENT_LOCKED = 21, + CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, + CALENDAR_ERROR_SYSTEM_DISABLED = 24, + CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, + CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, + CALENDAR_ERROR_RESTRICTED_LEVEL = 27, + CALENDAR_ERROR_USER_SQUELCHED = 28, + CALENDAR_ERROR_NO_INVITE = 29, + + CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, + CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, + CALENDAR_ERROR_NO_GUILD_INVITES = 38, + CALENDAR_ERROR_INVALID_SIGNUP = 39, + CALENDAR_ERROR_NO_MODERATOR = 40 +}; + +// Calendar - end + #endif diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 35a85753c20..3158c02a320 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -141,44 +141,6 @@ enum CharterTypes ARENA_TEAM_CHARTER_5v5_TYPE = 5 }; -enum CalendarError -{ - CALENDAR_OK = 0, - CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, - CALENDAR_ERROR_EVENTS_EXCEEDED = 2, - CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, - CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, - CALENDAR_ERROR_PERMISSIONS = 5, - CALENDAR_ERROR_EVENT_INVALID = 6, - CALENDAR_ERROR_NOT_INVITED = 7, - CALENDAR_ERROR_INTERNAL = 8, - CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, - CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, - CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, - CALENDAR_ERROR_NOT_ALLIED = 12, - CALENDAR_ERROR_IGNORING_YOU_S = 13, - CALENDAR_ERROR_INVITES_EXCEEDED = 14, - CALENDAR_ERROR_INVALID_DATE = 16, - CALENDAR_ERROR_INVALID_TIME = 17, - - CALENDAR_ERROR_NEEDS_TITLE = 19, - CALENDAR_ERROR_EVENT_PASSED = 20, - CALENDAR_ERROR_EVENT_LOCKED = 21, - CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, - CALENDAR_ERROR_SYSTEM_DISABLED = 24, - CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, - CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, - CALENDAR_ERROR_RESTRICTED_LEVEL = 27, - CALENDAR_ERROR_USER_SQUELCHED = 28, - CALENDAR_ERROR_NO_INVITE = 29, - - CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, - CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, - CALENDAR_ERROR_NO_GUILD_INVITES = 38, - CALENDAR_ERROR_INVALID_SIGNUP = 39, - CALENDAR_ERROR_NO_MODERATOR = 40 -}; - //class to deal with packet processing //allows to determine if next packet is safe to be processed class PacketFilter @@ -920,13 +882,13 @@ class WorldSession void HandleCalendarGetNumPending(WorldPacket& recv_data); void HandleCalendarEventSignup(WorldPacket& recv_data); - void SendCalendarEvent(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite); - void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags); - void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, uint8 status); + void SendCalendarEventInviteRemove(CalendarInvite const& invite, CalendarFlags flags); + void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status); void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent); - void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, uint8 sendEventType); + void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); void SendCalendarClearPendingAction(); |