diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt index f718eb0a..5127976b 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt @@ -304,9 +304,9 @@ internal class PlayerInfoClient( decodeMoveSpeed(buffer, blocks) } if (flags and APPEARANCE != 0) { - val len = buffer.g1Alt2() + val len = buffer.g1() val data = ByteArray(len) - buffer.gdata(data) + buffer.gdataAlt2(data) decodeAppearance(Unpooled.wrappedBuffer(data).toJagByteBuf(), blocks) } if (flags and HITS != 0) { @@ -345,14 +345,14 @@ internal class PlayerInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - blocks += MoveSpeedExtendedInfo(buffer.g1Alt3()) + blocks += MoveSpeedExtendedInfo(buffer.g1sAlt3()) } private fun decodeTemporaryMoveSpeed( buffer: JagByteBuf, blocks: MutableList, ) { - blocks += TemporaryMoveSpeedExtendedInfo(buffer.g1Alt2()) + blocks += TemporaryMoveSpeedExtendedInfo(buffer.g1sAlt2()) } private fun decodeSequence( @@ -563,9 +563,9 @@ internal class PlayerInfoClient( ) { val start = buffer.g2Alt3() val end = buffer.g2Alt2() - val hue = buffer.g1Alt3() - val saturation = buffer.g1() - val lightness = buffer.g1Alt1() + val hue = buffer.g1sAlt3() + val saturation = buffer.g1s() + val lightness = buffer.g1sAlt1() val weight = buffer.g1Alt1() blocks += TintingExtendedInfo( diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt index 52182d4b..d494b8bc 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt @@ -68,7 +68,8 @@ public class TranscriberPlugin( GameServerProt.UPDATE_ZONE_FULL_FOLLOWS -> pass(message, Transcriber::updateZoneFullFollows) GameServerProt.UPDATE_ZONE_PARTIAL_FOLLOWS -> pass(message, Transcriber::updateZonePartialFollows) GameServerProt.UPDATE_ZONE_PARTIAL_ENCLOSED -> pass(message, Transcriber::updateZonePartialEnclosed) - GameServerProt.LOC_ADD_CHANGE -> pass(message, Transcriber::locAddChange) + GameServerProt.LOC_ADD_CHANGE_V1 -> pass(message, Transcriber::locAddChangeV1) + GameServerProt.LOC_ADD_CHANGE_V2 -> pass(message, Transcriber::locAddChangeV2) GameServerProt.LOC_DEL -> pass(message, Transcriber::locDel) GameServerProt.LOC_ANIM -> pass(message, Transcriber::locAnim) GameServerProt.LOC_MERGE -> pass(message, Transcriber::locMerge) diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt index 40e76cab..189f0c02 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt @@ -210,19 +210,7 @@ import net.rsprox.protocol.game.outgoing.model.worldentity.SetActiveWorld import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZoneFullFollows import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialEnclosed import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFollows -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAddChangeV1 -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocMerge -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapProjAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjAdd -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCount -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjEnabledOps -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjUncustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.SoundArea +import net.rsprox.protocol.game.outgoing.model.zone.payload.* import net.rsprox.shared.BaseVarType import net.rsprox.shared.ScriptVarType import net.rsprox.shared.indexing.BinaryIndex @@ -1114,7 +1102,11 @@ public class IndexerTranscriber( override fun updateZonePartialFollows(message: UpdateZonePartialFollows) { } - override fun locAddChange(message: LocAddChangeV1) { + override fun locAddChangeV1(message: LocAddChangeV1) { + binaryIndex.increment(IndexedType.LOC, message.id) + } + + override fun locAddChangeV2(message: LocAddChangeV2) { binaryIndex.increment(IndexedType.LOC, message.id) } diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt index 7667f96e..fa2a6a41 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt @@ -112,19 +112,7 @@ import net.rsprox.protocol.game.outgoing.model.worldentity.SetActiveWorld import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZoneFullFollows import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialEnclosed import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFollows -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAddChangeV1 -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocMerge -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapProjAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjAdd -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCount -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjEnabledOps -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjUncustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.SoundArea +import net.rsprox.protocol.game.outgoing.model.zone.payload.* public interface ServerPacketTranscriber { public fun camLookAt(message: CamLookAt) @@ -381,7 +369,9 @@ public interface ServerPacketTranscriber { public fun updateZonePartialFollows(message: UpdateZonePartialFollows) - public fun locAddChange(message: LocAddChangeV1) + public fun locAddChangeV1(message: LocAddChangeV1) + + public fun locAddChangeV2(message: LocAddChangeV2) public fun locAnim(message: LocAnim) diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt index b05395bd..077013d6 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt @@ -42,7 +42,8 @@ public enum class GameServerProt : Prot { UPDATE_ZONE_PARTIAL_ENCLOSED, // Zone payload packets - LOC_ADD_CHANGE, + LOC_ADD_CHANGE_V1, + LOC_ADD_CHANGE_V2, LOC_DEL, LOC_ANIM, LOC_MERGE, diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt index 589d5ef6..7aea288e 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt @@ -139,19 +139,7 @@ import net.rsprox.protocol.game.outgoing.model.worldentity.SetActiveWorld import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZoneFullFollows import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialEnclosed import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFollows -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAddChangeV1 -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.LocMerge -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.MapProjAnim -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjAdd -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCount -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjDel -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjEnabledOps -import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjUncustomise -import net.rsprox.protocol.game.outgoing.model.zone.payload.SoundArea +import net.rsprox.protocol.game.outgoing.model.zone.payload.* import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildArea import net.rsprox.protocol.reflection.ReflectionCheck import net.rsprox.shared.ScriptVarType @@ -2447,8 +2435,13 @@ public class TextServerPacketTranscriber( when (event) { is LocAddChangeV1 -> { if (!filters[PropertyFilter.LOC_ADD_CHANGE]) continue - val root = sessionState.createFakeServerRoot("LOC_ADD_CHANGE") - root.buildLocAddChange(event) + val root = sessionState.createFakeServerRoot("LOC_ADD_CHANGE_V1") + root.buildLocAddChangeV1(event) + } + is LocAddChangeV2 -> { + if (!filters[PropertyFilter.LOC_ADD_CHANGE]) continue + val root = sessionState.createFakeServerRoot("LOC_ADD_CHANGE_V2") + root.buildLocAddChangeV2(event) } is LocAnim -> { if (!filters[PropertyFilter.LOC_ANIM]) continue @@ -2523,8 +2516,14 @@ public class TextServerPacketTranscriber( when (event) { is LocAddChangeV1 -> { if (!filters[PropertyFilter.LOC_ADD_CHANGE]) continue - group("LOC_ADD_CHANGE") { - buildLocAddChange(event) + group("LOC_ADD_CHANGE_V1") { + buildLocAddChangeV1(event) + } + } + is LocAddChangeV2 -> { + if (!filters[PropertyFilter.LOC_ADD_CHANGE]) continue + group("LOC_ADD_CHANGE_V2") { + buildLocAddChangeV2(event) } } is LocAnim -> { @@ -2609,9 +2608,14 @@ public class TextServerPacketTranscriber( root.coordGrid(buildAreaCoordGrid(message.zoneX, message.zoneZ, message.level)) } - override fun locAddChange(message: LocAddChangeV1) { + override fun locAddChangeV1(message: LocAddChangeV1) { + if (!filters[PropertyFilter.LOC_ADD_CHANGE]) return omit() + root.buildLocAddChangeV1(message) + } + + override fun locAddChangeV2(message: LocAddChangeV2) { if (!filters[PropertyFilter.LOC_ADD_CHANGE]) return omit() - root.buildLocAddChange(message) + root.buildLocAddChangeV2(message) } override fun locAnim(message: LocAnim) { @@ -2671,13 +2675,26 @@ public class TextServerPacketTranscriber( return sessionState.getActiveWorld().relativizeZoneCoord(xInZone, zInZone) } - private fun Property.buildLocAddChange(message: LocAddChangeV1) { + private fun Property.buildLocAddChangeV1(message: LocAddChangeV1) { scriptVarType("id", ScriptVarType.LOC, message.id) coordGrid(coordInZone(message.xInZone, message.zInZone)) scriptVarType("shape", ScriptVarType.LOC_SHAPE, message.shape) int("rotation", message.rotation) } + private fun Property.buildLocAddChangeV2(message: LocAddChangeV2) { + scriptVarType("id", ScriptVarType.LOC, message.id) + coordGrid(coordInZone(message.xInZone, message.zInZone)) + scriptVarType("shape", ScriptVarType.LOC_SHAPE, message.shape) + int("rotation", message.rotation) + val ops = message.ops + if (ops != null) { + for ((k, v) in ops) { + string("op$k", v) + } + } + } + private fun Property.buildLocAnim(message: LocAnim) { coordGrid(coordInZone(message.xInZone, message.zInZone)) scriptVarType("shape", ScriptVarType.LOC_SHAPE, message.shape)