209 lines
9.5 KiB
Java
209 lines
9.5 KiB
Java
import java.io.File;
|
|
import java.io.RandomAccessFile;
|
|
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
import net.runelite.rs.ScriptOpcodes;
|
|
|
|
@ObfuscatedName("cq")
|
|
public class class91 {
|
|
@ObfuscatedName("v")
|
|
@ObfuscatedSignature(
|
|
descriptor = "Lac;"
|
|
)
|
|
@Export("pcmPlayerProvider")
|
|
static class45 pcmPlayerProvider;
|
|
|
|
@ObfuscatedName("n")
|
|
@ObfuscatedSignature(
|
|
descriptor = "(Ljava/lang/String;B)Ljava/io/File;",
|
|
garbageValue = "26"
|
|
)
|
|
@Export("getFile")
|
|
public static File getFile(String var0) {
|
|
if (!FileSystem.FileSystem_hasPermissions) {
|
|
throw new RuntimeException("");
|
|
} else {
|
|
File var1 = (File)FileSystem.FileSystem_cacheFiles.get(var0);
|
|
if (var1 != null) {
|
|
return var1;
|
|
} else {
|
|
File var2 = new File(FileSystem.FileSystem_cacheDir, var0);
|
|
RandomAccessFile var3 = null;
|
|
|
|
try {
|
|
File var4 = new File(var2.getParent());
|
|
if (!var4.exists()) {
|
|
throw new RuntimeException("");
|
|
} else {
|
|
var3 = new RandomAccessFile(var2, "rw");
|
|
int var5 = var3.read();
|
|
var3.seek(0L);
|
|
var3.write(var5);
|
|
var3.seek(0L);
|
|
var3.close();
|
|
FileSystem.FileSystem_cacheFiles.put(var0, var2);
|
|
return var2;
|
|
}
|
|
} catch (Exception var8) {
|
|
try {
|
|
if (var3 != null) {
|
|
var3.close();
|
|
var3 = null;
|
|
}
|
|
} catch (Exception var7) {
|
|
}
|
|
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("aa")
|
|
@ObfuscatedSignature(
|
|
descriptor = "(ILbg;ZB)I",
|
|
garbageValue = "-99"
|
|
)
|
|
static int method2230(int var0, Script var1, boolean var2) {
|
|
int var3;
|
|
if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERTYPE) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].type();
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERITEM) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].id;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERPRICE) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].unitPrice;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERCOUNT) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].totalQuantity;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERCOMPLETEDCOUNT) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentQuantity;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_GETOFFERCOMPLETEDGOLD) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = Client.grandExchangeOffers[var3].currentPrice;
|
|
return 1;
|
|
} else {
|
|
int var13;
|
|
if (var0 == ScriptOpcodes.STOCKMARKET_ISOFFEREMPTY) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var13 = Client.grandExchangeOffers[var3].status();
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var13 == 0 ? 1 : 0;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_ISOFFERSTABLE) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var13 = Client.grandExchangeOffers[var3].status();
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var13 == 2 ? 1 : 0;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_ISOFFERFINISHED) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var13 = Client.grandExchangeOffers[var3].status();
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var13 == 5 ? 1 : 0;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.STOCKMARKET_ISOFFERADDING) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var13 = Client.grandExchangeOffers[var3].status();
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var13 == 1 ? 1 : 0;
|
|
return 1;
|
|
} else {
|
|
boolean var12;
|
|
if (var0 == ScriptOpcodes.TRADINGPOST_SORTBY_NAME) {
|
|
var12 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize] == 1;
|
|
if (class117.grandExchangeEvents != null) {
|
|
class117.grandExchangeEvents.sort(GrandExchangeEvents.GrandExchangeEvents_nameComparator, var12);
|
|
}
|
|
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_SORTBY_PRICE) {
|
|
var12 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize] == 1;
|
|
if (class117.grandExchangeEvents != null) {
|
|
class117.grandExchangeEvents.sort(GrandExchangeEvents.GrandExchangeEvents_priceComparator, var12);
|
|
}
|
|
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_SORTFILTERBY_WORLD) {
|
|
class240.Interpreter_intStackSize -= 2;
|
|
var12 = Interpreter.Interpreter_intStack[class240.Interpreter_intStackSize] == 1;
|
|
boolean var11 = Interpreter.Interpreter_intStack[class240.Interpreter_intStackSize + 1] == 1;
|
|
if (class117.grandExchangeEvents != null) {
|
|
Client.GrandExchangeEvents_worldComparator.filterWorlds = var11;
|
|
class117.grandExchangeEvents.sort(Client.GrandExchangeEvents_worldComparator, var12);
|
|
}
|
|
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_SORTBY_AGE) {
|
|
var12 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize] == 1;
|
|
if (class117.grandExchangeEvents != null) {
|
|
class117.grandExchangeEvents.sort(GrandExchangeEvents.GrandExchangeEvents_ageComparator, var12);
|
|
}
|
|
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_SORTBY_COUNT) {
|
|
var12 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize] == 1;
|
|
if (class117.grandExchangeEvents != null) {
|
|
class117.grandExchangeEvents.sort(GrandExchangeEvents.GrandExchangeEvents_quantityComparator, var12);
|
|
}
|
|
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETTOTALOFFERS) {
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = class117.grandExchangeEvents == null ? 0 : class117.grandExchangeEvents.events.size();
|
|
return 1;
|
|
} else {
|
|
GrandExchangeEvent var4;
|
|
if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERWORLD) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var4.world;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERNAME) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.getOfferName();
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERPREVIOUSNAME) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var4.getPreviousOfferName();
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERAGE) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
long var5 = Occluder.method4335() - MenuAction.field861 - var4.age;
|
|
int var7 = (int)(var5 / 3600000L);
|
|
int var8 = (int)((var5 - (long)(var7 * 3600000)) / 60000L);
|
|
int var9 = (int)((var5 - (long)(var7 * 3600000) - (long)(var8 * 60000)) / 1000L);
|
|
String var10 = var7 + ":" + var8 / 10 + var8 % 10 + ":" + var9 / 10 + var9 % 10;
|
|
Interpreter.Interpreter_stringStack[++Interpreter.Interpreter_stringStackSize - 1] = var10;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERCOUNT) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var4.grandExchangeOffer.totalQuantity;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERPRICE) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var4.grandExchangeOffer.unitPrice;
|
|
return 1;
|
|
} else if (var0 == ScriptOpcodes.TRADINGPOST_GETOFFERITEM) {
|
|
var3 = Interpreter.Interpreter_intStack[--class240.Interpreter_intStackSize];
|
|
var4 = (GrandExchangeEvent)class117.grandExchangeEvents.events.get(var3);
|
|
Interpreter.Interpreter_intStack[++class240.Interpreter_intStackSize - 1] = var4.grandExchangeOffer.id;
|
|
return 1;
|
|
} else {
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|