mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7186] Implement instance reset time show in calender.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
58840eb61e
commit
cec3da69fd
2 changed files with 42 additions and 1 deletions
|
|
@ -22,11 +22,52 @@
|
||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
#include "WorldSession.h"
|
#include "WorldSession.h"
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
|
#include "InstanceSaveMgr.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
|
||||||
recv_data.hexlike();
|
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)
|
void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7185"
|
#define REVISION_NR "7186"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue