2 * Copyright (C) 2005-2009 MaNGOS <http://www.mangosproject.org/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "WorldPacket.h"
23 #include "WorldSession.h"
25 #include "InstanceSaveMgr.h"
27 void WorldSession::HandleCalendarGetCalendar(WorldPacket
&recv_data
)
29 sLog
.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
32 time_t cur_time
= time(NULL
);
34 WorldPacket
data(SMSG_CALENDAR_SEND_CALENDAR
,4+4*0+4+4*0+4+4);
36 // TODO: calendar invite event output
37 data
<< (uint32
) 0; //invite node count
38 // TODO: calendar event output
39 data
<< (uint32
) 0; //event count
41 data
<< (uint32
) 0; //wtf??
42 data
<< (uint32
) secsToTimeBitFields(cur_time
); // current time
45 size_t p_counter
= data
.wpos();
46 data
<< uint32(counter
); // instance save count
48 for(int i
= 0; i
< TOTAL_DIFFICULTIES
; ++i
)
50 for (Player::BoundInstancesMap::const_iterator itr
= _player
->m_boundInstances
[i
].begin(); itr
!= _player
->m_boundInstances
[i
].end(); ++itr
)
54 InstanceSave
*save
= itr
->second
.save
;
55 data
<< uint32(save
->GetMapId());
56 data
<< uint32(save
->GetDifficulty());
57 data
<< uint32(save
->GetResetTime() - cur_time
);
58 data
<< uint64(save
->GetInstanceId()); // instance save id as unique instance copy id
63 data
.put
<uint32
>(p_counter
,counter
);
65 data
<< (uint32
) 1135753200; //wtf?? (28.12.2005 12:00)
66 data
<< (uint32
) 0; // unk counter 4
67 data
<< (uint32
) 0; // unk counter 5
68 //sLog.outDebug("Sending calendar");
73 void WorldSession::HandleCalendarGetEvent(WorldPacket
&recv_data
)
75 sLog
.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT");
79 void WorldSession::HandleCalendarGuildFilter(WorldPacket
&recv_data
)
81 sLog
.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER");
85 void WorldSession::HandleCalendarArenaTeam(WorldPacket
&recv_data
)
87 sLog
.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM");
91 void WorldSession::HandleCalendarAddEvent(WorldPacket
&recv_data
)
93 sLog
.outDebug("WORLD: CMSG_CALENDAR_ADD_EVENT");
97 void WorldSession::HandleCalendarUpdateEvent(WorldPacket
&recv_data
)
99 sLog
.outDebug("WORLD: CMSG_CALENDAR_UPDATE_EVENT");
103 void WorldSession::HandleCalendarRemoveEvent(WorldPacket
&recv_data
)
105 sLog
.outDebug("WORLD: CMSG_CALENDAR_REMOVE_EVENT");
109 void WorldSession::HandleCalendarCopyEvent(WorldPacket
&recv_data
)
111 sLog
.outDebug("WORLD: CMSG_CALENDAR_COPY_EVENT");
115 void WorldSession::HandleCalendarEventInvite(WorldPacket
&recv_data
)
117 sLog
.outDebug("WORLD: CMSG_CALENDAR_EVENT_INVITE");
121 void WorldSession::HandleCalendarEventRsvp(WorldPacket
&recv_data
)
123 sLog
.outDebug("WORLD: CMSG_CALENDAR_EVENT_RSVP");
127 void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket
&recv_data
)
129 sLog
.outDebug("WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE");
133 void WorldSession::HandleCalendarEventStatus(WorldPacket
&recv_data
)
135 sLog
.outDebug("WORLD: CMSG_CALENDAR_EVENT_STATUS");
139 void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket
&recv_data
)
141 sLog
.outDebug("WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS");
145 void WorldSession::HandleCalendarComplain(WorldPacket
&recv_data
)
147 sLog
.outDebug("WORLD: CMSG_CALENDAR_COMPLAIN");
151 void WorldSession::HandleCalendarGetNumPending(WorldPacket
&recv_data
)
153 sLog
.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING");
156 WorldPacket
data(SMSG_CALENDAR_SEND_NUM_PENDING
, 4);
157 data
<< uint32(0); // 0 - no pending invites, 1 - some pending invites