aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CalendarHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-07-29 00:04:37 +0200
committerShauren <shauren.trinity@gmail.com>2015-07-29 00:04:37 +0200
commit3604025bb7e1e1e7803a44b0f13931b88fcd26ac (patch)
treefac7e151b4f4b2982cf6e7393e61fea44c69195d /src/server/game/Handlers/CalendarHandler.cpp
parent0ada9ae513506fc0dc0c1729b9e385857401514f (diff)
Core/PacketIO: Added utility packet array class to handle loop counter limiting in packets received from the client
Diffstat (limited to 'src/server/game/Handlers/CalendarHandler.cpp')
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 36d04d6772a..e7c8268443a 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -173,36 +173,15 @@ void WorldSession::HandleCalendarAddEvent(WorldPackets::Calendar::CalendarAddEve
}
else
{
- // client limits the amount of players to be invited to 100
- ObjectGuid invitee[CALENDAR_MAX_INVITES];
- uint8 status[CALENDAR_MAX_INVITES];
- uint8 rank[CALENDAR_MAX_INVITES];
-
- memset(status, 0, sizeof(status));
- memset(rank, 0, sizeof(rank));
- try
- {
- for (uint32 i = 0; i < calendarAddEvent.EventInfo.Invites.size() && i < CALENDAR_MAX_INVITES; ++i)
- {
- invitee[i] = calendarAddEvent.EventInfo.Invites[i].Guid;
- status[i] = calendarAddEvent.EventInfo.Invites[i].Status;
- rank[i] = calendarAddEvent.EventInfo.Invites[i].Moderator;
- }
- }
- catch (ByteBufferException const&)
- {
- delete calendarEvent;
- calendarEvent = NULL;
- throw;
- }
-
SQLTransaction trans;
if (calendarAddEvent.EventInfo.Invites.size() > 1)
trans = CharacterDatabase.BeginTransaction();
- for (uint32 i = 0; i < calendarAddEvent.EventInfo.Invites.size() && i < CALENDAR_MAX_INVITES; ++i)
+ for (uint32 i = 0; i < calendarAddEvent.EventInfo.Invites.size(); ++i)
{
- CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), calendarEvent->GetEventId(), invitee[i], guid, CALENDAR_DEFAULT_RESPONSE_TIME, CalendarInviteStatus(status[i]), CalendarModerationRank(rank[i]), "");
+ CalendarInvite* invite = new CalendarInvite(sCalendarMgr->GetFreeInviteId(), calendarEvent->GetEventId(), calendarAddEvent.EventInfo.Invites[i].Guid,
+ guid, CALENDAR_DEFAULT_RESPONSE_TIME, CalendarInviteStatus(calendarAddEvent.EventInfo.Invites[i].Status),
+ CalendarModerationRank(calendarAddEvent.EventInfo.Invites[i].Moderator), "");
sCalendarMgr->AddInvite(calendarEvent, invite, trans);
}