Adjust server ranking

specificially, penalize servers that support both v4 and v5
Reasoning: We, as a project, have no interest in promoting servers
that intentionally restrict themselves to the feature set of an old,
potentially buggy version.
This commit is contained in:
sfan5
2021-03-15 11:27:38 +01:00
parent e37149a834
commit 9f144f3e3c

View File

@@ -201,8 +201,8 @@ fields = {
"mods": (False, "list", "str"),
"version": (True, "str"),
"proto_min": (False, "int"),
"proto_max": (False, "int"),
"proto_min": (True, "int"),
"proto_max": (True, "int"),
"gameid": (True, "str"),
"mapgen": (False, "str"),
@@ -371,6 +371,10 @@ class ServerList:
if uptime < HOUR_SECS:
points -= ((HOUR_SECS - uptime) / HOUR_SECS) * 8
# reduction to 40% for servers that support both legacy (v4) and v5 clients
if server["proto_min"] <= 32 and server["proto_max"] > 36:
points *= 0.4
return points
with self.lock: