TOCLIENT_HUDRM
TOCLIENT_HUDCHANGE
TOCLIENT_HUD_SET_FLAGS
+ PROTOCOL_VERSION 21:
+ TOCLIENT_BREATH
+ TOSERVER_BREATH
+ range added to ItemDefinition
+ drowning, leveled and liquid_range added to ContentFeatures
*/
-#define LATEST_PROTOCOL_VERSION 20
+#define LATEST_PROTOCOL_VERSION 21
// Server's supported network protocol range
#define SERVER_PROTOCOL_VERSION_MIN 13
{
if(protocol_version <= 17)
writeU8(os, 1); // version
- else
+ else if(protocol_version <= 20)
writeU8(os, 2); // version
+ else
+ writeU8(os, 3); // version
writeU8(os, type);
os<<serializeString(name);
os<<serializeString(description);
//serializeSimpleSoundSpec(sound_place, os);
os<<serializeString(sound_place.name);
writeF1000(os, sound_place.gain);
+ }
+ if(protocol_version > 20){
writeF1000(os, range);
}
}
// Deserialize
int version = readU8(is);
- if(version != 1 && version != 2)
+ if(version < 1 || version > 3)
throw SerializationError("unsupported ItemDefinition version");
type = (enum ItemType)readU8(is);
name = deSerializeString(is);
// Set the old default sound
sound_place.name = "default_place_node";
sound_place.gain = 0.5;
- } else if(version == 2) {
+ } else if(version >= 2) {
node_placement_prediction = deSerializeString(is);
//deserializeSimpleSoundSpec(sound_place, is);
sound_place.name = deSerializeString(is);
sound_place.gain = readF1000(is);
}
+ if(version == 3) {
+ range = readF1000(is);
+ }
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
try{
- range = readF1000(is);
}catch(SerializationError &e) {};
}
serializeSimpleSoundSpec(sound_dig, os);
serializeSimpleSoundSpec(sound_dug, os);
writeU8(os, rightclickable);
- // Stuff below should be moved to correct place in a version that otherwise changes
- // the protocol version
writeU8(os, drowning);
writeU8(os, leveled);
writeU8(os, liquid_range);
+ // Stuff below should be moved to correct place in a version that otherwise changes
+ // the protocol version
}
void ContentFeatures::deSerialize(std::istream &is)
deSerializeSimpleSoundSpec(sound_dig, is);
deSerializeSimpleSoundSpec(sound_dug, is);
rightclickable = readU8(is);
+ drowning = readU8(is);
+ leveled = readU8(is);
+ liquid_range = readU8(is);
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
try{
// Stuff below should be moved to correct place in a version that
// otherwise changes the protocol version
- drowning = readU8(is);
- leveled = readU8(is);
- liquid_range = readU8(is);
}catch(SerializationError &e) {};
}