From 7c7a614a20eb9082e125e8fee0cb4909b45fa665 Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Wed, 24 Apr 2024 11:17:18 +0200
Subject: [PATCH 1/7] fix deprecation
---
src/main/java/Game.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index feeea73..41b593c 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -13,7 +13,7 @@ import java.io.OutputStream;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.Socket;
-import java.net.URL;
+import java.net.URI;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.zip.CRC32;
@@ -684,9 +684,9 @@ public class Game extends GameShell {
}
}
- public URL getCodeBase() {
+ public URI getCodeBase() {
try {
- return new URL("http://" + server + ":" + (80 + portOffset));
+ return new URI("http://" + server + ":" + (80 + portOffset));
} catch (Exception ignored) {
}
return null;
@@ -10184,7 +10184,7 @@ public class Game extends GameShell {
public DataInputStream openURL(String s) throws IOException {
if (!jaggrabEnabled) {
- return new DataInputStream(new URL(getCodeBase(), s).openStream());
+ return new DataInputStream(getCodeBase().resolve(s).toURL().openStream());
}
if (jaggrabSocket != null) {
From 5865f59d06ff807e9bf983a75fc14f0211738bd4 Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Mon, 6 May 2024 23:46:29 +0200
Subject: [PATCH 2/7] fix linux white line in window, fix wsl2 mouse offset,
disable traversal keys for tab to work
---
src/main/java/GameShell.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/GameShell.java b/src/main/java/GameShell.java
index a7bd61b..d44c63c 100644
--- a/src/main/java/GameShell.java
+++ b/src/main/java/GameShell.java
@@ -7,7 +7,7 @@ import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
-public abstract class GameShell extends JComponent implements Runnable, MouseListener, MouseMotionListener, KeyListener, FocusListener, WindowListener {
+public abstract class GameShell extends Canvas implements Runnable, MouseListener, MouseMotionListener, KeyListener, FocusListener, WindowListener {
public final long[] otim = new long[10];
public final double[] frameTime = new double[100];
@@ -48,6 +48,7 @@ public abstract class GameShell extends JComponent implements Runnable, MouseLis
graphics = this.getGraphics();
startThread(this, 1);
requestFocus();
+ setFocusTraversalKeysEnabled(false);
}
public void initApplet(int width, int height) {
From 2e9f7e45748e7ff89ac855b947c9e04a2cc797fe Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Mon, 6 May 2024 23:56:52 +0200
Subject: [PATCH 3/7] empty string = localhost? Allows windows clients to find
local wsl2 servers address which 127.0.0.1 won't do
---
src/main/java/Game.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index 41b593c..5f94416 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -98,6 +98,7 @@ public class Game extends GameShell {
}
public static void main(String[] args) throws UnknownHostException {
+ System.setProperty("java.net.preferIPv6Addresses", "true");
System.out.println("RS2 user client - release #" + 317);
if (args.length != 5) {
@@ -1578,7 +1579,7 @@ public class Game extends GameShell {
Draw2D.drawLineX(0, 77, 479, 0);
}
- static String server = "0.0.0.0";
+ static String server = "";
public Socket openSocket(int port) throws IOException {
return new Socket(InetAddress.getByName(server), port);
From 4e773c112a7e3419b6cccca926b7ba4c1144ca4b Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Mon, 6 May 2024 23:59:41 +0200
Subject: [PATCH 4/7] replace ~/ with the actual home directory (same fix as in
late 2006 clients) mostly for Linux
---
src/main/java/Signlink.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/Signlink.java b/src/main/java/Signlink.java
index ae33cde..b979df2 100644
--- a/src/main/java/Signlink.java
+++ b/src/main/java/Signlink.java
@@ -59,7 +59,7 @@ public class Signlink implements Runnable {
}
public static String findcachedir() {
- String[] as = {"c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/", "/tmp/", "", "c:/rscache", "/rscache"};
+ String[] as = {"c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", System.getProperty("user.home") + "/", "/tmp/", "", "c:/rscache", "/rscache"};
if ((storeid < 32) || (storeid > 34)) {
storeid = 32;
}
From f3058eaa999c6a26f6b63bb87a0e53c3cb6bb962 Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Tue, 7 May 2024 00:16:56 +0200
Subject: [PATCH 5/7] fix unchecked operations, fix maven warnings, restore
original RSA keys
---
pom.xml | 14 +++++---------
src/main/java/Game.java | 4 ++--
src/main/java/LocType.java | 8 ++++----
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6f2ec0d..d7256d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,6 +2,9 @@
+
+ UTF-8
+
4.0.0
runescape
@@ -12,19 +15,12 @@
org.apache.maven.plugins
maven-compiler-plugin
+ 3.13.0
7
7
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- 9
- 9
-
-
@@ -51,4 +47,4 @@
-
\ No newline at end of file
+
diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index 5f94416..1d5af67 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -22,9 +22,9 @@ public class Game extends GameShell {
public static final int[][] designPartColor = {{6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193}, {8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 25239}, {25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003}, {4626, 11146, 6439, 12, 4758, 10270}, {4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574}};
public static final int[] designHairColor = {9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486};
- public static final BigInteger RSA_MODULUS = new BigInteger("150437374157649496260907284144944613391868328356428312785170855566836496148649769873303054925785940753587048471819630374797613652942136320599534564023031743563833250113572385619350489566973866283982326500382760586083379242813677444239924493338426453599564333273724064297982529208425077775100347146662074078333");
+ public static final BigInteger RSA_MODULUS = new BigInteger("7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789");
public static final int[] levelExperience;
- public static final BigInteger RSA_EXPONENT = new BigInteger("65537");
+ public static final BigInteger RSA_EXPONENT = new BigInteger("58778699976184461502525193738213253649000149147835990136706041084440742975821");
public static final String VALID_CHAT_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
public static final int[] BITMASK;
public static final int MAX_PLAYER_COUNT = 2048;
diff --git a/src/main/java/LocType.java b/src/main/java/LocType.java
index c9882c5..69cd26f 100644
--- a/src/main/java/LocType.java
+++ b/src/main/java/LocType.java
@@ -42,12 +42,12 @@ public class LocType {
/**
* This is where dynamically generated models go.
*/
- public static LRUMap modelCacheDynamic = new LRUMap(30);
+ public static LRUMap modelCacheDynamic = new LRUMap<>(30);
public static LocType[] cache;
/**
* This is where basic models go.
*/
- public static LRUMap modelCacheStatic = new LRUMap(500);
+ public static LRUMap modelCacheStatic = new LRUMap<>(500);
public static LocType get(int locID) {
if (locID >= count) {
@@ -296,7 +296,7 @@ public class LocType {
modelID += 0x10000;
}
- model = modelCacheStatic.get(modelID);
+ model = modelCacheStatic.get((long) modelID);
if (model == null) {
model = Model.tryGet(modelID & 0xffff);
if (model == null) {
@@ -346,7 +346,7 @@ public class LocType {
modelID += 0x10000;
}
- model = modelCacheStatic.get(modelID);
+ model = modelCacheStatic.get((long) modelID);
if (model == null) {
model = Model.tryGet(modelID & 0xffff);
From 6fece68f2a8653f7ad8a33c280ace3dae4c5b2fc Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Tue, 7 May 2024 00:39:37 +0200
Subject: [PATCH 6/7] bump java version, 8 gives warning by maven
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index d7256d6..342cfed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,8 +17,8 @@
maven-compiler-plugin
3.13.0
- 7
- 7
+ 21
+ 21
From 398da7f7612334b975bcd6e32dd8a13e1626adf7 Mon Sep 17 00:00:00 2001
From: lesleyrs <19632758+lesleyrs@users.noreply.github.com>
Date: Tue, 7 May 2024 00:57:57 +0200
Subject: [PATCH 7/7] add jdtls lsp files to gitignore
---
.gitignore | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index cf4defc..7f41c51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
-
+.classpath
+.project
+.settings/
.idea/
target/
-out/
\ No newline at end of file
+out/