diff options
author | megamage <none@none> | 2009-01-26 09:52:31 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-26 09:52:31 -0600 |
commit | 1be9f5dbdd4c5135cfd7c45401e362def7b0546b (patch) | |
tree | a6336dd81d197b7c5b3ee4c4bd26d6291f266d1b /src/game/CalendarHandler.cpp | |
parent | 028ff8b16311fd97e70f0164683bab9761bb22c3 (diff) |
*Update to Mangos 7187.
--HG--
branch : trunk
Diffstat (limited to 'src/game/CalendarHandler.cpp')
-rw-r--r-- | src/game/CalendarHandler.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/game/CalendarHandler.cpp b/src/game/CalendarHandler.cpp index fd2858646c2..6b1484bcbab 100644 --- a/src/game/CalendarHandler.cpp +++ b/src/game/CalendarHandler.cpp @@ -22,11 +22,52 @@ #include "WorldPacket.h" #include "WorldSession.h" #include "Opcodes.h" +#include "InstanceSaveMgr.h" + + void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data) { sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); recv_data.hexlike(); + + time_t cur_time = time(NULL); + + WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4); + + // TODO: calendar invite event output + data << (uint32) 0; //invite node count + // TODO: calendar event output + data << (uint32) 0; //event count + + data << (uint32) 0; //wtf?? + data << (uint32) secsToTimeBitFields(cur_time); // current time + + uint32 counter = 0; + size_t p_counter = data.wpos(); + data << uint32(counter); // instance save count + + for(int i = 0; i < TOTAL_DIFFICULTIES; ++i) + { + for (Player::BoundInstancesMap::iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr) + { + if(itr->second.perm) + { + InstanceSave *save = itr->second.save; + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - cur_time); + data << uint64(save->GetInstanceId()); // instance save id as unique instance copy id + ++counter; + } + } + } + data.put<uint32>(p_counter,counter); + + data << (uint32) 1135753200; //wtf?? (28.12.2005 12:00) + sLog.outDebug("Sending calendar"); + //data.hexlike(); + SendPacket(&data); } void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data) |