I'm going to give you the methods that I personally use to load multiple revisions of object maps without the location data files breaking each other
meaning white/invisible objects. This means that I can load every single revision landscape map almost perfectly. I'm also going to give you the code
to extend your location data file. Although I haven't seen anyone else do this but it's pretty easy if you go try it without this snippet. I recently needed
to add the Grand Exchange object map and it severely damaged my other maps. This will fix that. For any variable that you don't have, you'll have to initialize yourself.
Natvigate to your ObjectDef.java class and below:
Code:
stream = new Stream(streamLoader.getDataForName("loc.dat"));
Stream stream = new Stream(streamLoader.getDataForName("loc.idx"));
load your second revision data file:
Code:
stream2 = new Stream(FileOperations.ReadFile(Client.CachePath + "Cache/562_loc.dat"));
Stream stream2 = new Stream(FileOperations.ReadFile(Client.CachePath + "Cache/562_loc.idx"));
Add your fileIndex int array under the one that's already there:
Code:
int totalObjects2 = stream2.readUnsignedWord();
streamIndices2 = new int[totalObjects2];
int x = 2;
Loop through and read the file:
Code:
for (int j = 0; j < totalObjects2; j++)
{
streamIndices2[j] = x;
x += stream2.readUnsignedWord();
}
Next Navigate to your constructor "public static ObjectDef forID( int i ...)" and add this below the first {
Code:
if (i > streamIndices.length|| i > streamIndices2.length)
{
i = streamIndices.length+streamIndices2.length - 1;
System.out.println("Array Index Out of Bounds at ObjectDef forID");
}
Next find "stream.currentOffset = streamIndices[i];"
Code:
if (rev562)
{
stream2.currentOffset = streamIndices2[i];
} else {
stream.currentOffset = streamIndices[i];
}
Next find "objectdef.readValues(stream);"
Code:
if (rev508)
{
objectdef.read562Values(stream2);
} else {
objectdef.readValues(stream);
}
Then in your client class you need to set the bool to true when a specific landscape file is fetched from the Map_Index.
In your parse packet method at the bottom of (pktType = 74) you'll see: int objectMap = anIntArray1236[k16] = onDemandFetcher.getMapIndex(1, j26, l23);
UNDER THAT:
Code:
if (objectMap == 267) // Center Grand Exchange Landscape File
{
ObjectDef.rev562 = true; loadingStages = 1;
} else {
ObjectDef.rev562 = false; loadingStages = 1;
}
Then you can load any revision you want based on the objectmap!
Enjoy your uninterrupted 377 maps with GE, NEX, Tormented Demons or whatever the hell you want to add...
I made it a command to show you how fast it loads; here is the command ::fov with:
ObjectDef.rev562 =! ObjectDef.rev562