aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-11-27 00:47:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-11-29 22:08:25 +0200
commit7b6d6423004343c73fd37726fbbb9f981a50f271 (patch)
tree6af1fad878a6dd36af58729e7914ff7ac4634da7 /src/server.cpp
parent96a286dcf501e1a749767e20327613c02bb1ff63 (diff)
downloadminetest-7b6d6423004343c73fd37726fbbb9f981a50f271.tar.gz
minetest-7b6d6423004343c73fd37726fbbb9f981a50f271.tar.bz2
minetest-7b6d6423004343c73fd37726fbbb9f981a50f271.zip
Full protocol 13 compatibility on server side
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 684e3bb08..961bdeaf9 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1568,7 +1568,7 @@ void Server::AsyncRunStep()
if(obj)
data_buffer.append(serializeLongString(
- obj->getClientInitializationData()));
+ obj->getClientInitializationData(client->net_proto_version)));
else
data_buffer.append(serializeLongString(""));
@@ -2407,7 +2407,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
if(command == TOSERVER_PLAYERPOS)
{
- if(datasize < 2+12+12+4+4+4)
+ if(datasize < 2+12+12+4+4)
return;
u32 start = 0;
@@ -2415,7 +2415,9 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
v3s32 ss = readV3S32(&data[start+2+12]);
f32 pitch = (f32)readS32(&data[2+12+12]) / 100.0;
f32 yaw = (f32)readS32(&data[2+12+12+4]) / 100.0;
- u32 keyPressed = (u32)readU32(&data[2+12+12+4+4]);
+ u32 keyPressed = 0;
+ if(datasize >= 2+12+12+4+4+4)
+ keyPressed = (u32)readU32(&data[2+12+12+4+4]);
v3f position((f32)ps.X/100., (f32)ps.Y/100., (f32)ps.Z/100.);
v3f speed((f32)ss.X/100., (f32)ss.Y/100., (f32)ss.Z/100.);
pitch = wrapDegrees(pitch);