summaryrefslogtreecommitdiff
path: root/src/serialization.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-01-26 15:52:02 +0100
committerKahrl <kahrl@gmx.net>2015-01-27 16:55:25 +0100
commit80a7408e4d17e0e388f2d45fb90c5524a5dd7c89 (patch)
tree3bc5f712406c07192c085c0825d90ab0ade8f1af /src/serialization.h
parenteeea454bff0cfcda495c20029a0246f63f14393e (diff)
downloadminetest-80a7408e4d17e0e388f2d45fb90c5524a5dd7c89.tar.gz
minetest-80a7408e4d17e0e388f2d45fb90c5524a5dd7c89.tar.bz2
minetest-80a7408e4d17e0e388f2d45fb90c5524a5dd7c89.zip
Fix a crash (assert) when client set serial version < 24 in INIT
When SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM To resolve the problem: * Create a different CLIENT_MIN_VERSION to handle this problem * Remove the exception * Use an assert in case of bad developer code
Diffstat (limited to 'src/serialization.h')
-rw-r--r--src/serialization.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/serialization.h b/src/serialization.h
index caa1a66da..ab6fe0f79 100644
--- a/src/serialization.h
+++ b/src/serialization.h
@@ -71,6 +71,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define SER_FMT_VER_HIGHEST_WRITE 25
// Lowest supported serialization version
#define SER_FMT_VER_LOWEST 0
+// Lowest client supported serialization version
+// Can't do < 24 anymore; we have 16-bit dynamically allocated node IDs
+// in memory; conversion just won't work in this direction.
+#define SER_FMT_CLIENT_VER_LOWEST 24
inline bool ser_ver_supported(s32 v) {
return v >= SER_FMT_VER_LOWEST && v <= SER_FMT_VER_HIGHEST_READ;