mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Added some new regions
This commit is contained in:
parent
e25780a4c5
commit
9eedfc2336
3 changed files with 77 additions and 1260 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue