]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/connection.cpp
Add disable_jump and fall_damage_add_percent node groups
[dragonfireclient.git] / src / connection.cpp
index 5bf47f13c2b861bd09d392761fa384c86568c77e..4f5d095e5e034c2fa87200ab434e6a4e3bd233eb 100644 (file)
@@ -3,16 +3,16 @@ Minetest-c55
 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
+You should have received a copy of the GNU Lesser General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
@@ -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)
 {