aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/server/game/Calendar/Calendar.h40
-rwxr-xr-xsrc/server/game/Handlers/CalendarHandler.cpp23
2 files changed, 46 insertions, 17 deletions
diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h
index c53ba8bf113..d8da4ce7ffe 100755
--- a/src/server/game/Calendar/Calendar.h
+++ b/src/server/game/Calendar/Calendar.h
@@ -21,7 +21,6 @@
#include "Common.h"
-// TODO - Get correct values
enum CalendarEventType
{
CALENDARTYPE_RAID = 0,
@@ -31,8 +30,21 @@ enum CalendarEventType
CALENDARTYPE_OTHER,
};
-// TODO - Get correct values
-enum CalendarInviteStatus
+enum CalendarSendEventType
+{
+ CALENDARSENDEVENTTYPE_GET = 0,
+ CALENDARSENDEVENTTYPE_ADD,
+ CALENDARSENDEVENTTYPE_COPY
+};
+
+enum CalendarModerationRank
+{
+ CALENDARMODERATIONRANK_PLAYER = 0,
+ CALENDARMODERATIONRANK_MODERATOR,
+ CALENDARMODERATIONRANK_OWNER
+};
+
+enum CalendarEventStatus
{
CALENDARSTATUS_INVITED = 0,
CALENDARSTATUS_ACCEPTED,
@@ -41,6 +53,20 @@ enum CalendarInviteStatus
CALENDARSTATUS_OUT,
CALENDARSTATUS_STANDBY,
CALENDARSTATUS_CONFIRMED,
+ // CALENDARSTATUS_UNK7
+ // CALENDARSTATUS_UNK8
+ // CALENDARSTATUS_UNK9
+};
+
+enum CalendarFlags
+{
+ CALENDARFLAG_NONE = 0x000000,
+ CALENDARFLAG_NORMAL = 0x000001,
+ CALENDARFLAG_INVITES_LOCKED = 0x000010,
+ CALENDARFLAG_WITHOUT_INVITES = 0x000040,
+ CALENDARFLAG_GUILD_EVENT = 0x000400
+ // CALENDARFLAG_Unk10000 = 0x010000,
+ // CALENDARFLAG_Unk400000 = 0x400000
};
struct CalendarEvent
@@ -49,12 +75,12 @@ struct CalendarEvent
uint64 CreatorGuid;
std::string Name;
std::string Description;
- uint8 Type;
+ CalendarEventType Type;
uint8 Unk;
uint32 DungeonId;
uint32 UnkTime;
uint32 Time;
- uint32 Flags;
+ CalendarFlags Flags;
uint32 GuildId;
};
@@ -62,8 +88,8 @@ struct CalendarInvite
{
uint64 Id;
uint64 Event;
- uint8 Status;
- uint8 Rank;
+ CalendarEventStatus Status;
+ CalendarModerationRank Rank;
uint8 Unk1;
uint8 Unk2;
uint8 Unk3;
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 5cd67b0ffbc..ec7bac82547 100755
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -155,13 +155,13 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
std::string title;
std::string description;
- uint8 type;
+ uint8 type; // CalendarEventType
uint8 unkbyte;
uint32 maxInvites;
uint32 dungeonId;
uint32 eventPackedTime;
uint32 unkPackedTime;
- uint32 flags;
+ uint32 flags; // CalendarFlags
recv_data >> title;
recv_data >> description;
@@ -177,17 +177,17 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
event.Id = sCalendarMgr->GetNextEventId();
event.Name = title;
event.Description = description;
- event.Type = type;
+ event.Type = (CalendarEventType) type;
event.Unk = unkbyte;
event.DungeonId = dungeonId;
- event.Flags = flags;
+ event.Flags = (CalendarFlags) flags;
event.Time = eventPackedTime;
event.UnkTime = unkPackedTime;
event.CreatorGuid = GetPlayer()->GetGUID();
sCalendarMgr->AddEvent(event);
- if (((flags >> 6) & 1))
+ if (flags & CALENDARFLAG_WITHOUT_INVITES)
return;
uint32 inviteCount;
@@ -197,23 +197,26 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
return;
uint64 guid;
- uint8 status;
- uint8 rank;
- for (int32 i = 0; i < inviteCount; ++i)
+ uint8 status; // CalendarEventStatus
+ uint8 rank; // CalendarModerationRank
+ for (uint32 i = 0; i < inviteCount; ++i)
{
CalendarInvite invite;
invite.Id = sCalendarMgr->GetNextInviteId();
+
recv_data.readPackGUID(guid);
recv_data >> status;
recv_data >> rank;
+
invite.Event = event.Id;
invite.CreatorGuid = GetPlayer()->GetGUID();
invite.TargetGuid = guid;
- invite.Status = status;
- invite.Rank = rank;
+ invite.Status = (CalendarEventStatus) status;
+ invite.Rank = (CalendarModerationRank) rank;
invite.Time = event.Time;
invite.Text = ""; // hmm...
invite.Unk1 = invite.Unk2 = invite.Unk3 = 0;
+
sCalendarMgr->AddInvite(invite);
}
//SendCalendarEvent(eventId, true);