X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Fconnection.cpp;h=4f5d095e5e034c2fa87200ab434e6a4e3bd233eb;hb=d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d;hp=6cb655f2f090834d7a9553148353ccc23b1f351a;hpb=1bc37d576ce790c1169c5f9996be7bbc8026db2c;p=minetest.git 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) {