This snippet will eliminate preloading of maps, fix the object map bug on login, and allow more than 1390 map files to be loaded from the cache.
If your cache is over 65mb use this. http://www.rune-server.org/runescape...-modified.html
PART 1:
Step 1: Download
UppIT - Free File Sharing - map_index.Dat
Step 2: Open up Tom's Cache Suite and replace the map_index file with the one you just downloaded.
PATH: View/Edit Jagex Archives > versionlist.jag > replace map_index
PART 2:
Step 1: Open up OnDemandFetcher and replace your method start( with this:
Code:
public int mapAmount = 0;
public void start(StreamLoader streamLoader, client client1)
{
byte[] abyte2 = streamLoader.getDataForName("map_index");
Stream stream2 = new Stream(abyte2);
int j1 = abyte2.length / 6;
mapIndices1 = new int[j1];
mapIndices2 = new int[j1];
mapIndices3 = new int[j1];
for(int i2 = 0; i2 < j1; i2++)
{
mapIndices1[i2] = stream2.readUnsignedWord();
mapIndices2[i2] = stream2.readUnsignedWord();
mapIndices3[i2] = stream2.readUnsignedWord();
mapAmount++;
}
System.out.println("Map Amount: "+mapAmount+"");
abyte2 = streamLoader.getDataForName("midi_index");
stream2 = new Stream(abyte2);
j1 = abyte2.length;
anIntArray1348 = new int[j1];
for(int k2 = 0; k2 < j1; k2++)
anIntArray1348[k2] = stream2.readUnsignedByte();
clientInstance = client1;
running = true;
clientInstance.startRunnable(this, 2);
}
and close.
Step 2: Download
UppIT - Free File Sharing - Maps.rar
Step 3: Go into client.jerba and add these methods.
Code:
public void maps() {
for(int MapIndex = 0; MapIndex < 3536; MapIndex++) {
byte[] abyte0 = GetMap(MapIndex);
if(abyte0 != null && abyte0.length > 0) {
decompressors[4].method234(abyte0.length, abyte0, MapIndex);
}
}
}
public byte[] GetMap(int Index) {
try {
File Map = new File("./Maps/"+Index+".gz");
byte[] aByte = new byte[(int)Map.length()];
FileInputStream Fis = new FileInputStream(Map);
Fis.read(aByte);
System.out.println(""+Index+" aByte = ["+aByte+"]!");
Fis.close();
return aByte;
} catch(Exception e) {
return null;
}
}
public static final byte[] ReadFile(String s, boolean antiLeech) {
try {
byte abyte0[];
File file = new File(s);
int i = (int)file.length();
abyte0 = new byte[i];
DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
datainputstream.readFully(abyte0, 0, i);
datainputstream.close();
return abyte0;
} catch(Exception e) {
System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
return null;
}
}
Step 4: Add
into your start up method. Save, and compile, then run the client(make sure the maps are in the correct spot.
Once packed, removed the "maps();" from the startup method. You are now done, you have all the maps cache packed and no bugs what so ever with objects not loading on login
. Enjoy and rep++
Freezing Fix
- This fixing the freezing for certain area's such as Armadyl Chamber.
Go to your OnDemandFetcher.java and replace this method562 with this:
Code:
public int method562(int i, int k, int l)
{
int i1 = (l << 8) + k;
int mapNigga2;
int mapNigga3;
for(int j1 = 0; j1 < mapIndices1.length; j1++)
{
if(mapIndices1[j1] == i1)
{
if(i == 0) {
mapNigga2 = mapIndices2[j1] > 3535 ? -1 : mapIndices2[j1];
return mapNigga2;
} else {
mapNigga3 = mapIndices3[j1] > 3535 ? -1 : mapIndices3[j1];
return mapNigga3;
}
}
}
return -1;
}
You're done and it's fixed. Like i said this is sort of a cheap hax and the real fix is packing the rest of the 525 maps since I did dump from a 525(sorta)