summaryrefslogtreecommitdiff
path: root/src/tool.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-19 08:44:29 +0100
committerGitHub <noreply@github.com>2017-03-19 08:44:29 +0100
commitf8ad01ab7c4cf012781bd4caa821544e676c9267 (patch)
treeaf8664302b0dccfb1fa28f0d5479d47e0a57c4ab /src/tool.cpp
parentb8484ef24e8e1ec90a2967372808ab2bea538c7c (diff)
downloadminetest-f8ad01ab7c4cf012781bd4caa821544e676c9267.tar.gz
minetest-f8ad01ab7c4cf012781bd4caa821544e676c9267.tar.bz2
minetest-f8ad01ab7c4cf012781bd4caa821544e676c9267.zip
Update server min protocol version to v24 (#5411)
* Update server min protocol version to v24 It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14 * Drop protocol v23 and lesser code
Diffstat (limited to 'src/tool.cpp')
-rw-r--r--src/tool.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/tool.cpp b/src/tool.cpp
index 20b71fb31..1877a1cf8 100644
--- a/src/tool.cpp
+++ b/src/tool.cpp
@@ -27,33 +27,30 @@ with this program; if not, write to the Free Software Foundation, Inc.,
void ToolCapabilities::serialize(std::ostream &os, u16 protocol_version) const
{
- if(protocol_version <= 17)
- writeU8(os, 1); // version
- else
- writeU8(os, 2); // version
+ writeU8(os, 2); // version (protocol >= 18)
writeF1000(os, full_punch_interval);
writeS16(os, max_drop_level);
writeU32(os, groupcaps.size());
for (ToolGCMap::const_iterator i = groupcaps.begin(); i != groupcaps.end(); ++i) {
const std::string *name = &i->first;
const ToolGroupCap *cap = &i->second;
- os<<serializeString(*name);
+ os << serializeString(*name);
writeS16(os, cap->uses);
writeS16(os, cap->maxlevel);
writeU32(os, cap->times.size());
for (UNORDERED_MAP<int, float>::const_iterator
- i = cap->times.begin(); i != cap->times.end(); ++i) {
- writeS16(os, i->first);
- writeF1000(os, i->second);
+ j = cap->times.begin(); j != cap->times.end(); ++j) {
+ writeS16(os, j->first);
+ writeF1000(os, j->second);
}
}
- if(protocol_version > 17){
- writeU32(os, damageGroups.size());
- for (DamageGroup::const_iterator i = damageGroups.begin();
- i != damageGroups.end(); ++i) {
- os<<serializeString(i->first);
- writeS16(os, i->second);
- }
+
+ writeU32(os, damageGroups.size());
+
+ for (DamageGroup::const_iterator i = damageGroups.begin();
+ i != damageGroups.end(); ++i) {
+ os << serializeString(i->first);
+ writeS16(os, i->second);
}
}