rs-client/apis

This commit is contained in:
Lucwousin
2019-07-18 15:21:46 +02:00
parent aa5098aff5
commit 25ce6c2ee9
346 changed files with 78952 additions and 84408 deletions

View File

@@ -9,176 +9,131 @@ import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("dk")
@ObfuscatedName("ma")
@Implements("AccessFile")
public final class AccessFile {
@ObfuscatedName("o")
@ObfuscatedGetter(
intValue = -1762891465
)
static int field7;
@ObfuscatedName("lm")
@ObfuscatedSignature(
signature = "Lho;"
)
static Widget field8;
@ObfuscatedName("m")
@Export("file")
RandomAccessFile file;
@ObfuscatedName("f")
@ObfuscatedGetter(
longValue = -5849841282281477349L
)
@Export("capacity")
long capacity;
@ObfuscatedName("q")
@ObfuscatedGetter(
longValue = 7465414039279036117L
)
@Export("index")
long index;
@ObfuscatedName("q")
@Export("file")
RandomAccessFile file;
@ObfuscatedName("w")
@ObfuscatedGetter(
longValue = -4859377869140643535L
)
@Export("maxSize")
final long maxSize;
@ObfuscatedName("e")
@ObfuscatedGetter(
longValue = -5982883315607554345L
)
@Export("offset")
long offset;
public AccessFile(File var1, String var2, long var3) throws IOException {
if (var3 == -1L) {
var3 = Long.MAX_VALUE;
}
public AccessFile(File var1, String var2, long var3) throws IOException {
if (var3 == -1L) {
var3 = Long.MAX_VALUE;
}
if (var1.length() >= var3) {
var1.delete();
}
if (var1.length() > var3) {
var1.delete();
}
this.file = new RandomAccessFile(var1, var2);
this.capacity = var3;
this.index = 0L;
int var5 = this.file.read();
if (var5 != -1 && !var2.equals("r")) {
this.file.seek(0L);
this.file.write(var5);
}
this.file = new RandomAccessFile(var1, var2);
this.maxSize = var3;
this.offset = 0L;
int var5 = this.file.read();
if (var5 != -1 && !var2.equals("r")) {
this.file.seek(0L);
this.file.write(var5);
}
this.file.seek(0L);
}
this.file.seek(0L);
}
@ObfuscatedName("m")
@Export("seek")
final void seek(long index) throws IOException {
this.file.seek(index);
this.index = index;
}
@ObfuscatedName("q")
@Export("seek")
final void seek(long var1) throws IOException {
this.file.seek(var1);
this.offset = var1;
}
@ObfuscatedName("f")
@ObfuscatedSignature(
signature = "([BIIB)V",
garbageValue = "-86"
)
@Export("write")
public final void write(byte[] src, int srcIndex, int length) throws IOException {
if ((long)length + this.index > this.capacity) {
this.file.seek(this.capacity + 1L);
this.file.write(1);
throw new EOFException();
} else {
this.file.write(src, srcIndex, length);
this.index += (long)length;
}
}
@ObfuscatedName("w")
@ObfuscatedSignature(
signature = "([BIII)V",
garbageValue = "793801547"
)
@Export("write")
public final void write(byte[] var1, int var2, int var3) throws IOException {
if ((long)var3 + this.offset > this.maxSize) {
this.file.seek(this.maxSize);
this.file.write(1);
throw new EOFException();
} else {
this.file.write(var1, var2, var3);
this.offset += (long)var3;
}
}
@ObfuscatedName("q")
@ObfuscatedSignature(
signature = "(I)V",
garbageValue = "-189309573"
)
@Export("close")
public final void close() throws IOException {
this.closeSync(false);
}
@ObfuscatedName("e")
@ObfuscatedSignature(
signature = "(I)V",
garbageValue = "-1602757440"
)
@Export("close")
public final void close() throws IOException {
this.closeSync(false);
}
@ObfuscatedName("w")
@ObfuscatedSignature(
signature = "(ZI)V",
garbageValue = "166642884"
)
@Export("closeSync")
public final void closeSync(boolean sync) throws IOException {
if (this.file != null) {
if (sync) {
try {
this.file.getFD().sync();
} catch (SyncFailedException var3) {
}
}
@ObfuscatedName("p")
@ObfuscatedSignature(
signature = "(ZI)V",
garbageValue = "978888846"
)
@Export("closeSync")
public final void closeSync(boolean var1) throws IOException {
if (this.file != null) {
if (var1) {
try {
this.file.getFD().sync();
} catch (SyncFailedException var3) {
}
}
this.file.close();
this.file = null;
}
this.file.close();
this.file = null;
}
}
}
@ObfuscatedName("o")
@ObfuscatedSignature(
signature = "(I)J",
garbageValue = "-1069832112"
)
@Export("length")
public final long length() throws IOException {
return this.file.length();
}
@ObfuscatedName("k")
@ObfuscatedSignature(
signature = "(I)J",
garbageValue = "1189798798"
)
@Export("length")
public final long length() throws IOException {
return this.file.length();
}
@ObfuscatedName("u")
@ObfuscatedSignature(
signature = "([BIII)I",
garbageValue = "971670468"
)
@Export("read")
public final int read(byte[] dst, int dstIndex, int length) throws IOException {
int var4 = this.file.read(dst, dstIndex, length);
if (var4 > 0) {
this.index += (long)var4;
}
@ObfuscatedName("l")
@ObfuscatedSignature(
signature = "([BIII)I",
garbageValue = "701557643"
)
@Export("read")
public final int read(byte[] var1, int var2, int var3) throws IOException {
int var4 = this.file.read(var1, var2, var3);
if (var4 > 0) {
this.offset += (long)var4;
}
return var4;
}
return var4;
}
protected void finalize() throws Throwable {
if (this.file != null) {
System.out.println("");
this.close();
}
protected void finalize() throws Throwable {
if (this.file != null) {
System.out.println("");
this.close();
}
}
@ObfuscatedName("ig")
@ObfuscatedSignature(
signature = "(Lho;Ljv;IIZI)V",
garbageValue = "-728558316"
)
@Export("addWidgetItemMenuItem")
static final void addWidgetItemMenuItem(Widget var0, ItemDefinition var1, int var2, int var3, boolean var4) {
String[] var5 = var1.inventoryActions;
byte var6 = -1;
String var7 = null;
if (var5 != null && var5[var3] != null) {
if (var3 == 0) {
var6 = 33;
} else if (var3 == 1) {
var6 = 34;
} else if (var3 == 2) {
var6 = 35;
} else if (var3 == 3) {
var6 = 36;
} else {
var6 = 37;
}
var7 = var5[var3];
} else if (var3 == 4) {
var6 = 37;
var7 = "Drop";
}
if (var6 != -1 && var7 != null) {
class16.insertMenuItem(var7, BufferedFile.colorStartTag(16748608) + var1.name, var6, var1.id, var2, var0.id, var4);
}
}
}
}