diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-07-30 20:10:16 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-07-30 20:10:16 +0300 |
commit | f2051c98223d087c8ba3d7e4514935781c93ed1c (patch) | |
tree | 4b366692b8a1f9480b1472287aaa76d9599a19a3 | |
parent | f8fca8ca5e1e5cc72ea4a8c46cbf3d4f9a64ad0a (diff) | |
download | minetest-f2051c98223d087c8ba3d7e4514935781c93ed1c.tar.gz minetest-f2051c98223d087c8ba3d7e4514935781c93ed1c.tar.bz2 minetest-f2051c98223d087c8ba3d7e4514935781c93ed1c.zip |
fix to the former
-rw-r--r-- | src/server.cpp | 15 | ||||
-rw-r--r-- | src/server.h | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/server.cpp b/src/server.cpp index 368f0acbf..07f9875c4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1979,13 +1979,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) { net_proto_version = readU16(&data[2+1+PLAYERNAME_SIZE+PASSWORD_SIZE]); } - if(net_proto_version == 0) + getClient(peer->id)->net_proto_version = net_proto_version; + /*if(net_proto_version == 0) { - /*SendAccessDenied(m_con, peer_id, + SendAccessDenied(m_con, peer_id, L"Your client is too old (network protocol)"); - return;*/ - SendChatMessage(peer_id, L"# Server: NOTE: YOUR CLIENT IS OLD AND DOES NOT WORK PROPERLY WITH THIS SERVER"); - } + return; + }*/ /* Set up player @@ -2182,6 +2182,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) BroadcastChatMessage(message); } + if(getClient(peer->id)->net_proto_version == 0) + { + SendChatMessage(peer_id, L"# Server: NOTE: YOUR CLIENT IS OLD AND DOES NOT WORK PROPERLY WITH THIS SERVER"); + } + return; } diff --git a/src/server.h b/src/server.h index c300d40e6..4a2d667a8 100644 --- a/src/server.h +++ b/src/server.h @@ -235,6 +235,8 @@ public: u16 peer_id; // The serialization version to use with the client u8 serialization_version; + // + u16 net_proto_version; // Version is stored in here after INIT before INIT2 u8 pending_serialization_version; @@ -244,6 +246,7 @@ public: { peer_id = 0; serialization_version = SER_FMT_VER_INVALID; + net_proto_version = 0; pending_serialization_version = SER_FMT_VER_INVALID; m_nearest_unsent_d = 0; m_nearest_unsent_reset_timer = 0.0; |