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
56 lines
1.6 KiB
Java
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;
|
|
}
|
|
}
|
|
|