Files
runelite/runescape-client/src/main/java/NetCache.java
Owain van Brakel add4ca8005 chore: rev 188
2020-01-29 14:20:08 +01:00

222 lines
5.9 KiB
Java

import java.util.zip.CRC32;
import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("ib")
@Implements("NetCache")
public class NetCache {
@ObfuscatedName("c")
@ObfuscatedSignature(
signature = "Lkr;"
)
@Export("NetCache_socket")
public static AbstractSocket NetCache_socket;
@ObfuscatedName("t")
@ObfuscatedGetter(
intValue = 840388525
)
@Export("NetCache_loadTime")
public static int NetCache_loadTime;
@ObfuscatedName("o")
@ObfuscatedGetter(
longValue = -4475695681289819083L
)
public static long field3170;
@ObfuscatedName("e")
@ObfuscatedSignature(
signature = "Lln;"
)
@Export("NetCache_pendingPriorityWrites")
public static NodeHashTable NetCache_pendingPriorityWrites;
@ObfuscatedName("i")
@ObfuscatedGetter(
intValue = 1544867723
)
@Export("NetCache_pendingPriorityWritesCount")
public static int NetCache_pendingPriorityWritesCount;
@ObfuscatedName("g")
@ObfuscatedSignature(
signature = "Lln;"
)
@Export("NetCache_pendingPriorityResponses")
public static NodeHashTable NetCache_pendingPriorityResponses;
@ObfuscatedName("d")
@ObfuscatedGetter(
intValue = 562199049
)
@Export("NetCache_pendingPriorityResponsesCount")
public static int NetCache_pendingPriorityResponsesCount;
@ObfuscatedName("l")
@ObfuscatedSignature(
signature = "Ljq;"
)
@Export("NetCache_pendingWritesQueue")
public static DualNodeDeque NetCache_pendingWritesQueue;
@ObfuscatedName("j")
@ObfuscatedSignature(
signature = "Lln;"
)
@Export("NetCache_pendingWrites")
public static NodeHashTable NetCache_pendingWrites;
@ObfuscatedName("m")
@ObfuscatedGetter(
intValue = 1327913125
)
@Export("NetCache_pendingWritesCount")
public static int NetCache_pendingWritesCount;
@ObfuscatedName("p")
@ObfuscatedSignature(
signature = "Lln;"
)
@Export("NetCache_pendingResponses")
public static NodeHashTable NetCache_pendingResponses;
@ObfuscatedName("h")
@ObfuscatedGetter(
intValue = 818633537
)
@Export("NetCache_pendingResponsesCount")
public static int NetCache_pendingResponsesCount;
@ObfuscatedName("x")
@ObfuscatedSignature(
signature = "Lkp;"
)
@Export("NetCache_responseHeaderBuffer")
public static Buffer NetCache_responseHeaderBuffer;
@ObfuscatedName("k")
@ObfuscatedGetter(
intValue = -1652930621
)
public static int field3181;
@ObfuscatedName("z")
@Export("NetCache_crc")
static CRC32 NetCache_crc;
@ObfuscatedName("f")
@ObfuscatedSignature(
signature = "[Lia;"
)
@Export("NetCache_archives")
static Archive[] NetCache_archives;
@ObfuscatedName("b")
public static byte field3184;
@ObfuscatedName("r")
@ObfuscatedGetter(
intValue = -287174121
)
@Export("NetCache_crcMismatches")
public static int NetCache_crcMismatches;
@ObfuscatedName("s")
@ObfuscatedGetter(
intValue = -1375722445
)
@Export("NetCache_ioExceptions")
public static int NetCache_ioExceptions;
static {
NetCache_loadTime = 0;
NetCache_pendingPriorityWrites = new NodeHashTable(4096);
NetCache_pendingPriorityWritesCount = 0;
NetCache_pendingPriorityResponses = new NodeHashTable(32);
NetCache_pendingPriorityResponsesCount = 0;
NetCache_pendingWritesQueue = new DualNodeDeque();
NetCache_pendingWrites = new NodeHashTable(4096);
NetCache_pendingWritesCount = 0;
NetCache_pendingResponses = new NodeHashTable(4096);
NetCache_pendingResponsesCount = 0;
NetCache_responseHeaderBuffer = new Buffer(8);
field3181 = 0;
NetCache_crc = new CRC32();
NetCache_archives = new Archive[256];
field3184 = 0;
NetCache_crcMismatches = 0;
NetCache_ioExceptions = 0;
}
@ObfuscatedName("c")
@ObfuscatedSignature(
signature = "(II)Liz;",
garbageValue = "79077079"
)
@Export("getNpcDefinition")
public static NPCDefinition getNpcDefinition(int var0) {
NPCDefinition var1 = (NPCDefinition)NPCDefinition.NpcDefinition_cached.get((long)var0);
if (var1 != null) {
return var1;
} else {
byte[] var2 = NPCDefinition.NpcDefinition_archive.takeFile(9, var0);
var1 = new NPCDefinition();
var1.id = var0;
if (var2 != null) {
var1.decode(new Buffer(var2));
}
var1.postDecode();
NPCDefinition.NpcDefinition_cached.put(var1, (long)var0);
return var1;
}
}
@ObfuscatedName("ft")
@ObfuscatedSignature(
signature = "(Ljava/lang/String;I)V",
garbageValue = "-824025022"
)
@Export("doCheat")
static final void doCheat(String var0) {
if (var0.equalsIgnoreCase("toggleroof")) {
WorldMapSection2.clientPreferences.roofsHidden = !WorldMapSection2.clientPreferences.roofsHidden;
WorldMapData_1.savePreferences();
if (WorldMapSection2.clientPreferences.roofsHidden) {
ClientPreferences.addGameMessage(99, "", "Roofs are now all hidden");
} else {
ClientPreferences.addGameMessage(99, "", "Roofs will only be removed selectively");
}
}
if (var0.equalsIgnoreCase("displayfps")) {
Client.displayFps = !Client.displayFps;
}
if (var0.equalsIgnoreCase("renderself")) {
Client.renderSelf = !Client.renderSelf;
}
if (var0.equalsIgnoreCase("mouseovertext")) {
Client.showMouseOverText = !Client.showMouseOverText;
}
if (Client.staffModLevel >= 2) {
if (var0.equalsIgnoreCase("errortest")) {
throw new RuntimeException();
}
if (var0.equalsIgnoreCase("showcoord")) {
WorldMapIcon_0.worldMap.showCoord = !WorldMapIcon_0.worldMap.showCoord;
}
if (var0.equalsIgnoreCase("fpson")) {
Client.displayFps = true;
}
if (var0.equalsIgnoreCase("fpsoff")) {
Client.displayFps = false;
}
if (var0.equalsIgnoreCase("gc")) {
System.gc();
}
if (var0.equalsIgnoreCase("clientdrop")) {
WorldMapIcon_1.method308();
}
}
PacketBufferNode var1 = TilePaint.getPacketBufferNode(ClientPacket.field2270, Client.packetWriter.isaacCipher);
var1.packetBuffer.writeByte(var0.length() + 1);
var1.packetBuffer.writeStringCp1252NullTerminated(var0);
Client.packetWriter.addNode(var1);
}
}