Skip to content

Map Index

In revision #317 the "map_index" file is loaded from the cache in archive #5 and index #0. Archive #5 is also known as the "config archive."

// Buffer b;
int count = b.length() / 7; // 7 is because of how many bytes each entry is.

regionHash = new int[count]; // hash = (regionX << 8) + regionY, ex: 50 << 8 + 50 = 12850 (lumbridge!)
regionLandscapeIndex = new int[count]; // tile map
regionObjectMapIndex = new int[count]; // object map
regionPreload = new int[count]; // if the client should give priority to this map

for (int reg = 0; reg < count; reg++) {
    regionHash[reg] = b.getShortUnsigned();
    regionLandscapeIndex[reg] = b.getShortUnsigned();
    regionObjectMapIndex[reg] = b.getShortUnsigned();
    regionPreload[reg] = b.getUnsigned();
}