G-Earth/Extensions/G-Translator_1.0.2/decompiled/gearth/misc/HostInfo.java
Administrator 368b92d87a G-Earth 1.5.4 beta 22 - Initial release
Komplettes G-Earth Paket inkl. JRE, Extensions und Tools.

Extensions:
- G-BuildTools, G-Click Ultimate, G-Loader, G-Manipulate
- G-Presets, G-Translator, G-Trigger, G-itemViewer
- Market Utils, Packet Info Explorer, Plants
- RandomRoomVisitor, RoomLogger, Sanbovir Photo Inspector
- SpyFriends, WallAligner, XabboScripter, xabbo
2026-03-16 09:45:04 +01:00

56 lines
1.6 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package gearth.misc;
import gearth.protocol.HPacket;
import java.util.HashMap;
public class HostInfo {
private final String packetlogger;
private final String version;
private final HashMap<String, String> attributes;
public HostInfo(String packetlogger, String version, HashMap<String, String> attributes) {
this.packetlogger = packetlogger;
this.version = version;
this.attributes = attributes;
}
public static HostInfo fromPacket(HPacket packet) {
String packetlogger = packet.readString();
String version = packet.readString();
int attributeCount = packet.readInteger();
HashMap<String, String> attributes = new HashMap<String, String>();
for (int i = 0; i < attributeCount; ++i) {
String key = packet.readString();
String value = packet.readString();
attributes.put(key, value);
}
return new HostInfo(packetlogger, version, attributes);
}
public void appendToPacket(HPacket packet) {
packet.appendString(this.packetlogger);
packet.appendString(this.version);
packet.appendInt(this.attributes.size());
this.attributes.keySet().forEach(k -> {
packet.appendString((String)k);
packet.appendString(this.attributes.get(k));
});
}
public String getPacketlogger() {
return this.packetlogger;
}
public String getVersion() {
return this.version;
}
public HashMap<String, String> getAttributes() {
return this.attributes;
}
}