Closed mdcfe closed 2 months ago
Why can't there be a simple standard method 😞
I'll take a look at it :)
The server brand is supposed to be used for this purpose anyway, but Spigot still uses CraftBukkit
, and hybrid servers like Thermos and Kettle tend to be poorly maintained and don't report their server brand correctly either. This is why you have to use both the server brand and the version string, but the current Metrics class only reports the version string.
With the next release of the Metrics class, it will be part of the sent data. For now it will be ignored by the backend, but it will allow me to update the backend when enough servers switched to the new Metrics class.
Reviving this, using the latest metrics class:
Paper 1.21: { bukkitVersion: '1.21-38-1f5db50 (MC: 1.21)', bukkitName: 'Paper' }
Paper 1.20: { bukkitVersion: 'git-Paper-196 (MC: 1.20.1)', bukkitName: 'Paper' }
Spigot 1.21: { bukkitVersion: '4226-Spigot-146439e-2889b3a (MC: 1.21)', bukkitName: 'CraftBukkit' }
Purpur 1.21: { bukkitVersion: '1.21-2250-797ce6b (MC: 1.21)', bukkitName: 'Purpur' }
Purpur 1.20: { bukkitVersion: 'git-Purpur-2062 (MC: 1.20.1)', bukkitName: 'Purpur' }
Glowstone 1.12: { bukkitVersion: '2021.7.0-SNAPSHOT.09043bd (MC: 1.12.2)', bukkitName: 'Glowstone' }
"CraftBukkit" (spigots fork) 1.21: { bukkitVersion: '4226-Bukkit-2889b3a (MC: 1.21)', bukkitName: 'CraftBukkit' }
CatServer 1.18: { bukkitVersion: '1.18.2-edda1229 (MC: 1.18.2)', bukkitName: 'CatServer' }
Folia 1.20.6: { bukkitVersion: '1.20.6-5-d797082 (MC: 1.20.6)', bukkitName: 'Folia' }
Folia 1.20.1: { bukkitVersion: 'git-Folia-17 (MC: 1.20.1)', bukkitName: 'Folia' }
Arclight 1.21: { bukkitVersion: 'arclight-1.21-1.0.0-SNAPSHOT-b3349e9 (MC: 1.21)', bukkitName: 'Arclight' }
TacoSpigot: { bukkitVersion: 'git-TacoSpigot-"af15657" (MC: 1.9.4)', bukkitName: 'Paper' }
I am proposing a fix like this: first parse bukkitVersion, then fall back to bukkitName:
Currently, Glowstone isn't detected by bStats when parsing the server version. However, adding Glowstone isn't as simple as just checking the
bukkitVersion
field, because Glowstone doesn't actually include the string "Glowstone" anywhere in its version string. This could be worked around by regex matching its version strings, but this seems overcomplicated.Instead, this could be solved by sending the value of
Bukkit.getName()
from the Metrics class, which accurately identifies some server software:getName()
getVersion()
CraftBukkit
; ambiguous)CraftBukkit
; ambiguous)Paper
)TacoSpigot
; bStats currently calls itTaco
)Glowstone
)CraftBukkit
)