mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Massive varp/varbit related refactoring + new client command
This commit is contained in:
parent
e4811e32e3
commit
ed722c9e41
25 changed files with 183 additions and 137 deletions
|
|
@ -20,7 +20,7 @@ public final class AudioHandler {
|
|||
try {
|
||||
if (-1 == var1 && !musicEffectPlaying) {
|
||||
GameObject.method1870();
|
||||
} else if (var1 != -1 && (currentTrack != var1 || Class79.method1391(-1)) && musicVolume != 0 && !musicEffectPlaying) {
|
||||
} else if (var1 != -1 && (currentTrack != var1 || CSConfigCachefile.method1391(-1)) && musicVolume != 0 && !musicEffectPlaying) {
|
||||
method2099(var1, CacheIndex.musicIndex, musicVolume);
|
||||
}
|
||||
currentTrack = var1;
|
||||
|
|
@ -117,13 +117,13 @@ public final class AudioHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (musicEffectPlaying && Class79.method1391(-1)) {
|
||||
if (musicEffectPlaying && CSConfigCachefile.method1391(-1)) {
|
||||
if (0 != musicVolume && currentTrack != -1) {
|
||||
Class70.method1285(CacheIndex.musicIndex, currentTrack, musicVolume);
|
||||
}
|
||||
|
||||
musicEffectPlaying = false;
|
||||
} else if (musicVolume != 0 && currentTrack != -1 && Class79.method1391((byte) -92 + 91)) {
|
||||
} else if (musicVolume != 0 && currentTrack != -1 && CSConfigCachefile.method1391((byte) -92 + 91)) {
|
||||
TextureOperation12.outgoingBuffer.putOpcode(137);
|
||||
TextureOperation12.outgoingBuffer.writeInt(currentTrack);
|
||||
currentTrack = -1;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ public final class CS2Script extends Linkable {
|
|||
static int anInt3775 = 0;
|
||||
static int anInt2440 = 0;
|
||||
static ReferenceCache aReferenceCache_2442 = new ReferenceCache(50);
|
||||
static ReferenceCache aReferenceCache_2450 = new ReferenceCache(64);
|
||||
static byte[][][] aByteArrayArrayArray2452;
|
||||
RSInterface aClass11_2438;
|
||||
RSString aClass94_2439;
|
||||
|
|
@ -58,30 +57,6 @@ public final class CS2Script extends Linkable {
|
|||
}
|
||||
}
|
||||
|
||||
static Class79 method378(int var0, byte var1) {
|
||||
try {
|
||||
Class79 var2 = (Class79) aReferenceCache_2450.get(var0);
|
||||
if (var2 == null) {
|
||||
if (var1 < 126) {
|
||||
return null;
|
||||
} else {
|
||||
byte[] var3 = Class101.aClass153_1420.getFile(Class140_Sub7.method2032(var0), var0 & 1023);
|
||||
var2 = new Class79();
|
||||
if (var3 != null) {
|
||||
var2.method1387(new DataBuffer(var3));
|
||||
}
|
||||
|
||||
aReferenceCache_2450.put(var2, var0);
|
||||
return var2;
|
||||
}
|
||||
} else {
|
||||
return var2;
|
||||
}
|
||||
} catch (RuntimeException var4) {
|
||||
throw ClientErrorException.clientError(var4, "jl.A(" + var0 + ',' + var1 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
static void method379() {
|
||||
try {
|
||||
int var2 = Class146.anInt1904 * 128 - -64;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
package org.runite.client;
|
||||
|
||||
import org.rs09.SystemLogger;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
final class Class79 {
|
||||
final class CSConfigCachefile {
|
||||
|
||||
static int anInt1124 = -1;
|
||||
static int anInt1127 = 0;
|
||||
int anInt1123;
|
||||
int anInt1125;
|
||||
int anInt1128;
|
||||
int lowerBound;
|
||||
int upperBound;
|
||||
int parentVarpIndex;
|
||||
|
||||
|
||||
static void method1385(int var0, int var1) {
|
||||
|
|
@ -182,31 +184,44 @@ final class Class79 {
|
|||
}
|
||||
}
|
||||
|
||||
final void method1387(DataBuffer var1) {
|
||||
static CSConfigCachefile getCSConfigFileFromVarbitID(int varbitID) {
|
||||
try {
|
||||
while (true) {
|
||||
int var3 = var1.readUnsignedByte();
|
||||
if (var3 == 0) {
|
||||
return;
|
||||
CSConfigCachefile cacheFile = (CSConfigCachefile) VarpHelpers.varbitLookup.get(varbitID);
|
||||
if (cacheFile == null) {
|
||||
byte[] fileData = Class101.csConfigFileRAM.getFile(varbitID >>> 10, varbitID & 1023);
|
||||
cacheFile = new CSConfigCachefile();
|
||||
if (fileData != null) {
|
||||
cacheFile.tryParseConfigFile(new DataBuffer(fileData));
|
||||
}
|
||||
|
||||
this.method1389(var1, var3);
|
||||
VarpHelpers.varbitLookup.put(cacheFile, varbitID);
|
||||
}
|
||||
return cacheFile;
|
||||
} catch (RuntimeException var4) {
|
||||
throw ClientErrorException.clientError(var4, "kk.G(" + (var1 != null ? "{...}" : "null") + ',' + -111 + ')');
|
||||
throw ClientErrorException.clientError(var4, "jl.A(" + varbitID + ',' + (byte) 127 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
private void method1389(DataBuffer var1, int var3) {
|
||||
final void tryParseConfigFile(DataBuffer fileData) {
|
||||
try {
|
||||
if (1 == var3) {
|
||||
this.anInt1128 = var1.readUnsignedShort();
|
||||
this.anInt1123 = var1.readUnsignedByte();
|
||||
this.anInt1125 = var1.readUnsignedByte();
|
||||
boolean end = fileData.readUnsignedByte() == 0;
|
||||
while (!end) {
|
||||
this.parseConfigFile(fileData);
|
||||
end = fileData.readUnsignedByte() == 0;
|
||||
}
|
||||
} catch (RuntimeException var4) {
|
||||
throw ClientErrorException.clientError(var4, "kk.G(" + (fileData != null ? "{...}" : "null") + ',' + -111 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
private void parseConfigFile(DataBuffer fileData) {
|
||||
try {
|
||||
this.parentVarpIndex = fileData.readUnsignedShort();
|
||||
this.lowerBound = fileData.readUnsignedByte();
|
||||
this.upperBound = fileData.readUnsignedByte();
|
||||
|
||||
} catch (RuntimeException var5) {
|
||||
throw ClientErrorException.clientError(var5, "kk.B(" + (var1 != null ? "{...}" : "null") + ',' + 1 + ',' + var3 + ')');
|
||||
throw ClientErrorException.clientError(var5, "kk.B(" + (fileData != null ? "{...}" : "null") + ',' + 1 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ package org.runite.client;
|
|||
|
||||
final class Class101 {
|
||||
|
||||
static CacheIndex aClass153_1420;
|
||||
static CacheIndex csConfigFileRAM;
|
||||
static Class3_Sub24_Sub4 aClass3_Sub24_Sub4_1421;
|
||||
static Class30 aClass30_1422;
|
||||
static CacheIndex aClass153_1423;
|
||||
|
|
@ -65,7 +65,7 @@ final class Class101 {
|
|||
method1607(46, 78, true, null, null);
|
||||
}
|
||||
|
||||
aClass153_1420 = null;
|
||||
csConfigFileRAM = null;
|
||||
} catch (RuntimeException var2) {
|
||||
throw ClientErrorException.clientError(var2, "nj.A(" + var0 + ')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ final class Class107 {
|
|||
|
||||
static void method1648(CacheIndex var0) {
|
||||
try {
|
||||
Class101.aClass153_1420 = var0;
|
||||
Class101.csConfigFileRAM = var0;
|
||||
|
||||
} catch (RuntimeException var3) {
|
||||
throw ClientErrorException.clientError(var3, "og.B(" + (var0 != null ? "{...}" : "null") + ',' + 255 + ')');
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ final class Class108 {
|
|||
int var2 = Class140_Sub7.canvasHeight;
|
||||
int var3 = var2 * 956 / 503;
|
||||
Objects.requireNonNull(Class40.aAbstractSprite_680).method639((Class23.canvasWidth + -var3) / 2, 0, var3, var2);
|
||||
SequenceDefinition.aClass109_1856 = InterfaceWidget.a(Class79.anInt1124, var0);
|
||||
SequenceDefinition.aClass109_1856 = InterfaceWidget.a(CSConfigCachefile.anInt1124, var0);
|
||||
Objects.requireNonNull(SequenceDefinition.aClass109_1856).method1667(Class23.canvasWidth / 2 + -(SequenceDefinition.aClass109_1856.width / 2), 18);
|
||||
Class140_Sub2.aBoolean2713 = true;
|
||||
if (var1 > -50) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public final class Class140_Sub7 extends GameObject {
|
|||
|
||||
static boolean method2031(byte var0, boolean var1, int var2, int var3, Class3_Sub2[][][] var4, int var5) {
|
||||
try {
|
||||
byte var6 = !var1?(byte)(255 & Class79.anInt1127):1;
|
||||
byte var6 = !var1?(byte)(255 & CSConfigCachefile.anInt1127):1;
|
||||
if(Class158.aByteArrayArrayArray2008[WorldListCountry.localPlane][var2][var3] == var6) {
|
||||
return false;
|
||||
} else if((Unsorted.aByteArrayArrayArray113[WorldListCountry.localPlane][var2][var3] & 4) == 0) {
|
||||
|
|
|
|||
|
|
@ -12,29 +12,4 @@ public class Class163 {
|
|||
public static int localNPCCount = 0;
|
||||
|
||||
|
||||
static void updateVarbit(byte var0, int var1, int var2) {
|
||||
try {
|
||||
if (var0 >= -99) {
|
||||
updateVarbit((byte) 57, -14, 120);
|
||||
}
|
||||
|
||||
Class79 var3 = CS2Script.method378(var2, (byte) 127);
|
||||
int var4 = Objects.requireNonNull(var3).anInt1128;
|
||||
int var6 = var3.anInt1125;
|
||||
int var5 = var3.anInt1123;
|
||||
int var7 = Class3_Sub6.anIntArray2288[var6 - var5];
|
||||
if (var1 < 0) { //|| var7 < var1) { <-- commented out due to heavy suspicion of it being an Arios modification. Things work fine without it.
|
||||
var1 = 0;
|
||||
}
|
||||
|
||||
var7 <<= var5;
|
||||
int arg1 = var1 << var5 & var7 | ~var7 & Class57.varpArray[var4];
|
||||
int arg2 = var4;
|
||||
SystemLogger.logInfo("Setting " + arg1 + " to " + arg2);
|
||||
TextureOperation39.method281(arg1, arg2);
|
||||
} catch (RuntimeException var8) {
|
||||
throw ClientErrorException.clientError(var8, "wd.K(" + var0 + ',' + var1 + ',' + var2 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ final class Class25 {
|
|||
|
||||
static void method959() {
|
||||
try {
|
||||
CS2Script.aReferenceCache_2450.clear();
|
||||
VarpHelpers.varbitLookup.clear();
|
||||
|
||||
} catch (RuntimeException var2) {
|
||||
throw ClientErrorException.clientError(var2, "ec.B(" + 0 + ')');
|
||||
|
|
|
|||
|
|
@ -289,8 +289,8 @@ final class Class3_Sub28_Sub20 extends Node {
|
|||
static void method725() {
|
||||
try {
|
||||
if(Class137.method1817() == 2) {
|
||||
byte var2 = (byte)(255 & Class79.anInt1127 + -4);
|
||||
int var3 = Class79.anInt1127 % 104;
|
||||
byte var2 = (byte)(255 & CSConfigCachefile.anInt1127 + -4);
|
||||
int var3 = CSConfigCachefile.anInt1127 % 104;
|
||||
|
||||
int var4;
|
||||
int var5;
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@ final class Class3_Sub6 extends Linkable {
|
|||
|
||||
|
||||
static byte[][] softReferenceTestArray;
|
||||
static int[] anIntArray2288 = new int[32];
|
||||
static int[] expectedMinimumValues = new int[32];
|
||||
static int anInt2291;
|
||||
|
||||
static {
|
||||
int var0 = 2;
|
||||
int accumulator = 2;
|
||||
|
||||
for (int var1 = 0; var1 < 32; ++var1) {
|
||||
anIntArray2288[var1] = -1 + var0;
|
||||
var0 += var0;
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
expectedMinimumValues[i] = -1 + accumulator;
|
||||
accumulator += accumulator;
|
||||
}
|
||||
|
||||
anInt2291 = 1;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ final class Class75_Sub3 extends Class75 {
|
|||
Class67.aReferenceCache_1013.sweep(5);
|
||||
Texture.aReferenceCache_1146.sweep(5);
|
||||
Class159.aReferenceCache_2016.sweep(5);
|
||||
CS2Script.aReferenceCache_2450.sweep(5);
|
||||
VarpHelpers.varbitLookup.sweep(5);
|
||||
Class136.aReferenceCache_1772.sweep(5);
|
||||
RenderAnimationDefinition.aReferenceCache_1955.sweep(5);
|
||||
TextureOperation25.aReferenceCache_3412.sweep(5);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public final class Class97 {
|
|||
static void method1593(int var0, CacheIndex var1) {
|
||||
try {
|
||||
Class154.anInt1966 = var1.getArchiveForName(TextCore.aClass94_3574);
|
||||
Class79.anInt1124 = var1.getArchiveForName(TextCore.aClass94_1341);
|
||||
CSConfigCachefile.anInt1124 = var1.getArchiveForName(TextCore.aClass94_1341);
|
||||
if (var0 <= 108) {
|
||||
method1593(14, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package org.runite.client;
|
||||
|
||||
|
||||
import org.rs09.SystemLogger;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.net.URI;
|
||||
|
||||
public class ClientCommands {
|
||||
|
|
@ -192,6 +196,29 @@ public class ClientCommands {
|
|||
if (command.equalsStringIgnoreCase(TextCore.COMMAND_SHIFT_DROP_CLICK)) {
|
||||
shiftClickEnabled = !shiftClickEnabled;
|
||||
}
|
||||
|
||||
if (command.startsWith(TextCore.COMMAND_GETBITS)) {
|
||||
System.out.println("Trying to write file...");
|
||||
try {
|
||||
int index = command.substring(10).parseInt();
|
||||
File file = new File("FILE_BITS.txt");
|
||||
FileWriter writer = new FileWriter(file);
|
||||
for(int i = 0; i < 200000; i++){
|
||||
CSConfigCachefile cachefile = CSConfigCachefile.getCSConfigFileFromVarbitID(i);
|
||||
if(cachefile.parentVarpIndex == index){
|
||||
writer.write("ID: " + i + " lowerBound = " + cachefile.lowerBound + " upperBound = " + cachefile.upperBound + " size = " + ((cachefile.upperBound - cachefile.lowerBound) + 1));
|
||||
writer.write("\n");
|
||||
}
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
BufferedDataStream.addChatMessage(null, 0, RSString.parse("Wrote bits to " + file.getAbsolutePath()), -1);
|
||||
} catch (Exception e){
|
||||
SystemLogger.logInfo("Whoopsie");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
TextureOperation12.outgoingBuffer.putOpcode(44);
|
||||
TextureOperation12.outgoingBuffer.writeByte(command.length() + -1);
|
||||
TextureOperation12.outgoingBuffer.writeString(command.substring(2));
|
||||
|
|
@ -220,7 +247,7 @@ public class ClientCommands {
|
|||
Class159.aReferenceCache_2016.clearSoftReferences();//Originally Class133.method1803();
|
||||
Class3_Sub31.aReferenceCache_2604.clearSoftReferences();//Class38.method1025();
|
||||
Class27.aReferenceCache_511.clearSoftReferences();//Class38.method1025();
|
||||
CS2Script.aReferenceCache_2450.clearSoftReferences();//Class40.method1044();
|
||||
VarpHelpers.varbitLookup.clearSoftReferences();//Class40.method1044();
|
||||
Class136.aReferenceCache_1772.clearSoftReferences();
|
||||
RenderAnimationDefinition.aReferenceCache_1955.clearSoftReferences();//Originally: Class158_Sub1.method2192();
|
||||
TextureOperation25.aReferenceCache_3412.clearSoftReferences();//Originally: Class159.method2196();
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ final class KeyboardListener implements KeyListener, FocusListener {
|
|||
try {
|
||||
|
||||
if(TextureOperation33.aClass148_3049 != null) {
|
||||
int var2 = Class79.method1386(var1);
|
||||
int var2 = CSConfigCachefile.method1386(var1);
|
||||
if(var2 >= 0) {
|
||||
int var3 = 1 + Class25.anInt491 & 127;
|
||||
if(var3 != Class3_Sub28_Sub9.anInt3620) {
|
||||
|
|
|
|||
|
|
@ -902,11 +902,11 @@ public final class NPCDefinition {
|
|||
static int method1484(int var1) {
|
||||
try {
|
||||
|
||||
Class79 var2 = CS2Script.method378(var1, (byte)127);
|
||||
int var3 = Objects.requireNonNull(var2).anInt1128;
|
||||
int var5 = var2.anInt1125;
|
||||
int var4 = var2.anInt1123;
|
||||
int var6 = Class3_Sub6.anIntArray2288[var5 + -var4];
|
||||
CSConfigCachefile var2 = CSConfigCachefile.getCSConfigFileFromVarbitID(var1);
|
||||
int var3 = Objects.requireNonNull(var2).parentVarpIndex;
|
||||
int var5 = var2.upperBound;
|
||||
int var4 = var2.lowerBound;
|
||||
int var6 = Class3_Sub6.expectedMinimumValues[var5 + -var4];
|
||||
return ItemDefinition.ram[var3] >> var4 & var6;
|
||||
} catch (RuntimeException var7) {
|
||||
throw ClientErrorException.clientError(var7, "me.B(" + 64835055 + ',' + var1 + ')');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package org.runite.client;
|
|||
|
||||
import org.rs09.Discord;
|
||||
import org.rs09.SlayerTracker;
|
||||
import org.rs09.SystemLogger;
|
||||
import org.rs09.XPGainDraw;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
|
@ -78,7 +77,7 @@ public final class PacketParser {
|
|||
if (60 == Unsorted.incomingOpcode) {
|
||||
nodeModelId = BufferedDataStream.incomingBuffer.readUnsignedShort128();
|
||||
byte var69 = BufferedDataStream.incomingBuffer.readSignedNegativeByte();
|
||||
TextureOperation39.method281(var69, nodeModelId);
|
||||
VarpHelpers.setVarp(var69, nodeModelId);
|
||||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
} else {
|
||||
|
|
@ -443,7 +442,7 @@ public final class PacketParser {
|
|||
} else if (Unsorted.incomingOpcode == 226) {
|
||||
nodeModelId = BufferedDataStream.incomingBuffer.readInt();
|
||||
var19 = BufferedDataStream.incomingBuffer.readUnsignedShort128();
|
||||
TextureOperation39.method281(nodeModelId, var19);
|
||||
VarpHelpers.setVarp(nodeModelId, var19);
|
||||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
} else if (Unsorted.incomingOpcode == 21) {
|
||||
|
|
@ -1028,7 +1027,7 @@ public final class PacketParser {
|
|||
var19 = BufferedDataStream.incomingBuffer.readUnsignedShort128();
|
||||
modelId = BufferedDataStream.incomingBuffer.readUnsignedShortLE128();
|
||||
Class146.updateInterfacePacketCounter(var19);
|
||||
Class79.method1385(modelId, nodeModelId);
|
||||
CSConfigCachefile.method1385(modelId, nodeModelId);
|
||||
|
||||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
|
|
@ -1124,7 +1123,7 @@ public final class PacketParser {
|
|||
} else if (37 == Unsorted.incomingOpcode) {
|
||||
nodeModelId = BufferedDataStream.incomingBuffer.readUnsignedByte128();
|
||||
var19 = BufferedDataStream.incomingBuffer.readUnsignedShortLE();
|
||||
Class163.updateVarbit((byte) -122, nodeModelId, var19);
|
||||
VarpHelpers.setVarbit((byte) -122, nodeModelId, var19);
|
||||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
} else if (Unsorted.incomingOpcode == 155) {
|
||||
|
|
@ -1401,7 +1400,7 @@ public final class PacketParser {
|
|||
} else if (Unsorted.incomingOpcode == 84) {
|
||||
nodeModelId = BufferedDataStream.incomingBuffer.readIntLE();
|
||||
var19 = BufferedDataStream.incomingBuffer.readUnsignedShortLE128();
|
||||
Class163.updateVarbit((byte) -106, nodeModelId, var19);
|
||||
VarpHelpers.setVarbit((byte) -106, nodeModelId, var19);
|
||||
Unsorted.incomingOpcode = -1;
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ public class TextCore {
|
|||
*/
|
||||
static RSString COMMAND_HIGHRES_GRAPHICS_RESIZE = RSString.parse("::wm2");
|
||||
static RSString COMMAND_SHIFT_DROP_CLICK = RSString.parse("::shiftclick");
|
||||
static RSString COMMAND_GETBITS = RSString.parse("::getbits");
|
||||
static RSString COMMAND_REPLACE_CANVAS = RSString.parse("::replacecanvas");
|
||||
static RSString COMMAND_HIGHRES_GRAPHICS_WINDOW = RSString.parse("::wm1");
|
||||
static RSString COMMAND_QA_OP_TEST = RSString.parse("::qa_op_test");
|
||||
|
|
|
|||
|
|
@ -346,15 +346,15 @@ public final class Texture {
|
|||
}
|
||||
|
||||
if (6 == anIntArray3331[var7]) {
|
||||
var32 = 10 <= Class79.anInt1127 % 20 ? 16776960 : 16711680;
|
||||
var32 = 10 <= CSConfigCachefile.anInt1127 % 20 ? 16776960 : 16711680;
|
||||
}
|
||||
|
||||
if (anIntArray3331[var7] == 7) {
|
||||
var32 = Class79.anInt1127 % 20 < 10 ? 255 : 65535;
|
||||
var32 = CSConfigCachefile.anInt1127 % 20 < 10 ? 255 : 65535;
|
||||
}
|
||||
|
||||
if (8 == anIntArray3331[var7]) {
|
||||
var32 = Class79.anInt1127 % 20 >= 10 ? 8454016 : '\ub000';
|
||||
var32 = CSConfigCachefile.anInt1127 % 20 >= 10 ? 8454016 : '\ub000';
|
||||
}
|
||||
|
||||
if (9 == anIntArray3331[var7]) {
|
||||
|
|
@ -405,15 +405,15 @@ public final class Texture {
|
|||
}
|
||||
|
||||
if (1 == anIntArray3336[var7]) {
|
||||
FontType.bold.method696(var33, var2 - -Class32.anInt590, anInt2208 + var0, var32, Class79.anInt1127);
|
||||
FontType.bold.method696(var33, var2 - -Class32.anInt590, anInt2208 + var0, var32, CSConfigCachefile.anInt1127);
|
||||
}
|
||||
|
||||
if (anIntArray3336[var7] == 2) {
|
||||
FontType.bold.method695(var33, var2 - -Class32.anInt590, var0 - -anInt2208, var32, Class79.anInt1127);
|
||||
FontType.bold.method695(var33, var2 - -Class32.anInt590, var0 - -anInt2208, var32, CSConfigCachefile.anInt1127);
|
||||
}
|
||||
|
||||
if (anIntArray3336[var7] == 3) {
|
||||
FontType.bold.method692(var33, var2 + Class32.anInt590, anInt2208 + var0, var32, Class79.anInt1127, 150 - anIntArray3318[var7]);
|
||||
FontType.bold.method692(var33, var2 + Class32.anInt590, anInt2208 + var0, var32, CSConfigCachefile.anInt1127, 150 - anIntArray3318[var7]);
|
||||
}
|
||||
|
||||
if (4 == anIntArray3336[var7]) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.runite.client;
|
||||
|
||||
import org.rs09.SystemLogger;
|
||||
import org.rs09.client.util.ArrayUtils;
|
||||
import org.rs09.client.filestore.resources.configs.cursors.CursorDefinition;
|
||||
|
||||
|
|
@ -114,12 +115,13 @@ final class TextureOperation3 extends TextureOperation {
|
|||
|
||||
static void method306(int var0, int var2) {
|
||||
try {
|
||||
Class79 var3 = CS2Script.method378(var0, (byte)127);
|
||||
int var6 = Objects.requireNonNull(var3).anInt1125;
|
||||
int var5 = var3.anInt1123;
|
||||
int var4 = var3.anInt1128;
|
||||
int var7 = Class3_Sub6.anIntArray2288[var6 - var5];
|
||||
CSConfigCachefile var3 = CSConfigCachefile.getCSConfigFileFromVarbitID(var0);
|
||||
int var6 = Objects.requireNonNull(var3).upperBound;
|
||||
int var5 = var3.lowerBound;
|
||||
int var4 = var3.parentVarpIndex;
|
||||
int var7 = Class3_Sub6.expectedMinimumValues[var6 - var5];
|
||||
if(var2 < 0 || var7 < var2) {
|
||||
SystemLogger.logInfo(var7 + " < " + var2);
|
||||
var2 = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -166,25 +166,6 @@ class TextureOperation39 extends TextureOperation {
|
|||
}
|
||||
}
|
||||
|
||||
static void method281(int var1, int var2) {
|
||||
try {
|
||||
Class57.varpArray[var2] = var1;
|
||||
if(CustomVars.parse(var2,var1)){
|
||||
return;
|
||||
}
|
||||
Class3_Sub7 var3 = (Class3_Sub7) AtmosphereParser.aHashTable_3679.get(var2);
|
||||
if(null == var3) {
|
||||
var3 = new Class3_Sub7(4611686018427387905L);
|
||||
AtmosphereParser.aHashTable_3679.put(var2, var3);
|
||||
} else if (var3.aLong2295 != 4611686018427387905L) {
|
||||
var3.aLong2295 = TimeUtils.time() + 500L | 4611686018427387904L;
|
||||
}
|
||||
|
||||
} catch (RuntimeException var4) {
|
||||
throw ClientErrorException.clientError(var4, "nh.W(" + (byte) 99 + ',' + var1 + ',' + var2 + ')');
|
||||
}
|
||||
}
|
||||
|
||||
final void method161(byte var1) {
|
||||
try {
|
||||
super.method161(var1);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ import org.rs09.client.util.ArrayUtils;
|
|||
import org.runite.client.drawcalls.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
|
|
@ -1964,7 +1962,7 @@ public class Unsorted {
|
|||
Class136.method1816(512, -7);
|
||||
TextureOperation19.method257();
|
||||
} else {
|
||||
Class3_Sub5.method112((byte) (-4 + Class79.anInt1127 & 0xFF));
|
||||
Class3_Sub5.method112((byte) (-4 + CSConfigCachefile.anInt1127 & 0xFF));
|
||||
Class136.method1816(2, -7);
|
||||
}
|
||||
|
||||
|
|
@ -2646,7 +2644,7 @@ public class Unsorted {
|
|||
++var2;
|
||||
}
|
||||
|
||||
if (var1.retrieveSpriteFile(Class79.anInt1124)) {
|
||||
if (var1.retrieveSpriteFile(CSConfigCachefile.anInt1124)) {
|
||||
++var2;
|
||||
}
|
||||
|
||||
|
|
@ -4720,7 +4718,7 @@ public class Unsorted {
|
|||
}
|
||||
}
|
||||
|
||||
Class79.method1390(new DataBuffer(var4));
|
||||
CSConfigCachefile.method1390(new DataBuffer(var4));
|
||||
}
|
||||
} catch (Exception var8) {
|
||||
}
|
||||
|
|
@ -4913,7 +4911,7 @@ public class Unsorted {
|
|||
|
||||
static void method338(int var1, boolean var2, int var3, int var4, int var5) {
|
||||
try {
|
||||
++Class79.anInt1127;
|
||||
++CSConfigCachefile.anInt1127;
|
||||
Class124.method1745();
|
||||
if(!var2) {
|
||||
Class3_Sub5.method116(true);
|
||||
|
|
@ -5022,7 +5020,7 @@ public class Unsorted {
|
|||
}
|
||||
|
||||
Class58.method1194();
|
||||
byte var19 = Class137.method1817() != 2 ?1:(byte)Class79.anInt1127;
|
||||
byte var19 = Class137.method1817() != 2 ?1:(byte) CSConfigCachefile.anInt1127;
|
||||
if(HDToolKit.highDetail) {
|
||||
HDToolKit.method1846();
|
||||
HDToolKit.method1831(true);
|
||||
|
|
|
|||
58
Client/src/main/java/org/runite/client/VarpHelpers.java
Normal file
58
Client/src/main/java/org/runite/client/VarpHelpers.java
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package org.runite.client;
|
||||
|
||||
import org.rs09.CustomVars;
|
||||
import org.rs09.SystemLogger;
|
||||
import org.rs09.client.data.ReferenceCache;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class VarpHelpers {
|
||||
|
||||
static ReferenceCache varbitLookup = new ReferenceCache(64);
|
||||
|
||||
static void setVarbit(byte var0, int valueToSet, int varbitID) {
|
||||
try {
|
||||
if (var0 >= -99) {
|
||||
setVarbit((byte) 57, -14, 120);
|
||||
}
|
||||
|
||||
CSConfigCachefile cacheFile = CSConfigCachefile.getCSConfigFileFromVarbitID(varbitID);
|
||||
int parentVarp = Objects.requireNonNull(cacheFile).parentVarpIndex;
|
||||
int upperBound = cacheFile.upperBound;
|
||||
int lowerBound = cacheFile.lowerBound;
|
||||
int varbitSize = upperBound - lowerBound;
|
||||
SystemLogger.logInfo(parentVarp + " - bitStart: " + lowerBound + " bitEnd: " + upperBound + " bitSize = " + (varbitSize + 1));
|
||||
int expectedMinimumValue = Class3_Sub6.expectedMinimumValues[varbitSize];
|
||||
SystemLogger.logInfo("emv: " + expectedMinimumValue + " || vs: " + (127 + valueToSet));
|
||||
if (valueToSet < 0|| expectedMinimumValue < valueToSet) { //<-- commented out due to heavy suspicion of it being an Arios modification. Things work fine without it.
|
||||
SystemLogger.logInfo(expectedMinimumValue + " < " + valueToSet);
|
||||
valueToSet = 0;
|
||||
}
|
||||
|
||||
expectedMinimumValue <<= lowerBound;
|
||||
int modifiedVarpValue = valueToSet << lowerBound & expectedMinimumValue | ~expectedMinimumValue & Class57.varpArray[parentVarp];
|
||||
setVarp(modifiedVarpValue, parentVarp);
|
||||
} catch (RuntimeException var8) {
|
||||
throw ClientErrorException.clientError(var8, "wd.K(" + var0 + ',' + valueToSet + ',' + varbitID + ')');
|
||||
}
|
||||
}
|
||||
|
||||
static void setVarp(int valueToSet, int varpIndex) {
|
||||
try {
|
||||
Class57.varpArray[varpIndex] = valueToSet;
|
||||
if(CustomVars.parse(varpIndex,valueToSet)){
|
||||
return;
|
||||
}
|
||||
Class3_Sub7 var3 = (Class3_Sub7) AtmosphereParser.aHashTable_3679.get(varpIndex);
|
||||
if(null == var3) {
|
||||
var3 = new Class3_Sub7(4611686018427387905L);
|
||||
AtmosphereParser.aHashTable_3679.put(varpIndex, var3);
|
||||
} else if (var3.aLong2295 != 4611686018427387905L) {
|
||||
var3.aLong2295 = TimeUtils.time() + 500L | 4611686018427387904L;
|
||||
}
|
||||
|
||||
} catch (RuntimeException var4) {
|
||||
throw ClientErrorException.clientError(var4, "nh.W(" + (byte) 99 + ',' + valueToSet + ',' + varpIndex + ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,8 +7,14 @@ import core.net.packet.context.VarbitContext;
|
|||
public class Varbit implements OutgoingPacket<VarbitContext> {
|
||||
@Override
|
||||
public void send(VarbitContext varbitContext) {
|
||||
IoBuffer buffer = new IoBuffer(37);
|
||||
buffer.put((byte) varbitContext.value);
|
||||
IoBuffer buffer;
|
||||
if(varbitContext.value > 255){
|
||||
buffer = new IoBuffer(84);
|
||||
buffer.putLEInt((128 | varbitContext.value) & 255);
|
||||
} else {
|
||||
buffer = new IoBuffer(37);
|
||||
buffer.put((byte) 128 | varbitContext.value);
|
||||
}
|
||||
buffer.putLEShort(varbitContext.varbitId);
|
||||
varbitContext.getPlayer().getSession().write(buffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,6 +261,15 @@ class VisualCommand : CommandPlugin() {
|
|||
PacketRepository.send(Varbit::class.java, VarbitContext(player, value, val2))
|
||||
return true
|
||||
}
|
||||
"setbits" -> {
|
||||
args ?: return false
|
||||
val start = toInteger(args[1]!!)
|
||||
val end = toInteger(args[2]!!)
|
||||
val value = toInteger(args[3]!!)
|
||||
for(i in start until end){
|
||||
player?.varpManager?.setVarbit(i, value)
|
||||
}
|
||||
}
|
||||
"loop_anim_on_i" -> {
|
||||
var anim = toInteger(args!![1]!!)
|
||||
ContentAPI.submitWorldPulse(object : Pulse(3){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue