Added some new regions

This commit is contained in:
GregF 2025-02-17 10:37:28 +00:00 committed by Ryan
parent e25780a4c5
commit 9eedfc2336
3 changed files with 77 additions and 1260 deletions

File diff suppressed because it is too large Load diff

View file

@ -13,13 +13,9 @@ import kotlin.collections.HashMap
class XteaParser { class XteaParser {
companion object{ companion object{
val REGION_XTEA = HashMap<Int,IntArray>() val REGION_XTEA = HashMap<Int,IntArray>()
val DEFAULT_REGION_KEYS = intArrayOf(14881828, -6662814, 58238456, 146761213) private val DEFAULT_REGION_KEYS = intArrayOf(0, 0, 0, 0)
fun getRegionXTEA(regionId: Int): IntArray? { //Uses the xtea's from the sql to unlock regions fun getRegionXTEA(regionId: Int): IntArray { //Uses the xtea's from the sql to unlock regions
return REGION_XTEA.getOrDefault(regionId, DEFAULT_REGION_KEYS)
return REGION_XTEA[regionId]
return DEFAULT_REGION_KEYS //This one grabs the keys from the SQL
// return DEFAULT_REGION_KEYS;//This one only uses the default keys at the top,{ 14881828, -6662814, 58238456, 146761213 }. Unsure why they chose these numbers.
} }
} }
val parser = JSONParser() val parser = JSONParser()

View file

@ -24,10 +24,7 @@ public final class UpdateSceneGraph implements OutgoingPacket<SceneGraphContext>
for (int regionY = (player.getLocation().getRegionY() - 6) / 8; regionY <= ((player.getLocation().getRegionY() + 6) / 8); regionY++) { for (int regionY = (player.getLocation().getRegionY() - 6) / 8; regionY <= ((player.getLocation().getRegionY() + 6) / 8); regionY++) {
int[] keys = XteaParser.Companion.getRegionXTEA(regionX << 8 | regionY); int[] keys = XteaParser.Companion.getRegionXTEA(regionX << 8 | regionY);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (keys != null)
buffer.putIntB(keys[i]); buffer.putIntB(keys[i]);
else
buffer.putIntB(0);
} }
} }
} }