aboutsummaryrefslogtreecommitdiff
path: root/src/shared/ByteBuffer.h
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-27 11:39:40 -0600
committermegamage <none@none>2008-12-27 11:39:40 -0600
commitae5e329321d0b6eec74672e47251c1845f578fb0 (patch)
tree4dfa87c3dd9319b58011cac040d5f11efa30210d /src/shared/ByteBuffer.h
parent8a337e26c5c41bc126f6fd0b3bfbb783fc6b8aa4 (diff)
*Update to Mangos 6955.
--HG-- branch : trunk
Diffstat (limited to 'src/shared/ByteBuffer.h')
-rw-r--r--src/shared/ByteBuffer.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h
index 9bdd6067fbc..efd704a4904 100644
--- a/src/shared/ByteBuffer.h
+++ b/src/shared/ByteBuffer.h
@@ -243,6 +243,32 @@ class ByteBuffer
_rpos += len;
}
+ bool readPackGUID(uint64& guid)
+ {
+ if(rpos()+1 > size())
+ return false;
+
+ guid = 0;
+
+ uint8 guidmark=0;
+ (*this) >> guidmark;
+
+ for(int i=0;i<8;i++)
+ {
+ if(guidmark & (uint8(1) << i))
+ {
+ if(rpos()+1 > size())
+ return false;
+
+ uint8 bit;
+ (*this) >> bit;
+ guid |= (uint64(bit) << (i*8));
+ }
+ }
+
+ return true;
+ }
+
const uint8 *contents() const { return &_storage[0]; }
size_t size() const { return _storage.size(); }