Core/Calendar

* Fixed raid resets display in calendar
* Active instance locks will now be added to calendar as soon as they are created (not after login)
This commit is contained in:
Shauren
2012-02-24 19:06:53 +01:00
parent c4b6dc3a15
commit 9c3357c1de
3 changed files with 27 additions and 5 deletions
@@ -18185,6 +18185,15 @@ void Player::BindToInstance()
data << uint32(0); data << uint32(0);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
BindToInstance(mapSave, true); BindToInstance(mapSave, true);
time_t currTime = time(NULL);
data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8);
data << uint32(secsToTimeBitFields(currTime));
data << uint32(mapSave->GetMapId());
data << uint32(mapSave->GetDifficulty());
data << uint32(mapSave->GetResetTime() - currTime);
data << uint64(mapSave->GetInstanceId());
GetSession()->SendPacket(&data);
} }
void Player::SendRaidInfo() void Player::SendRaidInfo()
+9 -5
View File
@@ -42,7 +42,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
data << uint32(cur_time); // current time data << uint32(cur_time); // current time
data << uint32(secsToTimeBitFields(cur_time)); // unknown packed time data << uint32(secsToTimeBitFields(cur_time)); // unknown packed time
InstanceSave *save = NULL; InstanceSave *save = NULL;
uint32 counter = 0; uint32 counter = 0;
size_t p_counter = data.wpos(); size_t p_counter = data.wpos();
@@ -74,7 +74,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr) for (ResetTimeByMapDifficultyMap::const_iterator itr = resets.begin(); itr != resets.end(); ++itr)
{ {
uint32 mapId = PAIR32_LOPART(itr->first); uint32 mapId = PAIR32_LOPART(itr->first);
Difficulty difficulty = Difficulty(PAIR32_HIPART(itr->first));
if (sentMaps.find(mapId) != sentMaps.end()) if (sentMaps.find(mapId) != sentMaps.end())
continue; continue;
@@ -82,10 +82,14 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
if (!mapEntry || !mapEntry->IsRaid()) if (!mapEntry || !mapEntry->IsRaid())
continue; continue;
MapDifficulty const* diff = GetMapDifficultyData(mapId, difficulty);
if (!diff)
continue;
sentMaps.insert(mapId); sentMaps.insert(mapId);
data << uint32(mapId); data << uint32(mapId);
data << uint32(itr->second - cur_time); data << uint32(diff->resetTime);
data << uint32(mapEntry->unk_time); data << uint32(mapEntry->unk_time);
++counter; ++counter;
} }
@@ -148,7 +152,7 @@ void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data)
void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT");
std::string title; std::string title;
std::string description; std::string description;
uint8 type; uint8 type;
@@ -365,7 +369,7 @@ void WorldSession::SendCalendarEvent(uint64 eventId, bool added)
{ {
data << uint32(0); // invite count data << uint32(0); // invite count
for (uint8 i = 0; i < 0; ++i) for (uint8 i = 0; i < 0; ++i)
{ {
data << uint64(0); // invite played guid data << uint64(0); // invite played guid
data << uint8(0); // unk data << uint8(0); // unk
data << uint8(0); // status data << uint8(0); // status
+9
View File
@@ -2518,6 +2518,15 @@ void InstanceMap::PermBindAllPlayers(Player* source)
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4); WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
data << uint32(0); data << uint32(0);
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
time_t currTime = time(NULL);
data.Initialize(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, 4 + 4 + 4 + 4 + 8);
data << uint32(secsToTimeBitFields(currTime));
data << uint32(save->GetMapId());
data << uint32(save->GetDifficulty());
data << uint32(save->GetResetTime() - currTime);
data << uint64(save->GetInstanceId());
player->GetSession()->SendPacket(&data);
} }
// if the leader is not in the instance the group will not get a perm bind // if the leader is not in the instance the group will not get a perm bind