Added some new regions
This commit is contained in:
+74
-1250
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user