I got some old computers, one of them is running Windows 98 and XP. I was wondering that there is perhaps a standalone java client available? or is there still a way to get the java webclient, but it makes things a bit difficult as the site requires the new HTTPS protocol.
I would really love to play 2004scape on my old computer if that is still possible.
I tried building the old client (not Client2 repo) from github, but it seems to not able to download the cache. and wont load the game at all.
it’s not really practical, they have done some modifications to the networking,
to fix the cache issue you have to get the preliminary Jag files in one shot instead of the 6 byte header you can do something like this for a quick and dirty:
public static byte[] readBytesFromURL(String urlString) throws IOException {
@SuppressWarnings("deprecation")
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
try (InputStream inputStream = connection.getInputStream();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
return outputStream.toByteArray();
}
}
private Jagfile loadArchive(String name, int crc, String displayName, int displayProgress) {
int retry = 5;
byte[] data = signlink.cacheload(name);
if (data != null) {
this.crc32.reset();
this.crc32.update(data);
int crcValue = (int) this.crc32.getValue();
if (crcValue != crc) {
data = null;
}
}
if (data != null) {
return new Jagfile(data);
}
while (data == null) {
this.drawProgress("Requesting " + displayName, displayProgress);
try {
int lastProgress = 0;
/*
DataInputStream stream = this.openUrl(name + crc);
System.out.println(name + crc);
byte[] header = new byte[6];
stream.readFully(header, 0, 6);
Packet head = new Packet(header);
head.pos = 3;
int length = head.g3() + 6;
int offset = 6;
data = new byte[length];
System.arraycopy(header, 0, data, 0, 6);
while (offset < length) {
int remaining = length - offset;
if (remaining > 1000) {
remaining = 1000;
}
offset += stream.read(data, offset, remaining);
int progress = offset * 100 / length;
if (progress != lastProgress) {
this.drawProgress("Loading " + displayName + " - " + progress + "%", displayProgress);
}
lastProgress = progress;
}
data = new byte[length];
stream.read(data);
stream.close();
*/
data = readBytesFromURL("https://w1-2004.lostcity.rs/"+name+crc);
} catch (IOException ex) {
data = null;
for (int i = retry; i > 0; i--) {
this.drawProgress("Error loading - Will retry in " + i + " secs.", displayProgress);
try {
Thread.sleep(1000L);
} catch (Exception ignored) {
}
}
retry *= 2;
if (retry > 60) {
retry = 60;
}
}
}
signlink.cachesave(name, data);
return new Jagfile(data);
}
The big issue is that they took the approach of using websockets for the communication protocol. which would require an extensive overhaul of the java client to facilitate this mode of communication.