Skip to content

Commit 32aa79a

Browse files
authored
Merge pull request #69 from runejs/feature/update-server-renaming
Doing a large chunk of refactoring/renaming for the update server code
2 parents b85a09a + 094ef6e commit 32aa79a

35 files changed

+763
-713
lines changed

src/main/java/org/runejs/client/Class17.java

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -20,65 +20,8 @@ public class Class17 {
2020
public static Font helveticaBold;
2121
public static ProducingGraphicsBuffer chatboxTop;
2222
public static ProducingGraphicsBuffer aProducingGraphicsBuffer_463;
23-
public static int anInt464 = 0;
2423
public static int[] anIntArray466 = new int[256];
2524

26-
public static void handleUpdateServerConnection(GameSocket updateServerSocket, boolean arg2) {
27-
if(Class57.updateServerSocket != null) {
28-
try {
29-
Class57.updateServerSocket.kill();
30-
} catch(Exception exception) {
31-
exception.printStackTrace();
32-
/* empty */
33-
}
34-
Class57.updateServerSocket = null;
35-
}
36-
Class57.updateServerSocket = updateServerSocket;
37-
GameShell.method19(arg2);
38-
LinkedList.aClass40_Sub1_1081.currentPosition = 0;
39-
Class40_Sub5_Sub13.aClass40_Sub1_2752 = null;
40-
Landscape.anInt1157 = 0;
41-
PacketBuffer.aClass40_Sub5_Sub13_2250 = null;
42-
for(; ; ) {
43-
Class40_Sub5_Sub13 class40_sub5_sub13 = (Class40_Sub5_Sub13) Class37.aClass23_869.method329();
44-
if(class40_sub5_sub13 == null)
45-
break;
46-
Class51.aClass23_1194.put(class40_sub5_sub13.key, class40_sub5_sub13);
47-
anInt464--;
48-
ProducingGraphicsBuffer.anInt1618++;
49-
}
50-
for(; ; ) {
51-
Class40_Sub5_Sub13 class40_sub5_sub13 = (Class40_Sub5_Sub13) MovedStatics.aClass23_841.method329();
52-
if(class40_sub5_sub13 == null)
53-
break;
54-
InteractiveObject.aNodeQueue_485.unshift(class40_sub5_sub13);
55-
GameObjectDefinition.aClass23_2545.put(class40_sub5_sub13.key, class40_sub5_sub13);
56-
MovedStatics.anInt1006--;
57-
MovedStatics.anInt554++;
58-
}
59-
if(Class8.aByte302 != 0) {
60-
try {
61-
Buffer class40_sub1 = new Buffer(4);
62-
class40_sub1.putByte(4);
63-
class40_sub1.putByte(Class8.aByte302);
64-
class40_sub1.putShortBE(0);
65-
Class57.updateServerSocket.sendDataFromBuffer(4, 0, class40_sub1.buffer);
66-
} catch(java.io.IOException ioexception) {
67-
ioexception.printStackTrace();
68-
try {
69-
Class57.updateServerSocket.kill();
70-
} catch(Exception exception) {
71-
exception.printStackTrace();
72-
/* empty */
73-
}
74-
Class57.updateServerSocket = null;
75-
MovedStatics.anInt2278++;
76-
}
77-
}
78-
Class22.msSinceLastUpdate = 0;
79-
LinkedList.lastUpdateInMillis = System.currentTimeMillis();
80-
}
81-
8225
public static int method274(boolean arg0) {
8326
if(!arg0)
8427
aProducingGraphicsBuffer_463 = null;

src/main/java/org/runejs/client/Class22.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ 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 msSinceLastUpdate = 0;
2827
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};
2928

3029
public static void method299(byte arg0, int arg1) {
31-
int[] is = Class40_Sub5_Sub13.minimapImage.pixels;
30+
int[] is = MovedStatics.minimapImage.pixels;
3231
int i = is.length;
3332
for(int i_0_ = 0; i > i_0_; i_0_++)
3433
is[i_0_] = 0;
@@ -42,7 +41,7 @@ public static void method299(byte arg0, int arg1) {
4241
i_2_ += 4;
4342
}
4443
}
45-
Class40_Sub5_Sub13.minimapImage.method723();
44+
MovedStatics.minimapImage.method723();
4645
int i_4_ = (-10 + (int) (Math.random() * 20.0) + 238 << 8) + (228 + (int) (Math.random() * 20.0) << 16) + 238 + (int) (20.0 * Math.random()) + -10;
4746
int i_5_ = -10 + (int) (20.0 * Math.random()) + 238 << 16;
4847
for(int i_6_ = 1; i_6_ < 103; i_6_++) {

src/main/java/org/runejs/client/Class37.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.runejs.client.scene.tile.Wall;
2323

2424
public class Class37 {
25-
public static HashTable aClass23_869 = new HashTable(32);
2625
public static boolean aBoolean871 = false;
2726
public static int anInt874;
2827
public static int anInt876 = 0;
@@ -92,7 +91,7 @@ public static void renderMinimap() {
9291
int centerX = 48 + Player.localPlayer.worldX / 32;
9392
int centerY = 464 + -(Player.localPlayer.worldY / 32);
9493
int angle = GroundItemTile.cameraHorizontal + Class43.cameraYawOffset & 0x7ff;
95-
Class40_Sub5_Sub13.minimapImage.shapeImageToPixels(25, 5, 146, 151, centerX, centerY, angle, Class51.mapZoomOffset + 256, Landscape.anIntArray1186, MovedStatics.anIntArray852);
94+
MovedStatics.minimapImage.shapeImageToPixels(25, 5, 146, 151, centerX, centerY, angle, Class51.mapZoomOffset + 256, Landscape.anIntArray1186, MovedStatics.anIntArray852);
9695
for(int i = 0; GameObject.minimapHintCount > i; i++) {
9796
int hintX = 2 + 4 * Actor.minimapHintX[i] + -(Player.localPlayer.worldX / 32);
9897
int hintY = 2 + 4 * LinkedList.minimapHintY[i] - Player.localPlayer.worldY / 32;

src/main/java/org/runejs/client/Class40_Sub3.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void startup(int arg0) {
5151
Npc.currentScene = new Scene(MovedStatics.tile_height);
5252
for (int i = 0; i < 4; i++)
5353
Landscape.currentCollisionMap[i] = new CollisionMap(104, 104);
54-
Class40_Sub5_Sub13.minimapImage = new ImageRGB(512, 512);
54+
MovedStatics.minimapImage = new ImageRGB(512, 512);
5555
MovedStatics.anInt1607 = 5;
5656
Class40_Sub5_Sub6.loadingPercent = 20;
5757
Native.currentLoadingText = English.startingGameEngine;
@@ -225,10 +225,10 @@ public static void startup(int arg0) {
225225
MovedStatics.aClass40_Sub5_Sub14_Sub2Array215 = IndexedImage.getMultipleIndexedImages(CacheArchive.gameImageCacheArchive, Native.scrollbar, "");
226226
else
227227
i++;
228-
if (Class40_Sub5_Sub13.moderatorIcon != null)
228+
if (MovedStatics.moderatorIcon != null)
229229
i++;
230230
else
231-
Class40_Sub5_Sub13.moderatorIcon = IndexedImage.getMultipleIndexedImages(CacheArchive.gameImageCacheArchive, Native.aClass1_881, "");
231+
MovedStatics.moderatorIcon = IndexedImage.getMultipleIndexedImages(CacheArchive.gameImageCacheArchive, Native.aClass1_881, "");
232232
if (i < 14) {
233233
Native.currentLoadingText = English.loadingSprites + (100 * i / 14) + Native.percent;
234234
MovedStatics.anInt1607 = 70;

src/main/java/org/runejs/client/Class40_Sub5_Sub13.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/main/java/org/runejs/client/Class48.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
public class Class48 {
2727
public static int cameraOffsetY = 0;
2828
public static int modifiedWidgetId = 0;
29-
public static Buffer aClass40_Sub1_1132;
3029

3130
public int[][] anIntArrayArray1128;
3231
public int anInt1131;
@@ -340,7 +339,6 @@ public static void logout() {
340339
MouseHandler.currentSongId = -1;
341340
Class37.method436();
342341
MovedStatics.processGameStatus(10);
343-
ScreenController.frameMode(ScreenMode.FIXED);
344342
}
345343

346344
public int method921(int arg0, int arg1) {

src/main/java/org/runejs/client/Class51.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
public class Class51 {
1818
public static int mapZoomOffset = 0;
19-
public static HashTable aClass23_1194 = new HashTable(4096);
2019
public static int anInt1195 = 0;
2120
public static int gameStatusCode = 0;
2221
public static int[] anIntArray1198;

src/main/java/org/runejs/client/Class57.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class Class57 {
88
public static int[][] wayPoints = new int[104][104];
99
public static int clickX = 0;
1010
public static int anInt1342 = 0;
11-
public static GameSocket updateServerSocket;
1211
public static IndexedImage bottomChatBack;
1312
public static int[] anIntArray1347;
1413

src/main/java/org/runejs/client/Class8.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class Class8 {
2828
public static int[] anIntArray297 = new int[5];
2929
public static ProducingGraphicsBuffer flameLeftBackground;
3030
public static int itemSelected = 0;
31-
public static byte aByte302 = (byte) 0;
3231

3332
public Class8(int arg0) {
3433
CollisionMap.anInt141 = arg0;

src/main/java/org/runejs/client/GameShell.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.runejs.client.media.renderable.actor.Player;
1313
import org.runejs.client.media.renderable.actor.PlayerAppearance;
1414
import org.runejs.client.net.PacketBuffer;
15+
import org.runejs.client.net.UpdateServer;
1516
import org.runejs.client.scene.SceneCluster;
1617
import org.runejs.client.scene.tile.GenericTile;
1718
import org.runejs.client.scene.tile.Wall;
@@ -43,22 +44,22 @@ public abstract class GameShell extends Canvas implements Runnable, FocusListene
4344

4445

4546
public static void method19(boolean loggedIn) {
46-
if (Class57.updateServerSocket != null) {
47+
if (UpdateServer.updateServerSocket != null) {
4748
try {
4849
Buffer buffer = new Buffer(4);
4950
buffer.putByte(loggedIn ? 2 : 3);
5051
buffer.putMediumBE(0);
51-
Class57.updateServerSocket.sendDataFromBuffer(4, 0, buffer.buffer);
52+
UpdateServer.updateServerSocket.sendDataFromBuffer(4, 0, buffer.buffer);
5253
} catch (java.io.IOException ioexception) {
5354
ioexception.printStackTrace();
5455
try {
55-
Class57.updateServerSocket.kill();
56+
UpdateServer.updateServerSocket.kill();
5657
} catch (Exception exception) {
5758
exception.printStackTrace();
5859
/* empty */
5960
}
60-
Class57.updateServerSocket = null;
61-
MovedStatics.anInt2278++;
61+
UpdateServer.updateServerSocket = null;
62+
UpdateServer.anInt2278++;
6263
}
6364
}
6465

@@ -202,7 +203,7 @@ public void run() {
202203
}
203204
}
204205
setCanvas();
205-
ProducingGraphicsBuffer_Sub1.aProducingGraphicsBuffer_2213 = Class40_Sub5_Sub13.createGraphicsBuffer(Class12.width, IdentityKit.height, MouseHandler.gameCanvas);
206+
ProducingGraphicsBuffer_Sub1.aProducingGraphicsBuffer_2213 = MovedStatics.createGraphicsBuffer(Class12.width, IdentityKit.height, MouseHandler.gameCanvas);
206207
startup();
207208
SceneCluster.gameTimer = Timer.create();
208209
SceneCluster.gameTimer.start();

0 commit comments

Comments
 (0)