Class ServerStatusPing
{
"fmlNetworkVersion" : FMLNETVERSION,
"channels": [
{
"res": "fml:handshake",
"version": "1.2.3.4",
"required": true
}
],
"mods": [
{
"modid": "modid",
"modmarker": "{@literal <somestring>}"
}
]
}
Due to size of the ping packet (32767 UTF-16 code points of JSON data) this could exceed this limit and cause issues. To work around this, a truncation mechanism was introduced, to heuristically truncate the size of the data, at the expense of making the compatibility info on the server screen inaccurate.
Modern versions will send binary data, which is encoded in a custom format optimized for UTF-16 code point count.
See ServerStatusPing.Serializer.encodeOptimized(ByteBuf)
and ServerStatusPing.Serializer.decodeOptimized(String)
.
Essentially 15 bits of binary data are encoded into every UTF-16 code point. The resulting string is then stored in
the "d" property of the resulting JSON.
For the format of the binary data see ServerStatusPing.Serializer.serialize(ServerStatusPing)
.
The "channels" and "mods" properties are retained for backwards compatibility, but left empty. A client that cannot read the old format would not be able to connect anyways, but the properties must exist to not cause exceptions.
{
"fmlNetworkVersion": FMLNETVERSION,
"channels": [],
"mods": [],
"d": "<binary data>"
}
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ServerStatusPing
(Map<ResourceLocation, org.apache.commons.lang3.tuple.Pair<String, Boolean>> deserialized, Map<String, String> modMarkers, int fmlNetVer, boolean truncated) -
Method Summary
Modifier and TypeMethodDescriptionboolean
private List<Map.Entry<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, Boolean>>> getChannelsForMod
(String modId) int
private List<Map.Entry<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, Boolean>>> Map<ResourceLocation,
org.apache.commons.lang3.tuple.Pair<String, Boolean>> int
hashCode()
boolean
toString()
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
channels
private final transient Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, channelsBoolean>> -
mods
-
fmlNetworkVer
private final transient int fmlNetworkVer -
truncated
private final transient boolean truncated
-
-
Constructor Details
-
ServerStatusPing
public ServerStatusPing() -
ServerStatusPing
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getChannelsForMod
-
getNonModChannels
private List<Map.Entry<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, getNonModChannels()Boolean>>> -
getRemoteChannels
public Map<ResourceLocation,org.apache.commons.lang3.tuple.Pair<String, getRemoteChannels()Boolean>> -
getRemoteModData
-
getFMLNetworkVersion
public int getFMLNetworkVersion() -
isTruncated
public boolean isTruncated()
-