1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Full protocol 13 compatibility on server side

This commit is contained in:
Perttu Ahola 2012-11-27 00:47:03 +02:00
parent 96a286dcf5
commit 7b6d642300
4 changed files with 71 additions and 37 deletions

View file

@ -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);