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()
+6 -2
View File
@@ -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;
} }
+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