diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-06-17 02:40:36 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-17 02:40:36 +0300 |
commit | d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d (patch) | |
tree | 5b75f389b027a058e1f47fa3103a1cfb51f26b9b /src/connection.cpp | |
parent | 1bc37d576ce790c1169c5f9996be7bbc8026db2c (diff) | |
download | minetest-d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d.tar.gz minetest-d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d.tar.bz2 minetest-d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d.zip |
Properly and efficiently use split utility headers
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index 6cb655f2f..4f5d095e5 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -22,10 +22,22 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "log.h" #include "porting.h" +#include "util/serialize.h" +#include "util/numeric.h" +#include "util/string.h" namespace con { +static u16 readPeerId(u8 *packetdata) +{ + return readU16(&packetdata[4]); +} +static u8 readChannel(u8 *packetdata) +{ + return readU8(&packetdata[6]); +} + BufferedPacket makePacket(Address &address, u8 *data, u32 datasize, u32 protocol_id, u16 sender_peer_id, u8 channel) { |