diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-05-21 12:25:08 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-05-21 12:25:08 +0300 |
commit | fe02a19f1795429c110e6c7ed76d333cb42a3072 (patch) | |
tree | fb422c8acb96aea2d814b44ceb86c28f8ceb0e4c /src/connection.h | |
parent | 3b707b8a4a52a88da4398ec9b32109c073683a76 (diff) | |
download | dragonfireclient-fe02a19f1795429c110e6c7ed76d333cb42a3072.tar.xz |
Cleaned networking code a bit (had this one on the to-do list for like 4 months already)
Diffstat (limited to 'src/connection.h')
-rw-r--r-- | src/connection.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/connection.h b/src/connection.h index 0b5d5e230..6eb2f2824 100644 --- a/src/connection.h +++ b/src/connection.h @@ -99,19 +99,6 @@ public: {} }; -class GotSplitPacketException -{ - SharedBuffer<u8> m_data; -public: - GotSplitPacketException(SharedBuffer<u8> data): - m_data(data) - {} - SharedBuffer<u8> getData() - { - return m_data; - } -}; - inline u16 readPeerId(u8 *packetdata) { return readU16(&packetdata[4]); @@ -314,10 +301,10 @@ class IncomingSplitBuffer public: ~IncomingSplitBuffer(); /* - This will throw a GotSplitPacketException when a full - split packet is constructed. + Returns a reference counted buffer of length != 0 when a full split + packet is constructed. If not, returns one of length 0. */ - void insert(BufferedPacket &p, bool reliable); + SharedBuffer<u8> insert(BufferedPacket &p, bool reliable); void removeUnreliableTimedOuts(float dtime, float timeout); |