From bdf54908aa0b8dabbc67f1925de88bc88a70c935 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 22 Sep 2011 20:47:47 +0300 Subject: [PATCH] Make client report a newer version number to the server than 2011-07-31 does and make the server enforce it --- CMakeLists.txt | 2 +- doc/changelog.txt | 3 +++ src/client.cpp | 2 +- src/server.cpp | 8 ++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20bb3e30..ec94768e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/doc/changelog.txt b/doc/changelog.txt index 3f085667..66e0912c 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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) diff --git a/src/client.cpp b/src/client.cpp index a5ed6f61..fcc5a0a1 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -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); diff --git a/src/server.cpp b/src/server.cpp index 14d8942c..a0441707 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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