Skip to content

Commit 8786413

Browse files
committed
deob
1 parent 8861d96 commit 8786413

20 files changed

+154
-162
lines changed

src/main/java/com/jagex/runescape/Class17.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public static void method273(GameSocket arg0, boolean arg2) {
7575
MovedStatics.anInt2278++;
7676
}
7777
}
78-
Class22.anInt547 = 0;
79-
LinkedList.aLong1051 = System.currentTimeMillis();
78+
Class22.msSinceLastUpdate = 0;
79+
LinkedList.lastUpdateInMillis = System.currentTimeMillis();
8080
}
8181

8282
public static int method274(boolean arg0) {

src/main/java/com/jagex/runescape/Class22.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public abstract class Class22 {
2424
public static boolean membersWorld = false;
2525
public static boolean accountFlagged = false;
2626
public static int anInt545;
27-
public static int anInt547 = 0;
27+
public static int msSinceLastUpdate = 0;
2828
public static boolean[] aBooleanArray548 = new boolean[]{true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, false, false};
2929

3030
public static void method299(byte arg0, int arg1) {

src/main/java/com/jagex/runescape/Class59.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void dropClient() {
3434
else {
3535
// Connection lost
3636
OverlayDefinition.updateOverlay(40);
37-
PlayerAppearance.gameSocket = MovedStatics.gameSocket;
37+
PlayerAppearance.lostConnectionSocket = MovedStatics.gameSocket;
3838
MovedStatics.gameSocket = null;
3939
}
4040
}

src/main/java/com/jagex/runescape/ClientScriptRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ else if(object instanceof Number) {
295295
}
296296

297297
public static void runClientScripts(Object[] listeners, int arg1, int arg2, GameInterface gameInterface1, int arg4) {
298-
ClientScript clientScript = ClientScript.decodeClientScript(((Integer) listeners[0]).intValue(), 76);
298+
ClientScript clientScript = ClientScript.decodeClientScript((Integer) listeners[0], 76);
299299
int[] intOperands = clientScript.intOperands;
300300
int[] scriptOpcodes = clientScript.opcodes;
301301
int intValueIndex = 0;

src/main/java/com/jagex/runescape/GameShell.java

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,31 +62,26 @@ public static void method19(boolean arg0, int arg1) {
6262

6363
}
6464

65-
public static void method20(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, GameInterface[] arg7, int arg8, int arg9) {
66-
67-
if (arg6 != 1)
68-
providesignlink(null);
69-
for (int i = 0; i < arg7.length; i++) {
70-
GameInterface gameInterface = arg7[i];
71-
if (gameInterface != null && (gameInterface.type == GameInterfaceType.LAYER || gameInterface.hasListeners) && gameInterface != null && arg5 == gameInterface.parentId && (!gameInterface.isHidden || PacketBuffer.hiddenButtonTest)) {
72-
73-
74-
int i_1_ = arg4 + gameInterface.currentX;
75-
int i_2_ = arg0 + gameInterface.currentY;
65+
public static void runClientScriptsForInterface(int minY, int arg1, int scrollWidth, int arg3, int minX, int parentId, GameInterface[] interfaceCollection, int arg8, int scrollHeight) {
66+
for (int i = 0; i < interfaceCollection.length; i++) {
67+
GameInterface gameInterface = interfaceCollection[i];
68+
if (gameInterface != null && (gameInterface.type == GameInterfaceType.LAYER || gameInterface.hasListeners) && parentId == gameInterface.parentId && (!gameInterface.isHidden || PacketBuffer.hiddenButtonTest)) {
69+
int absoluteX = minX + gameInterface.currentX;
70+
int absoluteY = minY + gameInterface.currentY;
7671
if (!gameInterface.lockScroll)
77-
i_2_ -= arg9;
78-
int i_3_ = i_2_ + gameInterface.originalHeight;
79-
int i_4_ = arg0 >= i_2_ ? arg0 : i_2_;
72+
absoluteY -= scrollHeight;
73+
int bottomLeftY = absoluteY + gameInterface.originalHeight;
74+
int i_4_ = Math.max(minY, absoluteY);
8075
if (!gameInterface.lockScroll)
81-
i_1_ -= arg2;
82-
int i_5_ = i_1_ + gameInterface.originalWidth;
83-
int i_6_ = arg4 < i_1_ ? i_1_ : arg4;
84-
int i_7_ = arg1 > i_3_ ? i_3_ : arg1;
85-
int i_8_ = i_5_ < arg8 ? i_5_ : arg8;
76+
absoluteX -= scrollWidth;
77+
int topRightX = absoluteX + gameInterface.originalWidth;
78+
int i_6_ = Math.max(minX, absoluteX);
79+
int i_7_ = Math.min(arg1, bottomLeftY);
80+
int i_8_ = Math.min(topRightX, arg8);
8681
if (gameInterface.type == GameInterfaceType.LAYER) {
87-
method20(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, i, 1, arg7, i_8_, gameInterface.scrollPosition);
82+
runClientScriptsForInterface(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, i, interfaceCollection, i_8_, gameInterface.scrollPosition);
8883
if (gameInterface.children != null)
89-
method20(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, gameInterface.id, 1, gameInterface.children, i_8_, gameInterface.scrollPosition);
84+
runClientScriptsForInterface(i_4_, i_7_, gameInterface.scrollWidth, arg3, i_6_, gameInterface.id, gameInterface.children, i_8_, gameInterface.scrollPosition);
9085
}
9186
if (gameInterface.hasListeners) {
9287
boolean bool;
@@ -110,28 +105,28 @@ public static void method20(int arg0, int arg1, int arg2, int arg3, int arg4, in
110105
if (!gameInterface.aBoolean2730 && bool_10_ && (0x1 & arg3) != 0) {
111106
gameInterface.aBoolean2730 = true;
112107
if (gameInterface.anObjectArray2681 != null)
113-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2681, 0, RSString.clickY + -i_2_, gameInterface, Class57.clickX - i_1_);
108+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2681, 0, RSString.clickY + -absoluteY, gameInterface, Class57.clickX - absoluteX);
114109
}
115110
if (gameInterface.aBoolean2730 && bool_9_ && (arg3 & 0x4) != 0 && gameInterface.anObjectArray2747 != null)
116-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2747, 0, -i_2_ + Landscape.mouseY, gameInterface, -i_1_ + Class13.mouseX);
111+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2747, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX);
117112
if (gameInterface.aBoolean2730 && !bool_9_ && (0x2 & arg3) != 0) {
118113
gameInterface.aBoolean2730 = false;
119114
if (gameInterface.anObjectArray2707 != null)
120-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2707, 0, Landscape.mouseY - i_2_, gameInterface, Class13.mouseX - i_1_);
115+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2707, 0, Landscape.mouseY - absoluteY, gameInterface, Class13.mouseX - absoluteX);
121116
}
122117
if (bool_9_ && (arg3 & 0x8) != 0 && gameInterface.anObjectArray2644 != null)
123-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2644, 0, -i_2_ + Landscape.mouseY, gameInterface, -i_1_ + Class13.mouseX);
118+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2644, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX);
124119
if (!gameInterface.aBoolean2682 && bool && (0x10 & arg3) != 0) {
125120
gameInterface.aBoolean2682 = true;
126121
if (gameInterface.anObjectArray2658 != null)
127-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2658, 0, Landscape.mouseY - i_2_, gameInterface, Class13.mouseX - i_1_);
122+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2658, 0, Landscape.mouseY - absoluteY, gameInterface, Class13.mouseX - absoluteX);
128123
}
129124
if (gameInterface.aBoolean2682 && bool && (0x40 & arg3) != 0 && gameInterface.anObjectArray2680 != null)
130-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2680, 0, -i_2_ + Landscape.mouseY, gameInterface, -i_1_ + Class13.mouseX);
125+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2680, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX);
131126
if (gameInterface.aBoolean2682 && !bool && (arg3 & 0x20) != 0) {
132127
gameInterface.aBoolean2682 = false;
133128
if (gameInterface.anObjectArray2672 != null)
134-
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2672, 0, -i_2_ + Landscape.mouseY, gameInterface, -i_1_ + Class13.mouseX);
129+
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2672, 0, -absoluteY + Landscape.mouseY, gameInterface, -absoluteX + Class13.mouseX);
135130
}
136131
if (gameInterface.anObjectArray2712 != null && (arg3 & 0x80) != 0)
137132
ClientScriptRunner.runClientScripts(gameInterface.anObjectArray2712, 0, 0, gameInterface, 0);
@@ -143,8 +138,8 @@ public static void method20(int arg0, int arg1, int arg2, int arg3, int arg4, in
143138

144139
}
145140

