[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

@ -17,7 +17,6 @@
*/
#include "ObjectGuid.h"
#include "ByteBuffer.h"
#include <sstream>
char const* ObjectGuid::GetTypeName() const
@ -60,3 +59,15 @@ ByteBuffer &operator>>(ByteBuffer& buf, ObjectGuid& guid)
guid.Set(buf.read<uint64>());
return buf;
}
ByteBuffer& operator<< (ByteBuffer& buf, PackedGuid const& guid)
{
buf.append(guid.m_packedGuid);
return buf;
}
ByteBuffer &operator>>(ByteBuffer& buf, PackedGuidReader& guid)
{
guid.m_guidRef.Set(buf.readPackGUID());
return buf;
}