[9551] Add and use PackedGuid wrapper.

Also
* use more wide bytebuff << >> operators for objects
* use at read packet faisl alsways exception way instead some time used bool results.
This commit is contained in:
VladimirMangos 2010-03-08 20:19:25 +03:00
parent ad9243ebd0
commit c8fd454a79
26 changed files with 351 additions and 340 deletions

View file

@ -651,7 +651,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
}
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
data.append(GetPlayer()->GetPackGUID());
data << GetPlayer()->GetPackGUID();
data << uint32(achievement->ID);
data << uint32(secsToTimeBitFields(time(NULL)));
data << uint32(0);
@ -666,7 +666,7 @@ void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progr
// the counter is packed like a packed Guid
data.appendPackGUID(progress->counter);
data.append(GetPlayer()->GetPackGUID());
data << GetPlayer()->GetPackGUID();
data << uint32(0);
data << uint32(secsToTimeBitFields(progress->date));
data << uint32(0); // timer 1
@ -1855,7 +1855,7 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player)
{
// since we don't know the exact size of the packed GUIDs this is just an approximation
WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 4+4*2+m_completedAchievements.size()*4*2+m_completedAchievements.size()*7*4);
data.append(GetPlayer()->GetPackGUID());
data << GetPlayer()->GetPackGUID();
BuildAllDataPacket(&data);
player->GetSession()->SendPacket(&data);
}
@ -1876,7 +1876,7 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket *data)
{
*data << uint32(iter->first);
data->appendPackGUID(iter->second.counter);
data->append(GetPlayer()->GetPackGUID());
*data << GetPlayer()->GetPackGUID();
*data << uint32(0);
*data << uint32(secsToTimeBitFields(iter->second.date));
*data << uint32(0);