146-
public static void providesignlink(Signlink arg0) {
147-
Actor.aClass31_3152 = Main.signlink = arg0;
141+
public static void providesignlink(Signlink signlink) {
142+
Actor.signlink = Main.signlink = signlink;
148143
}
149144

150145
public static int method27(int arg0, int arg1) {
@@ -316,7 +311,7 @@ public void destroy() {
316311
if (MovedStatics.anApplet_Sub1_179 == this && !PacketBuffer.aBoolean2255) {
317312
MovedStatics.aLong219 = System.currentTimeMillis();
318313
Class43.sleep(5000L);
319-
Actor.aClass31_3152 = null;
314+
Actor.signlink = null;
320315
method17();
321316
}
322317
}
@@ -346,7 +341,7 @@ public void displayClientFrame(int clientVersion, int width, int height, int fil
346341
MovedStatics.anApplet_Sub1_179 = this;
347342
if (Main.signlink == null) {
348343
try {
349-
Actor.aClass31_3152 = Main.signlink = new Signlink(false, this, InetAddress.getByName(getCodeBase().getHost()), fileStoreId, null, 0);
344+
Actor.signlink = Main.signlink = new Signlink(false, this, InetAddress.getByName(getCodeBase().getHost()), fileStoreId, null, 0);
350345
} catch (IOException e) {
351346
e.printStackTrace();
352347
}
@@ -430,7 +425,7 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
430425
Insets insets = Class35.aFrame1732.getInsets();
431426
Class35.aFrame1732.setSize(insets.right + width + insets.left, insets.bottom + insets.top + height);
432427
// Class35.aFrame1732.setLocationRelativeTo(null);
433-
Actor.aClass31_3152 = Main.signlink = new Signlink(true, null, inetAddress, fileStoreId, cacheFolder, cacheIndexes);
428+
Actor.signlink = Main.signlink = new Signlink(true, null, inetAddress, fileStoreId, cacheFolder, cacheIndexes);
434429
Main.signlink.createCanvasNode(1, this);
435430
} catch (Exception exception) {
436431
MovedStatics.printException(null, exception);

src/main/java/com/jagex/runescape/GameSocket.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public class GameSocket implements Runnable {
1919

2020
public int anInt1509 = 0;
2121
public int anInt1520 = 0;
22-
public boolean socketInitialized;
22+
public boolean socketDisconnected;
2323
public byte[] aByteArray1504;
2424

2525
public GameSocket(Socket socket, Signlink signLink) throws IOException {
26-
socketInitialized = false;
26+
socketDisconnected = false;
2727
socketError = false;
2828
this.signLink = signLink;
2929
this.socket = socket;
@@ -35,7 +35,7 @@ public GameSocket(Socket socket, Signlink signLink) throws IOException {
3535

3636

3737
public void method1008(int arg0, int arg1, int arg2, byte[] arg3) throws IOException {
38-
if (!socketInitialized && arg2 < -126) {
38+
if (!socketDisconnected && arg2 < -126) {
3939
while (arg1 > 0) {
4040
int i = socketInputStream.read(arg3, arg0, arg1);
4141
if (i <= 0)
@@ -47,9 +47,9 @@ public void method1008(int arg0, int arg1, int arg2, byte[] arg3) throws IOExcep
4747
}
4848

4949
public void method1009() {
50-
if (!socketInitialized) {
50+
if (!socketDisconnected) {
5151
synchronized (this) {
52-
socketInitialized = true;
52+
socketDisconnected = true;
5353
this.notifyAll();
5454
}
5555
if (signLinkNode != null) {
@@ -69,7 +69,7 @@ public void method1009() {
6969
}
7070

7171
public void method1010(int arg0, int arg2, byte[] arg3) throws IOException {
72-
if (!socketInitialized) {
72+
if (!socketDisconnected) {
7373
if (socketError) {
7474
socketError = false;
7575
throw new IOException();
@@ -101,7 +101,7 @@ public void run() {
101101
int i_0_;
102102
synchronized (this) {
103103
if (anInt1509 == anInt1520) {
104-
if (socketInitialized) {
104+
if (socketDisconnected) {
105105
break;
106106
}
107107
try {
@@ -150,16 +150,14 @@ public void run() {
150150
}
151151
}
152152

153-
public int method1014(int arg0) throws IOException {
154-
if (arg0 >= -120)
155-
signLink = null;
156-
if (socketInitialized)
153+
public int inputStreamAvailable() throws IOException {
154+
if (socketDisconnected)
157155
return 0;
158156
return socketInputStream.available();
159157
}
160158

161159
public int read() throws IOException {
162-
if (socketInitialized)
160+
if (socketDisconnected)
163161
return 0;
164162
return socketInputStream.read();
165163
}

src/main/java/com/jagex/runescape/LinkedList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.awt.*;
1515

1616
public class LinkedList {
17-
public static long aLong1051;
17+
public static long lastUpdateInMillis;
1818
public static ImageRGB aClass40_Sub5_Sub14_Sub4_1057;
1919
public static int anInt1061;
2020
public static LinkedList aLinkedList_1064 = new LinkedList();

src/main/java/com/jagex/runescape/Main.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ public static void updateGame() {
12601260
Class59.dropClient();
12611261
} else {
12621262
for(int i = 0; i < 100; i++) {
1263-
if(!IncomingPackets.parseIncomingPackets(false))
1263+
if(!IncomingPackets.parseIncomingPackets())
12641264
break;
12651265
}
12661266
if(Class51.currentAction == 30 || Class51.currentAction == 35) {
@@ -1502,32 +1502,32 @@ else if(ActorDefinition.menuActionRow > 0)
15021502

15031503
int i = 34;
15041504
if(GameInterface.gameScreenInterfaceId != -1)
1505-
GameInterface.method360((byte) 125, 516, i, 338, GameInterface.gameScreenInterfaceId, 4, 4);
1505+
GameInterface.runClientScriptsForParentInterface(516, i, 338, GameInterface.gameScreenInterfaceId, 4, 4);
15061506

15071507
if(GameInterface.tabAreaInterfaceId == -1) {
15081508
if(Player.tabWidgetIds[Player.currentTabId] != -1)
1509-
GameInterface.method360((byte) 125, 743, i, 466, Player.tabWidgetIds[Player.currentTabId], 205, 553);
1509+
GameInterface.runClientScriptsForParentInterface(743, i, 466, Player.tabWidgetIds[Player.currentTabId], 205, 553);
15101510
} else
1511-
GameInterface.method360((byte) 125, 743, i, 466, GameInterface.tabAreaInterfaceId, 205, 553);
1511+
GameInterface.runClientScriptsForParentInterface(743, i, 466, GameInterface.tabAreaInterfaceId, 205, 553);
15121512

15131513
if(GameInterface.chatboxInterfaceId != -1)
1514-
GameInterface.method360((byte) 125, 496, i, 453, GameInterface.chatboxInterfaceId, 357, 17);
1514+
GameInterface.runClientScriptsForParentInterface(496, i, 453, GameInterface.chatboxInterfaceId, 357, 17);
15151515
else if(ChatBox.dialogueId != -1)
1516-
GameInterface.method360((byte) 125, 496, i, 453, ChatBox.dialogueId, 357, 17);
1516+
GameInterface.runClientScriptsForParentInterface(496, i, 453, ChatBox.dialogueId, 357, 17);
15171517

15181518
if(GameInterface.gameScreenInterfaceId != -1)
1519-
GameInterface.method360((byte) 125, 516, i ^ 0xffffffff, 338, GameInterface.gameScreenInterfaceId, 4, 4);
1519+
GameInterface.runClientScriptsForParentInterface(516, i ^ 0xffffffff, 338, GameInterface.gameScreenInterfaceId, 4, 4);
15201520

15211521
if(GameInterface.tabAreaInterfaceId != -1)
1522-
GameInterface.method360((byte) 125, 743, i ^ 0xffffffff, 466, GameInterface.tabAreaInterfaceId, 205, 553);
1522+
GameInterface.runClientScriptsForParentInterface(743, i ^ 0xffffffff, 466, GameInterface.tabAreaInterfaceId, 205, 553);
15231523

15241524
else if(Player.tabWidgetIds[Player.currentTabId] != -1)
1525-
GameInterface.method360((byte) 125, 743, i ^ 0xffffffff, 466, Player.tabWidgetIds[Player.currentTabId], 205, 553);
1525+
GameInterface.runClientScriptsForParentInterface(743, i ^ 0xffffffff, 466, Player.tabWidgetIds[Player.currentTabId], 205, 553);
15261526

15271527
if(GameInterface.chatboxInterfaceId != -1)
1528-
GameInterface.method360((byte) 125, 496, i ^ 0xffffffff, 453, GameInterface.chatboxInterfaceId, 357, 17);
1528+
GameInterface.runClientScriptsForParentInterface(496, i ^ 0xffffffff, 453, GameInterface.chatboxInterfaceId, 357, 17);
15291529
else if(ChatBox.dialogueId != -1)
1530-
GameInterface.method360((byte) 125, 496, i ^ 0xffffffff, 453, ChatBox.dialogueId, 357, 17);
1530+
GameInterface.runClientScriptsForParentInterface(496, i ^ 0xffffffff, 453, ChatBox.dialogueId, 357, 17);
15311531

15321532
// If hovering over a widget
15331533
if(MovedStatics.anInt1586 != -1 || FloorDecoration.anInt614 != -1 || MovedStatics.anInt573 != -1) {
@@ -1677,6 +1677,7 @@ public void processGameLoop() {
16771677
ScreenController.refreshFrameSize();
16781678
updateGame();
16791679
} else if (Class51.currentAction == 40) {
1680+
// Connection lost
16801681
SpotAnimDefinition.method552(true);
16811682
}
16821683
}
@@ -1760,15 +1761,15 @@ public void method40() {
17601761
}
17611762
if (Class8.anInt290 == 2) {
17621763
Class29.gameSocket = new GameSocket((Socket) ProducingGraphicsBuffer.aSignlinkNode_1632.value, signlink);
1763-
Buffer class40_sub1 = new Buffer(5);
1764-
class40_sub1.putByte(15);
1765-
class40_sub1.putIntBE(435);
1766-
Class29.gameSocket.method1010(5, 0, class40_sub1.buffer);
1764+
Buffer buffer = new Buffer(5);
1765+
buffer.putByte(15);
1766+
buffer.putIntBE(435);
1767+
Class29.gameSocket.method1010(5, 0, buffer.buffer);
17671768
Class8.anInt290++;
17681769
Class22_Sub1.aLong1841 = System.currentTimeMillis();
17691770
}
17701771
if (Class8.anInt290 == 3) {
1771-
if (Class51.currentAction > 5 && Class29.gameSocket.method1014(5 + -131) <= 0) {
1772+
if (Class51.currentAction > 5 && Class29.gameSocket.inputStreamAvailable() <= 0) {
17721773
if (System.currentTimeMillis() + -Class22_Sub1.aLong1841 > 30000L) {
17731774
method35(-2);
17741775
break;

0 commit comments

Comments
 (0)