diff --git a/packets.md b/packets.md index ca14b8a..6ffe5d7 100644 --- a/packets.md +++ b/packets.md @@ -87,3 +87,89 @@ This packet seems to provide the client with "trusted hosts". As of writing, thi ``` It is unknown what purpose these links serve. It may be a list of links that you are allowed to embed in private messages. + +### telemetry.ClientTelemetryPacket + +_Client-exclusive_ + +This packet is used for various purposes. It stores a single `String key` and a `Map metadata`. The `metadata` is optional in the constructor. It's used only three times: + +1. Each time a new screen is opened in `GuiUtil` it sends a `ClientTelemetryPacket`: + +```java +Essential.getInstance().getConnectionManager().send(new ClientTelemetryPacket("GUI_OPEN", MapsKt.mapOf(new Pair("name", screen.getClass().getName())))); +``` + +Which looks like this: + +```json +{"key": "GUI_OPEN", "metadata": {"name": "[screen.getClass().getName()]"}} +``` + +2. Each time you connect, a blank `ClientTelemetryPacket` will be sent: + +```java +this.send(new ClientTelemetryPacket("SESSION_START")); +``` + +3. Each time you connect, a `"MINI_STATE"` `ClientTelemetryPacket` will be sent, containing if a specific config setting is on: + +```java +this.send(new ClientTelemetryPacket("MINI_STATE", new HashMap() { + { + this.put("mini", !EssentialConfig.INSTANCE.getEssentialFull()); + } +})); +``` + +```java +public boolean getEssentialFull() { + return essentialFull; +} +``` + +```java +@Property( + type = PropertyType.SWITCH, + name = "Essential Full", + category = "General", + subcategory = "Experience", + description = "Enables all features available in Essential" +) +private static boolean essentialFull = true; +``` + +This is not to be confused with the `OnboardingData.hasAcceptedTos()` function. I'm not sure what exactly the Essential Full switch does, but disabling it seems to remove certain networking features. + +### mod.ClientModsAnnouncePacket + +_Client-exclusive_ + +_Sent on authentication_ + +This is a packet that contains: + +- The client's Minecraft version +- The MD5 checksum of every single mod the client has installed +It's worth noting that the mod with the ID `"feather"` has a fake checksum in both the Fabric and Forge version, regardless of Minecraft version: +```java +modId != "feather" ? checksum : "e3d04e686b28b34b5a98ce078e4f9da8" +``` +Since this is hardcoded, chances are the developers can find out exactly who uses a mod with this ID, where with a normal mod, you're able to spoof the signature by editing the .jar, tampering with the checksum. This is likely the [Feather client](https://feathermc.com/), which Essential devs have [a bit of history](https://twitter.com/Sk1er_/status/1499812679007064066) with. + +- The client's mod loader: +```java +public static enum Platform { + FORGE, + FABRIC; +} +``` +- The loader's version +In the Fabric version, it does this by finding the Fabric API, and then condensing its' ID and version to a string: +```java +String platformVersion = mod.getId() + ":" + mod.getVersion().getFriendlyString(); +``` +In Forge, it's as simple as: +```java +String.valueOf(ForgeVersion.getBuildVersion()); +```