diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-17 14:04:46 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-17 14:12:18 +0100 |
commit | 814e55597d3c3c1711825366d4345cee48d8fb87 (patch) | |
tree | cfa06c6de6cbcf1fa7ef960fac335d28150d5b63 | |
parent | bfc4652c668f7fffc134d461800d9fe4f0055837 (diff) | |
download | minetest-814e55597d3c3c1711825366d4345cee48d8fb87.tar.gz minetest-814e55597d3c3c1711825366d4345cee48d8fb87.tar.bz2 minetest-814e55597d3c3c1711825366d4345cee48d8fb87.zip |
Use the NetworkPacket api to read full version string instead of u8 pointers. Also store the reserved byte to use API properly
Fixes #2509
-rw-r--r-- | src/network/serverpackethandler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index bb3a53463..fd3b0ac0e 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -732,7 +732,7 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt) if (peer_proto_ver <= 22) { infostream << "Client sent message not expected by a " << "client using protocol version <= 22," - << "disconnecing peer_id: " << peer_id << std::endl; + << "disconnecting peer_id: " << peer_id << std::endl; m_con.DisconnectPeer(peer_id); return; } @@ -756,12 +756,13 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt) return; } - u8 major_ver, minor_ver, patch_ver; - *pkt >> major_ver >> minor_ver >> patch_ver; + u8 major_ver, minor_ver, patch_ver, reserved; + std::string full_ver; + *pkt >> major_ver >> minor_ver >> patch_ver >> reserved >> full_ver; m_clients.setClientVersion( peer_id, major_ver, minor_ver, patch_ver, - std::string(pkt->getString(6),(u16) pkt->getU8(4))); + full_ver); m_clients.event(peer_id, CSE_SetClientReady); m_script->on_joinplayer(playersao); |