From e66bb9b864ad8e917f20879d5a4a31fc744c766c Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Fri, 25 Jul 2014 07:35:55 +0200 Subject: [PATCH] Allow use all 6 faces for special tiles. Protocol version bump. --- src/clientserver.h | 5 +- src/nodedef.cpp | 155 +++++++++++++++++++++++++++++++++++++-------- src/nodedef.h | 2 +- 3 files changed, 134 insertions(+), 28 deletions(-) diff --git a/src/clientserver.h b/src/clientserver.h index f12384b18..5f7864768 100644 --- a/src/clientserver.h +++ b/src/clientserver.h @@ -105,9 +105,12 @@ with this program; if not, write to the Free Software Foundation, Inc., add swap_node PROTOCOL_VERSION 23: TOSERVER_CLIENT_READY + PROTOCOL_VERSION 24: + ContentFeatures version 7 + ContentFeatures: change number of special tiles to 6 (CF_SPECIAL_COUNT) */ -#define LATEST_PROTOCOL_VERSION 23 +#define LATEST_PROTOCOL_VERSION 24 // Server's supported network protocol range #define SERVER_PROTOCOL_VERSION_MIN 13 diff --git a/src/nodedef.cpp b/src/nodedef.cpp index e972ab927..93751c70e 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -195,9 +195,9 @@ void ContentFeatures::reset() groups["dig_immediate"] = 2; drawtype = NDT_NORMAL; visual_scale = 1.0; - for(u32 i=0; i<6; i++) + for(u32 i = 0; i < 6; i++) tiledef[i] = TileDef(); - for(u16 j=0; jtiledef[j]; if(tiledef[j].name == "") @@ -712,7 +712,7 @@ public: tile_shader[0] = shdsrc->getShader("water_surface_shader",material_type, f->drawtype); // Tiles (fill in f->tiles[]) - for(u16 j=0; j<6; j++){ + for(u16 j = 0; j < 6; j++){ // Shader f->tiles[j].shader_id = tile_shader[j]; // Texture @@ -821,7 +821,7 @@ public: writeU8(os, 1); // version u16 count = 0; std::ostringstream os2(std::ios::binary); - for(u32 i=0; i 13 && protocol_version < 24) { + writeU8(os, 6); // version + os<first); + writeS16(os, i->second); + } + writeU8(os, drawtype); + writeF1000(os, visual_scale); + writeU8(os, 6); + for(u32 i = 0; i < 6; i++) + tiledef[i].serialize(os, protocol_version); + //CF_SPECIAL_COUNT = 2 before cf ver. 7 and protocol ver. 24 + writeU8(os, 2); + for(u32 i = 0; i < 2; i++){ + tiledef_special[i].serialize(os, protocol_version); + } + writeU8(os, alpha); + writeU8(os, post_effect_color.getAlpha()); + writeU8(os, post_effect_color.getRed()); + writeU8(os, post_effect_color.getGreen()); + writeU8(os, post_effect_color.getBlue()); + writeU8(os, param_type); + writeU8(os, param_type_2); + writeU8(os, is_ground_content); + writeU8(os, light_propagates); + writeU8(os, sunlight_propagates); + writeU8(os, walkable); + writeU8(os, pointable); + writeU8(os, diggable); + writeU8(os, climbable); + writeU8(os, buildable_to); + os<