Make client report a newer version number to the server than 2011-07-31 does and... 0.2.20110922_1
authorPerttu Ahola <celeron55@gmail.com>
Thu, 22 Sep 2011 17:47:47 +0000 (20:47 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Thu, 22 Sep 2011 17:47:47 +0000 (20:47 +0300)
CMakeLists.txt
doc/changelog.txt
src/client.cpp
src/server.cpp

index 20bb3e308044b2cea8a688f5e6094bed63a2bd92..ec94768e0dc75f9cb35068dd3bd111f058ce3c53 100644 (file)
@@ -9,7 +9,7 @@ project(minetest)
 
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 2)
-set(VERSION_PATCH 20110922)
+set(VERSION_PATCH 20110922_1)
 set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 
 # Configuration options
index 3f085667c61a3d02d90643fd4fb438fe25cf248b..66e0912cdc6966650e55ec3f563e197b6c414d51 100644 (file)
@@ -3,6 +3,9 @@ Minetest-c55 changelog
 This should contain all the major changes.
 For minor stuff, refer to the commit log of the repository.
 
+0.2.20110922_1:
+- Make client report a newer version number to the server than 2011-07-31 does and make server disallow old clients
+
 0.2.20110922:
 - Map is saved in an SQLite database file (by Queatz)
 - Ladders (MarkTraceur)
index a5ed6f61bf204807399b9e342d7f330bf83aa754..fcc5a0a1e46fe84a200325cd89bd09fb2542b5fe 100644 (file)
@@ -431,7 +431,7 @@ void Client::step(float dtime)
                        snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str());
                        
                        // This should be incremented in each version
-                       writeU16(&data[51], 1);
+                       writeU16(&data[51], 2);
 
                        // Send as unreliable
                        Send(0, data, false);
index 14d8942cb0cf6a4a4b5091b8c70923ae207e248a..a04417074f9f5d3045e13a517c5cc6600def6095 100644 (file)
@@ -2010,6 +2010,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
                                        L"Your client is too old. Please upgrade.");
                        return;
                }
+               
+               /* Uhh... this should actually be a warning but let's do it like this */
+               if(net_proto_version < 2)
+               {
+                       SendAccessDenied(m_con, peer_id,
+                                       L"Your client is too old. Please upgrade.");
+                       return;
+               }
 
                /*
                        Set up player