mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +00:00
Fix Cache CRC Checks For The Client(Allows Cache To Actually Check For Updates)
This commit is contained in:
@@ -29,6 +29,12 @@ public class ClientSettings {
|
|||||||
* World 2 Will Connect On Port 43598
|
* World 2 Will Connect On Port 43598
|
||||||
*/
|
*/
|
||||||
public static int SERVER_WORLD = 1;
|
public static int SERVER_WORLD = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables/Disables FileServer CRC Checking For Cache Updates
|
||||||
|
*/
|
||||||
|
public static final boolean CHECK_CRC = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Npc Bits for the Server
|
* The Npc Bits for the Server
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.text.DecimalFormat;
|
|||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.zip.CRC32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
|
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
|
||||||
@@ -3429,11 +3430,12 @@ public class Game extends RSApplet {
|
|||||||
}
|
}
|
||||||
} catch (Exception _ex) {
|
} catch (Exception _ex) {
|
||||||
}
|
}
|
||||||
if (abyte0 != null) {
|
if(abyte0 != null && ClientSettings.CHECK_CRC) {
|
||||||
// aCRC32_930.reset();
|
aCRC32_930.reset();
|
||||||
// aCRC32_930.update(abyte0);
|
aCRC32_930.update(abyte0);
|
||||||
// int i1 = (int)aCRC32_930.getValue();
|
int i1 = (int)aCRC32_930.getValue();
|
||||||
// if(i1 != j)
|
if(i1 != j)
|
||||||
|
abyte0 = null;
|
||||||
}
|
}
|
||||||
if (abyte0 != null) {
|
if (abyte0 != null) {
|
||||||
StreamLoader streamLoader = new StreamLoader(abyte0);
|
StreamLoader streamLoader = new StreamLoader(abyte0);
|
||||||
@@ -3480,12 +3482,20 @@ public class Game extends RSApplet {
|
|||||||
} catch (Exception _ex) {
|
} catch (Exception _ex) {
|
||||||
decompressors[0] = null;
|
decompressors[0] = null;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* if(abyte0 != null) { aCRC32_930.reset();
|
if(abyte0 != null && ClientSettings.CHECK_CRC)
|
||||||
* aCRC32_930.update(abyte0); int i3 =
|
{
|
||||||
* (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
|
aCRC32_930.reset();
|
||||||
* j1++; s2 = "Checksum error: " + i3; } }
|
aCRC32_930.update(abyte0);
|
||||||
*/
|
int i3 = (int)aCRC32_930.getValue();
|
||||||
|
if(i3 != j)
|
||||||
|
{
|
||||||
|
abyte0 = null;
|
||||||
|
j1++;
|
||||||
|
s2 = "Checksum error: " + i3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
if (s2.equals("Unknown error")) {
|
if (s2.equals("Unknown error")) {
|
||||||
s2 = "Connection error";
|
s2 = "Connection error";
|
||||||
@@ -12046,8 +12056,9 @@ public class Game extends RSApplet {
|
|||||||
bigX = new int[4000];
|
bigX = new int[4000];
|
||||||
bigY = new int[4000];
|
bigY = new int[4000];
|
||||||
anInt1289 = -1;
|
anInt1289 = -1;
|
||||||
|
aCRC32_930 = new CRC32();
|
||||||
}
|
}
|
||||||
|
public CRC32 aCRC32_930;
|
||||||
public static String server;
|
public static String server;
|
||||||
public int ignoreCount;
|
public int ignoreCount;
|
||||||
public long aLong824;
|
public long aLong824;
|
||||||
|
|||||||
Reference in New Issue
Block a user