From 36ed6acbc7cbda77a37d568861851341f68d7874 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 17:58:25 +0200 Subject: [PATCH 01/16] feat: revision 236 (initial copy of 235) --- protocol/osrs-236/build.gradle.kts | 14 + .../v236/ClientPacketDecoderServiceV236.kt | 25 + .../v236/GameClientProtProviderV236.kt | 16 + .../v236/GameServerProtProviderV236.kt | 16 + .../v236/ServerPacketDecoderServiceV236.kt | 31 + .../decoder/codec/buttons/If1ButtonDecoder.kt | 23 + .../decoder/codec/buttons/IfButtonDDecoder.kt | 34 + .../decoder/codec/buttons/IfButtonTDecoder.kt | 33 + .../decoder/codec/buttons/IfButtonXDecoder.kt | 31 + .../codec/buttons/IfRunScriptDecoder.kt | 34 + .../decoder/codec/buttons/IfSubOpDecoder.kt | 33 + ...ClanSettingsAddBannedFromChannelDecoder.kt | 29 + ...dClanSettingsSetMutedFromChannelDecoder.kt | 31 + .../clan/ClanChannelFullRequestDecoder.kt | 22 + .../codec/clan/ClanChannelKickUserDecoder.kt | 28 + .../clan/ClanSettingsFullRequestDecoder.kt | 22 + .../codec/events/EventAppletFocusDecoder.kt | 22 + .../events/EventCameraPositionDecoder.kt | 24 + .../codec/events/EventKeyboardDecoder.kt | 33 + .../codec/events/EventMouseClickV1Decoder.kt | 31 + .../codec/events/EventMouseClickV2Decoder.kt | 31 + .../codec/events/EventMouseMoveDecoder.kt | 96 ++ .../codec/events/EventMouseScrollDecoder.kt | 22 + .../events/EventNativeMouseMoveDecoder.kt | 93 ++ .../friendchat/FriendChatJoinLeaveDecoder.kt | 27 + .../codec/friendchat/FriendChatKickDecoder.kt | 22 + .../friendchat/FriendChatSetRankDecoder.kt | 24 + .../decoder/codec/locs/OpLoc1Decoder.kt | 29 + .../decoder/codec/locs/OpLoc2Decoder.kt | 29 + .../decoder/codec/locs/OpLoc3Decoder.kt | 29 + .../decoder/codec/locs/OpLoc4Decoder.kt | 29 + .../decoder/codec/locs/OpLoc5Decoder.kt | 29 + .../decoder/codec/locs/OpLoc6Decoder.kt | 20 + .../decoder/codec/locs/OpLocTDecoder.kt | 35 + .../codec/messaging/MessagePrivateDecoder.kt | 29 + .../codec/messaging/MessagePublicDecoder.kt | 66 + .../misc/client/ConnectionTelemetryDecoder.kt | 42 + .../client/DetectModifiedClientDecoder.kt | 22 + .../decoder/codec/misc/client/IdleDecoder.kt | 19 + .../misc/client/MapBuildCompleteDecoder.kt | 19 + .../MembershipPromotionEligibilityDecoder.kt | 26 + .../codec/misc/client/NoTimeoutDecoder.kt | 19 + .../codec/misc/client/RSevenStatusDecoder.kt | 22 + .../client/ReflectionCheckReplyDecoder.kt | 135 +++ .../codec/misc/client/SendPingReplyDecoder.kt | 28 + .../misc/client/SoundJingleEndDecoder.kt | 22 + .../codec/misc/client/WindowStatusDecoder.kt | 28 + .../codec/misc/user/BugReportDecoder.kt | 34 + .../codec/misc/user/ClickWorldMapDecoder.kt | 21 + .../codec/misc/user/ClientCheatDecoder.kt | 22 + .../codec/misc/user/CloseModalDecoder.kt | 19 + .../codec/misc/user/HiscoreRequestDecoder.kt | 28 + .../codec/misc/user/IfCrmViewClickDecoder.kt | 33 + .../codec/misc/user/MoveGameClickDecoder.kt | 26 + .../misc/user/MoveMinimapClickDecoder.kt | 59 + .../codec/misc/user/OculusLeaveDecoder.kt | 19 + .../codec/misc/user/SendSnapshotDecoder.kt | 28 + .../misc/user/SetChatFilterSettingsDecoder.kt | 28 + .../codec/misc/user/SetHeadingDecoder.kt | 20 + .../codec/misc/user/TeleportDecoder.kt | 28 + .../decoder/codec/npcs/OpNpc1Decoder.kt | 25 + .../decoder/codec/npcs/OpNpc2Decoder.kt | 25 + .../decoder/codec/npcs/OpNpc3Decoder.kt | 25 + .../decoder/codec/npcs/OpNpc4Decoder.kt | 25 + .../decoder/codec/npcs/OpNpc5Decoder.kt | 25 + .../decoder/codec/npcs/OpNpc6Decoder.kt | 20 + .../decoder/codec/npcs/OpNpcTDecoder.kt | 31 + .../decoder/codec/objs/OpObj1Decoder.kt | 29 + .../decoder/codec/objs/OpObj2Decoder.kt | 29 + .../decoder/codec/objs/OpObj3Decoder.kt | 29 + .../decoder/codec/objs/OpObj4Decoder.kt | 29 + .../decoder/codec/objs/OpObj5Decoder.kt | 29 + .../decoder/codec/objs/OpObj6Decoder.kt | 26 + .../decoder/codec/objs/OpObjTDecoder.kt | 35 + .../decoder/codec/players/OpPlayer1Decoder.kt | 25 + .../decoder/codec/players/OpPlayer2Decoder.kt | 25 + .../decoder/codec/players/OpPlayer3Decoder.kt | 25 + .../decoder/codec/players/OpPlayer4Decoder.kt | 25 + .../decoder/codec/players/OpPlayer5Decoder.kt | 25 + .../decoder/codec/players/OpPlayer6Decoder.kt | 25 + .../decoder/codec/players/OpPlayer7Decoder.kt | 25 + .../decoder/codec/players/OpPlayer8Decoder.kt | 25 + .../decoder/codec/players/OpPlayerTDecoder.kt | 31 + .../resumed/ResumePCountDialogDecoder.kt | 22 + .../codec/resumed/ResumePNameDialogDecoder.kt | 22 + .../codec/resumed/ResumePObjDialogDecoder.kt | 22 + .../resumed/ResumePStringDialogDecoder.kt | 22 + .../codec/resumed/ResumePauseButtonDecoder.kt | 25 + .../codec/social/FriendListAddDecoder.kt | 22 + .../codec/social/FriendListDelDecoder.kt | 22 + .../codec/social/IgnoreListAddDecoder.kt | 22 + .../codec/social/IgnoreListDelDecoder.kt | 22 + .../worldentities/OpWorldEntity1Decoder.kt | 25 + .../worldentities/OpWorldEntity2Decoder.kt | 25 + .../worldentities/OpWorldEntity3Decoder.kt | 25 + .../worldentities/OpWorldEntity4Decoder.kt | 25 + .../worldentities/OpWorldEntity5Decoder.kt | 25 + .../worldentities/OpWorldEntity6Decoder.kt | 20 + .../worldentities/OpWorldEntityTDecoder.kt | 31 + .../prot/ClientMessageDecoderRepository.kt | 184 +++ .../incoming/decoder/prot/GameClientProt.kt | 176 +++ .../incoming/decoder/prot/GameClientProtId.kt | 105 ++ .../decoder/codec/camera/CamLookAtDecoder.kt | 32 + .../camera/CamLookAtEasedCoordDecoder.kt | 32 + .../decoder/codec/camera/CamModeDecoder.kt | 24 + .../codec/camera/CamMoveToArcDecoder.kt | 38 + .../codec/camera/CamMoveToCyclesDecoder.kt | 34 + .../decoder/codec/camera/CamMoveToDecoder.kt | 32 + .../decoder/codec/camera/CamResetDecoder.kt | 21 + .../decoder/codec/camera/CamRotateBy.kt | 30 + .../codec/camera/CamRotateToDecoder.kt | 30 + .../decoder/codec/camera/CamShakeDecoder.kt | 30 + .../codec/camera/CamSmoothResetDecoder.kt | 30 + .../codec/camera/CamTargetV3Decoder.kt | 31 + .../decoder/codec/camera/OculusSyncDecoder.kt | 22 + .../codec/clan/ClanChannelDeltaDecoder.kt | 111 ++ .../codec/clan/ClanChannelFullDecoder.kt | 89 ++ .../codec/clan/ClanSettingsDeltaDecoder.kt | 202 ++++ .../codec/clan/ClanSettingsFullDecoder.kt | 176 +++ .../codec/clan/MessageClanChannelDecoder.kt | 37 + .../clan/MessageClanChannelSystemDecoder.kt | 33 + .../decoder/codec/clan/VarClanDecoder.kt | 24 + .../codec/clan/VarClanDisableDecoder.kt | 21 + .../codec/clan/VarClanEnableDecoder.kt | 21 + .../friendchat/MessageFriendChannelDecoder.kt | 38 + .../UpdateFriendChatChannelFullV2Decoder.kt | 54 + ...pdateFriendChatChannelSingleUserDecoder.kt | 41 + .../codec/info/NpcInfoLargeV5Decoder.kt | 28 + .../codec/info/NpcInfoSmallV5Decoder.kt | 28 + .../decoder/codec/info/PlayerInfoDecoder.kt | 22 + .../codec/info/SetNpcUpdateOriginDecoder.kt | 38 + .../codec/info/WorldEntityInfoV6Decoder.kt | 112 ++ .../codec/interfaces/IfClearInvDecoder.kt | 24 + .../codec/interfaces/IfCloseSubDecoder.kt | 26 + .../codec/interfaces/IfMoveSubDecoder.kt | 28 + .../codec/interfaces/IfOpenSubDecoder.kt | 28 + .../codec/interfaces/IfOpenTopDecoder.kt | 22 + .../codec/interfaces/IfResyncV2Decoder.kt | 64 + .../codec/interfaces/IfSetAngleDecoder.kt | 30 + .../codec/interfaces/IfSetAnimDecoder.kt | 26 + .../codec/interfaces/IfSetColourDecoder.kt | 26 + .../codec/interfaces/IfSetEventsV2Decoder.kt | 32 + .../codec/interfaces/IfSetHideDecoder.kt | 26 + .../codec/interfaces/IfSetModelDecoder.kt | 26 + .../interfaces/IfSetNpcHeadActiveDecoder.kt | 26 + .../codec/interfaces/IfSetNpcHeadDecoder.kt | 26 + .../codec/interfaces/IfSetObjectDecoder.kt | 28 + .../interfaces/IfSetPlayerHeadDecoder.kt | 24 + .../IfSetPlayerModelBaseColourDecoder.kt | 28 + .../IfSetPlayerModelBodyTypeDecoder.kt | 26 + .../interfaces/IfSetPlayerModelObjDecoder.kt | 26 + .../interfaces/IfSetPlayerModelSelfDecoder.kt | 26 + .../codec/interfaces/IfSetPositionDecoder.kt | 28 + .../interfaces/IfSetRotateSpeedDecoder.kt | 28 + .../codec/interfaces/IfSetScrollPosDecoder.kt | 26 + .../codec/interfaces/IfSetTextDecoder.kt | 26 + .../decoder/codec/inv/UpdateInvFullDecoder.kt | 39 + .../codec/inv/UpdateInvPartialDecoder.kt | 45 + .../codec/inv/UpdateInvStopTransmitDecoder.kt | 20 + .../decoder/codec/logout/LogoutDecoder.kt | 21 + .../codec/logout/LogoutTransferDecoder.kt | 28 + .../codec/logout/LogoutWithReasonDecoder.kt | 22 + .../decoder/codec/map/RebuildRegionDecoder.kt | 55 + .../codec/map/RebuildWorldEntityV3Decoder.kt | 58 + .../decoder/codec/map/ReconnectDecoder.kt | 45 + .../decoder/codec/map/StaticRebuildDecoder.kt | 151 +++ .../codec/misc/client/HideLocOpsDecoder.kt | 22 + .../codec/misc/client/HideNpcOpsDecoder.kt | 22 + .../codec/misc/client/HideObjOpsDecoder.kt | 22 + .../codec/misc/client/HintArrowDecoder.kt | 55 + .../codec/misc/client/HiscoreReplyDecoder.kt | 78 ++ .../codec/misc/client/MinimapToggleDecoder.kt | 22 + .../misc/client/PacketGroupEndDecoder.kt | 21 + .../misc/client/PacketGroupStartDecoder.kt | 26 + .../misc/client/ReflectionCheckerDecoder.kt | 123 ++ .../codec/misc/client/ResetAnimsDecoder.kt | 21 + .../client/ResetInteractionModeDecoder.kt | 24 + .../codec/misc/client/SendPingDecoder.kt | 26 + .../codec/misc/client/ServerTickEndDecoder.kt | 21 + .../misc/client/SetHeatmapEnabledDecoder.kt | 22 + .../misc/client/SetInteractionModeDecoder.kt | 28 + .../codec/misc/client/SiteSettingsDecoder.kt | 24 + .../misc/client/UpdateRebootTimerDecoder.kt | 22 + .../codec/misc/client/UpdateUid192Decoder.kt | 31 + .../codec/misc/client/UrlOpenDecoder.kt | 26 + .../decoder/codec/misc/client/ZBufDecoder.kt | 22 + .../codec/misc/player/AccountFlagsDecoder.kt | 24 + .../misc/player/ChatFilterSettingsDecoder.kt | 24 + .../ChatFilterSettingsPrivateChatDecoder.kt | 24 + .../codec/misc/player/MessageGameDecoder.kt | 40 + .../misc/player/RunClientScriptDecoder.kt | 55 + .../codec/misc/player/SetMapFlagDecoder.kt | 26 + .../codec/misc/player/SetPlayerOpDecoder.kt | 26 + .../player/TriggerOnDialogAbortDecoder.kt | 21 + .../misc/player/UpdateRunEnergyDecoder.kt | 24 + .../misc/player/UpdateRunWeightDecoder.kt | 24 + .../codec/misc/player/UpdateStatV2Decoder.kt | 28 + .../player/UpdateStockMarketSlotDecoder.kt | 47 + .../misc/player/UpdateTradingPostDecoder.kt | 57 + .../codec/social/FriendListLoadedDecoder.kt | 21 + .../codec/social/MessagePrivateDecoder.kt | 35 + .../codec/social/MessagePrivateEchoDecoder.kt | 29 + .../codec/social/UpdateFriendListDecoder.kt | 64 + .../codec/social/UpdateIgnoreListDecoder.kt | 47 + .../decoder/codec/sound/MidiJingleDecoder.kt | 24 + .../codec/sound/MidiSongStopDecoder.kt | 24 + .../decoder/codec/sound/MidiSongV2Decoder.kt | 30 + .../sound/MidiSongWithSecondaryDecoder.kt | 32 + .../decoder/codec/sound/MidiSwapDecoder.kt | 28 + .../decoder/codec/sound/SynthSoundDecoder.kt | 28 + .../codec/specific/LocAnimSpecificDecoder.kt | 28 + .../codec/specific/MapAnimSpecificDecoder.kt | 29 + .../codec/specific/NpcAnimSpecificDecoder.kt | 26 + .../specific/NpcHeadIconSpecificDecoder.kt | 28 + .../specific/NpcSpotAnimSpecificDecoder.kt | 31 + .../codec/specific/ObjAddSpecificDecoder.kt | 38 + .../codec/specific/ObjCountSpecificDecoder.kt | 29 + .../specific/ObjCustomiseSpecificDecoder.kt | 37 + .../codec/specific/ObjDelSpecificDecoder.kt | 27 + .../specific/ObjEnabledOpsSpecificDecoder.kt | 28 + .../specific/ObjUncustomiseSpecificDecoder.kt | 27 + .../specific/PlayerAnimSpecificDecoder.kt | 24 + .../specific/PlayerSpotAnimSpecificDecoder.kt | 31 + .../specific/ProjAnimSpecificV4Decoder.kt | 43 + .../codec/unknown/UnknownStringDecoder.kt | 22 + .../decoder/codec/varp/VarpLargeDecoder.kt | 24 + .../decoder/codec/varp/VarpResetDecoder.kt | 21 + .../decoder/codec/varp/VarpSmallDecoder.kt | 24 + .../decoder/codec/varp/VarpSyncDecoder.kt | 21 + .../worldentity/SetActiveWorldV2Decoder.kt | 32 + .../header/UpdateZoneFullFollowsDecoder.kt | 26 + .../UpdateZonePartialEnclosedDecoder.kt | 67 ++ .../header/UpdateZonePartialFollowsDecoder.kt | 26 + .../zone/payload/LocAddChangeV2Decoder.kt | 45 + .../codec/zone/payload/LocAnimDecoder.kt | 28 + .../codec/zone/payload/LocDelDecoder.kt | 26 + .../codec/zone/payload/LocMergeDecoder.kt | 42 + .../codec/zone/payload/MapAnimDecoder.kt | 29 + .../zone/payload/MapProjAnimV2Decoder.kt | 44 + .../codec/zone/payload/ObjAddDecoder.kt | 38 + .../codec/zone/payload/ObjCountDecoder.kt | 29 + .../codec/zone/payload/ObjCustomiseDecoder.kt | 38 + .../codec/zone/payload/ObjDelDecoder.kt | 27 + .../zone/payload/ObjEnabledOpsDecoder.kt | 28 + .../zone/payload/ObjUncustomiseDecoder.kt | 28 + .../codec/zone/payload/SoundAreaDecoder.kt | 33 + .../outgoing/decoder/prot/GameServerProt.kt | 200 +++ .../outgoing/decoder/prot/GameServerProtId.kt | 139 +++ .../prot/ServerMessageDecoderRepository.kt | 310 +++++ .../model/info/npcinfo/NpcInfoClient.kt | 881 ++++++++++++++ .../model/info/playerinfo/PlayerInfoClient.kt | 1070 +++++++++++++++++ .../worldentityinfo/WorldEntityInfoClient.kt | 511 ++++++++ 252 files changed, 11640 insertions(+) create mode 100644 protocol/osrs-236/build.gradle.kts create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ClientPacketDecoderServiceV236.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameClientProtProviderV236.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameServerProtProviderV236.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ServerPacketDecoderServiceV236.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/If1ButtonDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonXDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfSubOpDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsAddBannedFromChannelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsSetMutedFromChannelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelFullRequestDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelKickUserDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanSettingsFullRequestDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventAppletFocusDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventKeyboardDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseClickV1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseClickV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseMoveDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseScrollDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventNativeMouseMoveDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatJoinLeaveDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatKickDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePrivateDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePublicDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ConnectionTelemetryDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/DetectModifiedClientDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/IdleDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MapBuildCompleteDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MembershipPromotionEligibilityDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/NoTimeoutDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/RSevenStatusDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ReflectionCheckReplyDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SoundJingleEndDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/WindowStatusDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/BugReportDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClientCheatDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/CloseModalDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/HiscoreRequestDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/OculusLeaveDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SendSnapshotDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetChatFilterSettingsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetHeadingDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePCountDialogDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePNameDialogDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePObjDialogDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePStringDialogDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListAddDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListDelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListAddDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListDelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/ClientMessageDecoderRepository.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProt.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamModeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamResetDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateBy.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateToDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamShakeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamSmoothResetDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamTargetV3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/OculusSyncDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelDeltaDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelFullDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsDeltaDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsFullDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelSystemDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDisableDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanEnableDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/MessageFriendChannelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/UpdateFriendChatChannelFullV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/UpdateFriendChatChannelSingleUserDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoLargeV5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoSmallV5Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/PlayerInfoDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/SetNpcUpdateOriginDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV6Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfClearInvDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfCloseSubDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfResyncV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAngleDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBodyTypeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelObjDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelSelfDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPositionDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetTextDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvPartialDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutTransferDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutWithReasonDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/RebuildRegionDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/RebuildWorldEntityV3Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/ReconnectDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/StaticRebuildDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideLocOpsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideNpcOpsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideObjOpsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HintArrowDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HiscoreReplyDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/MinimapToggleDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupEndDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupStartDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ReflectionCheckerDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetAnimsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetInteractionModeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SendPingDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ServerTickEndDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetHeatmapEnabledDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetInteractionModeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SiteSettingsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateUid192Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UrlOpenDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ZBufDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/AccountFlagsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsPrivateChatDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/MessageGameDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/RunClientScriptDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetPlayerOpDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/TriggerOnDialogAbortDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunEnergyDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunWeightDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStockMarketSlotDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateTradingPostDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/FriendListLoadedDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateEchoDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateFriendListDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateIgnoreListDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSwapDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/SynthSoundDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcSpotAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjAddSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjDelSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjUncustomiseSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerSpotAnimSpecificDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ProjAnimSpecificV4Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/unknown/UnknownStringDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpLargeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpResetDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSyncDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/worldentity/SetActiveWorldV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialEnclosedDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAddChangeV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAnimDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt diff --git a/protocol/osrs-236/build.gradle.kts b/protocol/osrs-236/build.gradle.kts new file mode 100644 index 00000000..f47018b2 --- /dev/null +++ b/protocol/osrs-236/build.gradle.kts @@ -0,0 +1,14 @@ +dependencies { + implementation(platform(rootProject.libs.netty.bom)) + implementation(rootProject.libs.netty.buffer) + implementation(rootProject.libs.netty.transport) + implementation(rootProject.libs.netty.handler) + implementation(rootProject.libs.rsprot.buffer) + implementation(rootProject.libs.rsprot.compression) + implementation(rootProject.libs.rsprot.protocol) + implementation(rootProject.libs.rsprot.crypto) + implementation(platform(rootProject.libs.log4j.bom)) + implementation(rootProject.libs.bundles.log4j) + implementation(projects.protocol) + implementation(projects.cache.cacheApi) +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ClientPacketDecoderServiceV236.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ClientPacketDecoderServiceV236.kt new file mode 100644 index 00000000..ef6dfd53 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ClientPacketDecoderServiceV236.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236 + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.message.IncomingMessage +import net.rsprox.protocol.ClientPacketDecoder +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.ClientMessageDecoderRepository + +public class ClientPacketDecoderServiceV236( + huffmanCodec: HuffmanCodec, +) : ClientPacketDecoder { + @OptIn(ExperimentalStdlibApi::class) + private val repository = ClientMessageDecoderRepository.build(huffmanCodec) + + override fun decode( + opcode: Int, + payload: JagByteBuf, + session: Session, + ): IncomingMessage { + return repository + .getDecoder(opcode) + .decode(payload, session) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameClientProtProviderV236.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameClientProtProviderV236.kt new file mode 100644 index 00000000..4a222a0c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameClientProtProviderV236.kt @@ -0,0 +1,16 @@ +package net.rsprox.protocol.v236 + +import net.rsprox.protocol.ProtProvider +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt +import kotlin.enums.EnumEntries + +public data object GameClientProtProviderV236 : ProtProvider { + override fun get(opcode: Int): GameClientProt { + return GameClientProt.entries.firstOrNull { it.opcode == opcode } + ?: throw IllegalArgumentException("Unknown game client prot: $opcode") + } + + override fun allProts(): EnumEntries { + return GameClientProt.entries + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameServerProtProviderV236.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameServerProtProviderV236.kt new file mode 100644 index 00000000..11368b93 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/GameServerProtProviderV236.kt @@ -0,0 +1,16 @@ +package net.rsprox.protocol.v236 + +import net.rsprox.protocol.ProtProvider +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt +import kotlin.enums.EnumEntries + +public data object GameServerProtProviderV236 : ProtProvider { + override fun get(opcode: Int): GameServerProt { + return GameServerProt.entries.firstOrNull { it.opcode == opcode } + ?: throw IllegalArgumentException("Unknown game server prot: $opcode") + } + + override fun allProts(): EnumEntries { + return GameServerProt.entries + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ServerPacketDecoderServiceV236.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ServerPacketDecoderServiceV236.kt new file mode 100644 index 00000000..3ca27072 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/ServerPacketDecoderServiceV236.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236 + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.message.IncomingMessage +import net.rsprox.cache.api.CacheProvider +import net.rsprox.protocol.ServerPacketDecoder +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.ServerMessageDecoderRepository + +public class ServerPacketDecoderServiceV236( + huffmanCodec: HuffmanCodec, + cache: CacheProvider, +) : ServerPacketDecoder { + @OptIn(ExperimentalStdlibApi::class) + private val repository = + ServerMessageDecoderRepository.build( + huffmanCodec, + cache, + ) + + override fun decode( + opcode: Int, + payload: JagByteBuf, + session: Session, + ): IncomingMessage { + return repository + .getDecoder(opcode) + .decode(payload, session) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/If1ButtonDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/If1ButtonDecoder.kt new file mode 100644 index 00000000..18ac5fd8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/If1ButtonDecoder.kt @@ -0,0 +1,23 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.If1Button +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class If1ButtonDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_BUTTON + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): If1Button { + val combinedId = buffer.gCombinedId() + return If1Button(combinedId) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt new file mode 100644 index 00000000..a02c2b57 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt @@ -0,0 +1,34 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.IfButtonD +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class IfButtonDDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_BUTTOND + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfButtonD { + val targetObj = buffer.g2Alt1() + val targetCombinedId = buffer.gCombinedIdAlt1() + val selectedObj = buffer.g2() + val selectedSub = buffer.g2Alt2() + val selectedCombinedId = buffer.gCombinedIdAlt2() + val targetSub = buffer.g2Alt1() + return IfButtonD( + selectedCombinedId, + selectedSub, + selectedObj, + targetCombinedId, + targetSub, + targetObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt new file mode 100644 index 00000000..0c7347c0 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.IfButtonT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class IfButtonTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_BUTTONT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfButtonT { + val targetCombinedId = buffer.gCombinedIdAlt3() + val selectedSub = buffer.g2Alt2() + val targetSub = buffer.g2Alt1() + val selectedObj = buffer.g2Alt1() + val selectedCombinedId = buffer.gCombinedIdAlt3() + val targetObj = buffer.g2Alt3() + return IfButtonT( + selectedCombinedId, + selectedSub, + selectedObj, + targetCombinedId, + targetSub, + targetObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonXDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonXDecoder.kt new file mode 100644 index 00000000..dbe3f9d6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonXDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.If3Button +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class IfButtonXDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_BUTTONX + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): If3Button { + val combinedId = buffer.gCombinedId() + val sub = buffer.g2() + val obj = buffer.g2() + val op = buffer.g1() + return If3Button( + combinedId, + sub, + obj, + op, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt new file mode 100644 index 00000000..e794c3c3 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt @@ -0,0 +1,34 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.extensions.toByteArray +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.IfRunScript +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class IfRunScriptDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_RUNSCRIPT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfRunScript { + // Function is method(int combinedId, int sub, int obj, int script, Object[] args) + // The order of argument does not seem to change (based on two revisions) + val script = buffer.g4Alt1() + val sub = buffer.g2Alt1() + val combinedId = buffer.gCombinedIdAlt1() + val obj = buffer.g2Alt1() + val bytes = buffer.buffer.toByteArray() + return IfRunScript( + combinedId, + sub, + obj, + script, + bytes, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfSubOpDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfSubOpDecoder.kt new file mode 100644 index 00000000..fff73e51 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfSubOpDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.buttons.IfSubOp +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class IfSubOpDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_SUBOP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSubOp { + val combinedId = buffer.gCombinedId() + val sub = buffer.g2() + val obj = buffer.g2() + val op = buffer.g1() + val subop = buffer.g1() + return IfSubOp( + combinedId, + sub, + obj, + op, + subop, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsAddBannedFromChannelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsAddBannedFromChannelDecoder.kt new file mode 100644 index 00000000..af4dae91 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsAddBannedFromChannelDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.clan.AffinedClanSettingsAddBannedFromChannel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class AffinedClanSettingsAddBannedFromChannelDecoder : + ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): AffinedClanSettingsAddBannedFromChannel { + val clanId = buffer.g1() + val memberIndex = buffer.g2() + val name = buffer.gjstr() + return AffinedClanSettingsAddBannedFromChannel( + name, + clanId, + memberIndex, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsSetMutedFromChannelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsSetMutedFromChannelDecoder.kt new file mode 100644 index 00000000..6707a524 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/AffinedClanSettingsSetMutedFromChannelDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.clan.AffinedClanSettingsSetMutedFromChannel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class AffinedClanSettingsSetMutedFromChannelDecoder : + ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): AffinedClanSettingsSetMutedFromChannel { + val clanId = buffer.g1() + val memberIndex = buffer.g2() + val muted = buffer.g1() == 1 + val name = buffer.gjstr() + return AffinedClanSettingsSetMutedFromChannel( + name, + clanId, + memberIndex, + muted, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelFullRequestDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelFullRequestDecoder.kt new file mode 100644 index 00000000..6ac2e943 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelFullRequestDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.clan.ClanChannelFullRequest +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ClanChannelFullRequestDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLANCHANNEL_FULL_REQUEST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanChannelFullRequest { + val clanId = buffer.g1s() + return ClanChannelFullRequest(clanId) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelKickUserDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelKickUserDecoder.kt new file mode 100644 index 00000000..b7de963f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanChannelKickUserDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.clan.ClanChannelKickUser +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ClanChannelKickUserDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLANCHANNEL_KICKUSER + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanChannelKickUser { + val clanId = buffer.g1() + val memberIndex = buffer.g2() + val name = buffer.gjstr() + return ClanChannelKickUser( + name, + clanId, + memberIndex, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanSettingsFullRequestDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanSettingsFullRequestDecoder.kt new file mode 100644 index 00000000..3ab887e6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/clan/ClanSettingsFullRequestDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.clan.ClanSettingsFullRequest +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ClanSettingsFullRequestDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLANSETTINGS_FULL_REQUEST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanSettingsFullRequest { + val clanId = buffer.g1s() + return ClanSettingsFullRequest(clanId) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventAppletFocusDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventAppletFocusDecoder.kt new file mode 100644 index 00000000..9ae85959 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventAppletFocusDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventAppletFocus +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class EventAppletFocusDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_APPLET_FOCUS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventAppletFocus { + val inFocus = buffer.g1() == 1 + return EventAppletFocus(inFocus) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt new file mode 100644 index 00000000..118dce5d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventCameraPosition +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class EventCameraPositionDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_CAMERA_POSITION + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventCameraPosition { + val angleY = buffer.g2() + val angleX = buffer.g2Alt3() + return EventCameraPosition( + angleX, + angleY, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventKeyboardDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventKeyboardDecoder.kt new file mode 100644 index 00000000..6614ba6f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventKeyboardDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventKeyboard +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class EventKeyboardDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_KEYBOARD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventKeyboard { + val count = buffer.readableBytes() / 4 + val keys = ByteArray(count) + var lastTransmittedKeyPress: Int = -1 + for (i in 0.. { + override val prot: ClientProt = GameClientProt.EVENT_MOUSE_CLICK_V1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventMouseClickV1 { + val packed = buffer.g2() + val rightClick = packed and 0x1 != 0 + val lastTransmittedMouseClick = packed ushr 1 + val x = buffer.g2() + val y = buffer.g2() + return EventMouseClickV1( + lastTransmittedMouseClick, + rightClick, + x, + y, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseClickV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseClickV2Decoder.kt new file mode 100644 index 00000000..ab7afa2a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseClickV2Decoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventMouseClickV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class EventMouseClickV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_MOUSE_CLICK_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventMouseClickV2 { + val x = buffer.g2() + val y = buffer.g2() + val code = buffer.g1Alt1() + val packed = buffer.g2Alt2() + val rightClick = packed and 0x1 != 0 + val lastTransmittedMouseClick = packed ushr 1 + return EventMouseClickV2( + lastTransmittedMouseClick, + code, + rightClick, + x, + y, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseMoveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseMoveDecoder.kt new file mode 100644 index 00000000..62b64bc6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseMoveDecoder.kt @@ -0,0 +1,96 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventMouseMove +import net.rsprox.protocol.game.incoming.model.events.util.MouseMovements +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Suppress("DuplicatedCode") +@Consistent +public class EventMouseMoveDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_MOUSE_MOVE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventMouseMove { + val stepExcess = buffer.g1() + val endExcess = buffer.g1() + val array = threadLocalArray.get() + var count = 0 + while (buffer.isReadable) { + var packed = buffer.g1() + var x: Int + var y: Int + var timeSinceLastMovement: Int + var delta: Boolean + if (packed and 0xE0 == 0xE0) { + timeSinceLastMovement = packed and 0x1f shl 8 or buffer.g1() + val packed = buffer.g4() + if (packed == Int.MIN_VALUE) { + x = -1 + y = -1 + } else { + x = packed and 0xFFFF + y = packed ushr 16 and 0xFFFF + } + delta = false + } else if (packed and 0xC0 == 0xC0) { + timeSinceLastMovement = packed and 0x3f + + val packed = buffer.g4() + if (packed == Int.MIN_VALUE) { + x = -1 + y = -1 + } else { + x = packed and 0xFFFF + y = packed ushr 16 and 0xFFFF + } + delta = false + } else if (packed and 0x80 == 0x80) { + timeSinceLastMovement = packed and 0x7f + x = buffer.g1() - 128 + y = buffer.g1() - 128 + delta = true + } else { + packed = (packed shl 8) or (buffer.g1()) + timeSinceLastMovement = (packed ushr 12) and 0x7 + x = ((packed shr 6) and 0x3F) - 32 + y = (packed and 0x3F) - 32 + delta = true + } + val change = + MouseMovements.MousePosChange.pack( + timeSinceLastMovement, + x, + y, + delta, + ) + array[count++] = change + } + val slice = array.copyOf(count) + return EventMouseMove( + stepExcess, + endExcess, + MouseMovements(slice), + ) + } + + private companion object { + /** + * Utilizing a thread-local initial long array, as the number of + * mouse movements is unknown (relies on remaining bytes in buffer, + * which in turn uses compression methods so each entry can be 2-4 bytes). + * As Netty's threads decode this, a thread-local implementation is + * perfectly safe to utilize, and will save us some memory in return. + */ + private val threadLocalArray = + ThreadLocal.withInitial { + LongArray(128) + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseScrollDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseScrollDecoder.kt new file mode 100644 index 00000000..4a4f8ec6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventMouseScrollDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventMouseScroll +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class EventMouseScrollDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_MOUSE_SCROLL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventMouseScroll { + val rotation = buffer.g2s() + return EventMouseScroll(rotation) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventNativeMouseMoveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventNativeMouseMoveDecoder.kt new file mode 100644 index 00000000..ddecfe71 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventNativeMouseMoveDecoder.kt @@ -0,0 +1,93 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.events + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.events.EventNativeMouseMove +import net.rsprox.protocol.game.incoming.model.events.util.MouseMovements +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Suppress("DuplicatedCode") +@Consistent +public class EventNativeMouseMoveDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.EVENT_NATIVE_MOUSE_MOVE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): EventNativeMouseMove { + val stepExcess = buffer.g1() + val endExcess = buffer.g1() + val array = threadLocalArray.get() + var count = 0 + while (buffer.isReadable) { + var packed = buffer.g1() + var x: Int + var y: Int + var timeSinceLastMovement: Int + var delta: Boolean + if (packed and 0xE0 == 0xE0) { + timeSinceLastMovement = packed and 0x1f shl 8 or buffer.g1() + y = buffer.g2s() + x = buffer.g2s() + delta = false + if (x == 0 && y == -0x8000) { + x = -1 + y = -1 + } + } else if (packed and 0xC0 == 0xC0) { + timeSinceLastMovement = packed and 0x3f + y = buffer.g2s() + x = buffer.g2s() + delta = false + if (x == 0 && y == -0x8000) { + x = -1 + y = -1 + } + } else if (packed and 0x80 == 0x80) { + timeSinceLastMovement = packed and 0x7f + x = buffer.g1() - 128 + y = buffer.g1() - 128 + delta = true + } else { + packed = (packed shl 8) or (buffer.g1()) + timeSinceLastMovement = (packed ushr 12) and 0x7 + x = ((packed shr 6) and 0x3F) - 32 + y = (packed and 0x3F) - 32 + delta = true + } + val lastMouseButton = buffer.g1() + val change = + MouseMovements.MousePosChange.pack( + timeSinceLastMovement, + x, + y, + delta, + lastMouseButton, + ) + array[count++] = change + } + val slice = array.copyOf(count) + return EventNativeMouseMove( + stepExcess, + endExcess, + MouseMovements(slice), + ) + } + + private companion object { + /** + * Utilizing a thread-local initial long array, as the number of + * mouse movements is unknown (relies on remaining bytes in buffer, + * which in turn uses compression methods so each entry can be 2-4 bytes). + * As Netty's threads decode this, a thread-local implementation is + * perfectly safe to utilize, and will save us some memory in return. + */ + private val threadLocalArray = + ThreadLocal.withInitial { + LongArray(128) + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatJoinLeaveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatJoinLeaveDecoder.kt new file mode 100644 index 00000000..1dde837d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatJoinLeaveDecoder.kt @@ -0,0 +1,27 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.friendchat.FriendChatJoinLeave +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class FriendChatJoinLeaveDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.FRIENDCHAT_JOIN_LEAVE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendChatJoinLeave { + val name = + if (!buffer.isReadable) { + null + } else { + buffer.gjstr() + } + return FriendChatJoinLeave(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatKickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatKickDecoder.kt new file mode 100644 index 00000000..218b4454 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatKickDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.friendchat.FriendChatKick +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class FriendChatKickDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.FRIENDCHAT_KICK + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendChatKick { + val name = buffer.gjstr() + return FriendChatKick(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt new file mode 100644 index 00000000..44c7bf78 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.friendchat.FriendChatSetRank +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class FriendChatSetRankDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.FRIENDCHAT_SETRANK + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendChatSetRank { + val rank = buffer.g1Alt3() + val name = buffer.gjstr() + return FriendChatSetRank( + name, + rank, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt new file mode 100644 index 00000000..9d1e6611 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc { + val x = buffer.g2Alt2() + val z = buffer.g2Alt1() + val controlKey = buffer.g1Alt2() == 1 + val id = buffer.g2Alt3() + return OpLoc( + id, + x, + z, + controlKey, + 1, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt new file mode 100644 index 00000000..56c27005 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc { + val x = buffer.g2Alt3() + val z = buffer.g2Alt3() + val controlKey = buffer.g1Alt3() == 1 + val id = buffer.g2() + return OpLoc( + id, + x, + z, + controlKey, + 2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt new file mode 100644 index 00000000..e1c4fa68 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc { + val z = buffer.g2Alt1() + val id = buffer.g2Alt1() + val x = buffer.g2Alt3() + val controlKey = buffer.g1Alt3() == 1 + return OpLoc( + id, + x, + z, + controlKey, + 3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt new file mode 100644 index 00000000..8e6de63b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc { + val x = buffer.g2Alt2() + val id = buffer.g2Alt1() + val z = buffer.g2Alt2() + val controlKey = buffer.g1Alt2() == 1 + return OpLoc( + id, + x, + z, + controlKey, + 4, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt new file mode 100644 index 00000000..cd827fdd --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc { + val x = buffer.g2() + val controlKey = buffer.g1Alt1() == 1 + val z = buffer.g2Alt2() + val id = buffer.g2Alt2() + return OpLoc( + id, + x, + z, + controlKey, + 5, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc6Decoder.kt new file mode 100644 index 00000000..193ebb1d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc6Decoder.kt @@ -0,0 +1,20 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLoc6 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLoc6Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOC6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLoc6 { + val id = buffer.g2Alt3() + return OpLoc6(id) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt new file mode 100644 index 00000000..bee640b0 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt @@ -0,0 +1,35 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.locs.OpLocT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpLocTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPLOCT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpLocT { + val z = buffer.g2() + val selectedObj = buffer.g2Alt2() + val x = buffer.g2() + val controlKey = buffer.g1() == 1 + val selectedCombinedId = buffer.gCombinedIdAlt1() + val selectedSub = buffer.g2Alt2() + val id = buffer.g2Alt2() + return OpLocT( + id, + x, + z, + controlKey, + selectedCombinedId, + selectedSub, + selectedObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePrivateDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePrivateDecoder.kt new file mode 100644 index 00000000..23d28a26 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePrivateDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.messaging + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.messaging.MessagePrivate +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +internal class MessagePrivateDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MESSAGE_PRIVATE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessagePrivate { + val name = buffer.gjstr() + val message = huffmanCodec.decode(buffer) + return MessagePrivate( + name, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePublicDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePublicDecoder.kt new file mode 100644 index 00000000..b80c2ee7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/messaging/MessagePublicDecoder.kt @@ -0,0 +1,66 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.messaging + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.messaging.MessagePublic +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +internal class MessagePublicDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MESSAGE_PUBLIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessagePublic { + val type = buffer.g1() + val colour = buffer.g1() + val effect = buffer.g1() + val patternArray = + if (colour in 13..20) { + ByteArray(colour - 12) { + buffer.g1().toByte() + } + } else { + null + } + val hasTrailingByte = type == CLAN_MAIN_CHANNEL_TYPE + val huffmanSlice = + if (hasTrailingByte) { + buffer.buffer.readSlice(buffer.readableBytes() - 1) + } else { + buffer.buffer + } + val message = huffmanCodec.decode(huffmanSlice) + val clanType = + if (hasTrailingByte) { + buffer.g1() + } else { + -1 + } + val pattern = + if (patternArray != null) { + MessagePublic.MessageColourPattern(patternArray) + } else { + null + } + return MessagePublic( + type, + colour, + effect, + message, + pattern, + clanType, + ) + } + + private companion object { + private const val CLAN_MAIN_CHANNEL_TYPE: Int = 3 + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ConnectionTelemetryDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ConnectionTelemetryDecoder.kt new file mode 100644 index 00000000..091300f4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ConnectionTelemetryDecoder.kt @@ -0,0 +1,42 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.ConnectionTelemetry +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ConnectionTelemetryDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CONNECTION_TELEMETRY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ConnectionTelemetry { + val connectionLostDuration = buffer.g2() + val loginDuration = buffer.g2() + val unusedDuration = buffer.g2() + check(unusedDuration == 0) { + "Unknown duration detected: $unusedDuration" + } + val clientState = buffer.g2() + val unused1 = buffer.g2() + check(unused1 == 0) { + "Unused1 property value detected: $unused1" + } + val loginCount = buffer.g2() + val unused2 = buffer.g2() + check(unused2 == 0) { + "Unused2 property value detected: $unused2" + } + return ConnectionTelemetry( + connectionLostDuration, + loginDuration, + clientState, + loginCount, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/DetectModifiedClientDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/DetectModifiedClientDecoder.kt new file mode 100644 index 00000000..f08a80b7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/DetectModifiedClientDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.DetectModifiedClient +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class DetectModifiedClientDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.DETECT_MODIFIED_CLIENT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): DetectModifiedClient { + val code = buffer.g4() + return DetectModifiedClient(code) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/IdleDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/IdleDecoder.kt new file mode 100644 index 00000000..40871221 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/IdleDecoder.kt @@ -0,0 +1,19 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.Idle +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class IdleDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IDLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): Idle = Idle +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MapBuildCompleteDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MapBuildCompleteDecoder.kt new file mode 100644 index 00000000..d716c2f5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MapBuildCompleteDecoder.kt @@ -0,0 +1,19 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.MapBuildComplete +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class MapBuildCompleteDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MAP_BUILD_COMPLETE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MapBuildComplete = MapBuildComplete +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MembershipPromotionEligibilityDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MembershipPromotionEligibilityDecoder.kt new file mode 100644 index 00000000..3d636a2d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/MembershipPromotionEligibilityDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.MembershipPromotionEligibility +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class MembershipPromotionEligibilityDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MEMBERSHIP_PROMOTION_ELIGIBILITY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MembershipPromotionEligibility { + val eligibleForIntroductoryPrice = buffer.g1() + val eligibleForTrialPurchase = buffer.g1() + return MembershipPromotionEligibility( + eligibleForIntroductoryPrice, + eligibleForTrialPurchase, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/NoTimeoutDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/NoTimeoutDecoder.kt new file mode 100644 index 00000000..15415855 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/NoTimeoutDecoder.kt @@ -0,0 +1,19 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.NoTimeout +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class NoTimeoutDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.NO_TIMEOUT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NoTimeout = NoTimeout +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/RSevenStatusDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/RSevenStatusDecoder.kt new file mode 100644 index 00000000..3501b20c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/RSevenStatusDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.RSevenStatus +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class RSevenStatusDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RSEVEN_STATUS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): RSevenStatus { + val packed = buffer.g1() + return RSevenStatus(packed) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ReflectionCheckReplyDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ReflectionCheckReplyDecoder.kt new file mode 100644 index 00000000..d386e1c5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/ReflectionCheckReplyDecoder.kt @@ -0,0 +1,135 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.extensions.checkCRC32 +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.ReflectionCheckReply +import net.rsprox.protocol.game.incoming.model.misc.client.ReflectionCheckReply.ErrorResult +import net.rsprox.protocol.reflection.ReflectionCheck +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getReflectionChecks +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt +import java.io.IOException +import java.io.InvalidClassException +import java.io.OptionalDataException +import java.io.StreamCorruptedException +import java.lang.reflect.InvocationTargetException + +@Consistent +internal class ReflectionCheckReplyDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.REFLECTION_CHECK_REPLY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ReflectionCheckReply { + val id = buffer.g4() + val checks = session.getReflectionChecks().remove(id) + checkNotNull(checks) { + "Unable to link reflection check reply to request: $id" + } + val results = ArrayList>(checks.size) + for (check in checks) { + val opcode = buffer.g1s() + if (opcode < 0) { + results += + if (opcode <= -10) { + val throwable = getExecutionThrowableClass(opcode) + ErrorResult( + check, + ErrorResult.ThrowableResultType.ExecutionThrowable(throwable), + ) + } else { + val throwable = getConstructionThrowableClass(opcode) + ErrorResult( + check, + ErrorResult.ThrowableResultType.ConstructionThrowable(throwable), + ) + } + continue + } + when (check) { + is ReflectionCheck.GetFieldValue -> { + val result = buffer.g4() + results += ReflectionCheckReply.GetFieldValueResult(check, result) + } + is ReflectionCheck.SetFieldValue -> { + results += ReflectionCheckReply.SetFieldValueResult(check) + } + is ReflectionCheck.GetFieldModifiers -> { + val modifiers = buffer.g4() + results += ReflectionCheckReply.GetFieldModifiersResult(check, modifiers) + } + is ReflectionCheck.InvokeMethod -> { + results += + when (opcode) { + 0 -> ReflectionCheckReply.InvokeMethodResult(check, ReflectionCheckReply.NullReturnValue) + 1 -> + ReflectionCheckReply.InvokeMethodResult( + check, + ReflectionCheckReply.NumberReturnValue(buffer.g8()), + ) + 2 -> + ReflectionCheckReply.InvokeMethodResult( + check, + ReflectionCheckReply.StringReturnValue(buffer.gjstr()), + ) + 4 -> ReflectionCheckReply.InvokeMethodResult(check, ReflectionCheckReply.UnknownReturnValue) + else -> throw IllegalStateException("Unknown opcode for method invocation: $opcode") + } + } + is ReflectionCheck.GetMethodModifiers -> { + val modifiers = buffer.g4() + results += ReflectionCheckReply.GetMethodModifiersResult(check, modifiers) + } + } + } + buffer.readerIndex(buffer.writerIndex()) + if (!buffer.buffer.checkCRC32()) { + throw IllegalStateException("CRC mismatch!") + } + return ReflectionCheckReply( + id, + results, + ) + } + + /** + * Gets the throwable class corresponding to each opcode during the reflection check execution. + * @param opcode the opcode value + * @return the throwable class corresponding to that opcode + */ + private fun getExecutionThrowableClass(opcode: Int): Class = + when (opcode) { + -10 -> ClassNotFoundException::class.java + -11 -> InvalidClassException::class.java + -12 -> StreamCorruptedException::class.java + -13 -> OptionalDataException::class.java + -14 -> IllegalAccessException::class.java + -15 -> IllegalArgumentException::class.java + -16 -> InvocationTargetException::class.java + -17 -> SecurityException::class.java + -18 -> IOException::class.java + -19 -> NullPointerException::class.java + -20 -> Exception::class.java + -21 -> Throwable::class.java + else -> throw IllegalArgumentException("Unknown execution throwable opcode: $opcode") + } + + /** + * Gets the throwable class corresponding to each opcode during the reflection check construction. + * @param opcode the opcode value + * @return the throwable class corresponding to that opcode + */ + private fun getConstructionThrowableClass(opcode: Int): Class = + when (opcode) { + -1 -> ClassNotFoundException::class.java + -2 -> SecurityException::class.java + -3 -> NullPointerException::class.java + -4 -> Exception::class.java + -5 -> Throwable::class.java + else -> throw IllegalArgumentException("Unknown construction throwable opcode: $opcode") + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt new file mode 100644 index 00000000..7460db43 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.SendPingReply +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class SendPingReplyDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.SEND_PING_REPLY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SendPingReply { + val value1 = buffer.g4Alt1() + val value2 = buffer.g4() + val fps = buffer.g1Alt2() + val gcPercentTime = buffer.g1Alt3() + return SendPingReply( + fps, + gcPercentTime, + value1, + value2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SoundJingleEndDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SoundJingleEndDecoder.kt new file mode 100644 index 00000000..5d717f3d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SoundJingleEndDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.SoundJingleEnd +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class SoundJingleEndDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.SOUND_JINGLEEND + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SoundJingleEnd { + val jingle = buffer.g4() + return SoundJingleEnd(jingle) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/WindowStatusDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/WindowStatusDecoder.kt new file mode 100644 index 00000000..775fcc6e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/WindowStatusDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.client.WindowStatus +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class WindowStatusDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.WINDOW_STATUS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): WindowStatus { + val windowMode = buffer.g1() + val frameWidth = buffer.g2() + val frameHeight = buffer.g2() + return WindowStatus( + windowMode, + frameWidth, + frameHeight, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/BugReportDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/BugReportDecoder.kt new file mode 100644 index 00000000..02687a1e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/BugReportDecoder.kt @@ -0,0 +1,34 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.BugReport +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class BugReportDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.BUG_REPORT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): BugReport { + val description = buffer.gjstr() + val type = buffer.g1Alt3() + val instructions = buffer.gjstr() + check(description.length <= 500) { + "Bug report description length cannot exceed 500 characters." + } + check(instructions.length <= 500) { + "Bug report instructions length cannot exceed 500 characters." + } + return BugReport( + type, + description, + instructions, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt new file mode 100644 index 00000000..0cfae719 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.incoming.model.misc.user.ClickWorldMap +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class ClickWorldMapDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLICKWORLDMAP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClickWorldMap { + val packed = buffer.g4Alt3() + return ClickWorldMap(CoordGrid(packed)) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClientCheatDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClientCheatDecoder.kt new file mode 100644 index 00000000..e7ae381d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClientCheatDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.ClientCheat +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ClientCheatDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLIENT_CHEAT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClientCheat { + val command = buffer.gjstr() + return ClientCheat(command) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/CloseModalDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/CloseModalDecoder.kt new file mode 100644 index 00000000..588d545a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/CloseModalDecoder.kt @@ -0,0 +1,19 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.CloseModal +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class CloseModalDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.CLOSE_MODAL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CloseModal = CloseModal +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/HiscoreRequestDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/HiscoreRequestDecoder.kt new file mode 100644 index 00000000..76bcc646 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/HiscoreRequestDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.HiscoreRequest +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class HiscoreRequestDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.HISCORE_REQUEST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HiscoreRequest { + val requestId = buffer.g1() + val type = buffer.g1() + val name = buffer.gjstr() + return HiscoreRequest( + type, + requestId, + name, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt new file mode 100644 index 00000000..7eaf61f9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.IfCrmViewClick +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class IfCrmViewClickDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IF_CRMVIEW_CLICK + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfCrmViewClick { + val serverTarget = buffer.g4Alt1() + val sub = buffer.g2Alt1() + val behaviour3 = buffer.g4Alt3() + val behaviour2 = buffer.g4Alt1() + val behaviour1 = buffer.g4Alt3() + val combinedId = buffer.gCombinedIdAlt1() + return IfCrmViewClick( + serverTarget, + combinedId, + sub, + behaviour1, + behaviour2, + behaviour3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt new file mode 100644 index 00000000..0ef32128 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.MoveGameClick +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class MoveGameClickDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MOVE_GAMECLICK + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MoveGameClick { + val keyCombination = buffer.g1Alt3() + val z = buffer.g2Alt3() + val x = buffer.g2Alt3() + return MoveGameClick( + x, + z, + keyCombination, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt new file mode 100644 index 00000000..cbbec660 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt @@ -0,0 +1,59 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.MoveMinimapClick +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class MoveMinimapClickDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.MOVE_MINIMAPCLICK + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MoveMinimapClick { + // The x, z and keyCombination get scrambled between revisions + val keyCombination = buffer.g1Alt3() + val z = buffer.g2Alt3() + val x = buffer.g2Alt3() + + // The arguments below are consistent across revisions + val minimapWidth = buffer.g1() + val minimapHeight = buffer.g1() + val cameraAngleY = buffer.g2() + val checkpoint1 = buffer.g1() + check(checkpoint1 == 57) { + "Invalid checkpoint 1: $checkpoint1" + } + val checkpoint2 = buffer.g1() + check(checkpoint2 == 0) { + "Invalid checkpoint 2: $checkpoint2" + } + val checkpoint3 = buffer.g1() + check(checkpoint3 == 0) { + "Invalid checkpoint 3: $checkpoint3" + } + val checkpoint4 = buffer.g1() + check(checkpoint4 == 89) { + "Invalid checkpoint 4: $checkpoint4" + } + val fineX = buffer.g2() + val fineZ = buffer.g2() + val checkpoint5 = buffer.g1() + check(checkpoint5 == 63) { + "Invalid checkpoint 5: $checkpoint5" + } + return MoveMinimapClick( + x, + z, + keyCombination, + minimapWidth, + minimapHeight, + cameraAngleY, + fineX, + fineZ, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/OculusLeaveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/OculusLeaveDecoder.kt new file mode 100644 index 00000000..f3a9046f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/OculusLeaveDecoder.kt @@ -0,0 +1,19 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.OculusLeave +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class OculusLeaveDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OCULUS_LEAVE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OculusLeave = OculusLeave +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SendSnapshotDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SendSnapshotDecoder.kt new file mode 100644 index 00000000..9365fdea --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SendSnapshotDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.SendSnapshot +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class SendSnapshotDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.SEND_SNAPSHOT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SendSnapshot { + val name = buffer.gjstr() + val ruleId = buffer.g1() + val mute = buffer.g1() == 1 + return SendSnapshot( + name, + ruleId, + mute, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetChatFilterSettingsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetChatFilterSettingsDecoder.kt new file mode 100644 index 00000000..42eba6d6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetChatFilterSettingsDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.SetChatFilterSettings +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class SetChatFilterSettingsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.SET_CHATFILTERSETTINGS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetChatFilterSettings { + val publicChatFilter = buffer.g1() + val privateChatFilter = buffer.g1() + val tradeChatFilter = buffer.g1() + return SetChatFilterSettings( + publicChatFilter, + privateChatFilter, + tradeChatFilter, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetHeadingDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetHeadingDecoder.kt new file mode 100644 index 00000000..e75b0293 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/SetHeadingDecoder.kt @@ -0,0 +1,20 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.SetHeading +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class SetHeadingDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.SET_HEADING + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetHeading { + val heading = buffer.g1Alt1() + return SetHeading(heading) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt new file mode 100644 index 00000000..185013d2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.misc.user.Teleport +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class TeleportDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.TELEPORT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): Teleport { + val x = buffer.g2Alt3() + val z = buffer.g2Alt2() + val oculusSyncValue = buffer.g4Alt2() + val level = buffer.g1Alt1() + return Teleport( + oculusSyncValue, + x, + z, + level, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt new file mode 100644 index 00000000..801806e3 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc { + val controlKey = buffer.g1Alt1() == 1 + val index = buffer.g2Alt1() + return OpNpc( + index, + controlKey, + 1, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc2Decoder.kt new file mode 100644 index 00000000..b396deda --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc2Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc { + val index = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 + return OpNpc( + index, + controlKey, + 2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt new file mode 100644 index 00000000..80e28d08 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc { + val controlKey = buffer.g1() == 1 + val index = buffer.g2Alt1() + return OpNpc( + index, + controlKey, + 3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt new file mode 100644 index 00000000..79851e46 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc { + val index = buffer.g2Alt3() + val controlKey = buffer.g1() == 1 + return OpNpc( + index, + controlKey, + 4, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt new file mode 100644 index 00000000..a399549f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc { + val index = buffer.g2Alt2() + val controlKey = buffer.g1Alt2() == 1 + return OpNpc( + index, + controlKey, + 5, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt new file mode 100644 index 00000000..10b521f3 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt @@ -0,0 +1,20 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpc6 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpc6Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPC6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpc6 { + val id = buffer.g2Alt2() + return OpNpc6(id) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt new file mode 100644 index 00000000..d94d357b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.npcs.OpNpcT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpNpcTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPNPCT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpNpcT { + val selectedObj = buffer.g2Alt3() + val selectedCombinedId = buffer.gCombinedIdAlt3() + val selectedSub = buffer.g2Alt1() + val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2Alt3() + return OpNpcT( + index, + controlKey, + selectedCombinedId, + selectedSub, + selectedObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt new file mode 100644 index 00000000..80f59a1d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj { + val controlKey = buffer.g1Alt3() == 1 + val x = buffer.g2Alt2() + val z = buffer.g2() + val id = buffer.g2Alt2() + return OpObj( + id, + x, + z, + controlKey, + 1, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt new file mode 100644 index 00000000..b22237b2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj { + val z = buffer.g2Alt3() + val x = buffer.g2() + val controlKey = buffer.g1Alt1() == 1 + val id = buffer.g2Alt3() + return OpObj( + id, + x, + z, + controlKey, + 2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt new file mode 100644 index 00000000..aebe315f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj { + val x = buffer.g2Alt2() + val controlKey = buffer.g1Alt2() == 1 + val id = buffer.g2Alt3() + val z = buffer.g2Alt1() + return OpObj( + id, + x, + z, + controlKey, + 3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt new file mode 100644 index 00000000..18164ecc --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj { + val z = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 + val id = buffer.g2() + val x = buffer.g2Alt3() + return OpObj( + id, + x, + z, + controlKey, + 4, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt new file mode 100644 index 00000000..59f81800 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj { + val id = buffer.g2Alt1() + val x = buffer.g2Alt3() + val z = buffer.g2Alt2() + val controlKey = buffer.g1Alt3() == 1 + return OpObj( + id, + x, + z, + controlKey, + 5, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt new file mode 100644 index 00000000..26199e9a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObj6 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObj6Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJ6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObj6 { + val id = buffer.g2() + val z = buffer.g2Alt1() + val x = buffer.g2Alt1() + return OpObj6( + id, + x, + z, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt new file mode 100644 index 00000000..860fc839 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt @@ -0,0 +1,35 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.objs.OpObjT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpObjTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPOBJT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpObjT { + val x = buffer.g2Alt3() + val controlKey = buffer.g1Alt2() == 1 + val selectedObj = buffer.g2Alt3() + val z = buffer.g2Alt1() + val id = buffer.g2() + val selectedCombinedId = buffer.gCombinedIdAlt1() + val selectedSub = buffer.g2Alt3() + return OpObjT( + id, + x, + z, + controlKey, + selectedCombinedId, + selectedSub, + selectedObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt new file mode 100644 index 00000000..77d48601 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2() + return OpPlayer( + index, + controlKey, + 1, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt new file mode 100644 index 00000000..5a7ea0fe --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val controlKey = buffer.g1() == 1 + val index = buffer.g2() + return OpPlayer( + index, + controlKey, + 2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt new file mode 100644 index 00000000..1ad5f65e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2() + return OpPlayer( + index, + controlKey, + 3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt new file mode 100644 index 00000000..e93f40be --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val index = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 + return OpPlayer( + index, + controlKey, + 4, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt new file mode 100644 index 00000000..e965ebf4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val index = buffer.g2Alt3() + val controlKey = buffer.g1Alt3() == 1 + return OpPlayer( + index, + controlKey, + 5, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt new file mode 100644 index 00000000..d1b9fa93 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer6Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val index = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 + return OpPlayer( + index, + controlKey, + 6, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt new file mode 100644 index 00000000..637c7957 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer7Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER7 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val index = buffer.g2Alt2() + val controlKey = buffer.g1Alt3() == 1 + return OpPlayer( + index, + controlKey, + 7, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt new file mode 100644 index 00000000..a6e8b903 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayer8Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYER8 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayer { + val controlKey = buffer.g1() == 1 + val index = buffer.g2Alt2() + return OpPlayer( + index, + controlKey, + 8, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt new file mode 100644 index 00000000..638f231f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.players + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.players.OpPlayerT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpPlayerTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPPLAYERT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpPlayerT { + val selectedSub = buffer.g2Alt2() + val index = buffer.g2() + val selectedCombinedId = buffer.gCombinedIdAlt1() + val selectedObj = buffer.g2Alt3() + val controlKey = buffer.g1() == 1 + return OpPlayerT( + index, + controlKey, + selectedCombinedId, + selectedSub, + selectedObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePCountDialogDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePCountDialogDecoder.kt new file mode 100644 index 00000000..ba3abd75 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePCountDialogDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.resumed.ResumePCountDialog +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ResumePCountDialogDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RESUME_P_COUNTDIALOG + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResumePCountDialog { + val count = buffer.g4() + return ResumePCountDialog(count) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePNameDialogDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePNameDialogDecoder.kt new file mode 100644 index 00000000..d30e6868 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePNameDialogDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.resumed.ResumePNameDialog +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ResumePNameDialogDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RESUME_P_NAMEDIALOG + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResumePNameDialog { + val name = buffer.gjstr() + return ResumePNameDialog(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePObjDialogDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePObjDialogDecoder.kt new file mode 100644 index 00000000..de2377e4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePObjDialogDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.resumed.ResumePObjDialog +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ResumePObjDialogDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RESUME_P_OBJDIALOG + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResumePObjDialog { + val obj = buffer.g2() + return ResumePObjDialog(obj) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePStringDialogDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePStringDialogDecoder.kt new file mode 100644 index 00000000..65d99ffa --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePStringDialogDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.resumed.ResumePStringDialog +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class ResumePStringDialogDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RESUME_P_STRINGDIALOG + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResumePStringDialog { + val string = buffer.gjstr() + return ResumePStringDialog(string) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt new file mode 100644 index 00000000..e6a1aa3d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.resumed.ResumePauseButton +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class ResumePauseButtonDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.RESUME_PAUSEBUTTON + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResumePauseButton { + val sub = buffer.g2Alt1() + val combinedId = buffer.gCombinedIdAlt1() + return ResumePauseButton( + combinedId, + sub, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListAddDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListAddDecoder.kt new file mode 100644 index 00000000..9d03f9e0 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListAddDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.social.FriendListAdd +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class FriendListAddDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.FRIENDLIST_ADD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendListAdd { + val name = buffer.gjstr() + return FriendListAdd(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListDelDecoder.kt new file mode 100644 index 00000000..566a1479 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/FriendListDelDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.social.FriendListDel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class FriendListDelDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.FRIENDLIST_DEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendListDel { + val name = buffer.gjstr() + return FriendListDel(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListAddDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListAddDecoder.kt new file mode 100644 index 00000000..cf814255 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListAddDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.social.IgnoreListAdd +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class IgnoreListAddDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IGNORELIST_ADD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IgnoreListAdd { + val name = buffer.gjstr() + return IgnoreListAdd(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListDelDecoder.kt new file mode 100644 index 00000000..64268123 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/social/IgnoreListDelDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.social.IgnoreListDel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +@Consistent +public class IgnoreListDelDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.IGNORELIST_DEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IgnoreListDel { + val name = buffer.gjstr() + return IgnoreListDel(name) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt new file mode 100644 index 00000000..46b42b05 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY1 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity { + val controlKey = buffer.g1Alt2() == 1 + val index = buffer.g2Alt2() + return OpWorldEntity( + index, + controlKey, + 1, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt new file mode 100644 index 00000000..fa1f78db --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity { + val controlKey = buffer.g1() == 1 + val index = buffer.g2Alt3() + return OpWorldEntity( + index, + controlKey, + 2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt new file mode 100644 index 00000000..ac30795f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity { + val controlKey = buffer.g1Alt1() == 1 + val index = buffer.g2Alt3() + return OpWorldEntity( + index, + controlKey, + 3, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt new file mode 100644 index 00000000..e518d849 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity { + val controlKey = buffer.g1Alt2() == 1 + val index = buffer.g2() + return OpWorldEntity( + index, + controlKey, + 4, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt new file mode 100644 index 00000000..1fedba2d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt @@ -0,0 +1,25 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity { + val index = buffer.g2Alt2() + val controlKey = buffer.g1Alt3() == 1 + return OpWorldEntity( + index, + controlKey, + 5, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity6Decoder.kt new file mode 100644 index 00000000..e52cfada --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity6Decoder.kt @@ -0,0 +1,20 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntity6 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntity6Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITY6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntity6 { + val id = buffer.g2() + return OpWorldEntity6(id) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt new file mode 100644 index 00000000..8ec326bc --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntityT +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.incoming.decoder.prot.GameClientProt + +public class OpWorldEntityTDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameClientProt.OPWORLDENTITYT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OpWorldEntityT { + val selectedObj = buffer.g2Alt1() + val controlKey = buffer.g1Alt2() == 1 + val selectedCombinedId = buffer.gCombinedIdAlt3() + val index = buffer.g2Alt3() + val selectedSub = buffer.g2Alt2() + return OpWorldEntityT( + index, + controlKey, + selectedCombinedId, + selectedSub, + selectedObj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/ClientMessageDecoderRepository.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/ClientMessageDecoderRepository.kt new file mode 100644 index 00000000..5edff785 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/ClientMessageDecoderRepository.kt @@ -0,0 +1,184 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.prot + +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ProtRepository +import net.rsprox.protocol.MessageDecoderRepository +import net.rsprox.protocol.MessageDecoderRepositoryBuilder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons.* +import net.rsprox.protocol.v236.game.incoming.decoder.codec.clan.AffinedClanSettingsAddBannedFromChannelDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.clan.AffinedClanSettingsSetMutedFromChannelDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.clan.ClanChannelFullRequestDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.clan.ClanChannelKickUserDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.clan.ClanSettingsFullRequestDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.events.* +import net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat.FriendChatJoinLeaveDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat.FriendChatKickDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.friendchat.FriendChatSetRankDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc1Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc2Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc3Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc4Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc5Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLoc6Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.locs.OpLocTDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.messaging.MessagePrivateDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.messaging.MessagePublicDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client.* +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.client.ReflectionCheckReplyDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.BugReportDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.ClickWorldMapDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.ClientCheatDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.CloseModalDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.HiscoreRequestDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.IfCrmViewClickDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.MoveGameClickDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.MoveMinimapClickDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.OculusLeaveDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.SendSnapshotDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.SetChatFilterSettingsDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.SetHeadingDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user.TeleportDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc1Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc2Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc3Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc4Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc5Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpc6Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.npcs.OpNpcTDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj1Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj2Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj3Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj4Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj5Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObj6Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.objs.OpObjTDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer1Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer2Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer3Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer4Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer5Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer6Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer7Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayer8Decoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.players.OpPlayerTDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed.ResumePCountDialogDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed.ResumePNameDialogDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed.ResumePObjDialogDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed.ResumePStringDialogDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed.ResumePauseButtonDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.social.FriendListAddDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.social.FriendListDelDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.social.IgnoreListAddDecoder +import net.rsprox.protocol.v236.game.incoming.decoder.codec.social.IgnoreListDelDecoder + +internal object ClientMessageDecoderRepository { + @ExperimentalStdlibApi + fun build(huffmanCodec: HuffmanCodec): MessageDecoderRepository { + val protRepository = ProtRepository.of() + val builder = + MessageDecoderRepositoryBuilder( + protRepository, + ).apply { + bind(If1ButtonDecoder()) + bind(IfButtonXDecoder()) + bind(IfSubOpDecoder()) + bind(IfButtonDDecoder()) + bind(IfButtonTDecoder()) + bind(IfRunScriptDecoder()) + + bind(OpNpc1Decoder()) + bind(OpNpc2Decoder()) + bind(OpNpc3Decoder()) + bind(OpNpc4Decoder()) + bind(OpNpc5Decoder()) + bind(OpNpc6Decoder()) + bind(OpNpcTDecoder()) + + bind(OpLoc1Decoder()) + bind(OpLoc2Decoder()) + bind(OpLoc3Decoder()) + bind(OpLoc4Decoder()) + bind(OpLoc5Decoder()) + bind(OpLoc6Decoder()) + bind(OpLocTDecoder()) + + bind(OpObj1Decoder()) + bind(OpObj2Decoder()) + bind(OpObj3Decoder()) + bind(OpObj4Decoder()) + bind(OpObj5Decoder()) + bind(OpObj6Decoder()) + bind(OpObjTDecoder()) + + bind(OpPlayer1Decoder()) + bind(OpPlayer2Decoder()) + bind(OpPlayer3Decoder()) + bind(OpPlayer4Decoder()) + bind(OpPlayer5Decoder()) + bind(OpPlayer6Decoder()) + bind(OpPlayer7Decoder()) + bind(OpPlayer8Decoder()) + bind(OpPlayerTDecoder()) + + bind(EventAppletFocusDecoder()) + bind(EventCameraPositionDecoder()) + bind(EventKeyboardDecoder()) + bind(EventMouseScrollDecoder()) + bind(EventMouseMoveDecoder()) + bind(EventNativeMouseMoveDecoder()) + bind(EventMouseClickV1Decoder()) + bind(EventMouseClickV2Decoder()) + + bind(ResumePauseButtonDecoder()) + bind(ResumePNameDialogDecoder()) + bind(ResumePStringDialogDecoder()) + bind(ResumePCountDialogDecoder()) + bind(ResumePObjDialogDecoder()) + + bind(FriendChatKickDecoder()) + bind(FriendChatSetRankDecoder()) + bind(FriendChatJoinLeaveDecoder()) + + bind(ClanChannelFullRequestDecoder()) + bind(ClanSettingsFullRequestDecoder()) + bind(ClanChannelKickUserDecoder()) + bind(AffinedClanSettingsAddBannedFromChannelDecoder()) + bind(AffinedClanSettingsSetMutedFromChannelDecoder()) + + bind(FriendListAddDecoder()) + bind(FriendListDelDecoder()) + bind(IgnoreListAddDecoder()) + bind(IgnoreListDelDecoder()) + + bind(MessagePublicDecoder(huffmanCodec)) + bind(MessagePrivateDecoder(huffmanCodec)) + + bind(MoveGameClickDecoder()) + bind(MoveMinimapClickDecoder()) + bind(ClientCheatDecoder()) + bind(SetChatFilterSettingsDecoder()) + bind(SetHeadingDecoder()) + bind(ClickWorldMapDecoder()) + bind(OculusLeaveDecoder()) + bind(CloseModalDecoder()) + bind(TeleportDecoder()) + bind(BugReportDecoder()) + bind(SendSnapshotDecoder()) + bind(HiscoreRequestDecoder()) + bind(IfCrmViewClickDecoder()) + + bind(ConnectionTelemetryDecoder()) + bind(SendPingReplyDecoder()) + bind(DetectModifiedClientDecoder()) + bind(ReflectionCheckReplyDecoder()) + bind(NoTimeoutDecoder()) + bind(IdleDecoder()) + bind(MapBuildCompleteDecoder()) + bind(MembershipPromotionEligibilityDecoder()) + bind(SoundJingleEndDecoder()) + bind(WindowStatusDecoder()) + bind(RSevenStatusDecoder()) + } + return builder.build() + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProt.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProt.kt new file mode 100644 index 00000000..da369f75 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProt.kt @@ -0,0 +1,176 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.prot + +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.Prot + +public enum class GameClientProt( + override val opcode: Int, + override val size: Int, +) : ClientProt { + // If buttons + IF_BUTTON(GameClientProtId.IF_BUTTON, 4), + IF_BUTTONX(GameClientProtId.IF_BUTTONX, 9), + IF_SUBOP(GameClientProtId.IF_SUBOP, 10), + IF_BUTTOND(GameClientProtId.IF_BUTTOND, 16), + IF_BUTTONT(GameClientProtId.IF_BUTTONT, 16), + IF_RUNSCRIPT(GameClientProtId.IF_RUNSCRIPT, Prot.VAR_SHORT), + + // Op npc + OPNPC1(GameClientProtId.OPNPC1, 3), + OPNPC2(GameClientProtId.OPNPC2, 3), + OPNPC3(GameClientProtId.OPNPC3, 3), + OPNPC4(GameClientProtId.OPNPC4, 3), + OPNPC5(GameClientProtId.OPNPC5, 3), + OPNPC6(GameClientProtId.OPNPC6, 2), + OPNPCT(GameClientProtId.OPNPCT, 11), + + @Deprecated( + "Deprecated since inventory rework in revision 204, " + + "all usagesgo through OPNPCT now.", + replaceWith = ReplaceWith("OPNPCT"), + ) + OPNPCU(GameClientProtId.OPNPCU, 11), + + // Op loc + OPLOC1(GameClientProtId.OPLOC1, 7), + OPLOC2(GameClientProtId.OPLOC2, 7), + OPLOC3(GameClientProtId.OPLOC3, 7), + OPLOC4(GameClientProtId.OPLOC4, 7), + OPLOC5(GameClientProtId.OPLOC5, 7), + OPLOC6(GameClientProtId.OPLOC6, 2), + OPLOCT(GameClientProtId.OPLOCT, 15), + + @Deprecated( + "Deprecated since inventory rework in revision 204, " + + "all usagesgo through OPLOCT now.", + replaceWith = ReplaceWith("OPLOCT"), + ) + OPLOCU(GameClientProtId.OPLOCU, 15), + + // Op obj + OPOBJ1(GameClientProtId.OPOBJ1, 7), + OPOBJ2(GameClientProtId.OPOBJ2, 7), + OPOBJ3(GameClientProtId.OPOBJ3, 7), + OPOBJ4(GameClientProtId.OPOBJ4, 7), + OPOBJ5(GameClientProtId.OPOBJ5, 7), + OPOBJ6(GameClientProtId.OPOBJ6, 6), + OPOBJT(GameClientProtId.OPOBJT, 15), + + @Deprecated( + "Deprecated since inventory rework in revision 204, " + + "all usagesgo through OPOBJT now.", + replaceWith = ReplaceWith("OPOBJT"), + ) + OPOBJU(GameClientProtId.OPOBJU, 15), + + // Op player + OPPLAYER1(GameClientProtId.OPPLAYER1, 3), + OPPLAYER2(GameClientProtId.OPPLAYER2, 3), + OPPLAYER3(GameClientProtId.OPPLAYER3, 3), + OPPLAYER4(GameClientProtId.OPPLAYER4, 3), + OPPLAYER5(GameClientProtId.OPPLAYER5, 3), + OPPLAYER6(GameClientProtId.OPPLAYER6, 3), + OPPLAYER7(GameClientProtId.OPPLAYER7, 3), + OPPLAYER8(GameClientProtId.OPPLAYER8, 3), + OPPLAYERT(GameClientProtId.OPPLAYERT, 11), + + @Deprecated( + "Deprecated since inventory rework in revision 204, " + + "all usagesgo through OPPLAYERT now.", + replaceWith = ReplaceWith("OPPLAYERT"), + ) + OPPLAYERU(GameClientProtId.OPPLAYERU, 11), + + OPWORLDENTITY1(GameClientProtId.OPWORLDENTITY1, 3), + OPWORLDENTITY2(GameClientProtId.OPWORLDENTITY2, 3), + OPWORLDENTITY3(GameClientProtId.OPWORLDENTITY3, 3), + OPWORLDENTITY4(GameClientProtId.OPWORLDENTITY4, 3), + OPWORLDENTITY5(GameClientProtId.OPWORLDENTITY5, 3), + OPWORLDENTITY6(GameClientProtId.OPWORLDENTITY6, 2), + OPWORLDENTITYT(GameClientProtId.OPWORLDENTITYT, 11), + + @Deprecated( + "Deprecated since inventory rework in revision 204, " + + "all usages go through OPWORLDENTITYT now.", + replaceWith = ReplaceWith("OPWORLDENTITYT"), + ) + OPWORLDENTITYU(GameClientProtId.OPWORLDENTITYU, 11), + + // Events + EVENT_APPLET_FOCUS(GameClientProtId.EVENT_APPLET_FOCUS, 1), + EVENT_CAMERA_POSITION(GameClientProtId.EVENT_CAMERA_POSITION, 4), + EVENT_KEYBOARD(GameClientProtId.EVENT_KEYBOARD, Prot.VAR_SHORT), + EVENT_MOUSE_SCROLL(GameClientProtId.EVENT_MOUSE_SCROLL, 2), + EVENT_MOUSE_MOVE(GameClientProtId.EVENT_MOUSE_MOVE, Prot.VAR_BYTE), + EVENT_NATIVE_MOUSE_MOVE(GameClientProtId.EVENT_NATIVE_MOUSE_MOVE, Prot.VAR_BYTE), + EVENT_MOUSE_CLICK_V1(GameClientProtId.EVENT_MOUSE_CLICK_V1, 6), + EVENT_MOUSE_CLICK_V2(GameClientProtId.EVENT_NATIVE_MOUSE_CLICK_V2, 7), + + @Deprecated( + "Deprecated since rework in revision 232, " + + "where the platforms were joined into a single packet.", + replaceWith = ReplaceWith("EVENT_MOUSE_CLICK_V2"), + ) + EVENT_NATIVE_MOUSE_CLICK(GameClientProtId.EVENT_NATIVE_MOUSE_CLICK_V1, 7), + + // Resume events + RESUME_PAUSEBUTTON(GameClientProtId.RESUME_PAUSEBUTTON, 6), + RESUME_P_NAMEDIALOG(GameClientProtId.RESUME_P_NAMEDIALOG, Prot.VAR_BYTE), + RESUME_P_STRINGDIALOG(GameClientProtId.RESUME_P_STRINGDIALOG, Prot.VAR_BYTE), + RESUME_P_COUNTDIALOG(GameClientProtId.RESUME_P_COUNTDIALOG, 4), + RESUME_P_OBJDIALOG(GameClientProtId.RESUME_P_OBJDIALOG, 2), + + // Friend chat packets + FRIENDCHAT_KICK(GameClientProtId.FRIENDCHAT_KICK, Prot.VAR_BYTE), + FRIENDCHAT_SETRANK(GameClientProtId.FRIENDCHAT_SETRANK, Prot.VAR_BYTE), + FRIENDCHAT_JOIN_LEAVE(GameClientProtId.FRIENDCHAT_JOIN_LEAVE, Prot.VAR_BYTE), + + // Clan packets + CLANCHANNEL_FULL_REQUEST(GameClientProtId.CLANCHANNEL_FULL_REQUEST, 1), + CLANSETTINGS_FULL_REQUEST(GameClientProtId.CLANSETTINGS_FULL_REQUEST, 1), + CLANCHANNEL_KICKUSER(GameClientProtId.CLANCHANNEL_KICKUSER, Prot.VAR_BYTE), + AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL( + GameClientProtId.AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL, + Prot.VAR_BYTE, + ), + AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL(GameClientProtId.AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL, Prot.VAR_BYTE), + + // Socials + FRIENDLIST_ADD(GameClientProtId.FRIENDLIST_ADD, Prot.VAR_BYTE), + FRIENDLIST_DEL(GameClientProtId.FRIENDLIST_DEL, Prot.VAR_BYTE), + IGNORELIST_ADD(GameClientProtId.IGNORELIST_ADD, Prot.VAR_BYTE), + IGNORELIST_DEL(GameClientProtId.IGNORELIST_DEL, Prot.VAR_BYTE), + + // Messaging + MESSAGE_PUBLIC(GameClientProtId.MESSAGE_PUBLIC, Prot.VAR_BYTE), + MESSAGE_PRIVATE(GameClientProtId.MESSAGE_PRIVATE, Prot.VAR_SHORT), + + // Misc. user packets + MOVE_GAMECLICK(GameClientProtId.MOVE_GAMECLICK, Prot.VAR_BYTE), + MOVE_MINIMAPCLICK(GameClientProtId.MOVE_MINIMAPCLICK, Prot.VAR_BYTE), + CLIENT_CHEAT(GameClientProtId.CLIENT_CHEAT, Prot.VAR_BYTE), + SET_CHATFILTERSETTINGS(GameClientProtId.SET_CHATFILTERSETTINGS, 3), + CLICKWORLDMAP(GameClientProtId.CLICKWORLDMAP, 4), + OCULUS_LEAVE(GameClientProtId.OCULUS_LEAVE, 0), + CLOSE_MODAL(GameClientProtId.CLOSE_MODAL, 0), + TELEPORT(GameClientProtId.TELEPORT, 9), + BUG_REPORT(GameClientProtId.BUG_REPORT, Prot.VAR_SHORT), + SEND_SNAPSHOT(GameClientProtId.SEND_SNAPSHOT, Prot.VAR_BYTE), + HISCORE_REQUEST(GameClientProtId.HISCORE_REQUEST, Prot.VAR_BYTE), + IF_CRMVIEW_CLICK(GameClientProtId.IF_CRMVIEW_CLICK, 22), + UPDATE_PLAYER_MODEL_V2(GameClientProtId.UPDATE_PLAYER_MODEL_V2, 26), + + // Misc. client packets + CONNECTION_TELEMETRY(GameClientProtId.CONNECTION_TELEMETRY, Prot.VAR_BYTE), + SEND_PING_REPLY(GameClientProtId.SEND_PING_REPLY, 10), + DETECT_MODIFIED_CLIENT(GameClientProtId.DETECT_MODIFIED_CLIENT, 4), + REFLECTION_CHECK_REPLY(GameClientProtId.REFLECTION_CHECK_REPLY, Prot.VAR_BYTE), + NO_TIMEOUT(GameClientProtId.NO_TIMEOUT, 0), + IDLE(GameClientProtId.IDLE, 0), + MAP_BUILD_COMPLETE(GameClientProtId.MAP_BUILD_COMPLETE, 0), + MEMBERSHIP_PROMOTION_ELIGIBILITY(GameClientProtId.MEMBERSHIP_PROMOTION_ELIGIBILITY, 2), + SOUND_JINGLEEND(GameClientProtId.SOUND_JINGLEEND, 4), + WINDOW_STATUS(GameClientProtId.WINDOW_STATUS, 5), + SET_HEADING(GameClientProtId.SET_HEADING, 1), + RSEVEN_STATUS(GameClientProtId.RSEVEN_STATUS, 1), +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt new file mode 100644 index 00000000..3c4bcb0c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt @@ -0,0 +1,105 @@ +package net.rsprox.protocol.v236.game.incoming.decoder.prot + +internal object GameClientProtId { + const val OPLOC2 = 0 + const val EVENT_KEYBOARD = 1 + const val RESUME_P_COUNTDIALOG = 2 + const val AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL = 3 + const val RESUME_P_OBJDIALOG = 4 + const val SOUND_JINGLEEND = 5 + const val OPPLAYER2 = 6 + const val EVENT_APPLET_FOCUS = 7 + const val OPLOCU = 8 + const val IF_BUTTON = 9 + const val SEND_SNAPSHOT = 10 + const val OPPLAYER4 = 11 + const val CLICKWORLDMAP = 12 + const val OCULUS_LEAVE = 13 + const val OPPLAYER1 = 14 + const val OPWORLDENTITY2 = 15 + const val OPWORLDENTITYU = 16 + const val OPLOC3 = 17 + const val EVENT_MOUSE_CLICK_V1 = 18 + const val OPWORLDENTITY5 = 19 + const val DETECT_MODIFIED_CLIENT = 20 + const val RESUME_P_NAMEDIALOG = 21 + const val CLOSE_MODAL = 22 + const val OPNPC1 = 23 + const val MOVE_MINIMAPCLICK = 24 + const val CLIENT_CHEAT = 25 + const val OPNPC2 = 26 + const val FRIENDLIST_DEL = 27 + const val OPLOC4 = 28 + const val OPPLAYER7 = 29 + const val IF_RUNSCRIPT = 30 + const val OPOBJ1 = 31 + const val RESUME_P_STRINGDIALOG = 32 + const val EVENT_MOUSE_SCROLL = 33 + const val CLANSETTINGS_FULL_REQUEST = 34 + const val BUG_REPORT = 35 + const val MAP_BUILD_COMPLETE = 36 + const val FRIENDCHAT_JOIN_LEAVE = 37 + const val CONNECTION_TELEMETRY = 38 + const val IF_BUTTONX = 39 + const val TELEPORT = 40 + const val OPWORLDENTITY4 = 41 + const val SEND_PING_REPLY = 42 + const val OPNPC5 = 43 + const val IDLE = 44 + const val IF_CRMVIEW_CLICK = 45 + const val OPOBJT = 46 + const val SET_CHATFILTERSETTINGS = 47 + const val OPPLAYER8 = 48 + const val EVENT_CAMERA_POSITION = 49 + const val OPLOC6 = 50 + const val OPWORLDENTITY1 = 51 + const val OPPLAYERU = 52 + const val REFLECTION_CHECK_REPLY = 53 + const val OPLOC5 = 54 + const val NO_TIMEOUT = 55 + const val OPOBJ3 = 56 + const val OPNPC6 = 57 + const val MESSAGE_PUBLIC = 58 + const val OPNPC4 = 59 + const val OPPLAYERT = 60 + const val OPLOCT = 61 + const val IGNORELIST_DEL = 62 + const val OPWORLDENTITYT = 63 + const val OPWORLDENTITY3 = 64 + const val MESSAGE_PRIVATE = 65 + const val IGNORELIST_ADD = 66 + const val FRIENDLIST_ADD = 67 + const val IF_BUTTONT = 68 + const val OPPLAYER3 = 69 + const val EVENT_MOUSE_MOVE = 70 + const val RESUME_PAUSEBUTTON = 71 + const val EVENT_NATIVE_MOUSE_CLICK_V2 = 72 + const val CLANCHANNEL_KICKUSER = 73 + const val FRIENDCHAT_SETRANK = 74 + const val OPNPCU = 75 + const val MOVE_GAMECLICK = 76 + const val OPOBJ2 = 77 + const val IF_SUBOP = 78 + const val OPOBJ6 = 79 + const val OPNPC3 = 80 + const val HISCORE_REQUEST = 81 + const val OPOBJU = 82 + const val EVENT_NATIVE_MOUSE_MOVE = 83 + const val CLANCHANNEL_FULL_REQUEST = 84 + const val IF_BUTTOND = 85 + const val UPDATE_PLAYER_MODEL_V2 = 86 + const val OPPLAYER5 = 87 + const val SET_HEADING = 88 + const val RSEVEN_STATUS = 89 + const val OPNPCT = 90 + const val OPOBJ5 = 91 + const val MEMBERSHIP_PROMOTION_ELIGIBILITY = 92 + const val WINDOW_STATUS = 93 + const val EVENT_NATIVE_MOUSE_CLICK_V1 = 94 + const val AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL = 95 + const val OPLOC1 = 96 + const val FRIENDCHAT_KICK = 97 + const val OPWORLDENTITY6 = 98 + const val OPPLAYER6 = 99 + const val OPOBJ4 = 100 +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt new file mode 100644 index 00000000..a301943a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamLookAt { + val destinationXInBuildArea = buffer.g1() + val destinationZInBuildArea = buffer.g1() + val height = buffer.g2() + val speed = buffer.g1() + val acceleration = buffer.g1() + return CamLookAt( + destinationXInBuildArea, + destinationZInBuildArea, + height, + speed, + acceleration, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt new file mode 100644 index 00000000..28f12b6a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamLookAtEasedCoord { + val destinationXInBuildArea = buffer.g1() + val destinationZInBuildArea = buffer.g1() + val height = buffer.g2() + val duration = buffer.g2() + val function = buffer.g1() + return CamLookAtEasedCoord( + destinationXInBuildArea, + destinationZInBuildArea, + height, + duration, + function, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamModeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamModeDecoder.kt new file mode 100644 index 00000000..fdfb77c9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamModeDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMode +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamModeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MODE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMode { + val mode = buffer.g1() + return CamMode( + mode, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt new file mode 100644 index 00000000..a227deb2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveToArc { + val destinationXInBuildArea = buffer.g1() + val destinationZInBuildArea = buffer.g1() + val height = buffer.g2() + val centerXInBuildArea = buffer.g1() + val centerZInBuildArea = buffer.g1() + val duration = buffer.g2() + val maintainFixedAltitude = buffer.gboolean() + val function = buffer.g1() + return CamMoveToArc( + centerXInBuildArea, + centerZInBuildArea, + destinationXInBuildArea, + destinationZInBuildArea, + height, + duration, + maintainFixedAltitude, + function, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt new file mode 100644 index 00000000..b6f576da --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -0,0 +1,34 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveToCycles { + val destinationXInBuildArea = buffer.g1() + val destinationZInBuildArea = buffer.g1() + val height = buffer.g2() + val duration = buffer.g2() + val maintainFixedAltitude = buffer.gboolean() + val function = buffer.g1() + return CamMoveToCycles( + destinationXInBuildArea, + destinationZInBuildArea, + height, + duration, + maintainFixedAltitude, + function, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt new file mode 100644 index 00000000..c756d18e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveTo { + val destinationXInBuildArea = buffer.g1() + val destinationZInBuildArea = buffer.g1() + val height = buffer.g2() + val speed = buffer.g1() + val acceleration = buffer.g1() + return CamMoveTo( + destinationXInBuildArea, + destinationZInBuildArea, + height, + speed, + acceleration, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamResetDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamResetDecoder.kt new file mode 100644 index 00000000..3650e3d1 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamResetDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamReset +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamResetDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_RESET + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamReset { + return CamReset + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateBy.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateBy.kt new file mode 100644 index 00000000..928ccf7b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateBy.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamRotateBy +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamRotateBy : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_ROTATEBY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamRotateBy { + val yAngle = buffer.g2() + val xAngle = buffer.g2() + val duration = buffer.g2() + val function = buffer.g1() + return CamRotateBy( + xAngle, + yAngle, + duration, + function, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateToDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateToDecoder.kt new file mode 100644 index 00000000..dfbb78f2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamRotateToDecoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamRotateTo +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamRotateToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_ROTATETO + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamRotateTo { + val yAngle = buffer.g2() + val xAngle = buffer.g2() + val duration = buffer.g2() + val function = buffer.g1() + return CamRotateTo( + xAngle, + yAngle, + duration, + function, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamShakeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamShakeDecoder.kt new file mode 100644 index 00000000..5e6f0601 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamShakeDecoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamShake +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamShakeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_SHAKE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamShake { + val type = buffer.g1() + val randomAmount = buffer.g1() + val sineAmount = buffer.g1() + val sineFrequency = buffer.g1() + return CamShake( + type, + randomAmount, + sineAmount, + sineFrequency, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamSmoothResetDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamSmoothResetDecoder.kt new file mode 100644 index 00000000..d05e9d73 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamSmoothResetDecoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamSmoothReset +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamSmoothResetDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_SMOOTHRESET + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamSmoothReset { + val cameraMoveConstantSpeed = buffer.g1() + val cameraMoveProportionalSpeed = buffer.g1() + val cameraLookConstantSpeed = buffer.g1() + val cameraLookProportionalSpeed = buffer.g1() + return CamSmoothReset( + cameraMoveConstantSpeed, + cameraMoveProportionalSpeed, + cameraLookConstantSpeed, + cameraLookProportionalSpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamTargetV3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamTargetV3Decoder.kt new file mode 100644 index 00000000..ce3c45ab --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamTargetV3Decoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamTargetV3 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class CamTargetV3Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_TARGET_V3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamTargetV3 { + val type = buffer.g1() + val worldEntityIndex = buffer.g2s() + val targetIndex = buffer.g2() + return CamTargetV3( + when (type) { + 0 -> CamTargetV3.PlayerCamTarget(worldEntityIndex, if (targetIndex == 65535) -1 else targetIndex) + 1 -> CamTargetV3.NpcCamTarget(worldEntityIndex, if (targetIndex == 65535) -1 else targetIndex) + 2 -> CamTargetV3.WorldEntityTarget(worldEntityIndex, if (targetIndex == 65535) -1 else targetIndex) + else -> throw IllegalStateException("Unknown type: $type") + }, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/OculusSyncDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/OculusSyncDecoder.kt new file mode 100644 index 00000000..7eb8e5b8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/OculusSyncDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.OculusSync +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class OculusSyncDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OCULUS_SYNC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): OculusSync { + val value = buffer.g4() + return OculusSync(value) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelDeltaDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelDeltaDecoder.kt new file mode 100644 index 00000000..796020e1 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelDeltaDecoder.kt @@ -0,0 +1,111 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.ClanChannelDelta +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ClanChannelDeltaDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CLANCHANNEL_DELTA + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanChannelDelta { + val clanType = buffer.g1() + val clanHash = buffer.g8() + val updateNum = buffer.g8() + val events = + buildList { + while (buffer.isReadable) { + when (val opcode = buffer.g1()) { + 0 -> break + 1 -> { + buffer.skipRead(1) + // TODO: Should name be nullable? + val name = buffer.gjstrnull() ?: "" + val world = buffer.g2() + val rank = buffer.g1() + add( + ClanChannelDelta.ClanChannelDeltaAddUserEvent( + name, + world, + rank, + ), + ) + } + 2 -> { + val index = buffer.g2() + val rank = buffer.g1() + val world = buffer.g2() + buffer.skipRead(8) + val name = buffer.gjstr() + add( + ClanChannelDelta.ClanChannelDeltaUpdateUserDetailsEvent( + index, + name, + rank, + world, + ), + ) + } + 3 -> { + val index = buffer.g2() + buffer.skipRead(1) + buffer.skipRead(1) + add( + ClanChannelDelta.ClanChannelDeltaDeleteUserEvent( + index, + ), + ) + } + 4 -> { + val name = buffer.gjstrnull() + if (name != null) { + buffer.skipRead(1) + val talkRank = buffer.g1() + val kickRank = buffer.g1() + add( + ClanChannelDelta.ClanChannelDeltaUpdateBaseSettingsEvent( + name, + talkRank, + kickRank, + ), + ) + } else { + add(ClanChannelDelta.ClanChannelDeltaUpdateBaseSettingsEvent()) + } + } + 5 -> { + buffer.skipRead(1) + val index = buffer.g2() + val rank = buffer.g1() + val world = buffer.g2() + buffer.skipRead(8) + val name = buffer.gjstr() + buffer.skipRead(1) + add( + ClanChannelDelta.ClanChannelDeltaUpdateUserDetailsV2Event( + index, + name, + rank, + world, + ), + ) + } + else -> throw IllegalStateException("Unknown clanchannel delta update: $opcode") + } + } + } + return ClanChannelDelta( + clanType, + clanHash, + updateNum, + events, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelFullDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelFullDecoder.kt new file mode 100644 index 00000000..d82e6454 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanChannelFullDecoder.kt @@ -0,0 +1,89 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.Base37 +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.ClanChannelFull +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ClanChannelFullDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CLANCHANNEL_FULL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanChannelFull { + val clanType = buffer.g1() + if (!buffer.isReadable) { + return ClanChannelFull( + clanType, + ClanChannelFull.ClanChannelFullLeaveUpdate, + ) + } + val flags = buffer.g1() + val version = + if (flags and ClanChannelFull.FLAG_HAS_VERSION != 0) { + buffer.g1() + } else { + ClanChannelFull.DEFAULT_OLDSCHOOL_VERSION + } + val clanHash = buffer.g8() + val updateNum = buffer.g8() + val clanName = buffer.gjstr() + val discardedBoolean = buffer.gboolean() + val kickRank = buffer.g1() + val talkRank = buffer.g1() + val memberCount = buffer.g2() + val base37 = flags and ClanChannelFull.FLAG_USE_BASE_37_NAMES != 0 + val displayNames = flags and ClanChannelFull.FLAG_USE_DISPLAY_NAMES != 0 + check(base37 || displayNames) { + "Unexpected behavior: Names not included in packet." + } + val members = + buildList { + for (i in 0..= 3) { + buffer.gboolean() + } else { + false + } + add( + ClanChannelFull.ClanMember( + checkNotNull(name), + rank, + world, + discardedMemberBoolean, + ), + ) + } + } + return ClanChannelFull( + clanType, + ClanChannelFull.ClanChannelFullJoinUpdate( + clanHash, + updateNum, + clanName, + discardedBoolean, + kickRank, + talkRank, + members, + version, + base37, + ), + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsDeltaDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsDeltaDecoder.kt new file mode 100644 index 00000000..c98bee25 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsDeltaDecoder.kt @@ -0,0 +1,202 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.ClanSettingsDelta +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ClanSettingsDeltaDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CLANSETTINGS_DELTA + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanSettingsDelta { + val clanType = buffer.g1() + val owner = buffer.g8() + val updateNum = buffer.g4() + val updates = + buildList { + while (buffer.isReadable) { + when (val opcode = buffer.g1()) { + 0 -> break + 1 -> { + val hashOpcode = buffer.g1() + val hash = + if (hashOpcode != 0xFF) { + buffer.readerIndex(buffer.readerIndex() - 1) + buffer.g8() + } else { + -1L + } + val name = buffer.gjstrnull() + add( + ClanSettingsDelta.ClanSettingsDeltaAddMemberV1Update( + hash, + name, + ), + ) + } + 2 -> { + val index = buffer.g2() + val rank = buffer.g1() + add( + ClanSettingsDelta.ClanSettingsDeltaSetMemberRankUpdate( + index, + rank, + ), + ) + } + 3 -> { + val hashOpcode = buffer.g1() + val hash = + if (hashOpcode != 0xFF) { + buffer.readerIndex(buffer.readerIndex() - 1) + buffer.g8() + } else { + -1L + } + val name = buffer.gjstrnull() + add( + ClanSettingsDelta.ClanSettingsDeltaAddBannedUpdate( + hash, + name, + ), + ) + } + 4 -> { + val allowUnaffined = buffer.g1() == 1 + val talkRank = buffer.g1() + val kickRank = buffer.g1() + val lootshareRank = buffer.g1() + val coinshareRank = buffer.g1() + add( + ClanSettingsDelta.ClanSettingsDeltaBaseSettingsUpdate( + allowUnaffined, + talkRank, + kickRank, + lootshareRank, + coinshareRank, + ), + ) + } + 5 -> { + val index = buffer.g2() + add(ClanSettingsDelta.ClanSettingsDeltaDeleteMemberUpdate(index)) + } + 6 -> { + val index = buffer.g2() + add(ClanSettingsDelta.ClanSettingsDeltaDeleteBannedUpdate(index)) + } + 7 -> { + val index = buffer.g2() + val value = buffer.g4() + val startBit = buffer.g1() + val endBit = buffer.g1() + add( + ClanSettingsDelta.ClanSettingsDeltaSetMemberExtraInfoUpdate( + index, + value, + startBit, + endBit, + ), + ) + } + 8 -> { + val setting = buffer.g4() + val value = buffer.g4() + add( + ClanSettingsDelta.ClanSettingsDeltaSetIntSettingUpdate( + setting, + value, + ), + ) + } + 9 -> { + val setting = buffer.g4() + val value = buffer.g8() + add( + ClanSettingsDelta.ClanSettingsDeltaSetLongSettingUpdate( + setting, + value, + ), + ) + } + 10 -> { + val setting = buffer.g4() + val value = buffer.gjstr() + add( + ClanSettingsDelta.ClanSettingsDeltaSetStringSettingUpdate( + setting, + value, + ), + ) + } + 11 -> { + val setting = buffer.g4() + val value = buffer.g4() + val startBit = buffer.g1() + val endBit = buffer.g1() + add( + ClanSettingsDelta.ClanSettingsDeltaSetVarbitSettingUpdate( + setting, + value, + startBit, + endBit, + ), + ) + } + 12 -> { + val clanName = buffer.gjstr() + buffer.skipRead(4) + add(ClanSettingsDelta.ClanSettingsDeltaSetClanNameUpdate(clanName)) + } + 13 -> { + val hashOpcode = buffer.g1() + val hash = + if (hashOpcode != 0xFF) { + buffer.readerIndex(buffer.readerIndex() - 1) + buffer.g8() + } else { + -1L + } + val name = buffer.gjstrnull() + val joinRuneDay = buffer.g2() + add( + ClanSettingsDelta.ClanSettingsDeltaAddMemberV2Update( + hash, + name, + joinRuneDay, + ), + ) + } + 14 -> { + val index = buffer.g2() + val muted = buffer.g1() == 1 + add( + ClanSettingsDelta.ClanSettingsDeltaSetMemberMutedUpdate( + index, + muted, + ), + ) + } + 15 -> { + val index = buffer.g2() + add(ClanSettingsDelta.ClanSettingsDeltaSetClanOwnerUpdate(index)) + } + else -> error("Unknown opcode: $opcode") + } + } + } + return ClanSettingsDelta( + clanType, + owner, + updateNum, + updates, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsFullDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsFullDecoder.kt new file mode 100644 index 00000000..54708626 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/ClanSettingsFullDecoder.kt @@ -0,0 +1,176 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.ClanSettingsFull +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ClanSettingsFullDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CLANSETTINGS_FULL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ClanSettingsFull { + val clanType = buffer.g1() + if (!buffer.isReadable) { + return ClanSettingsFull( + clanType, + ClanSettingsFull.ClanSettingsFullLeaveUpdate, + ) + } + val version = buffer.g1() + val flags = buffer.g1() + val updateNum = buffer.g4() + val creationTime = buffer.g4() + val affinedMemberCount = buffer.g2() + val bannedMemberCount = buffer.g1() + val clanName = buffer.gjstr() + if (version >= 4) { + buffer.skipRead(4) + } + val allowUnaffined = buffer.g1() == 1 + val talkRank = buffer.g1() + val kickRank = buffer.g1() + val lootshareRank = buffer.g1() + val coinshareRank = buffer.g1() + val hasAffinedHashes = flags and ClanSettingsFull.FLAG_HAS_AFFINED_HASHES != 0 + val hasAffinedDisplayNames = flags and ClanSettingsFull.FLAG_HAS_AFFINED_DISPLAY_NAMES != 0 + check(hasAffinedHashes || hasAffinedDisplayNames) { + "Unexpected behavior: No hashes or display names." + } + check(hasAffinedHashes != hasAffinedDisplayNames) { + "Unexpected behavior: Two ways of writing names detected" + } + val affinedMembers = + buildList { + for (i in 0..= 2) { + buffer.g4() + } else { + 0 + } + val joinRuneDay = + if (version >= 5) { + buffer.g2() + } else { + 0 + } + val muted = + if (version >= 6) { + buffer.g1() == 1 + } else { + false + } + if (hasAffinedHashes) { + add( + ClanSettingsFull.AffinedClanMember( + hash, + rank, + extraInfo, + joinRuneDay, + muted, + ), + ) + } else { + add( + ClanSettingsFull.AffinedClanMember( + checkNotNull(displayName), + rank, + extraInfo, + joinRuneDay, + muted, + ), + ) + } + } + } + val bannedMembers = + buildList { + for (i in 0..= 3) { + val settingsCount = buffer.g2() + buildList { + for (i in 0.. { + val value = buffer.g4() + add(ClanSettingsFull.IntClanSetting(id, value)) + } + 1 -> { + val value = buffer.g8() + add(ClanSettingsFull.LongClanSetting(id, value)) + } + 2 -> { + val value = buffer.gjstr() + add(ClanSettingsFull.StringClanSetting(id, value)) + } + else -> { + error("Unknown type: $type") + } + } + } + } + } else { + emptyList() + } + return ClanSettingsFull( + clanType, + ClanSettingsFull.ClanSettingsFullJoinUpdate( + updateNum, + creationTime, + clanName, + allowUnaffined, + talkRank, + kickRank, + lootshareRank, + coinshareRank, + affinedMembers, + bannedMembers, + settings, + hasAffinedHashes, + hasAffinedDisplayNames, + ), + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelDecoder.kt new file mode 100644 index 00000000..eebd26b7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelDecoder.kt @@ -0,0 +1,37 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.MessageClanChannel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessageClanChannelDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_CLANCHANNEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessageClanChannel { + val clanType = buffer.g1() + val name = buffer.gjstr() + val worldId = buffer.g2() + val worldMessageCounter = buffer.g3() + val chatCrownType = buffer.g1() + val message = huffmanCodec.decode(buffer) + return MessageClanChannel( + clanType, + name, + worldId, + worldMessageCounter, + chatCrownType, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelSystemDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelSystemDecoder.kt new file mode 100644 index 00000000..5a4cf80e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/MessageClanChannelSystemDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.MessageClanChannelSystem +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessageClanChannelSystemDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_CLANCHANNEL_SYSTEM + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessageClanChannelSystem { + val clanType = buffer.g1() + val worldId = buffer.g2() + val worldMessageCounter = buffer.g3() + val message = huffmanCodec.decode(buffer) + return MessageClanChannelSystem( + clanType, + worldId, + worldMessageCounter, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDecoder.kt new file mode 100644 index 00000000..86f65166 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.VarClan +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class VarClanDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARCLAN + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarClan { + val id = buffer.g2() + val data = ByteArray(buffer.readableBytes()) + buffer.gdata(data) + return VarClan(id, VarClan.UnknownVarClanData(data)) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDisableDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDisableDecoder.kt new file mode 100644 index 00000000..20385bb1 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanDisableDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.VarClanDisable +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class VarClanDisableDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARCLAN_DISABLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarClanDisable { + return VarClanDisable + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanEnableDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanEnableDecoder.kt new file mode 100644 index 00000000..9cb8c971 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/clan/VarClanEnableDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.clan.VarClanEnable +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class VarClanEnableDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARCLAN_ENABLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarClanEnable { + return VarClanEnable + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/MessageFriendChannelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/MessageFriendChannelDecoder.kt new file mode 100644 index 00000000..0ce30073 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/MessageFriendChannelDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.friendchat + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.Base37 +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.friendchat.MessageFriendChannel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessageFriendChannelDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_FRIENDCHANNEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessageFriendChannel { + val sender = buffer.gjstr() + val channelName = Base37.decodeWithCase(buffer.g8()) + val worldId = buffer.g2() + val worldMessageCounter = buffer.g3() + val chatCrownType = buffer.g1() + val message = huffmanCodec.decode(buffer) + return MessageFriendChannel( + sender, + channelName, + worldId, + worldMessageCounter, + chatCrownType, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/UpdateFriendChatChannelFullV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/UpdateFriendChatChannelFullV2Decoder.kt new file mode 100644 index 00000000..af68fc36 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/friendchat/UpdateFriendChatChannelFullV2Decoder.kt @@ -0,0 +1,54 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.friendchat + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.Base37 +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.friendchat.UpdateFriendChatChannelFull +import net.rsprox.protocol.game.outgoing.model.friendchat.UpdateFriendChatChannelFullV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateFriendChatChannelFullV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateFriendChatChannelFullV2 { + if (!buffer.isReadable) { + return UpdateFriendChatChannelFullV2(UpdateFriendChatChannelFullV2.LeaveUpdate) + } + val channelOwner = buffer.gjstr() + val channelName = Base37.decodeWithCase(buffer.g8()) + val kickRank = buffer.g1s() + val entryCount = buffer.gSmart1or2null() + val entries = + buildList { + for (i in 0.. { + override val prot: ClientProt = GameServerProt.UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateFriendChatChannelSingleUser { + val name = buffer.gjstr() + val worldId = buffer.g2() + val rank = buffer.g1s() + return if (rank != -128) { + val worldName = buffer.gjstr() + UpdateFriendChatChannelSingleUser( + UpdateFriendChatChannelSingleUser.AddedFriendChatUser( + name, + worldId, + rank, + worldName, + ), + ) + } else { + UpdateFriendChatChannelSingleUser( + UpdateFriendChatChannelSingleUser.RemovedFriendChatUser( + name, + worldId, + ), + ) + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoLargeV5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoLargeV5Decoder.kt new file mode 100644 index 00000000..86bdbb08 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoLargeV5Decoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.NpcInfo +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getNpcInfoBaseCoord +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class NpcInfoLargeV5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.NPC_INFO_LARGE_V5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NpcInfo { + val activeWorld = session.getActiveWorld() + val world = session.getWorld(activeWorld) + return world.npcInfo.decode( + buffer.buffer, + true, + session.getNpcInfoBaseCoord(), + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoSmallV5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoSmallV5Decoder.kt new file mode 100644 index 00000000..33eed6c8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/NpcInfoSmallV5Decoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.NpcInfo +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getNpcInfoBaseCoord +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class NpcInfoSmallV5Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.NPC_INFO_SMALL_V5 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NpcInfo { + val activeWorld = session.getActiveWorld() + val world = session.getWorld(activeWorld) + return world.npcInfo.decode( + buffer.buffer, + false, + session.getNpcInfoBaseCoord(), + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/PlayerInfoDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/PlayerInfoDecoder.kt new file mode 100644 index 00000000..699b893a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/PlayerInfoDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.PlayerInfo +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class PlayerInfoDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PLAYER_INFO + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): PlayerInfo { + val playerInfo = session.getWorld(session.getActiveWorld()).playerInfo + return playerInfo.decode(buffer.buffer) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/SetNpcUpdateOriginDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/SetNpcUpdateOriginDecoder.kt new file mode 100644 index 00000000..c7f1b40b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/SetNpcUpdateOriginDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.SetNpcUpdateOrigin +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.session.setNpcInfoBaseCoord +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SetNpcUpdateOriginDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_NPC_UPDATE_ORIGIN + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetNpcUpdateOrigin { + val originX = buffer.g1() + val originZ = buffer.g1() + val world = session.getWorld(session.getActiveWorld()) + val coord = + CoordGrid( + world.level, + world.baseX + originX, + world.baseZ + originZ, + ) + session.setNpcInfoBaseCoord(coord) + return SetNpcUpdateOrigin( + originX, + originZ, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV6Decoder.kt new file mode 100644 index 00000000..b19ae40b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV6Decoder.kt @@ -0,0 +1,112 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprox.cache.api.CacheProvider +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfo +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityUpdateType +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.allocateWorld +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt +import net.rsprox.protocol.v236.game.outgoing.model.info.npcinfo.NpcInfoClient +import net.rsprox.protocol.v236.game.outgoing.model.info.playerinfo.PlayerInfoClient +import net.rsprox.protocol.v236.game.outgoing.model.info.worldentityinfo.WorldEntityInfoClient + +internal class WorldEntityInfoV6Decoder( + private val huffmanCodec: HuffmanCodec, + private val cache: CacheProvider, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.WORLDENTITY_INFO_V6 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): WorldEntityInfo { + val activeWorld = session.getActiveWorld() + val world = session.getWorld(activeWorld) + val message = + world.worldEntity.decode( + buffer, + CoordGrid(world.level, world.baseX, world.baseZ), + 6, + ) + for ((index, update) in message.updates) { + when (update) { + is WorldEntityUpdateType.ActiveV2 -> { + } + WorldEntityUpdateType.HighResolutionToLowResolution -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV2 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + WorldEntityUpdateType.Idle -> { + // noop + } + + is WorldEntityUpdateType.ActiveV1 -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV1 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + + is WorldEntityUpdateType.LowResolutionToHighResolutionV3 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + + is WorldEntityUpdateType.ActiveV3 -> { + } + is WorldEntityUpdateType.ExtendedInfoOnly -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV4 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + } + } + return message + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfClearInvDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfClearInvDecoder.kt new file mode 100644 index 00000000..a827720b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfClearInvDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfClearInv +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfClearInvDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_CLEARINV + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfClearInv { + val combinedId = buffer.gCombinedIdAlt3() + return IfClearInv( + combinedId.interfaceId, + combinedId.componentId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfCloseSubDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfCloseSubDecoder.kt new file mode 100644 index 00000000..1e86adc4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfCloseSubDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfCloseSub +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class IfCloseSubDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_CLOSESUB + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfCloseSub { + val combinedId = buffer.gCombinedId() + return IfCloseSub( + combinedId.interfaceId, + combinedId.componentId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt new file mode 100644 index 00000000..c5f49b2b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfMoveSub +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfMoveSubDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_MOVESUB + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfMoveSub { + val sourceCombinedId = buffer.gCombinedIdAlt2() + val destinationCombinedId = buffer.gCombinedIdAlt1() + return IfMoveSub( + sourceCombinedId.interfaceId, + sourceCombinedId.componentId, + destinationCombinedId.interfaceId, + destinationCombinedId.componentId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt new file mode 100644 index 00000000..3cf68e60 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfOpenSub +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfOpenSubDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_OPENSUB + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfOpenSub { + val interfaceId = buffer.g2() + val type = buffer.g1Alt3() + val combinedId = buffer.gCombinedIdAlt2() + return IfOpenSub( + combinedId.interfaceId, + combinedId.componentId, + interfaceId, + type, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt new file mode 100644 index 00000000..d5babce5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfOpenTop +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfOpenTopDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_OPENTOP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfOpenTop { + val interfaceId = buffer.g2Alt3() + return IfOpenTop( + interfaceId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfResyncV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfResyncV2Decoder.kt new file mode 100644 index 00000000..71697358 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfResyncV2Decoder.kt @@ -0,0 +1,64 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfResyncV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class IfResyncV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_RESYNC_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfResyncV2 { + val topLevelInterface = buffer.g2() + val subInterfaceCount = buffer.g2() + val subInterfaces = + buildList { + for (i in 0.. { + override val prot: ClientProt = GameServerProt.IF_SETANGLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetAngle { + val zoom = buffer.g2Alt1() + val angleY = buffer.g2Alt2() + val angleX = buffer.g2Alt1() + val combinedId = buffer.gCombinedIdAlt3() + return IfSetAngle( + combinedId.interfaceId, + combinedId.componentId, + angleX, + angleY, + zoom, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt new file mode 100644 index 00000000..08ce3c4d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetAnim +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetAnimDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETANIM + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetAnim { + val anim = buffer.g2sAlt2() + val combinedId = buffer.gCombinedIdAlt1() + return IfSetAnim( + combinedId.interfaceId, + combinedId.componentId, + anim, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt new file mode 100644 index 00000000..eabee7c0 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetColour +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetColourDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETCOLOUR + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetColour { + val colour15BitPacked = buffer.g2Alt2() + val combinedId = buffer.gCombinedIdAlt2() + return IfSetColour( + combinedId.interfaceId, + combinedId.componentId, + colour15BitPacked, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt new file mode 100644 index 00000000..b45a4dba --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetEventsV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetEventsV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETEVENTS_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetEventsV2 { + val events1 = buffer.g4Alt2() + val combinedId = buffer.gCombinedIdAlt2() + val events2 = buffer.g4Alt3() + val start = buffer.g2Alt2() + val end = buffer.g2() + return IfSetEventsV2( + combinedId.interfaceId, + combinedId.componentId, + start, + end, + events1, + events2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt new file mode 100644 index 00000000..fc8234dc --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetHide +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetHideDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETHIDE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetHide { + val hidden = buffer.g1Alt1() == 1 + val combinedId = buffer.gCombinedIdAlt1() + return IfSetHide( + combinedId.interfaceId, + combinedId.componentId, + hidden, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt new file mode 100644 index 00000000..10c506ba --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetModel +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetModelDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETMODEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetModel { + val model = buffer.g2Alt3() + val combinedId = buffer.gCombinedId() + return IfSetModel( + combinedId.interfaceId, + combinedId.componentId, + model, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt new file mode 100644 index 00000000..39cd4174 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetNpcHeadActive +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetNpcHeadActiveDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETNPCHEAD_ACTIVE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetNpcHeadActive { + val combinedId = buffer.gCombinedIdAlt2() + val index = buffer.g2Alt1() + return IfSetNpcHeadActive( + combinedId.interfaceId, + combinedId.componentId, + index, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadDecoder.kt new file mode 100644 index 00000000..d1e8daa8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetNpcHead +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetNpcHeadDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETNPCHEAD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetNpcHead { + val npc = buffer.g2Alt3() + val combinedId = buffer.gCombinedIdAlt1() + return IfSetNpcHead( + combinedId.interfaceId, + combinedId.componentId, + npc, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt new file mode 100644 index 00000000..a5cf0450 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetObject +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetObjectDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETOBJECT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetObject { + val obj = buffer.g2Alt2() + val count = buffer.g4Alt3() + val combinedId = buffer.gCombinedIdAlt1() + return IfSetObject( + combinedId.interfaceId, + combinedId.componentId, + obj, + count, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt new file mode 100644 index 00000000..be15f97c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerHead +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPlayerHeadDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPLAYERHEAD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPlayerHead { + val combinedId = buffer.gCombinedIdAlt1() + return IfSetPlayerHead( + combinedId.interfaceId, + combinedId.componentId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt new file mode 100644 index 00000000..086edc1a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerModelBaseColour +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPlayerModelBaseColourDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPLAYERMODEL_BASECOLOUR + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPlayerModelBaseColour { + val index = buffer.g1() + val combinedId = buffer.gCombinedIdAlt2() + val colour = buffer.g1Alt1() + return IfSetPlayerModelBaseColour( + combinedId.interfaceId, + combinedId.componentId, + index, + colour, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBodyTypeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBodyTypeDecoder.kt new file mode 100644 index 00000000..31c744cd --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBodyTypeDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerModelBodyType +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPlayerModelBodyTypeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPLAYERMODEL_BODYTYPE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPlayerModelBodyType { + val combinedId = buffer.gCombinedId() + val bodyType = buffer.g1Alt3() + return IfSetPlayerModelBodyType( + combinedId.interfaceId, + combinedId.componentId, + bodyType, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelObjDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelObjDecoder.kt new file mode 100644 index 00000000..de87bfa8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelObjDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerModelObj +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPlayerModelObjDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPLAYERMODEL_OBJ + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPlayerModelObj { + val obj = buffer.g4() + val combinedId = buffer.gCombinedIdAlt2() + return IfSetPlayerModelObj( + combinedId.interfaceId, + combinedId.componentId, + obj, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelSelfDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelSelfDecoder.kt new file mode 100644 index 00000000..e5f55ee7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelSelfDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerModelSelf +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPlayerModelSelfDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPLAYERMODEL_SELF + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPlayerModelSelf { + val copyObjs = buffer.g1Alt3() == 0 + val combinedId = buffer.gCombinedId() + return IfSetPlayerModelSelf( + combinedId.interfaceId, + combinedId.componentId, + copyObjs, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPositionDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPositionDecoder.kt new file mode 100644 index 00000000..be7eec1b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPositionDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPosition +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetPositionDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETPOSITION + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetPosition { + val y = buffer.g2sAlt3() + val combinedId = buffer.gCombinedIdAlt1() + val x = buffer.g2sAlt2() + return IfSetPosition( + combinedId.interfaceId, + combinedId.componentId, + x, + y, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt new file mode 100644 index 00000000..d89d054e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetRotateSpeed +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetRotateSpeedDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETROTATESPEED + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetRotateSpeed { + val xSpeed = buffer.g2Alt3() + val ySpeed = buffer.g2Alt3() + val combinedId = buffer.gCombinedIdAlt3() + return IfSetRotateSpeed( + combinedId.interfaceId, + combinedId.componentId, + xSpeed, + ySpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt new file mode 100644 index 00000000..2432b6e6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetScrollPos +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetScrollPosDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETSCROLLPOS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetScrollPos { + val combinedId = buffer.gCombinedIdAlt2() + val scrollPos = buffer.g2() + return IfSetScrollPos( + combinedId.interfaceId, + combinedId.componentId, + scrollPos, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetTextDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetTextDecoder.kt new file mode 100644 index 00000000..8123fd3b --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetTextDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetText +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class IfSetTextDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.IF_SETTEXT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): IfSetText { + val text = buffer.gjstr() + val combinedId = buffer.gCombinedIdAlt2() + return IfSetText( + combinedId.interfaceId, + combinedId.componentId, + text, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt new file mode 100644 index 00000000..14a8b8a2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt @@ -0,0 +1,39 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.inv.UpdateInvFull +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateInvFullDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_INV_FULL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateInvFull { + val combinedId = buffer.gCombinedId() + val inventoryId = buffer.g2() + val capacity = buffer.g2() + val objs = + buildList { + for (i in 0..= 0xFF) { + count = buffer.g4() + } + add(UpdateInvFull.Obj(id - 1, count)) + } + } + return UpdateInvFull( + combinedId.interfaceId, + combinedId.componentId, + inventoryId, + objs, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvPartialDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvPartialDecoder.kt new file mode 100644 index 00000000..fce9dad4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvPartialDecoder.kt @@ -0,0 +1,45 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprot.protocol.util.gCombinedId +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.inv.UpdateInvPartial +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateInvPartialDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_INV_PARTIAL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateInvPartial { + val combinedId = buffer.gCombinedId() + val inventoryId = buffer.g2() + val objs = + buildList { + while (buffer.isReadable) { + val slot = buffer.gSmart1or2() + val id = buffer.g2() + if (id == 0) { + add(UpdateInvPartial.IndexedObj(slot, -1, 0)) + continue + } + var count = buffer.g1() + if (count >= 0xFF) { + count = buffer.g4() + } + add(UpdateInvPartial.IndexedObj(slot, id - 1, count)) + } + } + return UpdateInvPartial( + combinedId.interfaceId, + combinedId.componentId, + inventoryId, + objs, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt new file mode 100644 index 00000000..7ab11023 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt @@ -0,0 +1,20 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.inv.UpdateInvStopTransmit +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateInvStopTransmitDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_INV_STOPTRANSMIT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateInvStopTransmit { + val inventoryId = buffer.g2Alt1() + return UpdateInvStopTransmit(inventoryId) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutDecoder.kt new file mode 100644 index 00000000..5f4cfb24 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.logout.Logout +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class LogoutDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOGOUT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): Logout { + return Logout + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutTransferDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutTransferDecoder.kt new file mode 100644 index 00000000..fa59aa5f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutTransferDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.logout.LogoutTransfer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class LogoutTransferDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOGOUT_TRANSFER + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LogoutTransfer { + val host = buffer.gjstr() + val id = buffer.g2() + val properties = buffer.g4() + return LogoutTransfer( + host, + id, + properties, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutWithReasonDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutWithReasonDecoder.kt new file mode 100644 index 00000000..e70412b5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/logout/LogoutWithReasonDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.logout.LogoutWithReason +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class LogoutWithReasonDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOGOUT_WITHREASON + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LogoutWithReason { + val reason = buffer.g1() + return LogoutWithReason(reason) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/RebuildRegionDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/RebuildRegionDecoder.kt new file mode 100644 index 00000000..7aa84836 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/RebuildRegionDecoder.kt @@ -0,0 +1,55 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.map + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.bitbuffer.toBitBuf +import net.rsprot.crypto.xtea.XteaKey +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.map.RebuildRegion +import net.rsprox.protocol.game.outgoing.model.map.util.BuildArea +import net.rsprox.protocol.game.outgoing.model.map.util.RebuildRegionZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class RebuildRegionDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.REBUILD_REGION + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): RebuildRegion { + val zoneZ = buffer.g2() + val reload = buffer.g1Alt1() == 1 + val zoneX = buffer.g2Alt2() + val xteaCount = buffer.g2() + val buildArea = BuildArea() + buffer.buffer.toBitBuf().use { bitBuf -> + for (level in 0..<4) { + for (x in 0..<13) { + for (z in 0..<13) { + val exists = bitBuf.gBits(1) == 1 + val value = if (exists) bitBuf.gBits(26) else -1 + buildArea[level, x, z] = RebuildRegionZone(value) + } + } + } + } + val keys = + buildList { + for (i in 0.. { + override val prot: ClientProt = GameServerProt.REBUILD_WORLDENTITY_V3 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): RebuildWorldEntityV3 { + val baseX = buffer.g2() + val baseZ = buffer.g2() + val xteaCount = buffer.g2() + val world = session.getWorld(session.getActiveWorld()) + val width = world.sizeX / 8 + val length = world.sizeZ / 8 + val buildArea = BuildArea(4, width, length) + buffer.buffer.toBitBuf().use { bitBuf -> + for (level in 0..<4) { + for (x in 0.. { + override val prot: ClientProt = GameServerProt.RECONNECT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): Reconnect { + val playerInfoInitBlock = + buffer.buffer + .toBitBuf() + .use { bitBuf -> + val localPlayerAbsolutePosition = bitBuf.gBits(30) + val lowResolutionPositions = IntArray(2048) + for (i in 1.. { + override val prot: ClientProt = GameServerProt.REBUILD_NORMAL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): StaticRebuildMessage { + val playerInfoInitBlock = + if (buffer.isReadable(MINIMUM_REBUILD_LOGIN_CAPACITY)) { + buffer.buffer + .toBitBuf() + .use { bitBuf -> + val localPlayerAbsolutePosition = bitBuf.gBits(30) + val lowResolutionPositions = IntArray(2048) + for (i in 1.. { + override val prot: ClientProt = GameServerProt.HIDELOCOPS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HideLocOps { + val hidden = buffer.gboolean() + return HideLocOps(hidden) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideNpcOpsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideNpcOpsDecoder.kt new file mode 100644 index 00000000..fe18a9b5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideNpcOpsDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.HideNpcOps +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class HideNpcOpsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.HIDENPCOPS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HideNpcOps { + val hidden = buffer.gboolean() + return HideNpcOps(hidden) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideObjOpsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideObjOpsDecoder.kt new file mode 100644 index 00000000..6594dbc9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HideObjOpsDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.HideObjOps +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class HideObjOpsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.HIDEOBJOPS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HideObjOps { + val hidden = buffer.gboolean() + return HideObjOps(hidden) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HintArrowDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HintArrowDecoder.kt new file mode 100644 index 00000000..f00d5e91 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HintArrowDecoder.kt @@ -0,0 +1,55 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.HintArrow +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class HintArrowDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.HINT_ARROW + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HintArrow { + return when (val type = buffer.g1()) { + 0 -> { + buffer.skipRead(5) + HintArrow(HintArrow.ResetHintArrow) + } + 1 -> { + val index = buffer.g2() + buffer.skipRead(3) + HintArrow(HintArrow.NpcHintArrow(index)) + } + 10 -> { + val index = buffer.g2() + buffer.skipRead(3) + HintArrow(HintArrow.PlayerHintArrow(index)) + } + 11 -> { + val index = buffer.g2() + val height = buffer.g3() + HintArrow(HintArrow.WorldEntityHintArrow(index, height)) + } + in 2..6 -> { + val x = buffer.g2() + val z = buffer.g2() + val height = buffer.g1() + HintArrow( + HintArrow.TileHintArrow( + x, + z, + height, + type, + ), + ) + } + else -> error("Unknown hint arrow type: $type") + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HiscoreReplyDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HiscoreReplyDecoder.kt new file mode 100644 index 00000000..f3a85ed5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/HiscoreReplyDecoder.kt @@ -0,0 +1,78 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.HiscoreReply +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class HiscoreReplyDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.HISCORE_REPLY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): HiscoreReply { + val requestId = buffer.g1() + return when (val responseType = buffer.g1()) { + 0 -> { + val version = buffer.g1() + val statCount = buffer.g1() + val stats = + buildList { + for (i in 0.. { + val reason = buffer.gjstr() + HiscoreReply( + requestId, + HiscoreReply.FailedHiscoreReply(reason), + ) + } + else -> error("Invalid hiscore reply type: $responseType") + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/MinimapToggleDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/MinimapToggleDecoder.kt new file mode 100644 index 00000000..314da07f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/MinimapToggleDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.MinimapToggle +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MinimapToggleDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MINIMAP_TOGGLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MinimapToggle { + val state = buffer.g1() + return MinimapToggle(state) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupEndDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupEndDecoder.kt new file mode 100644 index 00000000..71ad001f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupEndDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.PacketGroupEnd +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class PacketGroupEndDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PACKET_GROUP_END + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): PacketGroupEnd { + return PacketGroupEnd(buffer.g2()) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupStartDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupStartDecoder.kt new file mode 100644 index 00000000..d1cbf298 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/PacketGroupStartDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.PacketGroupStart +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.setBytesConsumed +import net.rsprox.protocol.session.setRemainingBytesInPacketGroup +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class PacketGroupStartDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PACKET_GROUP_START + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): PacketGroupStart { + val length = buffer.g2s() + session.setRemainingBytesInPacketGroup(length) + session.setBytesConsumed(null) + return PacketGroupStart(length) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ReflectionCheckerDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ReflectionCheckerDecoder.kt new file mode 100644 index 00000000..6966fe65 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ReflectionCheckerDecoder.kt @@ -0,0 +1,123 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.ReflectionChecker +import net.rsprox.protocol.reflection.ReflectionCheck +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getReflectionChecks +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Suppress("DuplicatedCode") +@Consistent +internal class ReflectionCheckerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.REFLECTION_CHECKER + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ReflectionChecker { + val checksCount = buffer.g1() + val id = buffer.g4() + val checks = + buildList { + for (i in 0.. { + val className = buffer.gjstr() + val fieldName = buffer.gjstr() + add( + ReflectionCheck.GetFieldValue( + className, + fieldName, + ), + ) + } + 1 -> { + val className = buffer.gjstr() + val fieldName = buffer.gjstr() + val value = buffer.g4() + add( + ReflectionCheck.SetFieldValue( + className, + fieldName, + value, + ), + ) + } + 2 -> { + val className = buffer.gjstr() + val fieldName = buffer.gjstr() + add( + ReflectionCheck.GetFieldModifiers( + className, + fieldName, + ), + ) + } + 3 -> { + val className = buffer.gjstr() + val methodName = buffer.gjstr() + val parameterClassCount = buffer.g1() + val parameterClasses = + buildList { + for (j in 0.. { + val className = buffer.gjstr() + val methodName = buffer.gjstr() + val parameterClassCount = buffer.g1() + val parameterClasses = + buildList { + for (j in 0.. error("Unknown reflection check type: $opcode") + } + } + } + val old = session.getReflectionChecks().put(id, checks) + check(old == null) { + "Overlapping reflection check: $old/$checks" + } + return ReflectionChecker( + id, + checks, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetAnimsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetAnimsDecoder.kt new file mode 100644 index 00000000..6b64cfd5 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetAnimsDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.ResetAnims +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ResetAnimsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.RESET_ANIMS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResetAnims { + return ResetAnims + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetInteractionModeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetInteractionModeDecoder.kt new file mode 100644 index 00000000..1024f8de --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ResetInteractionModeDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.ResetInteractionMode +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ResetInteractionModeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.RESET_INTERACTION_MODE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ResetInteractionMode { + val worldId = buffer.g2() + return ResetInteractionMode( + worldId, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SendPingDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SendPingDecoder.kt new file mode 100644 index 00000000..d9a01aa2 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SendPingDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.SendPing +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SendPingDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SEND_PING + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SendPing { + val value1 = buffer.g4() + val value2 = buffer.g4() + return SendPing( + value1, + value2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ServerTickEndDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ServerTickEndDecoder.kt new file mode 100644 index 00000000..fe9f937e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ServerTickEndDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.ServerTickEnd +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ServerTickEndDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SERVER_TICK_END + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ServerTickEnd { + return ServerTickEnd + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetHeatmapEnabledDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetHeatmapEnabledDecoder.kt new file mode 100644 index 00000000..85b17e80 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetHeatmapEnabledDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.SetHeatmapEnabled +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SetHeatmapEnabledDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_HEATMAP_ENABLED + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetHeatmapEnabled { + val enabled = buffer.gboolean() + return SetHeatmapEnabled(enabled) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetInteractionModeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetInteractionModeDecoder.kt new file mode 100644 index 00000000..4be4ff97 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SetInteractionModeDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.SetInteractionMode +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SetInteractionModeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_INTERACTION_MODE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetInteractionMode { + val worldId = buffer.g2() + val tileInteractionMode = buffer.g1() + val entityInteractionMode = buffer.g1() + return SetInteractionMode( + worldId, + tileInteractionMode, + entityInteractionMode, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SiteSettingsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SiteSettingsDecoder.kt new file mode 100644 index 00000000..7868ef74 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/SiteSettingsDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.SiteSettings +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SiteSettingsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SITE_SETTINGS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SiteSettings { + val settings = buffer.gjstr() + return SiteSettings( + settings, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt new file mode 100644 index 00000000..f70edf83 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateRebootTimer { + val gameCycles = buffer.g2Alt3() + return UpdateRebootTimer( + gameCycles, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateUid192Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateUid192Decoder.kt new file mode 100644 index 00000000..2a3314f6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateUid192Decoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.crypto.crc.CyclicRedundancyCheck +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateUid192 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateUid192Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_UID192 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateUid192 { + val data = ByteArray(24) + buffer.gdata(data) + val expectedCrc = buffer.g4() + val crc = CyclicRedundancyCheck.computeCrc32(data) + if (expectedCrc != crc) { + throw IllegalStateException("CRC Mismatch: $expectedCrc != $crc") + } + return UpdateUid192( + data, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UrlOpenDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UrlOpenDecoder.kt new file mode 100644 index 00000000..1a552f5f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UrlOpenDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.UrlOpen +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UrlOpenDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.URL_OPEN + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UrlOpen { + // The URL is already decrypted at the proxy level + // Additionally, any sensitive web tokens are erased at the proxy. + val url = buffer.gjstr() + return UrlOpen( + url, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ZBufDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ZBufDecoder.kt new file mode 100644 index 00000000..f6515a04 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/ZBufDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.ZBuf +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ZBufDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.ZBUF + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ZBuf { + val enabled = buffer.gboolean() + return ZBuf(enabled) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/AccountFlagsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/AccountFlagsDecoder.kt new file mode 100644 index 00000000..c671b37e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/AccountFlagsDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.AccountFlags +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class AccountFlagsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.ACCOUNT_FLAGS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): AccountFlags { + val flags = buffer.g8() + return AccountFlags( + flags, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsDecoder.kt new file mode 100644 index 00000000..0b8e0735 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettings +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ChatFilterSettingsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CHAT_FILTER_SETTINGS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ChatFilterSettings { + val publicChatFilter = buffer.g1() + val tradeChatFilter = buffer.g1Alt2() + return ChatFilterSettings( + publicChatFilter, + tradeChatFilter, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsPrivateChatDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsPrivateChatDecoder.kt new file mode 100644 index 00000000..f5dc5e42 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/ChatFilterSettingsPrivateChatDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPrivateChat +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class ChatFilterSettingsPrivateChatDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CHAT_FILTER_SETTINGS_PRIVATECHAT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ChatFilterSettingsPrivateChat { + val privateChatFilter = buffer.g1() + return ChatFilterSettingsPrivateChat( + privateChatFilter, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/MessageGameDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/MessageGameDecoder.kt new file mode 100644 index 00000000..9e755bbb --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/MessageGameDecoder.kt @@ -0,0 +1,40 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessageGameDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_GAME + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessageGame { + val type = buffer.gSmart1or2() + val name = + if (buffer.g1() == 1) { + buffer.gjstr() + } else { + null + } + val message = buffer.gjstr() + return if (name != null) { + MessageGame( + type, + name, + message, + ) + } else { + MessageGame( + type, + message, + ) + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/RunClientScriptDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/RunClientScriptDecoder.kt new file mode 100644 index 00000000..465db005 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/RunClientScriptDecoder.kt @@ -0,0 +1,55 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.extensions.gjstr +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class RunClientScriptDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.RUNCLIENTSCRIPT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): RunClientScript { + val types = buffer.gjstr() + val arguments = ArrayDeque() + for (char in types.reversed()) { + when (char) { + 'W' -> { + val length = buffer.gVarInt2() + val array = + IntArray(length) { + buffer.gVarInt2s() + } + arguments.addFirst(array) + } + 'X' -> { + val length = buffer.gVarInt2() + val array = + Array(length) { + buffer.buffer.gjstr() + } + arguments.addFirst(array) + } + 's' -> { + arguments.addFirst(buffer.gjstr()) + } + else -> { + arguments.addFirst(buffer.g4()) + } + } + } + val id = buffer.g4() + return RunClientScript( + id, + types.toCharArray(), + arguments, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt new file mode 100644 index 00000000..e9751128 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetMapFlag { + val xInBuildArea = buffer.g1() + val zInBuildArea = buffer.g1() + return SetMapFlag( + xInBuildArea, + zInBuildArea, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetPlayerOpDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetPlayerOpDecoder.kt new file mode 100644 index 00000000..695ab37a --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetPlayerOpDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class SetPlayerOpDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_PLAYER_OP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetPlayerOp { + val id = buffer.g1Alt2() + val priority = buffer.g1() == 1 + val op = buffer.gjstr() + return SetPlayerOp( + id, + priority, + if (op == "null") null else op, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/TriggerOnDialogAbortDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/TriggerOnDialogAbortDecoder.kt new file mode 100644 index 00000000..4c52aea7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/TriggerOnDialogAbortDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class TriggerOnDialogAbortDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.TRIGGER_ONDIALOGABORT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): TriggerOnDialogAbort { + return TriggerOnDialogAbort + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunEnergyDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunEnergyDecoder.kt new file mode 100644 index 00000000..58782bad --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunEnergyDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateRunEnergyDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_RUNENERGY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateRunEnergy { + val energy = buffer.g2() + return UpdateRunEnergy( + energy, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunWeightDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunWeightDecoder.kt new file mode 100644 index 00000000..9038b7f3 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateRunWeightDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunWeight +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateRunWeightDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_RUNWEIGHT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateRunWeight { + val runweight = buffer.g2s() + return UpdateRunWeight( + runweight, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt new file mode 100644 index 00000000..bdad8038 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateStatV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateStatV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_STAT_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateStatV2 { + val currentLevel = buffer.g1Alt1() + val invisibleBoostedLevel = buffer.g1Alt3() + val stat = buffer.g1Alt1() + val experience = buffer.g4() + return UpdateStatV2( + stat, + currentLevel, + invisibleBoostedLevel, + experience, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStockMarketSlotDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStockMarketSlotDecoder.kt new file mode 100644 index 00000000..0dedb627 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStockMarketSlotDecoder.kt @@ -0,0 +1,47 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateStockMarketSlot +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateStockMarketSlotDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_STOCKMARKET_SLOT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateStockMarketSlot { + val slot = buffer.g1() + return when (val status = buffer.g1()) { + 0 -> { + UpdateStockMarketSlot( + slot, + UpdateStockMarketSlot.ResetStockMarketSlot, + ) + } + else -> { + val obj = buffer.g2() + val price = buffer.g4() + val count = buffer.g4() + val completedCount = buffer.g4() + val completedGold = buffer.g4() + UpdateStockMarketSlot( + slot, + UpdateStockMarketSlot.SetStockMarketSlot( + status, + obj, + price, + count, + completedCount, + completedGold, + ), + ) + } + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateTradingPostDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateTradingPostDecoder.kt new file mode 100644 index 00000000..13aae348 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateTradingPostDecoder.kt @@ -0,0 +1,57 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateTradingPost +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateTradingPostDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_TRADINGPOST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateTradingPost { + val reset = buffer.g1() == 0 + if (reset) { + return UpdateTradingPost(UpdateTradingPost.ResetTradingPost) + } + val age = buffer.g8() + val obj = buffer.g2() + val status = buffer.g1() == 1 + val offerCount = buffer.g2() + val offers = + buildList { + for (i in 0.. { + override val prot: ClientProt = GameServerProt.FRIENDLIST_LOADED + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): FriendListLoaded { + return FriendListLoaded + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateDecoder.kt new file mode 100644 index 00000000..dbd8e0ea --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateDecoder.kt @@ -0,0 +1,35 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.social.MessagePrivate +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessagePrivateDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_PRIVATE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessagePrivate { + val sender = buffer.gjstr() + val worldId = buffer.g2() + val worldMessageCounter = buffer.g3() + val chatCrownType = buffer.g1() + val message = huffmanCodec.decode(buffer) + return MessagePrivate( + sender, + worldId, + worldMessageCounter, + chatCrownType, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateEchoDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateEchoDecoder.kt new file mode 100644 index 00000000..b84f4b76 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/MessagePrivateEchoDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.social.MessagePrivateEcho +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class MessagePrivateEchoDecoder( + private val huffmanCodec: HuffmanCodec, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MESSAGE_PRIVATE_ECHO + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MessagePrivateEcho { + val recipient = buffer.gjstr() + val message = huffmanCodec.decode(buffer) + return MessagePrivateEcho( + recipient, + message, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateFriendListDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateFriendListDecoder.kt new file mode 100644 index 00000000..f2cd771d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateFriendListDecoder.kt @@ -0,0 +1,64 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.social.UpdateFriendList +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateFriendListDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_FRIENDLIST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateFriendList { + return UpdateFriendList( + buildList { + while (buffer.isReadable) { + val added = buffer.g1() == 1 + val name = buffer.gjstr() + val previousName = buffer.gjstr() + val worldId = buffer.g2() + val rank = buffer.g1() + val properties = buffer.g1() + if (worldId > 0) { + val worldName = buffer.gjstr() + val platform = buffer.g1() + val worldFlags = buffer.g4() + val notes = buffer.gjstr() + add( + UpdateFriendList.OnlineFriend( + added, + name, + previousName, + worldId, + rank, + properties, + notes, + worldName, + platform, + worldFlags, + ), + ) + continue + } + val notes = buffer.gjstr() + add( + UpdateFriendList.OfflineFriend( + added, + name, + previousName, + rank, + properties, + notes, + ), + ) + } + }, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateIgnoreListDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateIgnoreListDecoder.kt new file mode 100644 index 00000000..3dc5417f --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/social/UpdateIgnoreListDecoder.kt @@ -0,0 +1,47 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.social + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.social.UpdateIgnoreList +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UpdateIgnoreListDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_IGNORELIST + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateIgnoreList { + return UpdateIgnoreList( + buildList { + while (buffer.isReadable) { + val type = buffer.g1() + val name = buffer.gjstr() + if (type == 4) { + add( + UpdateIgnoreList.RemovedIgnoredEntry( + name, + ), + ) + continue + } + val added = type and 0x1 != 0 + val previousName = buffer.gjstr() + val note = buffer.gjstr() + add( + UpdateIgnoreList.AddedIgnoredEntry( + name, + previousName, + note, + added, + ), + ) + } + }, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt new file mode 100644 index 00000000..b4d39082 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.MidiJingle +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MidiJingleDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MIDI_JINGLE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MidiJingle { + val id = buffer.g2() + val lengthInMillis = buffer.g3Alt2() + return MidiJingle( + id, + lengthInMillis, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt new file mode 100644 index 00000000..59e27a08 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.MidiSongStop +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MidiSongStopDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MIDI_SONG_STOP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MidiSongStop { + val fadeOutSpeed = buffer.g2() + val fadeOutDelay = buffer.g2Alt3() + return MidiSongStop( + fadeOutDelay, + fadeOutSpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt new file mode 100644 index 00000000..fd3df6f6 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.MidiSongV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MidiSongV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MIDI_SONG_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MidiSongV2 { + val fadeOutSpeed = buffer.g2Alt3() + val fadeOutDelay = buffer.g2Alt1() + val fadeInSpeed = buffer.g2() + val id = buffer.g2Alt2() + val fadeInDelay = buffer.g2Alt1() + return MidiSongV2( + id, + fadeOutDelay, + fadeOutSpeed, + fadeInDelay, + fadeInSpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt new file mode 100644 index 00000000..c1826d53 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.MidiSongWithSecondary +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MidiSongWithSecondaryDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MIDI_SONG_WITHSECONDARY + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MidiSongWithSecondary { + val fadeOutDelay = buffer.g2Alt1() + val secondaryId = buffer.g2Alt3() + val fadeInSpeed = buffer.g2Alt3() + val fadeInDelay = buffer.g2Alt1() + val fadeOutSpeed = buffer.g2() + val primaryId = buffer.g2() + return MidiSongWithSecondary( + primaryId, + secondaryId, + fadeOutDelay, + fadeOutSpeed, + fadeInDelay, + fadeInSpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSwapDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSwapDecoder.kt new file mode 100644 index 00000000..a5421e42 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSwapDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.MidiSwap +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MidiSwapDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MIDI_SWAP + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MidiSwap { + val fadeInSpeed = buffer.g2Alt2() + val fadeInDelay = buffer.g2Alt3() + val fadeOutDelay = buffer.g2Alt3() + val fadeOutSpeed = buffer.g2() + return MidiSwap( + fadeOutDelay, + fadeOutSpeed, + fadeInDelay, + fadeInSpeed, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/SynthSoundDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/SynthSoundDecoder.kt new file mode 100644 index 00000000..b239e4de --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/SynthSoundDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.sound.SynthSound +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SynthSoundDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SYNTH_SOUND + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SynthSound { + val id = buffer.g2() + val loops = buffer.g1() + val delay = buffer.g2() + return SynthSound( + id, + loops, + delay, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt new file mode 100644 index 00000000..a17d8e39 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.LocAnimSpecific +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildArea +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.LocProperties +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class LocAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOC_ANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LocAnimSpecific { + val coordInBuildArea = CoordInBuildArea(buffer.g3Alt1()) + val locProperties = LocProperties(buffer.g1Alt3()) + val id = buffer.g2() + return LocAnimSpecific( + id, + coordInBuildArea, + locProperties, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt new file mode 100644 index 00000000..a5128da7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.MapAnimSpecific +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildArea +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MapAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MAP_ANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MapAnimSpecific { + val coordInBuildArea = CoordInBuildArea(buffer.g3Alt3()) + val id = buffer.g2Alt2() + val delay = buffer.g2Alt3() + val height = buffer.g1Alt3() + return MapAnimSpecific( + id, + delay, + height, + coordInBuildArea, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt new file mode 100644 index 00000000..83fd3edd --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.NpcAnimSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class NpcAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.NPC_ANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NpcAnimSpecific { + val index = buffer.g2Alt3() + val delay = buffer.g1Alt3() + val id = buffer.g2Alt1() + return NpcAnimSpecific( + index, + id, + delay, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt new file mode 100644 index 00000000..858e86ce --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.NpcHeadIconSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class NpcHeadIconSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.NPC_HEADICON_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NpcHeadIconSpecific { + val spriteGroup = buffer.g4Alt2() + val spriteIndex = buffer.g2sAlt3() + val index = buffer.g2Alt2() + val headIconSlot = buffer.g1Alt2() + return NpcHeadIconSpecific( + index, + headIconSlot, + spriteGroup, + spriteIndex, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcSpotAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcSpotAnimSpecificDecoder.kt new file mode 100644 index 00000000..e8a1b6a0 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcSpotAnimSpecificDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.NpcSpotAnimSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class NpcSpotAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.NPC_SPOTANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): NpcSpotAnimSpecific { + val slot = buffer.g1Alt2() + val id = buffer.g2() + val packed = buffer.g4Alt1() + val index = buffer.g2() + val height = packed ushr 16 + val delay = packed and 0xFFFF + return NpcSpotAnimSpecific( + index, + id, + slot, + height, + delay, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjAddSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjAddSpecificDecoder.kt new file mode 100644 index 00000000..9bcac521 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjAddSpecificDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjAddSpecific +import net.rsprox.protocol.game.outgoing.model.util.OpFlags +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjAddSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_ADD_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjAddSpecific { + val timeUntilDespawn = buffer.g2Alt3() + val neverBecomesPublic = buffer.g1() == 1 + val coordGrid = CoordGrid(buffer.g4Alt3()) + val id = buffer.g2() + val timeUntilPublic = buffer.g2Alt2() + val opFlags = OpFlags(buffer.g1Alt2()) + val ownershipType = buffer.g1Alt2() + val quantity = buffer.g4() + return ObjAddSpecific( + id, + quantity, + coordGrid, + opFlags, + timeUntilPublic, + timeUntilDespawn, + ownershipType, + neverBecomesPublic, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt new file mode 100644 index 00000000..e6c17733 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjCountSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjCountSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_COUNT_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjCountSpecific { + val id = buffer.g2() + val oldQuantity = buffer.g4Alt1() + val coordGrid = CoordGrid(buffer.g4()) + val newQuantity = buffer.g4Alt3() + return ObjCountSpecific( + id, + oldQuantity, + newQuantity, + coordGrid, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt new file mode 100644 index 00000000..cde21c9d --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt @@ -0,0 +1,37 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjCustomiseSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjCustomiseSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_CUSTOMISE_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjCustomiseSpecific { + val model = buffer.g2Alt2() + val quantity = buffer.g4Alt3() + val coordGrid = CoordGrid(buffer.g4Alt2()) + val recol = buffer.g2sAlt1() + val retex = buffer.g2s() + val id = buffer.g2Alt2() + val retexIndex = buffer.g2sAlt3() + val recolIndex = buffer.g2sAlt2() + return ObjCustomiseSpecific( + id, + quantity, + model, + recolIndex, + recol, + retexIndex, + retex, + coordGrid, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjDelSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjDelSpecificDecoder.kt new file mode 100644 index 00000000..a75f3faf --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjDelSpecificDecoder.kt @@ -0,0 +1,27 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjDelSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjDelSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_DEL_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjDelSpecific { + val coordGrid = CoordGrid(buffer.g4Alt3()) + val quantity = buffer.g4Alt1() + val id = buffer.g2Alt2() + return ObjDelSpecific( + id, + quantity, + coordGrid, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt new file mode 100644 index 00000000..1d78c3f8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjEnabledOpsSpecific +import net.rsprox.protocol.game.outgoing.model.util.OpFlags +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjEnabledOpsSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_ENABLED_OPS_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjEnabledOpsSpecific { + val opFlags = OpFlags(buffer.g1Alt3()) + val coordGrid = CoordGrid(buffer.g4Alt1()) + val id = buffer.g2Alt1() + return ObjEnabledOpsSpecific( + id, + opFlags, + coordGrid, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjUncustomiseSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjUncustomiseSpecificDecoder.kt new file mode 100644 index 00000000..4d3a6f29 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjUncustomiseSpecificDecoder.kt @@ -0,0 +1,27 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ObjUncustomiseSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjUncustomiseSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_UNCUSTOMISE_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjUncustomiseSpecific { + val coordGrid = CoordGrid(buffer.g4()) + val quantity = buffer.g4Alt1() + val id = buffer.g2Alt2() + return ObjUncustomiseSpecific( + id, + quantity, + coordGrid, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerAnimSpecificDecoder.kt new file mode 100644 index 00000000..fc2f3ea8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerAnimSpecificDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.PlayerAnimSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class PlayerAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PLAYER_ANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): PlayerAnimSpecific { + val id = buffer.g2Alt2() + val delay = buffer.g1Alt1() + return PlayerAnimSpecific( + id, + delay, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerSpotAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerSpotAnimSpecificDecoder.kt new file mode 100644 index 00000000..155b723c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/PlayerSpotAnimSpecificDecoder.kt @@ -0,0 +1,31 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.specific.PlayerSpotAnimSpecific +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class PlayerSpotAnimSpecificDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PLAYER_SPOTANIM_SPECIFIC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): PlayerSpotAnimSpecific { + val id = buffer.g2Alt1() + val slot = buffer.g1Alt1() + val packed = buffer.g4Alt1() + val index = buffer.g2Alt2() + val height = packed ushr 16 + val delay = packed and 0xFFFF + return PlayerSpotAnimSpecific( + index, + id, + slot, + height, + delay, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ProjAnimSpecificV4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ProjAnimSpecificV4Decoder.kt new file mode 100644 index 00000000..2b636835 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ProjAnimSpecificV4Decoder.kt @@ -0,0 +1,43 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.specific.ProjAnimSpecificV4 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ProjAnimSpecificV4Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.PROJANIM_SPECIFIC_V4 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ProjAnimSpecificV4 { + val startTime = buffer.g2() + val endTime = buffer.g2Alt2() + val end = CoordGrid(buffer.g4Alt1()) + val endHeight = buffer.g2Alt1() + val start = CoordGrid(buffer.g4Alt2()) + val targetIndex = buffer.g3sAlt1() + val startHeight = buffer.g2Alt3() + val sourceIndex = buffer.g3sAlt2() + val angle = buffer.g1Alt2() + val id = buffer.g2Alt2() + val progress = buffer.g2Alt1() + return ProjAnimSpecificV4( + id, + startHeight, + endHeight, + startTime, + endTime, + angle, + progress, + start, + sourceIndex, + end, + targetIndex, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/unknown/UnknownStringDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/unknown/UnknownStringDecoder.kt new file mode 100644 index 00000000..cee29ef7 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/unknown/UnknownStringDecoder.kt @@ -0,0 +1,22 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.unknown + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.unknown.UnknownString +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class UnknownStringDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UNKNOWN_STRING + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UnknownString { + val string = buffer.gjstr() + return UnknownString(string) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpLargeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpLargeDecoder.kt new file mode 100644 index 00000000..e475f350 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpLargeDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.varp.VarpLarge +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class VarpLargeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARP_LARGE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarpLarge { + val id = buffer.g2Alt1() + val value = buffer.g4Alt3() + return VarpLarge( + id, + value, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpResetDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpResetDecoder.kt new file mode 100644 index 00000000..79fd0bd9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpResetDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.varp.VarpReset +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class VarpResetDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARP_RESET + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarpReset { + return VarpReset + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt new file mode 100644 index 00000000..746b7ad9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt @@ -0,0 +1,24 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.varp.VarpSmall +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class VarpSmallDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARP_SMALL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarpSmall { + val value = buffer.g1s() + val id = buffer.g2Alt3() + return VarpSmall( + id, + value, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSyncDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSyncDecoder.kt new file mode 100644 index 00000000..e6d5ea40 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSyncDecoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.varp.VarpSync +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class VarpSyncDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.VARP_SYNC + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): VarpSync { + return VarpSync + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/worldentity/SetActiveWorldV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/worldentity/SetActiveWorldV2Decoder.kt new file mode 100644 index 00000000..47a28f55 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/worldentity/SetActiveWorldV2Decoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.worldentity + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.metadata.Consistent +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.worldentity.SetActiveWorldV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.session.setActiveWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +@Consistent +internal class SetActiveWorldV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_ACTIVE_WORLD_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetActiveWorldV2 { + val index = buffer.g2s() + val activeLevel = buffer.g1() + session.setActiveWorld(index, activeLevel) + val world = session.getWorld(index) + world.level = activeLevel + return if (index == -1) { + SetActiveWorldV2(SetActiveWorldV2.RootWorldType(activeLevel)) + } else { + SetActiveWorldV2(SetActiveWorldV2.DynamicWorldType(index, activeLevel)) + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt new file mode 100644 index 00000000..97524937 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZoneFullFollows +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateZoneFullFollowsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_ZONE_FULL_FOLLOWS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateZoneFullFollows { + val level = buffer.g1Alt3() + val zoneX = buffer.g1Alt1() + val zoneZ = buffer.g1() + return UpdateZoneFullFollows( + zoneX, + zoneZ, + level, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialEnclosedDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialEnclosedDecoder.kt new file mode 100644 index 00000000..fa2e14db --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialEnclosedDecoder.kt @@ -0,0 +1,67 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.IncomingZoneProt +import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialEnclosed +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocAddChangeV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocAnimDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocDelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocMergeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.MapAnimDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.MapProjAnimV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjAddDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjCountDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjCustomiseDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjDelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjEnabledOpsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.ObjUncustomiseDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.SoundAreaDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateZonePartialEnclosedDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_ZONE_PARTIAL_ENCLOSED + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateZonePartialEnclosed { + val zoneZ = buffer.g1Alt2() + val level = buffer.g1() + val zoneX = buffer.g1Alt3() + val packets = + buildList { + while (buffer.isReadable) { + val index = buffer.g1() + val decoder = IndexedZoneProtDecoder.entries[index] + add(decoder.decoder.decode(buffer, session) as IncomingZoneProt) + } + } + return UpdateZonePartialEnclosed( + zoneX, + zoneZ, + level, + packets, + ) + } + + private enum class IndexedZoneProtDecoder( + val decoder: ProxyMessageDecoder<*>, + ) { + OBJ_DEL(ObjDelDecoder()), + OBJ_COUNT(ObjCountDecoder()), + LOC_MERGE(LocMergeDecoder()), + LOC_ADD_CHANGE_V2(LocAddChangeV2Decoder()), + OBJ_ENABLED_OPS(ObjEnabledOpsDecoder()), + MAP_ANIM(MapAnimDecoder()), + SOUND_AREA(SoundAreaDecoder()), + LOC_ANIM(LocAnimDecoder()), + OBJ_CUSTOMISE(ObjCustomiseDecoder()), + LOC_DEL(LocDelDecoder()), + OBJ_UNCUSTOMISE(ObjUncustomiseDecoder()), + MAP_PROJANIM_V2(MapProjAnimV2Decoder()), + OBJ_ADD(ObjAddDecoder()), + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt new file mode 100644 index 00000000..c0199e96 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFollows +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateZonePartialFollowsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_ZONE_PARTIAL_FOLLOWS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateZonePartialFollows { + val zoneZ = buffer.g1Alt1() + val level = buffer.g1Alt3() + val zoneX = buffer.g1Alt2() + return UpdateZonePartialFollows( + zoneX, + zoneZ, + level, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAddChangeV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAddChangeV2Decoder.kt new file mode 100644 index 00000000..8ffc0270 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAddChangeV2Decoder.kt @@ -0,0 +1,45 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.util.OpFlags +import net.rsprox.protocol.game.outgoing.model.zone.payload.LocAddChangeV2 +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.LocProperties +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class LocAddChangeV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOC_ADD_CHANGE_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LocAddChangeV2 { + val opOverrideCount = buffer.g1Alt2() + val opOverrides: Map? = + if (opOverrideCount > 0) { + buildMap { + for (i in 0.. { + override val prot: ClientProt = GameServerProt.LOC_ANIM + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LocAnim { + val locProperties = LocProperties(buffer.g1Alt2()) + val id = buffer.g2Alt3() + val coordInZone = CoordInZone(buffer.g1Alt2()) + return LocAnim( + id, + coordInZone, + locProperties, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt new file mode 100644 index 00000000..74bbd3ac --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt @@ -0,0 +1,26 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.LocDel +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.LocProperties +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class LocDelDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOC_DEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LocDel { + val locProperties = LocProperties(buffer.g1()) + val coordInZone = CoordInZone(buffer.g1Alt3()) + return LocDel( + coordInZone, + locProperties, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt new file mode 100644 index 00000000..a4bcc72c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt @@ -0,0 +1,42 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.LocMerge +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.LocProperties +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class LocMergeDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.LOC_MERGE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): LocMerge { + val locProperties = LocProperties(buffer.g1()) + val minZ = buffer.g1sAlt1() + val start = buffer.g2Alt2() + val index = buffer.g2Alt2() + val maxZ = buffer.g1sAlt3() + val minX = buffer.g1sAlt3() + val end = buffer.g2() + val coordInZone = CoordInZone(buffer.g1Alt1()) + val id = buffer.g2Alt1() + val maxX = buffer.g1sAlt2() + return LocMerge( + index, + id, + coordInZone, + locProperties, + start, + end, + minX, + minZ, + maxX, + maxZ, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt new file mode 100644 index 00000000..ef6f5a00 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.MapAnim +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MapAnimDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MAP_ANIM + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MapAnim { + val id = buffer.g2() + val height = buffer.g1Alt3() + val delay = buffer.g2() + val coordInZone = CoordInZone(buffer.g1Alt1()) + return MapAnim( + id, + delay, + height, + coordInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt new file mode 100644 index 00000000..51cc1e13 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt @@ -0,0 +1,44 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.zone.payload.MapProjAnimV2 +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class MapProjAnimV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.MAP_PROJANIM_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): MapProjAnimV2 { + val sourceIndex = buffer.g3sAlt2() + val targetIndex = buffer.g3sAlt2() + val startTime = buffer.g2Alt1() + val coordInZone = CoordInZone(buffer.g1Alt1()) + val endHeight = buffer.g2Alt3() + val angle = buffer.g1Alt1() + val startHeight = buffer.g2() + val progress = buffer.g2Alt1() + val endTime = buffer.g2Alt3() + val end = CoordGrid(buffer.g4Alt3()) + val id = buffer.g2Alt2() + return MapProjAnimV2( + id, + startHeight, + endHeight, + startTime, + endTime, + angle, + progress, + sourceIndex, + targetIndex, + coordInZone, + end, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt new file mode 100644 index 00000000..9c32897c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.util.OpFlags +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjAdd +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjAddDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_ADD + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjAdd { + val timeUntilPublic = buffer.g2Alt2() + val coordInZone = CoordInZone(buffer.g1Alt3()) + val neverBecomesPublic = buffer.g1Alt3() == 1 + val opFlags = OpFlags(buffer.g1Alt3()) + val ownershipType = buffer.g1Alt1() + val id = buffer.g2Alt1() + val quantity = buffer.g4Alt1() + val timeUntilDespawn = buffer.g2() + return ObjAdd( + id, + quantity, + coordInZone, + opFlags, + timeUntilPublic, + timeUntilDespawn, + ownershipType, + neverBecomesPublic, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt new file mode 100644 index 00000000..93d5edb9 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt @@ -0,0 +1,29 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCount +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjCountDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_COUNT + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjCount { + val id = buffer.g2Alt3() + val oldQuantity = buffer.g4Alt3() + val newQuantity = buffer.g4Alt1() + val coordInZone = CoordInZone(buffer.g1Alt2()) + return ObjCount( + id, + oldQuantity, + newQuantity, + coordInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt new file mode 100644 index 00000000..2c6bdbc8 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt @@ -0,0 +1,38 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjCustomise +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjCustomiseDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_CUSTOMISE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjCustomise { + val coordInZone = CoordInZone(buffer.g1Alt3()) + val recolIndex = buffer.g2sAlt3() + val quantity = buffer.g4Alt1() + val id = buffer.g2Alt3() + val retexIndex = buffer.g2sAlt1() + val model = buffer.g2Alt3() + val recol = buffer.g2sAlt1() + val retex = buffer.g2sAlt1() + return ObjCustomise( + id, + quantity, + model, + recolIndex, + recol, + retexIndex, + retex, + coordInZone.xInZone, + coordInZone.zInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt new file mode 100644 index 00000000..b55bb731 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt @@ -0,0 +1,27 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjDel +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjDelDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_DEL + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjDel { + val id = buffer.g2() + val coordInZone = CoordInZone(buffer.g1Alt1()) + val quantity = buffer.g4Alt1() + return ObjDel( + id, + quantity, + coordInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt new file mode 100644 index 00000000..e4c8c9ee --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.util.OpFlags +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjEnabledOps +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjEnabledOpsDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_ENABLED_OPS + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjEnabledOps { + val coordInZone = CoordInZone(buffer.g1Alt2()) + val opFlags = OpFlags(buffer.g1()) + val id = buffer.g2() + return ObjEnabledOps( + id, + opFlags, + coordInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt new file mode 100644 index 00000000..6bfa28bc --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt @@ -0,0 +1,28 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.ObjUncustomise +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class ObjUncustomiseDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.OBJ_UNCUSTOMISE + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): ObjUncustomise { + val coordInZone = CoordInZone(buffer.g1()) + val quantity = buffer.g4Alt3() + val id = buffer.g2Alt3() + return ObjUncustomise( + id, + quantity, + coordInZone.xInZone, + coordInZone.zInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt new file mode 100644 index 00000000..d13aa0fd --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt @@ -0,0 +1,33 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.zone.payload.SoundArea +import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInZone +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class SoundAreaDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SOUND_AREA + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SoundArea { + val radius = buffer.g1() + val coordInZone = CoordInZone(buffer.g1Alt2()) + val size = buffer.g1Alt3() + val id = buffer.g2Alt2() + val loops = buffer.g1Alt3() + val delay = buffer.g1Alt3() + return SoundArea( + id, + delay, + loops, + radius, + size, + coordInZone, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt new file mode 100644 index 00000000..043d7272 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt @@ -0,0 +1,200 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.prot + +import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.Prot +import net.rsprot.protocol.ServerProt + +public enum class GameServerProt( + override val opcode: Int, + override val size: Int, +) : ServerProt, + ClientProt { + // Interface related packets + IF_RESYNC_V2(GameServerProtId.IF_RESYNC_V2, Prot.VAR_SHORT), + IF_OPENTOP(GameServerProtId.IF_OPENTOP, 2), + IF_OPENSUB(GameServerProtId.IF_OPENSUB, 7), + IF_CLOSESUB(GameServerProtId.IF_CLOSESUB, 4), + IF_MOVESUB(GameServerProtId.IF_MOVESUB, 8), + IF_CLEARINV(GameServerProtId.IF_CLEARINV, 4), + + IF_SETEVENTS_V2(GameServerProtId.IF_SETEVENTS_V2, 16), + IF_SETPOSITION(GameServerProtId.IF_SETPOSITION, 8), + IF_SETSCROLLPOS(GameServerProtId.IF_SETSCROLLPOS, 6), + IF_SETROTATESPEED(GameServerProtId.IF_SETROTATESPEED, 8), + IF_SETTEXT(GameServerProtId.IF_SETTEXT, Prot.VAR_SHORT), + IF_SETHIDE(GameServerProtId.IF_SETHIDE, 5), + IF_SETANGLE(GameServerProtId.IF_SETANGLE, 10), + IF_SETOBJECT(GameServerProtId.IF_SETOBJECT, 10), + IF_SETCOLOUR(GameServerProtId.IF_SETCOLOUR, 6), + IF_SETANIM(GameServerProtId.IF_SETANIM, 6), + IF_SETNPCHEAD(GameServerProtId.IF_SETNPCHEAD, 6), + IF_SETNPCHEAD_ACTIVE(GameServerProtId.IF_SETNPCHEAD_ACTIVE, 6), + IF_SETPLAYERHEAD(GameServerProtId.IF_SETPLAYERHEAD, 4), + IF_SETMODEL(GameServerProtId.IF_SETMODEL, 6), + IF_SETPLAYERMODEL_BASECOLOUR(GameServerProtId.IF_SETPLAYERMODEL_BASECOLOUR, 6), + IF_SETPLAYERMODEL_BODYTYPE(GameServerProtId.IF_SETPLAYERMODEL_BODYTYPE, 5), + IF_SETPLAYERMODEL_OBJ(GameServerProtId.IF_SETPLAYERMODEL_OBJ, 8), + IF_SETPLAYERMODEL_SELF(GameServerProtId.IF_SETPLAYERMODEL_SELF, 5), + + // Music-system related packets (excl. zone ones) + MIDI_SONG_V2(GameServerProtId.MIDI_SONG_V2, 10), + MIDI_SONG_WITHSECONDARY(GameServerProtId.MIDI_SONG_WITHSECONDARY, 12), + MIDI_SWAP(GameServerProtId.MIDI_SWAP, 8), + MIDI_SONG_STOP(GameServerProtId.MIDI_SONG_STOP, 4), + MIDI_JINGLE(GameServerProtId.MIDI_JINGLE, 5), + SYNTH_SOUND(GameServerProtId.SYNTH_SOUND, 5), + + // Zone header packets + UPDATE_ZONE_FULL_FOLLOWS(GameServerProtId.UPDATE_ZONE_FULL_FOLLOWS, 3), + UPDATE_ZONE_PARTIAL_FOLLOWS(GameServerProtId.UPDATE_ZONE_PARTIAL_FOLLOWS, 3), + UPDATE_ZONE_PARTIAL_ENCLOSED(GameServerProtId.UPDATE_ZONE_PARTIAL_ENCLOSED, Prot.VAR_SHORT), + + // Zone payload packets + LOC_ADD_CHANGE_V2(GameServerProtId.LOC_ADD_CHANGE_V2, -2), + LOC_DEL(GameServerProtId.LOC_DEL, 2), + LOC_ANIM(GameServerProtId.LOC_ANIM, 4), + LOC_MERGE(GameServerProtId.LOC_MERGE, 14), + OBJ_ADD(-1, 14), + OBJ_DEL(-1, 7), + OBJ_COUNT(-1, 11), + OBJ_ENABLED_OPS(-1, 4), + OBJ_CUSTOMISE(-1, 17), + OBJ_UNCUSTOMISE(-1, 7), + MAP_ANIM(GameServerProtId.MAP_ANIM, 6), + + // MAP_PROJANIM_V2 has no packet of its own. It can only be transmitted via the partial enclosed packet. + MAP_PROJANIM_V2(-1, 24), + SOUND_AREA(GameServerProtId.SOUND_AREA, 7), + + // Specific packets + PROJANIM_SPECIFIC_V4(GameServerProtId.PROJANIM_SPECIFIC_V4, 27), + MAP_ANIM_SPECIFIC(GameServerProtId.MAP_ANIM_SPECIFIC, 8), + LOC_ANIM_SPECIFIC(GameServerProtId.LOC_ANIM_SPECIFIC, 6), + NPC_HEADICON_SPECIFIC(GameServerProtId.NPC_HEADICON_SPECIFIC, 9), + NPC_SPOTANIM_SPECIFIC(GameServerProtId.NPC_SPOTANIM_SPECIFIC, 9), + NPC_ANIM_SPECIFIC(GameServerProtId.NPC_ANIM_SPECIFIC, 5), + PLAYER_ANIM_SPECIFIC(GameServerProtId.PLAYER_ANIM_SPECIFIC, 3), + PLAYER_SPOTANIM_SPECIFIC(GameServerProtId.PLAYER_SPOTANIM_SPECIFIC, 9), + OBJ_ADD_SPECIFIC(GameServerProtId.OBJ_ADD_SPECIFIC, 17), + OBJ_DEL_SPECIFIC(GameServerProtId.OBJ_DEL_SPECIFIC, 10), + OBJ_ENABLED_OPS_SPECIFIC(GameServerProtId.OBJ_ENABLED_OPS_SPECIFIC, 7), + OBJ_UNCUSTOMISE_SPECIFIC(GameServerProtId.OBJ_UNCUSTOMISE_SPECIFIC, 10), + OBJ_COUNT_SPECIFIC(GameServerProtId.OBJ_COUNT_SPECIFIC, 14), + OBJ_CUSTOMISE_SPECIFIC(GameServerProtId.OBJ_CUSTOMISE_SPECIFIC, 20), + + // Info packets + PLAYER_INFO(GameServerProtId.PLAYER_INFO, Prot.VAR_SHORT), + NPC_INFO_SMALL_V5(GameServerProtId.NPC_INFO_SMALL_V5, Prot.VAR_SHORT), + NPC_INFO_LARGE_V5(GameServerProtId.NPC_INFO_LARGE_V5, Prot.VAR_SHORT), + + SET_NPC_UPDATE_ORIGIN(GameServerProtId.SET_NPC_UPDATE_ORIGIN, 2), + + // World entity packets + SET_ACTIVE_WORLD_V2(GameServerProtId.SET_ACTIVE_WORLD_V2, 3), + WORLDENTITY_INFO_V6(GameServerProtId.WORLDENTITY_INFO_V6, Prot.VAR_SHORT), + + // Map packets + REBUILD_NORMAL(GameServerProtId.REBUILD_NORMAL, Prot.VAR_SHORT), + REBUILD_REGION(GameServerProtId.REBUILD_REGION, Prot.VAR_SHORT), + REBUILD_WORLDENTITY_V3(GameServerProtId.REBUILD_WORLDENTITY_V3, Prot.VAR_SHORT), + + // Varp packets + VARP_SMALL(GameServerProtId.VARP_SMALL, 3), + VARP_LARGE(GameServerProtId.VARP_LARGE, 6), + VARP_RESET(GameServerProtId.VARP_RESET, 0), + VARP_SYNC(GameServerProtId.VARP_SYNC, 0), + + // Camera packets + CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), + CAM_RESET(GameServerProtId.CAM_RESET, 0), + CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), + CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), + CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), + CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), + CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), + CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), + CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), + CAM_MODE(GameServerProtId.CAM_MODE, 1), + CAM_TARGET_V3(GameServerProtId.CAM_TARGET_V3, 5), + OCULUS_SYNC(GameServerProtId.OCULUS_SYNC, 4), + + // Inventory packets + UPDATE_INV_FULL(GameServerProtId.UPDATE_INV_FULL, Prot.VAR_SHORT), + UPDATE_INV_PARTIAL(GameServerProtId.UPDATE_INV_PARTIAL, Prot.VAR_SHORT), + UPDATE_INV_STOPTRANSMIT(GameServerProtId.UPDATE_INV_STOPTRANSMIT, 2), + + // Social packets + MESSAGE_PRIVATE(GameServerProtId.MESSAGE_PRIVATE, Prot.VAR_SHORT), + MESSAGE_PRIVATE_ECHO(GameServerProtId.MESSAGE_PRIVATE_ECHO, Prot.VAR_SHORT), + FRIENDLIST_LOADED(GameServerProtId.FRIENDLIST_LOADED, 0), + UPDATE_FRIENDLIST(GameServerProtId.UPDATE_FRIENDLIST, Prot.VAR_SHORT), + UPDATE_IGNORELIST(GameServerProtId.UPDATE_IGNORELIST, Prot.VAR_SHORT), + + // Friend chat (old "clans") packets + UPDATE_FRIENDCHAT_CHANNEL_FULL_V2(GameServerProtId.UPDATE_FRIENDCHAT_CHANNEL_FULL_V2, Prot.VAR_SHORT), + UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER(GameServerProtId.UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER, Prot.VAR_BYTE), + MESSAGE_FRIENDCHANNEL(GameServerProtId.MESSAGE_FRIENDCHANNEL, Prot.VAR_BYTE), + + // Clan chat packets + VARCLAN(GameServerProtId.VARCLAN, Prot.VAR_BYTE), + VARCLAN_ENABLE(GameServerProtId.VARCLAN_ENABLE, 0), + VARCLAN_DISABLE(GameServerProtId.VARCLAN_DISABLE, 0), + CLANCHANNEL_FULL(GameServerProtId.CLANCHANNEL_FULL, Prot.VAR_SHORT), + CLANCHANNEL_DELTA(GameServerProtId.CLANCHANNEL_DELTA, Prot.VAR_SHORT), + CLANSETTINGS_FULL(GameServerProtId.CLANSETTINGS_FULL, Prot.VAR_SHORT), + CLANSETTINGS_DELTA(GameServerProtId.CLANSETTINGS_DELTA, Prot.VAR_SHORT), + MESSAGE_CLANCHANNEL(GameServerProtId.MESSAGE_CLANCHANNEL, Prot.VAR_BYTE), + MESSAGE_CLANCHANNEL_SYSTEM(GameServerProtId.MESSAGE_CLANCHANNEL_SYSTEM, Prot.VAR_BYTE), + + // Log out packets + LOGOUT(GameServerProtId.LOGOUT, 0), + LOGOUT_WITHREASON(GameServerProtId.LOGOUT_WITHREASON, 1), + LOGOUT_TRANSFER(GameServerProtId.LOGOUT_TRANSFER, Prot.VAR_BYTE), + + // Misc. player state packets + UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), + UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), + SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), + UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), + + // Misc. player packets + RUNCLIENTSCRIPT(GameServerProtId.RUNCLIENTSCRIPT, Prot.VAR_SHORT), + TRIGGER_ONDIALOGABORT(GameServerProtId.TRIGGER_ONDIALOGABORT, 0), + MESSAGE_GAME(GameServerProtId.MESSAGE_GAME, Prot.VAR_BYTE), + CHAT_FILTER_SETTINGS(GameServerProtId.CHAT_FILTER_SETTINGS, 2), + CHAT_FILTER_SETTINGS_PRIVATECHAT(GameServerProtId.CHAT_FILTER_SETTINGS_PRIVATECHAT, 1), + UPDATE_TRADINGPOST(GameServerProtId.UPDATE_TRADINGPOST, Prot.VAR_SHORT), + UPDATE_STOCKMARKET_SLOT(GameServerProtId.UPDATE_STOCKMARKET_SLOT, 20), + ACCOUNT_FLAGS(GameServerProtId.ACCOUNT_FLAGS, 8), + + // Misc. client state packets + HINT_ARROW(GameServerProtId.HINT_ARROW, 6), + RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), + UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), + MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), + SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), + HIDENPCOPS(GameServerProtId.HIDENPCOPS, 1), + HIDEOBJOPS(GameServerProtId.HIDEOBJOPS, 1), + HIDELOCOPS(GameServerProtId.HIDELOCOPS, 1), + SET_INTERACTION_MODE(GameServerProtId.SET_INTERACTION_MODE, 4), + RESET_INTERACTION_MODE(GameServerProtId.RESET_INTERACTION_MODE, 2), + ZBUF(GameServerProtId.ZBUF, 1), + + // Misc. client packets + URL_OPEN(GameServerProtId.URL_OPEN, Prot.VAR_SHORT), + SITE_SETTINGS(GameServerProtId.SITE_SETTINGS, Prot.VAR_BYTE), + UPDATE_UID192(GameServerProtId.UPDATE_UID192, 28), + REFLECTION_CHECKER(GameServerProtId.REFLECTION_CHECKER, Prot.VAR_SHORT), + SEND_PING(GameServerProtId.SEND_PING, 8), + HISCORE_REPLY(GameServerProtId.HISCORE_REPLY, Prot.VAR_SHORT), + PACKET_GROUP_START(GameServerProtId.PACKET_GROUP_START, 2), + + // Unknown packets + UNKNOWN_STRING(GameServerProtId.UNKNOWN_STRING, Prot.VAR_BYTE), + + PACKET_GROUP_END(0xFE, 0), + RECONNECT(0xFF, Prot.VAR_SHORT), +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt new file mode 100644 index 00000000..c1046a88 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt @@ -0,0 +1,139 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.prot + +internal object GameServerProtId { + const val SERVER_TICK_END = 0 + const val SET_PLAYER_OP = 1 + const val HISCORE_REPLY = 2 + const val UPDATE_REBOOT_TIMER = 3 + const val HIDENPCOPS = 4 + const val REFLECTION_CHECKER = 5 + const val URL_OPEN = 6 + const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 7 + const val LOC_DEL = 8 + const val IF_CLEARINV = 9 + const val PACKET_GROUP_START = 10 + const val IF_OPENSUB = 11 + const val MESSAGE_PRIVATE = 12 + const val HIDELOCOPS = 13 + const val SOUND_AREA = 14 + const val CAM_ROTATETO = 15 + const val CAM_TARGET_V3 = 16 + const val CAM_LOOKAT = 17 + const val IF_SETCOLOUR = 18 + const val UPDATE_IGNORELIST = 19 + const val MIDI_SONG_V2 = 20 + const val NPC_INFO_LARGE_V5 = 21 + const val NPC_ANIM_SPECIFIC = 22 + const val SET_INTERACTION_MODE = 23 + const val VARP_SMALL = 24 + const val CAM_LOOKAT_EASED_COORD = 25 + const val SYNTH_SOUND = 26 + const val MAP_ANIM_SPECIFIC = 27 + const val CAM_ROTATEBY = 28 + const val OBJ_ENABLED_OPS_SPECIFIC = 29 + const val MINIMAP_TOGGLE = 30 + const val UPDATE_INV_STOPTRANSMIT = 31 + const val MIDI_JINGLE = 32 + const val PLAYER_SPOTANIM_SPECIFIC = 33 + const val IF_SETPLAYERMODEL_BASECOLOUR = 34 + const val UPDATE_STAT_V2 = 35 + const val IF_SETANIM = 36 + const val MESSAGE_GAME = 37 + const val LOGOUT_WITHREASON = 38 + const val MESSAGE_CLANCHANNEL_SYSTEM = 39 + const val IF_RESYNC_V2 = 40 + const val FRIENDLIST_LOADED = 41 + const val TRIGGER_ONDIALOGABORT = 42 + const val IF_SETPOSITION = 43 + const val CAM_MODE = 44 + const val IF_OPENTOP = 45 + const val IF_SETSCROLLPOS = 46 + const val MIDI_SWAP = 47 + const val UPDATE_ZONE_PARTIAL_FOLLOWS = 48 + const val IF_SETHIDE = 49 + const val IF_MOVESUB = 50 + const val OBJ_ADD_SPECIFIC = 51 + const val HINT_ARROW = 52 + const val UPDATE_FRIENDLIST = 53 + const val LOC_ADD_CHANGE_V2 = 54 + const val UPDATE_TRADINGPOST = 55 + const val NPC_INFO_SMALL_V5 = 56 + const val IF_CLOSESUB = 57 + const val UPDATE_STOCKMARKET_SLOT = 58 + const val IF_SETMODEL = 59 + const val RESET_INTERACTION_MODE = 60 + const val IF_SETROTATESPEED = 61 + const val UNKNOWN_STRING = 62 + const val UPDATE_RUNENERGY = 63 + const val CLANCHANNEL_DELTA = 64 + const val IF_SETNPCHEAD_ACTIVE = 65 + const val LOGOUT = 66 + const val PROJANIM_SPECIFIC_V4 = 67 + const val CLANCHANNEL_FULL = 68 + const val SITE_SETTINGS = 69 + const val SET_MAP_FLAG = 70 + const val MESSAGE_CLANCHANNEL = 71 + const val VARCLAN_ENABLE = 72 + const val CLANSETTINGS_FULL = 73 + const val VARP_SYNC = 74 + const val PLAYER_ANIM_SPECIFIC = 75 + const val RESET_ANIMS = 76 + const val NPC_SPOTANIM_SPECIFIC = 77 + const val UPDATE_UID192 = 78 + const val REBUILD_NORMAL = 79 + const val MESSAGE_PRIVATE_ECHO = 80 + const val VARP_RESET = 81 + const val IF_SETTEXT = 82 + const val MIDI_SONG_WITHSECONDARY = 83 + const val SET_ACTIVE_WORLD_V2 = 84 + const val IF_SETOBJECT = 85 + const val LOC_ANIM = 86 + const val IF_SETPLAYERMODEL_SELF = 87 + const val REBUILD_WORLDENTITY_V3 = 88 + const val OBJ_DEL_SPECIFIC = 89 + const val VARCLAN_DISABLE = 90 + const val LOC_ANIM_SPECIFIC = 91 + const val SET_HEATMAP_ENABLED = 92 + const val UPDATE_INV_FULL = 93 + const val UPDATE_ZONE_FULL_FOLLOWS = 94 + const val CAM_SMOOTHRESET = 95 + const val CAM_SHAKE = 96 + const val PLAYER_INFO = 97 + const val CAM_RESET = 98 + const val NPC_HEADICON_SPECIFIC = 99 + const val SET_NPC_UPDATE_ORIGIN = 100 + const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 101 + const val MESSAGE_FRIENDCHANNEL = 102 + const val CLANSETTINGS_DELTA = 103 + const val REBUILD_REGION = 104 + const val UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER = 105 + const val CAM_MOVETO_CYCLES = 106 + const val LOGOUT_TRANSFER = 107 + const val CAM_MOVETO_ARC = 108 + const val UPDATE_ZONE_PARTIAL_ENCLOSED = 109 + const val IF_SETPLAYERMODEL_OBJ = 110 + const val CAM_MOVETO = 111 + const val UPDATE_RUNWEIGHT = 112 + const val SEND_PING = 113 + const val IF_SETPLAYERHEAD = 114 + const val IF_SETANGLE = 115 + const val VARCLAN = 116 + const val MIDI_SONG_STOP = 117 + const val HIDEOBJOPS = 118 + const val IF_SETPLAYERMODEL_BODYTYPE = 119 + const val MAP_ANIM = 120 + const val IF_SETNPCHEAD = 121 + const val OCULUS_SYNC = 122 + const val UPDATE_INV_PARTIAL = 123 + const val CHAT_FILTER_SETTINGS = 124 + const val LOC_MERGE = 125 + const val RUNCLIENTSCRIPT = 126 + const val VARP_LARGE = 127 + const val ZBUF = 128 + const val OBJ_CUSTOMISE_SPECIFIC = 129 + const val OBJ_COUNT_SPECIFIC = 130 + const val ACCOUNT_FLAGS = 131 + const val OBJ_UNCUSTOMISE_SPECIFIC = 132 + const val WORLDENTITY_INFO_V6 = 133 + const val IF_SETEVENTS_V2 = 134 +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt new file mode 100644 index 00000000..74e46c0e --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt @@ -0,0 +1,310 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.prot + +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ProtRepository +import net.rsprox.cache.api.CacheProvider +import net.rsprox.protocol.MessageDecoderRepository +import net.rsprox.protocol.MessageDecoderRepositoryBuilder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtEasedCoordDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamModeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToArcDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToCyclesDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamResetDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateBy +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateToDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamShakeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamSmoothResetDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamTargetV3Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.OculusSyncDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.ClanChannelDeltaDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.ClanChannelFullDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.ClanSettingsDeltaDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.ClanSettingsFullDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.MessageClanChannelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.MessageClanChannelSystemDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.VarClanDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.VarClanDisableDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.clan.VarClanEnableDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.friendchat.MessageFriendChannelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.friendchat.UpdateFriendChatChannelFullV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.friendchat.UpdateFriendChatChannelSingleUserDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.NpcInfoLargeV5Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.NpcInfoSmallV5Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.PlayerInfoDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.SetNpcUpdateOriginDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.WorldEntityInfoV6Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.* +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfClearInvDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfCloseSubDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfMoveSubDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfOpenSubDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfOpenTopDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfResyncV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetAngleDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetAnimDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetColourDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetHideDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetModelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetNpcHeadActiveDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetNpcHeadDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetObjectDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPlayerHeadDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPlayerModelBaseColourDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPlayerModelBodyTypeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPlayerModelObjDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPlayerModelSelfDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetPositionDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetRotateSpeedDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetScrollPosDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfSetTextDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv.UpdateInvFullDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv.UpdateInvPartialDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.inv.UpdateInvStopTransmitDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout.LogoutDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout.LogoutTransferDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.logout.LogoutWithReasonDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.map.RebuildRegionDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.map.RebuildWorldEntityV3Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.map.ReconnectDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.map.StaticRebuildDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.HideLocOpsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.HideNpcOpsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.HideObjOpsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.HintArrowDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.HiscoreReplyDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.MinimapToggleDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.PacketGroupEndDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.PacketGroupStartDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ReflectionCheckerDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ResetAnimsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ResetInteractionModeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SendPingDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ServerTickEndDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetHeatmapEnabledDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetInteractionModeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SiteSettingsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateRebootTimerDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateUid192Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UrlOpenDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ZBufDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.AccountFlagsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.ChatFilterSettingsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.ChatFilterSettingsPrivateChatDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.MessageGameDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.RunClientScriptDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetMapFlagDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetPlayerOpDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.TriggerOnDialogAbortDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateRunEnergyDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateRunWeightDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateStatV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateStockMarketSlotDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateTradingPostDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.social.FriendListLoadedDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.social.MessagePrivateDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.social.MessagePrivateEchoDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.social.UpdateFriendListDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.social.UpdateIgnoreListDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.MidiJingleDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.MidiSongStopDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.MidiSongV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.MidiSongWithSecondaryDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.MidiSwapDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.sound.SynthSoundDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.* +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.LocAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.MapAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.NpcAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.NpcHeadIconSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.NpcSpotAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.ObjAddSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.PlayerAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.PlayerSpotAnimSpecificDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.specific.ProjAnimSpecificV4Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.unknown.UnknownStringDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp.VarpLargeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp.VarpResetDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp.VarpSmallDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.varp.VarpSyncDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.worldentity.SetActiveWorldV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header.UpdateZoneFullFollowsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header.UpdateZonePartialEnclosedDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.header.UpdateZonePartialFollowsDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocAddChangeV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocAnimDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocDelDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.LocMergeDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.MapAnimDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.zone.payload.SoundAreaDecoder + +internal object ServerMessageDecoderRepository { + @ExperimentalStdlibApi + fun build( + huffmanCodec: HuffmanCodec, + cache: CacheProvider, + ): MessageDecoderRepository { + val protRepository = ProtRepository.of() + val builder = + MessageDecoderRepositoryBuilder( + protRepository, + ).apply { + bind(CamRotateToDecoder()) + bind(CamRotateBy()) + bind(CamLookAtEasedCoordDecoder()) + bind(CamLookAtDecoder()) + bind(CamModeDecoder()) + bind(CamMoveToArcDecoder()) + bind(CamMoveToCyclesDecoder()) + bind(CamMoveToDecoder()) + bind(CamResetDecoder()) + bind(CamShakeDecoder()) + bind(CamSmoothResetDecoder()) + bind(CamTargetV3Decoder()) + bind(OculusSyncDecoder()) + + bind(ClanChannelDeltaDecoder()) + bind(ClanChannelFullDecoder()) + bind(ClanSettingsDeltaDecoder()) + bind(ClanSettingsFullDecoder()) + bind(MessageClanChannelDecoder(huffmanCodec)) + bind(MessageClanChannelSystemDecoder(huffmanCodec)) + bind(VarClanDisableDecoder()) + bind(VarClanEnableDecoder()) + bind(VarClanDecoder()) + + bind(MessageFriendChannelDecoder(huffmanCodec)) + bind(UpdateFriendChatChannelFullV2Decoder()) + bind(UpdateFriendChatChannelSingleUserDecoder()) + + bind(PlayerInfoDecoder()) + bind(NpcInfoSmallV5Decoder()) + bind(NpcInfoLargeV5Decoder()) + bind(SetNpcUpdateOriginDecoder()) + bind(WorldEntityInfoV6Decoder(huffmanCodec, cache)) + + bind(IfClearInvDecoder()) + bind(IfCloseSubDecoder()) + bind(IfResyncV2Decoder()) + bind(IfMoveSubDecoder()) + bind(IfOpenSubDecoder()) + bind(IfOpenTopDecoder()) + bind(IfSetAngleDecoder()) + bind(IfSetAnimDecoder()) + bind(IfSetColourDecoder()) + bind(IfSetEventsV2Decoder()) + bind(IfSetHideDecoder()) + bind(IfSetModelDecoder()) + bind(IfSetNpcHeadActiveDecoder()) + bind(IfSetNpcHeadDecoder()) + bind(IfSetObjectDecoder()) + bind(IfSetPlayerHeadDecoder()) + bind(IfSetPlayerModelBaseColourDecoder()) + bind(IfSetPlayerModelBodyTypeDecoder()) + bind(IfSetPlayerModelObjDecoder()) + bind(IfSetPlayerModelSelfDecoder()) + bind(IfSetPositionDecoder()) + bind(IfSetRotateSpeedDecoder()) + bind(IfSetScrollPosDecoder()) + bind(IfSetTextDecoder()) + + bind(UpdateInvFullDecoder()) + bind(UpdateInvPartialDecoder()) + bind(UpdateInvStopTransmitDecoder()) + + bind(LogoutDecoder()) + bind(LogoutTransferDecoder()) + bind(LogoutWithReasonDecoder()) + + bind(ReconnectDecoder()) + bind(StaticRebuildDecoder(huffmanCodec, cache)) + bind(RebuildRegionDecoder()) + bind(RebuildWorldEntityV3Decoder()) + + bind(SetHeatmapEnabledDecoder()) + bind(HideLocOpsDecoder()) + bind(HideNpcOpsDecoder()) + bind(HideObjOpsDecoder()) + bind(SetInteractionModeDecoder()) + bind(ResetInteractionModeDecoder()) + bind(HintArrowDecoder()) + bind(HiscoreReplyDecoder()) + bind(MinimapToggleDecoder()) + bind(ReflectionCheckerDecoder()) + bind(ResetAnimsDecoder()) + bind(SendPingDecoder()) + bind(ServerTickEndDecoder()) + bind(UpdateRebootTimerDecoder()) + bind(SiteSettingsDecoder()) + bind(UpdateUid192Decoder()) + bind(UrlOpenDecoder()) + bind(PacketGroupStartDecoder()) + bind(PacketGroupEndDecoder()) + bind(ZBufDecoder()) + + bind(ChatFilterSettingsDecoder()) + bind(ChatFilterSettingsPrivateChatDecoder()) + bind(MessageGameDecoder()) + bind(RunClientScriptDecoder()) + bind(SetMapFlagDecoder()) + bind(SetPlayerOpDecoder()) + bind(TriggerOnDialogAbortDecoder()) + bind(UpdateRunEnergyDecoder()) + bind(UpdateRunWeightDecoder()) + bind(UpdateStatV2Decoder()) + bind(UpdateStockMarketSlotDecoder()) + bind(UpdateTradingPostDecoder()) + bind(AccountFlagsDecoder()) + + bind(FriendListLoadedDecoder()) + bind(MessagePrivateEchoDecoder(huffmanCodec)) + bind(MessagePrivateDecoder(huffmanCodec)) + bind(UpdateFriendListDecoder()) + bind(UpdateIgnoreListDecoder()) + + bind(MidiJingleDecoder()) + bind(MidiSongV2Decoder()) + bind(MidiSongStopDecoder()) + bind(MidiSongWithSecondaryDecoder()) + bind(MidiSwapDecoder()) + bind(SynthSoundDecoder()) + + bind(LocAnimSpecificDecoder()) + bind(MapAnimSpecificDecoder()) + bind(NpcAnimSpecificDecoder()) + bind(NpcHeadIconSpecificDecoder()) + bind(NpcSpotAnimSpecificDecoder()) + bind(PlayerAnimSpecificDecoder()) + bind(PlayerSpotAnimSpecificDecoder()) + bind(ProjAnimSpecificV4Decoder()) + bind(ObjAddSpecificDecoder()) + bind(ObjDelSpecificDecoder()) + bind(ObjCountSpecificDecoder()) + bind(ObjEnabledOpsSpecificDecoder()) + bind(ObjCustomiseSpecificDecoder()) + bind(ObjUncustomiseSpecificDecoder()) + + bind(VarpLargeDecoder()) + bind(VarpResetDecoder()) + bind(VarpSmallDecoder()) + bind(VarpSyncDecoder()) + + bind(SetActiveWorldV2Decoder()) + + bind(UpdateZonePartialEnclosedDecoder()) + bind(UpdateZoneFullFollowsDecoder()) + bind(UpdateZonePartialFollowsDecoder()) + + bind(LocAddChangeV2Decoder()) + bind(LocAnimDecoder()) + bind(LocDelDecoder()) + bind(LocMergeDecoder()) + bind(MapAnimDecoder()) + bind(SoundAreaDecoder()) + + bind(UnknownStringDecoder()) + } + return builder.build() + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt new file mode 100644 index 00000000..1f1e3429 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt @@ -0,0 +1,881 @@ +package net.rsprox.protocol.v236.game.outgoing.model.info.npcinfo + +import io.netty.buffer.ByteBuf +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.bitbuffer.BitBuf +import net.rsprot.buffer.bitbuffer.toBitBuf +import net.rsprot.buffer.extensions.toJagByteBuf +import net.rsprox.cache.api.CacheProvider +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.exceptions.DecodeError +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.MoveSpeed +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.NpcInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.NpcInfoDecoder +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.NpcUpdateType +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.BaseAnimationSetExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.BodyCustomisationExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.CombatLevelChangeExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.HeadCustomisationExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.HeadIconCustomisationExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.NameChangeExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.TransformationExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.customisation.ModelCustomisation +import net.rsprox.protocol.game.outgoing.model.info.npcinfo.extendedinfo.customisation.ResetCustomisation +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.EnabledOpsExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.ExactMoveExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.ExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.FaceAngleExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.FacePathingEntityExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Headbar +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Hit +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.HitExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SayExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SequenceExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Spotanim +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SpotanimExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.TintingExtendedInfo + +@Suppress("DuplicatedCode") +internal class NpcInfoClient( + val cache: CacheProvider, +) : NpcInfoDecoder { + private var deletedNPCCount: Int = 0 + private var deletedNPC = IntArray(1000) + private var npc = arrayOfNulls(65536) + private var transmittedNPCCount = 0 + private var transmittedNPC = IntArray(65536) + private var extraUpdateNPCCount: Int = 0 + private var extraUpdateNPC: IntArray = IntArray(250) + private var cycle = 0 + + private val updates: MutableMap = mutableMapOf() + private val extendedInfoBlocks: MutableMap> = mutableMapOf() + + override fun decode( + buffer: ByteBuf, + large: Boolean, + baseCoord: CoordGrid, + ): NpcInfo { + deletedNPCCount = 0 + extraUpdateNPCCount = 0 + buffer.toBitBuf().use { bitBuffer -> + processHighResolution(bitBuffer) + processLowResolution(large, bitBuffer, baseCoord) + } + processExtendedInfo(buffer.toJagByteBuf()) + for (i in 0..() + for ((index, update) in updates) { + when (update) { + UpdateType.IDLE -> { + // Too spammy, continue + continue + } + UpdateType.LOW_RESOLUTION_TO_HIGH_RESOLUTION -> { + val npc = checkNotNull(npc[index]) + val extendedInfo = this.extendedInfoBlocks[index] ?: emptyList() + result[index] = + NpcUpdateType.LowResolutionToHighResolution( + npc.id, + npc.spawnCycle, + npc.coord.x, + npc.coord.z, + npc.coord.level, + npc.angle, + npc.jump, + extendedInfo, + ) + } + UpdateType.HIGH_RESOLUTION_TO_LOW_RESOLUTION -> { + result[index] = NpcUpdateType.HighResolutionToLowResolution + } + UpdateType.ACTIVE -> { + val npc = checkNotNull(npc[index]) + val extendedInfo = this.extendedInfoBlocks[index] ?: emptyList() + result[index] = + NpcUpdateType.Active( + npc.coord.x, + npc.coord.z, + npc.coord.level, + npc.steps, + npc.moveSpeed, + extendedInfo, + npc.jump, + ) + } + } + } + this.updates.clear() + this.extendedInfoBlocks.clear() + return NpcInfo(result) + } + + private fun processExtendedInfo(buffer: JagByteBuf) { + for (i in 0..() + + this.extendedInfoBlocks[index] = blocks + + if (flag and LEVEL_CHANGE != 0) { + decodeCombatLevelChange(buffer, blocks) + } + if (flag and HEADICON_CUSTOMISATION != 0) { + decodeHeadiconCustomisation(buffer, blocks) + } + if (flag and FACE_ANGLE != 0) { + decodeFaceAngle(buffer, blocks) + } + if (flag and SEQUENCE != 0) { + decodeSequence(buffer, blocks) + } + if (flag and OPS != 0) { + decodeEnabledOps(buffer, blocks) + } + if (flag and OLD_SPOTANIM_UNUSED != 0) { + throw IllegalStateException("Old spotanim used!") + } + if (flag and BAS_CHANGE != 0) { + decodeBaseAnimationSet(buffer, blocks) + } + if (flag and HEAD_CUSTOMISATION != 0) { + decodeHeadCustomisation(npc.id, buffer, blocks) + } + if (flag and BODY_CUSTOMISATION != 0) { + decodeBodyCustomisation(npc.id, buffer, blocks) + } + if (flag and SAY != 0) { + decodeSay(buffer, blocks) + } + if (flag and SPOTANIM != 0) { + decodeSpotanim(buffer, blocks) + } + if (flag and FACE_PATHINGENTITY != 0) { + decodeFacePathingEntity(buffer, blocks) + } + if (flag and TRANSFORMATION != 0) { + decodeTransformation(buffer, blocks, npc) + } + if (flag and EXACT_MOVE != 0) { + decodeExactMove(buffer, blocks) + } + if (flag and OLD_FACE_COORD_UNUSED != 0) { + throw IllegalStateException("Old face coord used!") + } + if (flag and TINTING != 0) { + decodeTinting(buffer, blocks) + } + if (flag and HITS != 0) { + decodeHits(buffer, blocks) + } + if (flag and NAME_CHANGE != 0) { + decodeNameChange(buffer, blocks) + } + } + } + + private fun decodeBaseAnimationSet( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val flag = buffer.g4Alt3() + val turnLeftAnim = if (flag and 0x1 != 0) buffer.g2Alt1() else null + val turnRightAnim = if (flag and 0x2 != 0) buffer.g2() else null + val walkAnim = if (flag and 0x4 != 0) buffer.g2Alt1() else null + val walkAnimBack = if (flag and 0x8 != 0) buffer.g2Alt3() else null + val walkAnimLeft = if (flag and 0x10 != 0) buffer.g2Alt1() else null + val walkAnimRight = if (flag and 0x20 != 0) buffer.g2() else null + val runAnim = if (flag and 0x40 != 0) buffer.g2() else null + val runAnimBack = if (flag and 0x80 != 0) buffer.g2Alt1() else null + val runAnimLeft = if (flag and 0x100 != 0) buffer.g2Alt3() else null + val runAnimRight = if (flag and 0x200 != 0) buffer.g2Alt2() else null + val crawlAnim = if (flag and 0x400 != 0) buffer.g2Alt3() else null + val crawlAnimBack = if (flag and 0x800 != 0) buffer.g2() else null + val crawlAnimLeft = if (flag and 0x1000 != 0) buffer.g2Alt1() else null + val crawlAnimRight = if (flag and 0x2000 != 0) buffer.g2() else null + val readyAnim = if (flag and 0x4000 != 0) buffer.g2Alt1() else null + blocks += + BaseAnimationSetExtendedInfo( + turnLeftAnim, + turnRightAnim, + walkAnim, + walkAnimBack, + walkAnimLeft, + walkAnimRight, + runAnim, + runAnimBack, + runAnimLeft, + runAnimRight, + crawlAnim, + crawlAnimBack, + crawlAnimLeft, + crawlAnimRight, + readyAnim, + ) + } + + private fun decodeHits( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val hitCount = buffer.g1Alt3() + val hits = ArrayList(hitCount) + for (i in 0.. { + val delay = buffer.gSmart1or2() + hits += + Hit( + 0x7FFE, + -1, + -1, + -1, + delay, + ) + } + 0x7FFF -> { + val mainType = buffer.gSmart1or2() + val value = buffer.gSmart1or2() + val soakType = buffer.gSmart1or2() + val soakValue = buffer.gSmart1or2() + val delay = buffer.gSmart1or2() + hits += + Hit( + mainType, + value, + soakType, + soakValue, + delay, + ) + } + else -> { + val value = buffer.gSmart1or2() + val delay = buffer.gSmart1or2() + hits += + Hit( + type, + value, + -1, + -1, + delay, + ) + } + } + } + + val headbarCount = buffer.g1Alt1() + val headbars = ArrayList(headbarCount) + for (i in 0.. 0) { + buffer.g1Alt3() + } else { + startFill + } + headbars += + Headbar( + type, + startFill, + endFill, + startTime, + endTime, + ) + } + blocks += HitExtendedInfo(hits, headbars) + } + + private fun decodeSpotanim( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val spotanims = mutableMapOf() + val count = buffer.g1Alt3() + for (i in 0.., + ) { + val id = buffer.g2Alt1() + val delay = buffer.g1Alt2() + blocks += SequenceExtendedInfo(id, delay) + } + + private fun decodeCombatLevelChange( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val level = buffer.g4() + blocks += CombatLevelChangeExtendedInfo(level) + } + + private fun decodeTinting( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val start = buffer.g2Alt2() + val end = buffer.g2Alt2() + val hue = buffer.g1Alt2() + val saturation = buffer.g1Alt3() + val lightness = buffer.g1Alt2() + val weight = buffer.g1Alt3() + blocks += + TintingExtendedInfo( + start, + end, + hue, + saturation, + lightness, + weight, + ) + } + + private fun decodeTransformation( + buffer: JagByteBuf, + blocks: MutableList, + npc: Npc, + ) { + val id = buffer.g2Alt3() + blocks += TransformationExtendedInfo(id) + npc.id = id + } + + private fun decodeEnabledOps( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val flag = buffer.g1Alt3() + blocks += EnabledOpsExtendedInfo(flag) + } + + private fun decodeFacePathingEntity( + buffer: JagByteBuf, + blocks: MutableList, + ) { + var index = buffer.g2Alt2() + index += buffer.g1() shl 16 + blocks += FacePathingEntityExtendedInfo(index) + } + + private fun decodeBodyCustomisation( + id: Int, + buffer: JagByteBuf, + blocks: MutableList, + ) { + val flag = buffer.g1Alt1() + if (flag and 0x1 != 0) { + blocks += BodyCustomisationExtendedInfo(ResetCustomisation) + return + } + val models = + if (flag and 0x2 != 0) { + val count = buffer.g1Alt1() + val models = ArrayList(count) + for (i in 0..(length) + for (i in 0..(length) + for (i in 0.., + ) { + val flag = buffer.g1Alt2() + if (flag and 0x1 != 0) { + blocks += BodyCustomisationExtendedInfo(ResetCustomisation) + return + } + val models = + if (flag and 0x2 != 0) { + val count = buffer.g1Alt1() + val models = ArrayList(count) + for (i in 0..(length) + for (i in 0..(length) + for (i in 0.., + ) { + val text = buffer.gjstr() + blocks += SayExtendedInfo(text) + } + + private fun decodeExactMove( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val deltaX1 = buffer.g1sAlt3() + val deltaZ1 = buffer.g1s() + val deltaX2 = buffer.g1sAlt3() + val deltaZ2 = buffer.g1sAlt3() + val delay1 = buffer.g2Alt2() + val delay2 = buffer.g2Alt2() + val direction = buffer.g2Alt3() + blocks += + ExactMoveExtendedInfo( + deltaX1, + deltaZ1, + delay1, + deltaX2, + deltaZ2, + delay2, + direction, + ) + } + + private fun decodeNameChange( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val text = buffer.gjstr() + blocks += NameChangeExtendedInfo(text) + } + + private fun decodeHeadiconCustomisation( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val flag = buffer.g1Alt2() + val groups = IntArray(8) + val indices = IntArray(8) + for (i in 0..<8) { + if (flag and (1 shl i) != 0) { + groups[i] = buffer.gSmart2or4null() + indices[i] = buffer.gSmart1or2null() + } else { + groups[i] = -1 + indices[i] = -1 + } + } + blocks += HeadIconCustomisationExtendedInfo(groups, indices) + } + + private fun decodeFaceAngle( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val angle = buffer.g2Alt2() + val instant = buffer.g1() == 1 + blocks += FaceAngleExtendedInfo(angle, instant) + } + + private fun processHighResolution(buffer: BitBuf) { + val count = buffer.gBits(8) + if (count < transmittedNPCCount) { + for (i in count.. { + transmittedNPC[transmittedNPCCount++] = index + npc.lastTransmitCycle = cycle + npc.clearMovement() + extraUpdateNPC[extraUpdateNPCCount++] = index + updates[index] = UpdateType.ACTIVE + } + 1 -> { + transmittedNPC[transmittedNPCCount++] = index + npc.lastTransmitCycle = cycle + val walkDirection = buffer.gBits(3) + npc.addRouteWaypointAdjacent( + walkDirection, + MoveSpeed.WALK, + ) + val extendedInfo = buffer.gBits(1) + if (extendedInfo == 1) { + this.extraUpdateNPC[extraUpdateNPCCount++] = index + } + updates[index] = UpdateType.ACTIVE + } + 2 -> { + transmittedNPC[transmittedNPCCount++] = index + npc.lastTransmitCycle = cycle + if (buffer.gBits(1) == 1) { + val walkDirection = buffer.gBits(3) + npc.addRouteWaypointAdjacent( + walkDirection, + MoveSpeed.RUN, + ) + val runDirection = buffer.gBits(3) + npc.addRouteWaypointAdjacent( + runDirection, + MoveSpeed.RUN, + ) + } else { + val crawlDirection = buffer.gBits(3) + npc.addRouteWaypointAdjacent( + crawlDirection, + MoveSpeed.CRAWL, + ) + } + val extendedInfo = buffer.gBits(1) + if (extendedInfo == 1) { + this.extraUpdateNPC[extraUpdateNPCCount++] = index + } + updates[index] = UpdateType.ACTIVE + } + 3 -> { + npc.clearMovement() + deletedNPC[deletedNPCCount++] = index + updates[index] = UpdateType.HIGH_RESOLUTION_TO_LOW_RESOLUTION + } + } + } + } + + private fun processLowResolution( + large: Boolean, + buffer: BitBuf, + baseCoord: CoordGrid, + ) { + while (true) { + val indexBitCount = 16 + val capacity = (1 shl indexBitCount) + if (buffer.readableBits() >= indexBitCount + 12) { + val index = buffer.gBits(indexBitCount) + if (capacity - 1 != index) { + var isNew = false + if (npc[index] == null) { + npc[index] = Npc(-1, CoordGrid.INVALID) + isNew = true + } + val existingType = updates[index] + if (existingType == UpdateType.HIGH_RESOLUTION_TO_LOW_RESOLUTION) { + // Teleport + updates[index] = UpdateType.ACTIVE + } else { + updates[index] = UpdateType.LOW_RESOLUTION_TO_HIGH_RESOLUTION + } + val npc = checkNotNull(npc[index]) + transmittedNPC[transmittedNPCCount++] = index + npc.lastTransmitCycle = cycle + + val deltaX = decodeDelta(large, buffer) + val hasSpawnCycle = buffer.gBits(1) == 1 + if (hasSpawnCycle) { + npc.spawnCycle = buffer.gBits(32) + } + val angle = NPC_TURN_ANGLES[buffer.gBits(3)] + val jump = buffer.gBits(1) + val deltaZ = decodeDelta(large, buffer) + npc.id = buffer.gBits(14) + val extendedInfo = buffer.gBits(1) + if (isNew) { + npc.turnAngle = angle + npc.angle = angle + } + // reset bas + if (npc.turnSpeed == 0) { + npc.angle = 0 + } + if (extendedInfo == 1) { + this.extraUpdateNPC[extraUpdateNPCCount++] = index + } + npc.addRouteWaypoint( + baseCoord, + deltaX, + deltaZ, + jump == 1, + ) + continue + } + } + return + } + } + + private fun decodeDelta( + large: Boolean, + buffer: BitBuf, + ): Int = + if (large) { + var delta = buffer.gBits(8) + if (delta > 127) { + delta -= 256 + } + delta + } else { + var delta = buffer.gBits(6) + if (delta > 31) { + delta -= 64 + } + delta + } + + private class Npc( + var id: Int, + var coord: CoordGrid, + ) { + var lastTransmitCycle: Int = 0 + var moveSpeed: MoveSpeed = MoveSpeed.STATIONARY + var turnAngle = 0 + var angle = 0 + var spawnCycle = 0 + var turnSpeed = 32 + var jump: Boolean = false + var steps: MutableList = mutableListOf() + + fun clearMovement() { + this.moveSpeed = MoveSpeed.STATIONARY + this.jump = false + } + + fun addRouteWaypoint( + baseCoord: CoordGrid, + relativeX: Int, + relativeZ: Int, + jump: Boolean, + ) { + coord = CoordGrid(baseCoord.level, baseCoord.x + relativeX, baseCoord.z + relativeZ) + moveSpeed = MoveSpeed.STATIONARY + this.jump = jump + } + + fun addRouteWaypointAdjacent( + opcode: Int, + speed: MoveSpeed, + ) { + steps += opcode + var x = coord.x + var z = coord.z + if (opcode == 0) { + --x + ++z + } + + if (opcode == 1) { + ++z + } + + if (opcode == 2) { + ++x + ++z + } + + if (opcode == 3) { + --x + } + + if (opcode == 4) { + ++x + } + + if (opcode == 5) { + --x + --z + } + + if (opcode == 6) { + --z + } + + if (opcode == 7) { + ++x + --z + } + + coord = CoordGrid(coord.level, x, z) + moveSpeed = speed + } + } + + private companion object { + private val NPC_TURN_ANGLES = intArrayOf(768, 1024, 1280, 512, 1536, 256, 0, 1792) + private const val EXTENDED_SHORT: Int = 0x10 + private const val EXTENDED_MEDIUM: Int = 0x800 + + private const val OLD_SPOTANIM_UNUSED: Int = 0x1 + private const val SEQUENCE: Int = 0x2 + private const val HITS: Int = 0x4 + private const val TRANSFORMATION: Int = 0x8 + private const val OLD_FACE_COORD_UNUSED: Int = 0x20 + private const val SAY: Int = 0x40 + private const val FACE_PATHINGENTITY: Int = 0x80 + private const val TINTING: Int = 0x100 + private const val LEVEL_CHANGE: Int = 0x200 + private const val HEAD_CUSTOMISATION: Int = 0x400 + private const val NAME_CHANGE: Int = 0x1000 + private const val BODY_CUSTOMISATION: Int = 0x2000 + private const val EXACT_MOVE: Int = 0x4000 + private const val OPS: Int = 0x8000 + private const val HEADICON_CUSTOMISATION: Int = 0x10000 + private const val FACE_ANGLE: Int = 0x20000 + private const val SPOTANIM: Int = 0x40000 + private const val BAS_CHANGE: Int = 0x80000 + + private enum class UpdateType { + IDLE, + LOW_RESOLUTION_TO_HIGH_RESOLUTION, + HIGH_RESOLUTION_TO_LOW_RESOLUTION, + ACTIVE, + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt new file mode 100644 index 00000000..ed57d324 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt @@ -0,0 +1,1070 @@ +package net.rsprox.protocol.v236.game.outgoing.model.info.playerinfo + +import io.netty.buffer.ByteBuf +import io.netty.buffer.Unpooled +import net.rsprot.buffer.JagByteBuf +import net.rsprot.buffer.bitbuffer.BitBuf +import net.rsprot.buffer.bitbuffer.toBitBuf +import net.rsprot.buffer.extensions.toJagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.PlayerInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.PlayerInfoDecoder +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.PlayerUpdateType +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.AppearanceExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.ChatExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.MoveSpeedExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.NameExtrasExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.ObjTypeCustomisation +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.extendedinfo.TemporaryMoveSpeedExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.util.LowResolutionPosition +import net.rsprox.protocol.game.outgoing.model.info.playerinfo.util.PlayerInfoInitBlock +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.ExactMoveExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.ExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.FaceAngleExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.FacePathingEntityExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Headbar +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Hit +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.HitExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SayExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SequenceExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.Spotanim +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SpotanimExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.TintingExtendedInfo + +@Suppress("DuplicatedCode") +internal class PlayerInfoClient( + private val localIndex: Int, + private val huffmanCodec: HuffmanCodec, +) : PlayerInfoDecoder { + private var extendedInfoCount: Int = 0 + private val extendedInfoIndices: IntArray = IntArray(2048) + private var highResolutionCount: Int = 0 + private val highResolutionIndices: IntArray = IntArray(2048) + private var lowResolutionCount: Int = 0 + private val lowResolutionIndices: IntArray = IntArray(2048) + private val unmodifiedFlags: ByteArray = ByteArray(2048) + private val cachedPlayers: Array = arrayOfNulls(2048) + private val lowResolutionPositions: IntArray = IntArray(2048) + private val updateTypes: Array = + Array(2048) { + UpdateType.LOW_RESOLUTION_IDLE + } + + override fun gpiInit(initBlock: PlayerInfoInitBlock) { + val localPlayer = Player() + cachedPlayers[localIndex] = localPlayer + localPlayer.coord = initBlock.localPlayerCoord + highResolutionCount = 0 + highResolutionIndices[highResolutionCount++] = localIndex + unmodifiedFlags[localIndex] = 0 + lowResolutionCount = 0 + for (idx in 1..<2048) { + if (idx == localIndex) continue + val packed = initBlock.getLowResolutionPosition(idx).packed + val level = packed shr 16 + val x = packed shr 8 and 597 + val z = packed and 597 + lowResolutionPositions[idx] = CoordGrid(level, x, z).packed + lowResolutionIndices[lowResolutionCount++] = idx + unmodifiedFlags[idx] = 0 + } + } + + override fun reset() { + for (i in cachedPlayers.indices) { + cachedPlayers[i] = null + } + highResolutionCount = 0 + lowResolutionCount = 0 + unmodifiedFlags.fill(0) + lowResolutionPositions.fill(0) + lowResolutionIndices.fill(0) + } + + override fun decode(buffer: ByteBuf): PlayerInfo { + extendedInfoCount = 0 + updateTypes.fill(UpdateType.LOW_RESOLUTION_IDLE) + for (player in cachedPlayers) { + player?.extendedInfoBlocks = emptyList() + } + val updates = mutableMapOf() + decodeBitCodes(buffer) + for ((index, updateType) in updateTypes.withIndex()) { + when (updateType) { + UpdateType.LOW_RESOLUTION_IDLE -> { + // updates[index] = PlayerUpdateType.LowResolutionIdle + // ^Ignore these as they are too spammy + } + UpdateType.HIGH_RESOLUTION_IDLE -> { + val player = checkNotNull(cachedPlayers[index]) + updates[index] = PlayerUpdateType.HighResolutionIdle(player.extendedInfoBlocks) + } + UpdateType.LOW_RESOLUTION_TO_HIGH_RESOLUTION -> { + val player = checkNotNull(cachedPlayers[index]) + updates[index] = + PlayerUpdateType.LowResolutionToHighResolution( + player.coord, + player.extendedInfoBlocks, + ) + } + UpdateType.HIGH_RESOLUTION_MOVEMENT -> { + val player = checkNotNull(cachedPlayers[index]) + updates[index] = + PlayerUpdateType.HighResolutionMovement( + player.coord, + player.extendedInfoBlocks, + ) + } + UpdateType.LOW_RESOLUTION_MOVEMENT -> { + val coord = CoordGrid(this.lowResolutionPositions[index]) + val lowResX = coord.x + val lowResZ = coord.z + val level = coord.level + updates[index] = + PlayerUpdateType.LowResolutionMovement( + LowResolutionPosition( + lowResX, + lowResZ, + level, + ), + ) + } + UpdateType.HIGH_RESOLUTION_TO_LOW_RESOLUTION -> { + val coord = CoordGrid(this.lowResolutionPositions[index]) + val lowResX = coord.x + val lowResZ = coord.z + val level = coord.level + updates[index] = + PlayerUpdateType.HighResolutionToLowResolution( + LowResolutionPosition( + lowResX, + lowResZ, + level, + ), + ) + } + } + } + return PlayerInfo(updates) + } + + private fun setUpdateType( + idx: Int, + updateType: UpdateType, + ) { + this.updateTypes[idx] = updateType + } + + private fun decodeBitCodes(byteBuf: ByteBuf) { + byteBuf.toBitBuf().use { buffer -> + var skipped = 0 + for (i in 0.. 0) { + --skipped + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + val active = buffer.gBits(1) + if (active == 0) { + skipped = readStationary(buffer) + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + getHighResolutionPlayerPosition(buffer, idx) + } + } + } + } + if (skipped != 0) { + throw RuntimeException() + } + } + byteBuf.toBitBuf().use { buffer -> + var skipped = 0 + for (i in 0.. 0) { + --skipped + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + val active = buffer.gBits(1) + if (active == 0) { + skipped = readStationary(buffer) + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + getHighResolutionPlayerPosition(buffer, idx) + } + } + } + } + if (skipped != 0) { + throw RuntimeException() + } + } + + byteBuf.toBitBuf().use { buffer -> + var skipped = 0 + for (i in 0.. 0) { + --skipped + setUpdateType(idx, UpdateType.LOW_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + val active = buffer.gBits(1) + if (active == 0) { + skipped = readStationary(buffer) + setUpdateType(idx, UpdateType.LOW_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else if (getLowResolutionPlayerPosition(buffer, idx)) { + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } + } + } + } + if (skipped != 0) { + throw RuntimeException() + } + } + byteBuf.toBitBuf().use { buffer -> + var skipped = 0 + for (i in 0.. 0) { + --skipped + setUpdateType(idx, UpdateType.LOW_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else { + val active = buffer.gBits(1) + if (active == 0) { + skipped = readStationary(buffer) + setUpdateType(idx, UpdateType.LOW_RESOLUTION_IDLE) + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } else if (getLowResolutionPlayerPosition(buffer, idx)) { + unmodifiedFlags[idx] = (unmodifiedFlags[idx].toInt() or NEXT_CYCLE_INACTIVE).toByte() + } + } + } + } + if (skipped != 0) { + throw RuntimeException() + } + } + lowResolutionCount = 0 + highResolutionCount = 0 + for (i in 1..<2048) { + unmodifiedFlags[i] = (unmodifiedFlags[i].toInt() shr 1).toByte() + val cachedPlayer = cachedPlayers[i] + if (cachedPlayer != null) { + highResolutionIndices[highResolutionCount++] = i + } else { + lowResolutionIndices[lowResolutionCount++] = i + } + } + decodeExtendedInfo(byteBuf.toJagByteBuf()) + } + + private fun decodeExtendedInfo(buffer: JagByteBuf) { + for (i in 0..() + player.extendedInfoBlocks = blocks + decodeExtendedInfoBlocks(buffer, flag, blocks) + } + } + + private fun decodeExtendedInfoBlocks( + buffer: JagByteBuf, + flags: Int, + blocks: MutableList, + ) { + if (flags and APPEARANCE != 0) { + val len = buffer.g1Alt1() + val data = ByteArray(len) + buffer.gdataAlt3(data) + decodeAppearance(Unpooled.wrappedBuffer(data).toJagByteBuf(), blocks) + } + if (flags and TEMP_MOVE_SPEED != 0) { + decodeTemporaryMoveSpeed(buffer, blocks) + } + if (flags and TINTING != 0) { + decodeTinting(buffer, blocks) + } + if (flags and FACE_ANGLE != 0) { + decodeFaceAngle(buffer, blocks) + } + if (flags and SEQUENCE != 0) { + decodeSequence(buffer, blocks) + } + if (flags and SAY != 0) { + decodeSay(buffer, blocks) + } + if (flags and CHAT != 0) { + decodeChat(buffer, blocks) + } + if (flags and HITS != 0) { + decodeHit(buffer, blocks) + } + if (flags and MOVE_SPEED != 0) { + decodeMoveSpeed(buffer, blocks) + } + if (flags and CHAT_OLD != 0) { + throw IllegalStateException("Old chat used!") + } + if (flags and SPOTANIM != 0) { + decodeSpotanims(buffer, blocks) + } + if (flags and NAME_EXTRAS != 0) { + decodeNameExtras(buffer, blocks) + } + if (flags and EXACT_MOVE != 0) { + decodeExactMove(buffer, blocks) + } + if (flags and FACE_PATHINGENTITY != 0) { + decodeFacePathingEntity(buffer, blocks) + } + } + + private fun decodeMoveSpeed( + buffer: JagByteBuf, + blocks: MutableList, + ) { + blocks += MoveSpeedExtendedInfo(buffer.g1sAlt1()) + } + + private fun decodeTemporaryMoveSpeed( + buffer: JagByteBuf, + blocks: MutableList, + ) { + blocks += TemporaryMoveSpeedExtendedInfo(buffer.g1sAlt2()) + } + + private fun decodeSequence( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val id = buffer.g2Alt1() + val delay = buffer.g1Alt1() + blocks += SequenceExtendedInfo(id, delay) + } + + private fun decodeFacePathingEntity( + buffer: JagByteBuf, + blocks: MutableList, + ) { + var index = buffer.g2() + index += buffer.g1Alt3() shl 16 + blocks += FacePathingEntityExtendedInfo(index) + } + + private fun decodeFaceAngle( + buffer: JagByteBuf, + blocks: MutableList, + ) { + blocks += FaceAngleExtendedInfo(buffer.g2()) + } + + private fun decodeSay( + buffer: JagByteBuf, + blocks: MutableList, + ) { + blocks += SayExtendedInfo(buffer.gjstr()) + } + + private fun decodeNameExtras( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val beforeName = buffer.gjstr() + val afterName = buffer.gjstr() + val afterCombatLevel = buffer.gjstr() + blocks += NameExtrasExtendedInfo(beforeName, afterName, afterCombatLevel) + } + + private fun decodeChat( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val colourAndEffectsPacked = buffer.g2Alt2() + val modIcon = buffer.g1Alt2() + val autotyper = buffer.g1Alt2() == 1 + val huffmanLength = buffer.g1Alt3() + val data = ByteArray(huffmanLength) + buffer.gdataAlt1(data) + val text = huffmanCodec.decode(Unpooled.wrappedBuffer(data)) + val colour = colourAndEffectsPacked ushr 8 + val effects = colourAndEffectsPacked and 0xFF + val patternLength = if (colour in 13..20) colour - 12 else 0 + val pattern = + if (patternLength in 1..8) { + val array = ByteArray(patternLength) + for (i in 0.., + ) { + val deltaX1 = buffer.g1sAlt3() + val deltaZ1 = buffer.g1s() + val deltaX2 = buffer.g1s() + val deltaZ2 = buffer.g1sAlt1() + val delay1 = buffer.g2Alt2() + val delay2 = buffer.g2() + val direction = buffer.g2Alt3() + blocks += + ExactMoveExtendedInfo( + deltaX1, + deltaZ1, + delay1, + deltaX2, + deltaZ2, + delay2, + direction, + ) + } + + private fun decodeSpotanims( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val spotanims = mutableMapOf() + val count = buffer.g1() + for (i in 0.., + ) { + val hitCount = buffer.g1Alt2() + val hits = ArrayList(hitCount) + for (i in 0.. { + val delay = buffer.gSmart1or2() + hits += + Hit( + 0x7FFE, + -1, + -1, + -1, + delay, + ) + } + 0x7FFF -> { + val mainType = buffer.gSmart1or2() + val value = buffer.gSmart1or2() + val soakType = buffer.gSmart1or2() + val soakValue = buffer.gSmart1or2() + val delay = buffer.gSmart1or2() + hits += + Hit( + mainType, + value, + soakType, + soakValue, + delay, + ) + } + else -> { + val value = buffer.gSmart1or2() + val delay = buffer.gSmart1or2() + hits += + Hit( + type, + value, + -1, + -1, + delay, + ) + } + } + } + + val headbarCount = buffer.g1Alt2() + val headbars = ArrayList(headbarCount) + for (i in 0.. 0) { + buffer.g1Alt1() + } else { + startFill + } + headbars += + Headbar( + type, + startFill, + endFill, + startTime, + endTime, + ) + } + blocks += HitExtendedInfo(hits, headbars) + } + + private fun decodeTinting( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val start = buffer.g2Alt2() + val end = buffer.g2Alt2() + val hue = buffer.g1sAlt3() + val saturation = buffer.g1sAlt1() + val lightness = buffer.g1sAlt3() + val weight = buffer.g1Alt1() + blocks += + TintingExtendedInfo( + start, + end, + hue, + saturation, + lightness, + weight, + ) + } + + private fun decodeAppearance( + buffer: JagByteBuf, + blocks: MutableList, + ) { + val gender = buffer.g1s() + val skullIcon = buffer.g1s() + val overheadIcon = buffer.g1s() + val identKit = IntArray(12) + var transformedNpcId: Int = -1 + for (i in 0..<12) { + val flag = buffer.g1() + if (flag == 0) { + identKit[i] = 0 + continue + } + val extra = buffer.g1() + identKit[i] = (flag shl 8) + extra + if (i == 0 && identKit[i] == 65535) { + transformedNpcId = buffer.g2() + break + } + } + val interfaceInentKit = IntArray(12) + for (i in 0..<12) { + val value = buffer.g1() + if (value == 0) { + interfaceInentKit[i] = 0 + } else { + interfaceInentKit[i] = (value shl 8) + buffer.g1() + } + } + val colours = IntArray(5) + for (i in 0..<5) { + colours[i] = buffer.g1() + } + val readyAnim = buffer.g2() + val turnAnim = buffer.g2() + val walkAnim = buffer.g2() + val walkAnimBack = buffer.g2() + val walkAnimLeft = buffer.g2() + val walkAnimRight = buffer.g2() + val runAnim = buffer.g2() + val name = buffer.gjstr() + val combatLevel = buffer.g1() + val skillLevel = buffer.g2() + val hidden = buffer.g1() == 1 + val customisationFlag = buffer.g2() + val forceRefresh = customisationFlag shr 15 and 0x1 == 1 + val objTypeCustomisation: Array? = + if (customisationFlag > 0 && customisationFlag != 32768) { + val customisation = arrayOfNulls(12) + for (i in 0..<12) { + val hasCustomisation = customisationFlag shr (12 - i) and 1 + if (hasCustomisation == 1) { + var recolIndices: Int = -1 + var recol1: Int = -1 + var recol2: Int = -1 + var retexIndices: Int = -1 + var retex1: Int = -1 + var retex2: Int = -1 + var manWear: Int = -1 + var womanWear: Int = -1 + var manHead: Int = -1 + var womanHead: Int = -1 + + val slotFlag = buffer.g1() + val recol = slotFlag and 0x1 != 0 + val retex = slotFlag and 0x2 != 0 + val wearModels = slotFlag and 0x4 != 0 + val headModels = slotFlag and 0x8 != 0 + if (recol) { + recolIndices = buffer.g1() + val recolIndex1 = recolIndices and 15 + val recolIndex2 = recolIndices ushr 4 and 15 + recol1 = + if (recolIndex1 != 15) { + buffer.g2() + } else { + -1 + } + recol2 = + if (recolIndex2 != 15) { + buffer.g2() + } else { + -1 + } + } + + if (retex) { + retexIndices = buffer.g1() + val retexIndex1 = retexIndices and 15 + val retexIndex2 = retexIndices ushr 4 and 15 + retex1 = + if (retexIndex1 != 15) { + buffer.g2() + } else { + -1 + } + retex2 = + if (retexIndex2 != 15) { + buffer.g2() + } else { + -1 + } + } + + if (wearModels) { + manWear = buffer.g2() + womanWear = buffer.g2() + } + + if (headModels) { + manHead = buffer.g2() + womanHead = buffer.g2() + } + customisation[i] = + ObjTypeCustomisation( + recolIndices, + recol1, + recol2, + retexIndices, + retex1, + retex2, + manWear, + womanWear, + manHead, + womanHead, + ) + } + } + customisation + } else { + null + } + val beforeName = buffer.gjstr() + val afterName = buffer.gjstr() + val afterCombatLevel = buffer.gjstr() + val textGender = buffer.g1s() + blocks += + AppearanceExtendedInfo( + name, + combatLevel, + skillLevel, + hidden, + gender, + textGender, + skullIcon, + overheadIcon, + transformedNpcId, + identKit, + interfaceInentKit, + colours, + readyAnim, + turnAnim, + walkAnim, + walkAnimBack, + walkAnimLeft, + walkAnimRight, + runAnim, + beforeName, + afterName, + afterCombatLevel, + forceRefresh, + objTypeCustomisation, + ) + } + + private fun getHighResolutionPlayerPosition( + buffer: BitBuf, + idx: Int, + ) { + val extendedInfo = buffer.gBits(1) == 1 + if (extendedInfo) { + extendedInfoIndices[extendedInfoCount++] = idx + } + val opcode = buffer.gBits(2) + val cachedPlayer = checkNotNull(cachedPlayers[idx]) + if (opcode == 0) { + if (extendedInfo) { + cachedPlayer.queuedMove = false + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_IDLE) + } else if (localIndex == idx) { + throw RuntimeException() + } else { + lowResolutionPositions[idx] = + (cachedPlayer.coord.level shl 28) + .or(cachedPlayer.coord.z shr 13) + .or(cachedPlayer.coord.x shr 13 shl 14) + cachedPlayers[idx] = null + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_TO_LOW_RESOLUTION) + if (buffer.gBits(1) != 0) { + getLowResolutionPlayerPosition(buffer, idx) + } + } + } else if (opcode == 1) { + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_MOVEMENT) + val movementOpcode = buffer.gBits(3) + var curX = cachedPlayer.coord.x + var curZ = cachedPlayer.coord.z + when (movementOpcode) { + 0 -> { + --curX + --curZ + } + 1 -> { + --curZ + } + 2 -> { + ++curX + --curZ + } + 3 -> { + --curX + } + 4 -> { + ++curX + } + 5 -> { + --curX + ++curZ + } + 6 -> { + ++curZ + } + 7 -> { + ++curX + ++curZ + } + } + cachedPlayer.coord = CoordGrid(cachedPlayer.coord.level, curX, curZ) + cachedPlayer.queuedMove = extendedInfo + } else if (opcode == 2) { + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_MOVEMENT) + val movementOpcode = buffer.gBits(4) + var curX = cachedPlayer.coord.x + var curZ = cachedPlayer.coord.z + when (movementOpcode) { + 0 -> { + curX -= 2 + curZ -= 2 + } + 1 -> { + --curX + curZ -= 2 + } + 2 -> { + curZ -= 2 + } + 3 -> { + ++curX + curZ -= 2 + } + 4 -> { + curX += 2 + curZ -= 2 + } + 5 -> { + curX -= 2 + --curZ + } + 6 -> { + curX += 2 + --curZ + } + 7 -> { + curX -= 2 + } + 8 -> { + curX += 2 + } + 9 -> { + curX -= 2 + ++curZ + } + 10 -> { + curX += 2 + ++curZ + } + 11 -> { + curX -= 2 + curZ += 2 + } + 12 -> { + --curX + curZ += 2 + } + 13 -> { + curZ += 2 + } + 14 -> { + ++curX + curZ += 2 + } + 15 -> { + curX += 2 + curZ += 2 + } + } + cachedPlayer.coord = CoordGrid(cachedPlayer.coord.level, curX, curZ) + cachedPlayer.queuedMove = extendedInfo + } else { + setUpdateType(idx, UpdateType.HIGH_RESOLUTION_MOVEMENT) + val far = buffer.gBits(1) + if (far == 0) { + val coord = buffer.gBits(12) + val deltaLevel = coord shr 10 + var deltaX = coord shr 5 and 31 + if (deltaX > 15) { + deltaX -= 32 + } + var deltaZ = coord and 31 + if (deltaZ > 15) { + deltaZ -= 32 + } + var curLevel = cachedPlayer.coord.level + var curX = cachedPlayer.coord.x + var curZ = cachedPlayer.coord.z + curX += deltaX + curZ += deltaZ + curLevel = (curLevel + deltaLevel) and 0x3 + cachedPlayer.coord = CoordGrid(curLevel, curX, curZ) + cachedPlayer.queuedMove = extendedInfo + } else { + val coord = buffer.gBits(30) + val deltaLevel = coord shr 28 + val deltaX = coord shr 14 and 16383 + val deltaZ = coord and 16383 + var curLevel = cachedPlayer.coord.level + var curX = cachedPlayer.coord.x + var curZ = cachedPlayer.coord.z + curX = (curX + deltaX) and 16383 + curZ = (curZ + deltaZ) and 16383 + curLevel = (curLevel + deltaLevel) and 0x3 + cachedPlayer.coord = CoordGrid(curLevel, curX, curZ) + cachedPlayer.queuedMove = extendedInfo + } + } + } + + private fun getLowResolutionPlayerPosition( + buffer: BitBuf, + idx: Int, + ): Boolean { + val opcode = buffer.gBits(2) + when (opcode) { + 0 -> { + if (buffer.gBits(1) != 0) { + getLowResolutionPlayerPosition(buffer, idx) + } + val x = buffer.gBits(13) + val z = buffer.gBits(13) + val extendedInfo = buffer.gBits(1) == 1 + if (extendedInfo) { + this.extendedInfoIndices[extendedInfoCount++] = idx + } + if (cachedPlayers[idx] != null) { + throw RuntimeException() + } + val player = Player() + cachedPlayers[idx] = player + // cached appearance decoding + val lowResolutionPosition = lowResolutionPositions[idx] + val level = lowResolutionPosition shr 28 + val lowResX = lowResolutionPosition shr 14 and 0xFF + val lowResZ = lowResolutionPosition and 0xFF + player.coord = CoordGrid(level, (lowResX shl 13) + x, (lowResZ shl 13) + z) + player.queuedMove = false + setUpdateType(idx, UpdateType.LOW_RESOLUTION_TO_HIGH_RESOLUTION) + return true + } + 1 -> { + val levelDelta = buffer.gBits(2) + val lowResPosition = lowResolutionPositions[idx] + lowResolutionPositions[idx] = + ((((lowResPosition shr 28) + levelDelta) and 3 shl 28)) + .plus(lowResPosition and 268435455) + setUpdateType(idx, UpdateType.LOW_RESOLUTION_MOVEMENT) + return false + } + 2 -> { + setUpdateType(idx, UpdateType.LOW_RESOLUTION_MOVEMENT) + val bitpacked = buffer.gBits(5) + val levelDelta = bitpacked shr 3 + val movementCode = bitpacked and 7 + val lowResPosition = lowResolutionPositions[idx] + val level = (lowResPosition shr 28) + levelDelta and 3 + var x = lowResPosition shr 14 and 255 + var z = lowResPosition and 255 + if (movementCode == 0) { + --x + --z + } + + if (movementCode == 1) { + --z + } + + if (movementCode == 2) { + ++x + --z + } + + if (movementCode == 3) { + --x + } + + if (movementCode == 4) { + ++x + } + + if (movementCode == 5) { + --x + ++z + } + + if (movementCode == 6) { + ++z + } + + if (movementCode == 7) { + ++x + ++z + } + lowResolutionPositions[idx] = (x shl 14) + z + (level shl 28) + return false + } + else -> { + setUpdateType(idx, UpdateType.LOW_RESOLUTION_MOVEMENT) + val bitpacked = buffer.gBits(18) + val levelDelta = bitpacked shr 16 + val xDelta = bitpacked shr 8 and 255 + val zDelta = bitpacked and 255 + val lowResPosition = lowResolutionPositions[idx] + val level = (lowResPosition shr 28) + levelDelta and 3 + val x = (xDelta + (lowResPosition shr 14)) and 255 + val z = (zDelta + lowResPosition) and 255 + lowResolutionPositions[idx] = (x shl 14) + z + (level shl 28) + return false + } + } + } + + private fun readStationary(buffer: BitBuf): Int { + val type = buffer.gBits(2) + return when (type) { + 0 -> 0 + 1 -> buffer.gBits(5) + 2 -> buffer.gBits(8) + else -> buffer.gBits(11) + } + } + + private companion object { + private const val CUR_CYCLE_INACTIVE = 0x1 + private const val NEXT_CYCLE_INACTIVE = 0x2 + + private const val EXTENDED_SHORT = 0x1 + private const val EXTENDED_MEDIUM = 0x100 + + private const val CHAT_OLD = 0x2 + private const val APPEARANCE = 0x4 + private const val FACE_PATHINGENTITY = 0x8 + private const val SEQUENCE = 0x10 + private const val SAY = 0x20 + private const val HITS = 0x40 + private const val FACE_ANGLE = 0x80 + private const val EXACT_MOVE = 0x200 + private const val NAME_EXTRAS = 0x400 + private const val MOVE_SPEED = 0x800 + private const val CHAT = 0x1000 + private const val TINTING = 0x2000 + private const val TEMP_MOVE_SPEED = 0x4000 + private const val SPOTANIM = 0x10000 + + private class Player { + var queuedMove: Boolean = false + var coord: CoordGrid = CoordGrid.INVALID + var extendedInfoBlocks: List = emptyList() + } + + private enum class UpdateType { + LOW_RESOLUTION_IDLE, + HIGH_RESOLUTION_IDLE, + LOW_RESOLUTION_TO_HIGH_RESOLUTION, + HIGH_RESOLUTION_MOVEMENT, + LOW_RESOLUTION_MOVEMENT, + HIGH_RESOLUTION_TO_LOW_RESOLUTION, + } + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt new file mode 100644 index 00000000..5c6889fc --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt @@ -0,0 +1,511 @@ +package net.rsprox.protocol.v236.game.outgoing.model.info.worldentityinfo + +import net.rsprot.buffer.JagByteBuf +import net.rsprox.protocol.common.CoordFine +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.EnabledOpsExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.ExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.shared.extendedinfo.SequenceExtendedInfo +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfo +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoDecoder +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV1 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV2 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV3 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV4 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV5 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV6 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityMoveSpeed +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityUpdateType + +public class WorldEntityInfoClient : WorldEntityInfoDecoder { + private var transmittedWorldEntityCount: Int = 0 + private val transmittedWorldEntity: IntArray = IntArray(25) + private val worldEntity: Array = arrayOfNulls(4096) + private val earlyRemovals: MutableSet = mutableSetOf() + private val updates: MutableMap = mutableMapOf() + + override fun decode( + buffer: JagByteBuf, + baseCoord: CoordGrid, + version: Int, + ): WorldEntityInfo { + updates.clear() + earlyRemovals.clear() + if (version >= 6) { + decodeHighResolutionV4(buffer) + decodeLowResolutionV4(buffer, baseCoord) + } else if (version >= 5) { + decodeHighResolutionV3(buffer) + decodeLowResolutionV3(buffer, baseCoord) + } else if (version >= 3) { + decodeHighResolutionV2(buffer) + decodeLowResolutionV2(buffer, baseCoord, version) + } else { + decodeHighResolutionV1(buffer) + decodeLowResolutionV1(buffer, baseCoord) + } + val updates = updates.toMap() + return when (version) { + 1 -> WorldEntityInfoV1(updates) + 2 -> WorldEntityInfoV2(updates) + 3 -> WorldEntityInfoV3(updates) + 4 -> WorldEntityInfoV4(updates) + 5 -> WorldEntityInfoV5(earlyRemovals, updates) + 6 -> WorldEntityInfoV6(earlyRemovals, updates) + else -> error("Invalid version: $version") + } + } + + private fun decodeHighResolutionV1(buffer: JagByteBuf) { + val count = buffer.g1() + if (count < transmittedWorldEntityCount) { + throw RuntimeException("dang") + } + if (count > transmittedWorldEntityCount) { + throw RuntimeException("dang!") + } + this.transmittedWorldEntityCount = 0 + for (i in 0.. transmittedWorldEntityCount) { + throw RuntimeException("dang!") + } + this.transmittedWorldEntityCount = 0 + for (i in 0.. transmittedWorldEntityCount) { + throw RuntimeException("dang!") + } + this.transmittedWorldEntityCount = 0 + for (i in 0.. transmittedWorldEntityCount) { + throw RuntimeException("dang!") + } + this.transmittedWorldEntityCount = 0 + for (i in 0.. { + val flags = buffer.g1() + if (flags == 0) { + return emptyList() + } + val blocks = mutableListOf() + if (flags and 0x1 != 0) { + val id = buffer.g2() + val delay = buffer.g1() + blocks += SequenceExtendedInfo(id, delay) + } + + if (flags and 0x2 != 0) { + blocks += EnabledOpsExtendedInfo(buffer.g1()) + } + return blocks + } + + private fun decodeAngledCoordFineComponent( + buffer: JagByteBuf, + bitpackedOpcode: Int, + shift: Int, + ): Int { + val opcode = (bitpackedOpcode shr shift) and 0x3 + return when (opcode) { + 3 -> buffer.g4() + 2 -> buffer.g2s() + 1 -> buffer.g1s() + else -> 0 + } + } + + private fun decodeLowResolutionV1( + buffer: JagByteBuf, + baseCoord: CoordGrid, + ) { + while (buffer.isReadable(10)) { + val index = buffer.g2() + this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index + val sizeX = buffer.g1() * 8 + val sizeZ = buffer.g1() * 8 + val xInBuildArea = buffer.g1() + val zInBuildArea = buffer.g1() + val angle = buffer.g2() + val unknownProperty = buffer.g2() + val coord = CoordGrid(baseCoord.level, baseCoord.x + xInBuildArea, baseCoord.z + zInBuildArea) + val worldEntity = + WorldEntityV1( + index, + sizeX, + sizeZ, + unknownProperty, + coord, + angle, + WorldEntityMoveSpeed.ZERO, + ) + this.worldEntity[index] = worldEntity + this.updates[index] = + WorldEntityUpdateType.LowResolutionToHighResolutionV1( + sizeX, + sizeZ, + angle, + unknownProperty, + coord, + ) + } + } + + private fun decodeLowResolutionV2( + buffer: JagByteBuf, + baseCoord: CoordGrid, + version: Int, + ) { + while (buffer.isReadable(10)) { + val index = buffer.g2() + this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index + val sizeX = buffer.g1() * 8 + val sizeZ = buffer.g1() * 8 + val level = buffer.g1s() + var coordFine = CoordFine(0, 0, 0) + var angle = 0 + val bitpackedAngledCoordFineOpcodes = buffer.g1s() + if (bitpackedAngledCoordFineOpcodes != 0) { + val deltaX = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 0) + val deltaY = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 2) + val deltaZ = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 4) + angle = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 6) + coordFine = CoordFine(coordFine.x + deltaX, coordFine.y + deltaY, coordFine.z + deltaZ) + } + coordFine = + CoordFine( + (baseCoord.x shl 7) + coordFine.x, + coordFine.y, + (baseCoord.z shl 7) + coordFine.z, + ) + val centerFineOffsetX = if (version >= 4) buffer.g2s() else null + val centerFineOffsetZ = if (version >= 4) buffer.g2s() else null + val worldEntity = + WorldEntityV2( + index, + sizeX, + sizeZ, + coordFine, + angle, + level, + centerFineOffsetX, + centerFineOffsetZ, + ) + this.worldEntity[index] = worldEntity + this.updates[index] = + WorldEntityUpdateType.LowResolutionToHighResolutionV2( + sizeX, + sizeZ, + angle, + coordFine, + level, + centerFineOffsetX, + centerFineOffsetZ, + ) + } + } + + private fun decodeLowResolutionV3( + buffer: JagByteBuf, + baseCoord: CoordGrid, + ) { + while (buffer.isReadable(10)) { + val index = buffer.g2() + this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index + val sizeX = buffer.g1() * 8 + val sizeZ = buffer.g1() * 8 + val id = buffer.g2() + var coordFine = CoordFine(0, 0, 0) + var angle = 0 + val bitpackedAngledCoordFineOpcodes = buffer.g1s() + if (bitpackedAngledCoordFineOpcodes != 0) { + val deltaX = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 0) + val deltaY = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 2) + val deltaZ = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 4) + angle = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 6) + coordFine = CoordFine(coordFine.x + deltaX, coordFine.y + deltaY, coordFine.z + deltaZ) + } + coordFine = + CoordFine( + (baseCoord.x shl 7) + coordFine.x, + coordFine.y, + (baseCoord.z shl 7) + coordFine.z, + ) + val priority = buffer.g1() + val worldEntity = + WorldEntityV3( + index, + id, + sizeX, + sizeZ, + priority, + coordFine, + angle, + ) + this.worldEntity[index] = worldEntity + this.updates[index] = + WorldEntityUpdateType.LowResolutionToHighResolutionV3( + id, + sizeX, + sizeZ, + angle, + priority, + coordFine, + ) + } + } + + private fun decodeLowResolutionV4( + buffer: JagByteBuf, + baseCoord: CoordGrid, + ) { + while (buffer.isReadable) { + val index = buffer.g2() + this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index + val sizeX = buffer.g1() * 8 + val sizeZ = buffer.g1() * 8 + val id = buffer.g2() + var coordFine = CoordFine(0, 0, 0) + var angle = 0 + val bitpackedAngledCoordFineOpcodes = buffer.g1s() + if (bitpackedAngledCoordFineOpcodes != 0) { + val deltaX = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 0) + val deltaY = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 2) + val deltaZ = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 4) + angle = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 6) + coordFine = CoordFine(coordFine.x + deltaX, coordFine.y + deltaY, coordFine.z + deltaZ) + } + coordFine = + CoordFine( + (baseCoord.x shl 7) + coordFine.x, + coordFine.y, + (baseCoord.z shl 7) + coordFine.z, + ) + val priority = buffer.g1() + val worldEntity = + WorldEntityV3( + index, + id, + sizeX, + sizeZ, + priority, + coordFine, + angle, + ) + val extendedInfo = decodeWorldEntityInfoExtendedInfo(buffer) + this.worldEntity[index] = worldEntity + this.updates[index] = + WorldEntityUpdateType.LowResolutionToHighResolutionV4( + id, + sizeX, + sizeZ, + angle, + priority, + coordFine, + extendedInfo, + ) + } + } + + @Suppress("unused") + private class WorldEntityV1( + val index: Int, + val sizeX: Int, + val sizeZ: Int, + val unknownProperty: Int, + var coordGrid: CoordGrid, + var angle: Int, + var moveSpeed: WorldEntityMoveSpeed, + ) + + @Suppress("unused") + private class WorldEntityV2( + val index: Int, + val sizeX: Int, + val sizeZ: Int, + var coordFine: CoordFine, + var angle: Int, + val level: Int, + val centerFineOffsetX: Int?, + val centerFineOffsetZ: Int?, + ) + + @Suppress("unused") + private class WorldEntityV3( + val index: Int, + val id: Int, + val sizeX: Int, + val sizeZ: Int, + val priority: Int, + var coordFine: CoordFine, + var angle: Int, + ) +} From f710d91132ed7b6507aa0423a676bc0955beae56 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 18:09:57 +0200 Subject: [PATCH 02/16] feat: update prot ids --- .../incoming/decoder/prot/GameClientProtId.kt | 198 ++++++------- .../outgoing/decoder/prot/GameServerProtId.kt | 278 +++++++++--------- 2 files changed, 242 insertions(+), 234 deletions(-) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt index 3c4bcb0c..75734fe6 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/prot/GameClientProtId.kt @@ -1,105 +1,105 @@ package net.rsprox.protocol.v236.game.incoming.decoder.prot internal object GameClientProtId { - const val OPLOC2 = 0 - const val EVENT_KEYBOARD = 1 - const val RESUME_P_COUNTDIALOG = 2 - const val AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL = 3 - const val RESUME_P_OBJDIALOG = 4 - const val SOUND_JINGLEEND = 5 - const val OPPLAYER2 = 6 - const val EVENT_APPLET_FOCUS = 7 - const val OPLOCU = 8 - const val IF_BUTTON = 9 + const val OPWORLDENTITYT = 0 + const val IGNORELIST_ADD = 1 + const val AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL = 2 + const val OPWORLDENTITY3 = 3 + const val CLANSETTINGS_FULL_REQUEST = 4 + const val WINDOW_STATUS = 5 + const val UPDATE_PLAYER_MODEL_V2 = 6 + const val SEND_PING_REPLY = 7 + const val REFLECTION_CHECK_REPLY = 8 + const val EVENT_NATIVE_MOUSE_MOVE = 9 const val SEND_SNAPSHOT = 10 - const val OPPLAYER4 = 11 - const val CLICKWORLDMAP = 12 - const val OCULUS_LEAVE = 13 - const val OPPLAYER1 = 14 - const val OPWORLDENTITY2 = 15 - const val OPWORLDENTITYU = 16 - const val OPLOC3 = 17 - const val EVENT_MOUSE_CLICK_V1 = 18 - const val OPWORLDENTITY5 = 19 - const val DETECT_MODIFIED_CLIENT = 20 - const val RESUME_P_NAMEDIALOG = 21 - const val CLOSE_MODAL = 22 - const val OPNPC1 = 23 - const val MOVE_MINIMAPCLICK = 24 - const val CLIENT_CHEAT = 25 - const val OPNPC2 = 26 - const val FRIENDLIST_DEL = 27 - const val OPLOC4 = 28 - const val OPPLAYER7 = 29 - const val IF_RUNSCRIPT = 30 - const val OPOBJ1 = 31 - const val RESUME_P_STRINGDIALOG = 32 - const val EVENT_MOUSE_SCROLL = 33 - const val CLANSETTINGS_FULL_REQUEST = 34 - const val BUG_REPORT = 35 - const val MAP_BUILD_COMPLETE = 36 - const val FRIENDCHAT_JOIN_LEAVE = 37 - const val CONNECTION_TELEMETRY = 38 - const val IF_BUTTONX = 39 - const val TELEPORT = 40 - const val OPWORLDENTITY4 = 41 - const val SEND_PING_REPLY = 42 - const val OPNPC5 = 43 - const val IDLE = 44 - const val IF_CRMVIEW_CLICK = 45 - const val OPOBJT = 46 - const val SET_CHATFILTERSETTINGS = 47 - const val OPPLAYER8 = 48 - const val EVENT_CAMERA_POSITION = 49 - const val OPLOC6 = 50 - const val OPWORLDENTITY1 = 51 - const val OPPLAYERU = 52 - const val REFLECTION_CHECK_REPLY = 53 - const val OPLOC5 = 54 - const val NO_TIMEOUT = 55 - const val OPOBJ3 = 56 - const val OPNPC6 = 57 - const val MESSAGE_PUBLIC = 58 - const val OPNPC4 = 59 - const val OPPLAYERT = 60 - const val OPLOCT = 61 - const val IGNORELIST_DEL = 62 - const val OPWORLDENTITYT = 63 - const val OPWORLDENTITY3 = 64 - const val MESSAGE_PRIVATE = 65 - const val IGNORELIST_ADD = 66 - const val FRIENDLIST_ADD = 67 - const val IF_BUTTONT = 68 - const val OPPLAYER3 = 69 - const val EVENT_MOUSE_MOVE = 70 - const val RESUME_PAUSEBUTTON = 71 - const val EVENT_NATIVE_MOUSE_CLICK_V2 = 72 - const val CLANCHANNEL_KICKUSER = 73 - const val FRIENDCHAT_SETRANK = 74 - const val OPNPCU = 75 - const val MOVE_GAMECLICK = 76 - const val OPOBJ2 = 77 - const val IF_SUBOP = 78 - const val OPOBJ6 = 79 - const val OPNPC3 = 80 - const val HISCORE_REQUEST = 81 - const val OPOBJU = 82 - const val EVENT_NATIVE_MOUSE_MOVE = 83 - const val CLANCHANNEL_FULL_REQUEST = 84 - const val IF_BUTTOND = 85 - const val UPDATE_PLAYER_MODEL_V2 = 86 - const val OPPLAYER5 = 87 - const val SET_HEADING = 88 + const val OPPLAYER8 = 11 + const val HISCORE_REQUEST = 12 + const val CLANCHANNEL_KICKUSER = 13 + const val FRIENDCHAT_KICK = 14 + const val EVENT_APPLET_FOCUS = 15 + const val OPLOCU = 16 + const val RESUME_P_OBJDIALOG = 17 + const val EVENT_MOUSE_SCROLL = 18 + const val EVENT_MOUSE_CLICK_V1 = 19 + const val IF_RUNSCRIPT = 20 + const val OPOBJU = 21 + const val OPNPC1 = 22 + const val OPLOC1 = 23 + const val MESSAGE_PRIVATE = 24 + const val OPLOC2 = 25 + const val OPOBJT = 26 + const val OPPLAYER4 = 27 + const val RESUME_PAUSEBUTTON = 28 + const val FRIENDCHAT_SETRANK = 29 + const val OPLOC3 = 30 + const val BUG_REPORT = 31 + const val OPWORLDENTITY1 = 32 + const val AFFINEDCLANSETTINGS_SETMUTED_FROMCHANNEL = 33 + const val FRIENDLIST_DEL = 34 + const val RESUME_P_NAMEDIALOG = 35 + const val OPPLAYER6 = 36 + const val RESUME_P_STRINGDIALOG = 37 + const val DETECT_MODIFIED_CLIENT = 38 + const val OPLOC4 = 39 + const val OPOBJ5 = 40 + const val OPNPCU = 41 + const val EVENT_MOUSE_MOVE = 42 + const val CLOSE_MODAL = 43 + const val OPOBJ3 = 44 + const val OPOBJ1 = 45 + const val RESUME_P_COUNTDIALOG = 46 + const val OCULUS_LEAVE = 47 + const val IGNORELIST_DEL = 48 + const val OPWORLDENTITY5 = 49 + const val OPLOCT = 50 + const val TELEPORT = 51 + const val OPWORLDENTITYU = 52 + const val OPNPCT = 53 + const val MOVE_GAMECLICK = 54 + const val IF_BUTTONT = 55 + const val OPLOC6 = 56 + const val IF_BUTTON = 57 + const val OPPLAYERU = 58 + const val MAP_BUILD_COMPLETE = 59 + const val IF_BUTTOND = 60 + const val MOVE_MINIMAPCLICK = 61 + const val CONNECTION_TELEMETRY = 62 + const val OPNPC3 = 63 + const val OPPLAYER5 = 64 + const val OPOBJ2 = 65 + const val OPPLAYER2 = 66 + const val OPNPC4 = 67 + const val CLIENT_CHEAT = 68 + const val FRIENDLIST_ADD = 69 + const val OPNPC2 = 70 + const val OPPLAYER1 = 71 + const val CLANCHANNEL_FULL_REQUEST = 72 + const val OPNPC5 = 73 + const val IDLE = 74 + const val OPPLAYER3 = 75 + const val CLICKWORLDMAP = 76 + const val EVENT_NATIVE_MOUSE_CLICK_V2 = 77 + const val EVENT_KEYBOARD = 78 + const val OPPLAYERT = 79 + const val IF_CRMVIEW_CLICK = 80 + const val SET_HEADING = 81 + const val SOUND_JINGLEEND = 82 + const val OPPLAYER7 = 83 + const val OPWORLDENTITY6 = 84 + const val OPLOC5 = 85 + const val MEMBERSHIP_PROMOTION_ELIGIBILITY = 86 + const val EVENT_CAMERA_POSITION = 87 + const val OPOBJ4 = 88 const val RSEVEN_STATUS = 89 - const val OPNPCT = 90 - const val OPOBJ5 = 91 - const val MEMBERSHIP_PROMOTION_ELIGIBILITY = 92 - const val WINDOW_STATUS = 93 - const val EVENT_NATIVE_MOUSE_CLICK_V1 = 94 - const val AFFINEDCLANSETTINGS_ADDBANNED_FROMCHANNEL = 95 - const val OPLOC1 = 96 - const val FRIENDCHAT_KICK = 97 - const val OPWORLDENTITY6 = 98 - const val OPPLAYER6 = 99 - const val OPOBJ4 = 100 + const val OPOBJ6 = 90 + const val IF_BUTTONX = 91 + const val OPWORLDENTITY2 = 92 + const val OPNPC6 = 93 + const val MESSAGE_PUBLIC = 94 + const val IF_SUBOP = 95 + const val OPWORLDENTITY4 = 96 + const val EVENT_NATIVE_MOUSE_CLICK_V1 = 97 + const val SET_CHATFILTERSETTINGS = 98 + const val NO_TIMEOUT = 99 + const val FRIENDCHAT_JOIN_LEAVE = 100 } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt index c1046a88..9f5575ac 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProtId.kt @@ -1,139 +1,147 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.prot internal object GameServerProtId { - const val SERVER_TICK_END = 0 - const val SET_PLAYER_OP = 1 - const val HISCORE_REPLY = 2 - const val UPDATE_REBOOT_TIMER = 3 - const val HIDENPCOPS = 4 - const val REFLECTION_CHECKER = 5 - const val URL_OPEN = 6 - const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 7 - const val LOC_DEL = 8 - const val IF_CLEARINV = 9 - const val PACKET_GROUP_START = 10 - const val IF_OPENSUB = 11 - const val MESSAGE_PRIVATE = 12 - const val HIDELOCOPS = 13 - const val SOUND_AREA = 14 - const val CAM_ROTATETO = 15 - const val CAM_TARGET_V3 = 16 - const val CAM_LOOKAT = 17 - const val IF_SETCOLOUR = 18 - const val UPDATE_IGNORELIST = 19 - const val MIDI_SONG_V2 = 20 - const val NPC_INFO_LARGE_V5 = 21 - const val NPC_ANIM_SPECIFIC = 22 - const val SET_INTERACTION_MODE = 23 - const val VARP_SMALL = 24 - const val CAM_LOOKAT_EASED_COORD = 25 - const val SYNTH_SOUND = 26 - const val MAP_ANIM_SPECIFIC = 27 - const val CAM_ROTATEBY = 28 - const val OBJ_ENABLED_OPS_SPECIFIC = 29 - const val MINIMAP_TOGGLE = 30 - const val UPDATE_INV_STOPTRANSMIT = 31 - const val MIDI_JINGLE = 32 - const val PLAYER_SPOTANIM_SPECIFIC = 33 - const val IF_SETPLAYERMODEL_BASECOLOUR = 34 - const val UPDATE_STAT_V2 = 35 - const val IF_SETANIM = 36 - const val MESSAGE_GAME = 37 - const val LOGOUT_WITHREASON = 38 - const val MESSAGE_CLANCHANNEL_SYSTEM = 39 - const val IF_RESYNC_V2 = 40 - const val FRIENDLIST_LOADED = 41 - const val TRIGGER_ONDIALOGABORT = 42 - const val IF_SETPOSITION = 43 - const val CAM_MODE = 44 - const val IF_OPENTOP = 45 - const val IF_SETSCROLLPOS = 46 - const val MIDI_SWAP = 47 - const val UPDATE_ZONE_PARTIAL_FOLLOWS = 48 - const val IF_SETHIDE = 49 - const val IF_MOVESUB = 50 - const val OBJ_ADD_SPECIFIC = 51 - const val HINT_ARROW = 52 - const val UPDATE_FRIENDLIST = 53 - const val LOC_ADD_CHANGE_V2 = 54 - const val UPDATE_TRADINGPOST = 55 - const val NPC_INFO_SMALL_V5 = 56 - const val IF_CLOSESUB = 57 - const val UPDATE_STOCKMARKET_SLOT = 58 - const val IF_SETMODEL = 59 - const val RESET_INTERACTION_MODE = 60 - const val IF_SETROTATESPEED = 61 - const val UNKNOWN_STRING = 62 - const val UPDATE_RUNENERGY = 63 - const val CLANCHANNEL_DELTA = 64 - const val IF_SETNPCHEAD_ACTIVE = 65 - const val LOGOUT = 66 - const val PROJANIM_SPECIFIC_V4 = 67 - const val CLANCHANNEL_FULL = 68 - const val SITE_SETTINGS = 69 - const val SET_MAP_FLAG = 70 - const val MESSAGE_CLANCHANNEL = 71 - const val VARCLAN_ENABLE = 72 - const val CLANSETTINGS_FULL = 73 - const val VARP_SYNC = 74 - const val PLAYER_ANIM_SPECIFIC = 75 - const val RESET_ANIMS = 76 - const val NPC_SPOTANIM_SPECIFIC = 77 - const val UPDATE_UID192 = 78 - const val REBUILD_NORMAL = 79 - const val MESSAGE_PRIVATE_ECHO = 80 - const val VARP_RESET = 81 - const val IF_SETTEXT = 82 - const val MIDI_SONG_WITHSECONDARY = 83 - const val SET_ACTIVE_WORLD_V2 = 84 - const val IF_SETOBJECT = 85 - const val LOC_ANIM = 86 - const val IF_SETPLAYERMODEL_SELF = 87 - const val REBUILD_WORLDENTITY_V3 = 88 - const val OBJ_DEL_SPECIFIC = 89 - const val VARCLAN_DISABLE = 90 - const val LOC_ANIM_SPECIFIC = 91 - const val SET_HEATMAP_ENABLED = 92 - const val UPDATE_INV_FULL = 93 - const val UPDATE_ZONE_FULL_FOLLOWS = 94 - const val CAM_SMOOTHRESET = 95 - const val CAM_SHAKE = 96 - const val PLAYER_INFO = 97 - const val CAM_RESET = 98 - const val NPC_HEADICON_SPECIFIC = 99 - const val SET_NPC_UPDATE_ORIGIN = 100 - const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 101 - const val MESSAGE_FRIENDCHANNEL = 102 - const val CLANSETTINGS_DELTA = 103 - const val REBUILD_REGION = 104 - const val UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER = 105 - const val CAM_MOVETO_CYCLES = 106 - const val LOGOUT_TRANSFER = 107 - const val CAM_MOVETO_ARC = 108 - const val UPDATE_ZONE_PARTIAL_ENCLOSED = 109 - const val IF_SETPLAYERMODEL_OBJ = 110 - const val CAM_MOVETO = 111 - const val UPDATE_RUNWEIGHT = 112 - const val SEND_PING = 113 - const val IF_SETPLAYERHEAD = 114 - const val IF_SETANGLE = 115 - const val VARCLAN = 116 - const val MIDI_SONG_STOP = 117 - const val HIDEOBJOPS = 118 - const val IF_SETPLAYERMODEL_BODYTYPE = 119 - const val MAP_ANIM = 120 - const val IF_SETNPCHEAD = 121 - const val OCULUS_SYNC = 122 - const val UPDATE_INV_PARTIAL = 123 - const val CHAT_FILTER_SETTINGS = 124 - const val LOC_MERGE = 125 - const val RUNCLIENTSCRIPT = 126 - const val VARP_LARGE = 127 - const val ZBUF = 128 - const val OBJ_CUSTOMISE_SPECIFIC = 129 - const val OBJ_COUNT_SPECIFIC = 130 - const val ACCOUNT_FLAGS = 131 - const val OBJ_UNCUSTOMISE_SPECIFIC = 132 - const val WORLDENTITY_INFO_V6 = 133 - const val IF_SETEVENTS_V2 = 134 + const val UPDATE_INV_STOPTRANSMIT = 0 + const val LOC_ADD_CHANGE_V2 = 1 + const val OCULUS_SYNC = 2 + const val NPC_HEADICON_SPECIFIC = 3 + const val CAM_SHAKE = 4 + const val IF_SETMODEL = 5 + const val MAP_ANIM = 6 + const val IF_SETOBJECT = 7 + const val UPDATE_REBOOT_TIMER_V2 = 8 + const val UNKNOWN_STRING = 9 + const val VARCLAN_ENABLE = 10 + const val UPDATE_ZONE_PARTIAL_FOLLOWS = 11 + const val IF_SETHIDE = 12 + const val LOC_ANIM_SPECIFIC = 13 + const val SERVER_TICK_END = 14 + const val IF_SETNPCHEAD = 15 + const val IF_SETPLAYERMODEL_OBJ = 16 + const val REFLECTION_CHECKER = 17 + const val CLANCHANNEL_FULL = 18 + const val NPC_SPOTANIM_SPECIFIC = 19 + const val RESET_ANIMS = 20 + const val IF_OPENSUB = 21 + const val MESSAGE_PRIVATE = 22 + const val SYNTH_SOUND = 23 + const val CAM_MOVETO_ARC_V1 = 24 + const val SET_INTERACTION_MODE = 25 + const val PROJANIM_SPECIFIC_V4 = 26 + const val IF_SETROTATESPEED = 27 + const val UPDATE_INV_PARTIAL = 28 + const val HIDENPCOPS = 29 + const val CLANSETTINGS_DELTA = 30 + const val IF_MOVESUB = 31 + const val VARCLAN = 32 + const val OBJ_ENABLED_OPS_SPECIFIC = 33 + const val REBUILD_NORMAL = 34 + const val MIDI_JINGLE = 35 + const val MESSAGE_FRIENDCHANNEL = 36 + const val VARP_SYNC = 37 + const val SITE_SETTINGS = 38 + const val OBJ_DEL_SPECIFIC = 39 + const val SET_NPC_UPDATE_ORIGIN = 40 + const val VARCLAN_DISABLE = 41 + const val IF_SETPOSITION = 42 + const val CAM_ROTATETO = 43 + const val UPDATE_REBOOT_TIMER_V1 = 44 + const val MESSAGE_PRIVATE_ECHO = 45 + const val LOC_DEL = 46 + const val MESSAGE_GAME = 47 + const val IF_SETANGLE = 48 + const val LOGOUT_TRANSFER = 49 + const val UPDATE_STAT_V2 = 50 + const val IF_CLEARINV = 51 + const val CAM_MOVETO_V1 = 52 + const val CHAT_FILTER_SETTINGS = 53 + const val PLAYER_INFO = 54 + const val MIDI_SWAP = 55 + const val VARP_SMALL = 56 + const val CAM_SMOOTHRESET = 57 + const val FRIENDLIST_LOADED = 58 + const val REBUILD_WORLDENTITY_V3 = 59 + const val UPDATE_TRADINGPOST = 60 + const val CAM_MOVETO_CYCLES_V1 = 61 + const val RESET_INTERACTION_MODE = 62 + const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 63 + const val NPC_INFO_SMALL_V5 = 64 + const val IF_SETSCROLLPOS = 65 + const val IF_SETCOLOUR = 66 + const val IF_OPENTOP = 67 + const val LOGOUT = 68 + const val SET_PLAYER_OP = 69 + const val UPDATE_IGNORELIST = 70 + const val VARP_RESET = 71 + const val REBUILD_REGION = 72 + const val SET_ACTIVE_WORLD_V2 = 73 + const val IF_SETPLAYERMODEL_SELF = 74 + const val CAM_MODE = 75 + const val HINT_ARROW = 76 + const val UPDATE_RUNWEIGHT = 77 + const val TRIGGER_ONDIALOGABORT = 78 + const val LOC_MERGE = 79 + const val SEND_PING = 80 + const val SET_HEATMAP_ENABLED = 81 + const val MESSAGE_CLANCHANNEL_SYSTEM = 82 + const val UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER = 83 + const val CAM_TARGET_V3 = 84 + const val LOC_ANIM = 85 + const val IF_SETPLAYERMODEL_BASECOLOUR = 86 + const val NPC_INFO_LARGE_V5 = 87 + const val MIDI_SONG_STOP = 88 + const val IF_SETPLAYERHEAD = 89 + const val CAM_RESET = 90 + const val NPC_ANIM_SPECIFIC = 91 + const val IF_SETTEXT = 92 + const val MAP_ANIM_SPECIFIC = 93 + const val CAM_ROTATEBY = 94 + const val VARP_LARGE = 95 + const val IF_CLOSESUB = 96 + const val IF_SETNPCHEAD_ACTIVE = 97 + const val HIDELOCOPS = 98 + const val CAM_LOOKAT_EASED_COORD_V1 = 99 + const val UPDATE_ZONE_FULL_FOLLOWS = 100 + const val UPDATE_ZONE_PARTIAL_ENCLOSED = 101 + const val CLANCHANNEL_DELTA = 102 + const val UPDATE_STOCKMARKET_SLOT = 103 + const val CAM_LOOKAT_V1 = 104 + const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 105 + const val IF_SETPLAYERMODEL_BODYTYPE = 106 + const val MESSAGE_CLANCHANNEL = 107 + const val PLAYER_SPOTANIM_SPECIFIC = 108 + const val PLAYER_ANIM_SPECIFIC = 109 + const val MIDI_SONG_V2 = 110 + const val UPDATE_RUNENERGY = 111 + const val HISCORE_REPLY = 112 + const val MINIMAP_TOGGLE = 113 + const val URL_OPEN = 114 + const val SOUND_AREA = 115 + const val UPDATE_UID192 = 116 + const val LOGOUT_WITHREASON = 117 + const val RUNCLIENTSCRIPT = 118 + const val IF_SETANIM = 119 + const val SET_MAP_FLAG_V1 = 120 + const val CLANSETTINGS_FULL = 121 + const val OBJ_ADD_SPECIFIC = 122 + const val UPDATE_INV_FULL = 123 + const val HIDEOBJOPS = 124 + const val PACKET_GROUP_START = 125 + const val UPDATE_FRIENDLIST = 126 + const val MIDI_SONG_WITHSECONDARY = 127 + const val CAM_MOVETO_CYCLES_V2 = 128 + const val WORLDENTITY_INFO_V6 = 129 + const val ACCOUNT_FLAGS = 130 + const val IF_SETEVENTS_V2 = 131 + const val WORLDENTITY_INFO_V7 = 132 + const val OBJ_UNCUSTOMISE_SPECIFIC = 133 + const val CAM_MOVETO_V2 = 134 + const val ZBUF = 135 + const val OBJ_COUNT_SPECIFIC = 136 + const val CAM_MOVETO_ARC_V2 = 137 + const val CAM_LOOKAT_EASED_COORD_V2 = 138 + const val SET_MAP_FLAG_V2 = 139 + const val CAM_LOOKAT_V2 = 140 + const val IF_RESYNC_V2 = 141 + const val OBJ_CUSTOMISE_SPECIFIC = 142 } From 944f9a754ea624317d9b58e456bb2b0faa0e3bdb Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 18:32:02 +0200 Subject: [PATCH 03/16] refactor: add _v1 suffix to all the older packets with a newer variant --- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- .../decoder/codec/camera/CamLookAtDecoder.kt | 10 +++---- .../camera/CamLookAtEasedCoordDecoder.kt | 10 +++---- .../codec/camera/CamMoveToArcDecoder.kt | 10 +++---- .../codec/camera/CamMoveToCyclesDecoder.kt | 10 +++---- .../decoder/codec/camera/CamMoveToDecoder.kt | 10 +++---- .../misc/client/UpdateRebootTimerDecoder.kt | 10 +++---- .../codec/misc/player/SetMapFlagDecoder.kt | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 14 +++++----- .../outgoing/decoder/prot/GameServerProtId.kt | 14 +++++----- ...der.kt => CamLookAtEasedCoordV1Decoder.kt} | 10 +++---- ...LookAtDecoder.kt => CamLookAtV1Decoder.kt} | 10 +++---- ...ArcDecoder.kt => CamMoveToArcV1Decoder.kt} | 10 +++---- ...Decoder.kt => CamMoveToCyclesV1Decoder.kt} | 10 +++---- ...MoveToDecoder.kt => CamMoveToV1Decoder.kt} | 10 +++---- ...coder.kt => UpdateRebootTimerV1Decoder.kt} | 10 +++---- ...pFlagDecoder.kt => SetMapFlagV1Decoder.kt} | 10 +++---- .../outgoing/decoder/prot/GameServerProt.kt | 22 ++++++++++----- .../prot/ServerMessageDecoderRepository.kt | 28 +++++++++---------- ...EasedCoord.kt => CamLookAtEasedCoordV1.kt} | 6 ++-- .../camera/{CamLookAt.kt => CamLookAtV1.kt} | 6 ++-- .../{CamMoveToArc.kt => CamMoveToArcV1.kt} | 8 +++--- ...amMoveToCycles.kt => CamMoveToCyclesV1.kt} | 6 ++-- .../camera/{CamMoveTo.kt => CamMoveToV1.kt} | 6 ++-- ...eRebootTimer.kt => UpdateRebootTimerV1.kt} | 6 ++-- .../player/{SetMapFlag.kt => SetMapFlagV1.kt} | 4 +-- .../rsprox/transcriber/TranscriberPlugin.kt | 14 +++++----- .../transcriber/indexer/IndexerTranscriber.kt | 16 +++++------ .../interfaces/ServerPacketTranscriber.kt | 16 +++++------ .../rsprox/transcriber/prot/GameServerProt.kt | 14 +++++----- .../text/TextServerPacketTranscriber.kt | 18 ++++++------ 138 files changed, 761 insertions(+), 753 deletions(-) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/{CamLookAtEasedCoordDecoder.kt => CamLookAtEasedCoordV1Decoder.kt} (83%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/{CamLookAtDecoder.kt => CamLookAtV1Decoder.kt} (76%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/{CamMoveToArcDecoder.kt => CamMoveToArcV1Decoder.kt} (89%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/{CamMoveToCyclesDecoder.kt => CamMoveToCyclesV1Decoder.kt} (86%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/{CamMoveToDecoder.kt => CamMoveToV1Decoder.kt} (76%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/{UpdateRebootTimerDecoder.kt => UpdateRebootTimerV1Decoder.kt} (77%) rename protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/{SetMapFlagDecoder.kt => SetMapFlagV1Decoder.kt} (76%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/{CamLookAtEasedCoord.kt => CamLookAtEasedCoordV1.kt} (95%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/{CamLookAt.kt => CamLookAtV1.kt} (96%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/{CamMoveToArc.kt => CamMoveToArcV1.kt} (96%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/{CamMoveToCycles.kt => CamMoveToCyclesV1.kt} (96%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/{CamMoveTo.kt => CamMoveToV1.kt} (96%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/{UpdateRebootTimer.kt => UpdateRebootTimerV1.kt} (89%) rename protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/{SetMapFlag.kt => SetMapFlagV1.kt} (94%) diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 52d2a866..86435065 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 1b52df0a..c32d9aae 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 8b01f947..1f3b79c7 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index b6398afc..28dcd2bc 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index d658f7df..5b68e308 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 50bc0c74..fc2828a2 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v223.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 85e1cca4..384a894a 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v223.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProt.kt index b01c3af7..38366345 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProt.kt @@ -105,11 +105,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTH_RESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -154,7 +154,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), UPDATE_STAT_V1(GameServerProtId.UPDATE_STAT_V1, 6), @@ -171,7 +171,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProtId.kt index 9a7a690a..f817b9a3 100644 --- a/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-223/src/main/kotlin/net/rsprox/protocol/v223/game/outgoing/decoder/prot/GameServerProtId.kt @@ -4,7 +4,7 @@ internal object GameServerProtId { const val REFLECTION_CHECKER = 0 const val UPDATE_ZONE_FULL_FOLLOWS = 1 const val LOGOUT = 2 - const val UPDATE_REBOOT_TIMER = 3 + const val UPDATE_REBOOT_TIMER_V1 = 3 const val CLANSETTINGS_DELTA = 4 const val IF_SETPLAYERMODEL_BASECOLOUR = 5 const val SYNTH_SOUND = 6 @@ -20,7 +20,7 @@ internal object GameServerProtId { const val MESSAGE_FRIENDCHANNEL = 16 const val UPDATE_ZONE_PARTIAL_ENCLOSED = 17 const val MESSAGE_PRIVATE_ECHO = 18 - const val SET_MAP_FLAG = 19 + const val SET_MAP_FLAG_V1 = 19 const val NPC_INFO_SMALL_V4 = 20 const val HISCORE_REPLY = 21 const val LOC_ANIM = 22 @@ -37,7 +37,7 @@ internal object GameServerProtId { const val SET_HEATMAP_ENABLED = 33 const val URL_OPEN = 34 const val IF_MOVESUB = 35 - const val CAM_LOOKAT_EASED_COORD = 36 + const val CAM_LOOKAT_EASED_COORD_V1 = 36 const val NPC_HEADICON_SPECIFIC = 37 const val OBJ_ADD = 38 const val CAM_SHAKE = 39 @@ -69,7 +69,7 @@ internal object GameServerProtId { const val SITE_SETTINGS = 65 const val MAP_PROJANIM_V1 = 66 const val OBJ_ENABLED_OPS = 67 - const val CAM_MOVETO = 68 + const val CAM_MOVETO_V1 = 68 const val LOGOUT_WITHREASON = 69 const val VARCLAN = 70 const val CAM_MODE = 71 @@ -100,7 +100,7 @@ internal object GameServerProtId { const val IF_CLOSESUB = 96 const val RESET_ANIMS = 97 const val REBUILD_NORMAL = 98 - const val CAM_LOOKAT = 99 + const val CAM_LOOKAT_V1 = 99 const val IF_SETNPCHEAD = 100 const val UPDATE_INV_PARTIAL = 101 const val IF_SETANIM = 102 @@ -121,10 +121,10 @@ internal object GameServerProtId { const val PLAYER_ANIM_SPECIFIC = 117 const val PROJANIM_SPECIFIC_V2 = 118 const val SET_PLAYER_OP = 119 - const val CAM_MOVETO_CYCLES = 120 + const val CAM_MOVETO_CYCLES_V1 = 120 const val REBUILD_REGION = 121 const val IF_SETHIDE = 122 - const val CAM_MOVETO_ARC = 123 + const val CAM_MOVETO_ARC_V1 = 123 const val VARCLAN_ENABLE = 124 const val CAM_TARGET_V2 = 125 const val HINT_ARROW = 126 diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index ad4f510b..42bed561 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 1b4f7d82..c05fbaed 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 1950c720..28aa6b02 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 622581f1..87827c5e 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 79ce35d3..d2f9ae3d 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index ca52d84f..3c8a2053 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v224.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 64ae1420..024e3ebf 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v224.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProt.kt index adf5e2d2..0be3307d 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProt.kt @@ -105,11 +105,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -154,7 +154,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), UPDATE_STAT_V1(GameServerProtId.UPDATE_STAT_V1, 6), @@ -171,7 +171,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProtId.kt index a9bb8c86..a85766b6 100644 --- a/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-224/src/main/kotlin/net/rsprox/protocol/v224/game/outgoing/decoder/prot/GameServerProtId.kt @@ -31,7 +31,7 @@ internal object GameServerProtId { const val MESSAGE_CLANCHANNEL_SYSTEM = 27 const val SEND_PING = 28 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 29 - const val UPDATE_REBOOT_TIMER = 30 + const val UPDATE_REBOOT_TIMER_V1 = 30 const val LOGOUT_WITHREASON = 31 const val UPDATE_ZONE_FULL_FOLLOWS = 32 const val IF_CLOSESUB = 33 @@ -56,7 +56,7 @@ internal object GameServerProtId { const val SITE_SETTINGS = 52 const val IF_SETPOSITION = 53 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 54 - const val CAM_MOVETO_ARC = 55 + const val CAM_MOVETO_ARC_V1 = 55 const val OBJ_ADD = 56 const val SERVER_TICK_END = 57 const val MAP_PROJANIM_V1 = 58 @@ -66,12 +66,12 @@ internal object GameServerProtId { const val LOC_MERGE = 62 const val VARP_LARGE = 63 const val TRIGGER_ONDIALOGABORT = 64 - const val CAM_LOOKAT = 65 + const val CAM_LOOKAT_V1 = 65 const val IF_SETPLAYERMODEL_OBJ = 66 const val CAM_SHAKE = 67 const val IF_SETNPCHEAD_ACTIVE = 68 const val CAM_RESET = 69 - const val CAM_MOVETO_CYCLES = 70 + const val CAM_MOVETO_CYCLES_V1 = 70 const val VARP_SMALL = 71 const val LOGOUT_TRANSFER = 72 const val VARCLAN_ENABLE = 73 @@ -82,7 +82,7 @@ internal object GameServerProtId { const val SET_PLAYER_OP = 78 const val RESET_ANIMS = 79 const val OCULUS_SYNC = 80 - const val CAM_LOOKAT_EASED_COORD = 81 + const val CAM_LOOKAT_EASED_COORD_V1 = 81 const val MIDI_SWAP = 82 const val IF_SETPLAYERHEAD = 83 const val URL_OPEN = 84 @@ -92,7 +92,7 @@ internal object GameServerProtId { const val MAP_ANIM = 88 const val VARCLAN_DISABLE = 89 const val UPDATE_IGNORELIST = 90 - const val SET_MAP_FLAG = 91 + const val SET_MAP_FLAG_V1 = 91 const val IF_SETPLAYERMODEL_BASECOLOUR = 92 const val CLANCHANNEL_FULL = 93 const val NPC_INFO_SMALL_V4 = 94 @@ -111,7 +111,7 @@ internal object GameServerProtId { const val CAM_ROTATEBY = 107 const val CAM_ROTATETO = 108 const val HINT_ARROW = 109 - const val CAM_MOVETO = 110 + const val CAM_MOVETO_V1 = 110 const val SOUND_AREA = 111 const val VARCLAN = 112 const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 113 diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index c7273bb0..9243699d 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 044e4c56..464577ff 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 0064d0f6..7c4a5cf6 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index e5bf27b2..2e11b237 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 20a8d7d5..7ccdaaf4 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 986bb188..f02af048 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v225.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt2() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index e931dac1..c95793c1 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v225.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProt.kt index 2fc2f17f..65c7d38b 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProt.kt @@ -117,11 +117,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -166,7 +166,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), UPDATE_STAT_V1(GameServerProtId.UPDATE_STAT_V1, 6), @@ -183,7 +183,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProtId.kt index 92cadea5..78781a5b 100644 --- a/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-225/src/main/kotlin/net/rsprox/protocol/v225/game/outgoing/decoder/prot/GameServerProtId.kt @@ -16,7 +16,7 @@ internal object GameServerProtId { const val VARCLAN_ENABLE = 12 const val PROJANIM_SPECIFIC_V1 = 13 const val IF_SETROTATESPEED = 14 - const val SET_MAP_FLAG = 15 + const val SET_MAP_FLAG_V1 = 15 const val MESSAGE_FRIENDCHANNEL = 16 const val SOUND_AREA = 17 const val OBJ_COUNT = 18 @@ -24,7 +24,7 @@ internal object GameServerProtId { const val MESSAGE_PRIVATE = 20 const val PROJANIM_SPECIFIC_V2 = 21 const val CHAT_FILTER_SETTINGS = 22 - const val CAM_MOVETO = 23 + const val CAM_MOVETO_V1 = 23 const val CAM_ROTATEBY = 24 const val VARP_SMALL = 25 const val UPDATE_INV_FULL = 26 @@ -36,7 +36,7 @@ internal object GameServerProtId { const val CAM_MODE = 32 const val IF_SETPLAYERMODEL_BODYTYPE = 33 const val MESSAGE_CLANCHANNEL = 34 - const val CAM_LOOKAT_EASED_COORD = 35 + const val CAM_LOOKAT_EASED_COORD_V1 = 35 const val IF_RESYNC_V1 = 36 const val CAM_TARGET_V1 = 37 const val IF_SETPLAYERHEAD = 38 @@ -48,7 +48,7 @@ internal object GameServerProtId { const val MAP_ANIM = 44 const val SERVER_TICK_END = 45 const val TRIGGER_ONDIALOGABORT = 46 - const val UPDATE_REBOOT_TIMER = 47 + const val UPDATE_REBOOT_TIMER_V1 = 47 const val VARCLAN = 48 const val MESSAGE_PRIVATE_ECHO = 49 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V1 = 50 @@ -63,7 +63,7 @@ internal object GameServerProtId { const val LOGOUT = 59 const val PLAYER_ANIM_SPECIFIC = 60 const val UPDATE_FRIENDLIST = 61 - const val CAM_LOOKAT = 62 + const val CAM_LOOKAT_V1 = 62 const val FRIENDLIST_LOADED = 63 const val IF_SETANGLE = 64 const val IF_SETANIM = 65 @@ -71,7 +71,7 @@ internal object GameServerProtId { const val LOGOUT_WITHREASON = 67 const val UPDATE_RUNENERGY = 68 const val REFLECTION_CHECKER = 69 - const val CAM_MOVETO_CYCLES = 70 + const val CAM_MOVETO_CYCLES_V1 = 70 const val UPDATE_INV_PARTIAL = 71 const val LOC_ADD_CHANGE_V1 = 72 const val CAM_ROTATETO = 73 @@ -111,7 +111,7 @@ internal object GameServerProtId { const val MIDI_SONG_V2 = 107 const val UPDATE_IGNORELIST = 108 const val NPC_INFO_LARGE_V4 = 109 - const val CAM_MOVETO_ARC = 110 + const val CAM_MOVETO_ARC_V1 = 110 const val NPC_ANIM_SPECIFIC = 111 const val SEND_PING = 112 const val UPDATE_STAT_V1 = 113 diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 61a25fef..ab29929c 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 2b4cc892..ea076c2b 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 8e483d76..97b738ca 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index c6561a7b..b60f120a 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 4abf2203..cc7f96d6 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index bbea8da1..5f5d08d0 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v226.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index ae853d6f..0f1e1b4c 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v226.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProt.kt index f61c1eeb..094a0fd9 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProt.kt @@ -137,11 +137,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -186,7 +186,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), UPDATE_STAT_V1(GameServerProtId.UPDATE_STAT_V1, 6), @@ -203,7 +203,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProtId.kt index f34ab49b..99fc13cf 100644 --- a/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-226/src/main/kotlin/net/rsprox/protocol/v226/game/outgoing/decoder/prot/GameServerProtId.kt @@ -5,8 +5,8 @@ internal object GameServerProtId { const val CLANSETTINGS_DELTA = 1 const val OBJ_CUSTOMISE = 2 const val IF_SETPLAYERMODEL_BASECOLOUR = 3 - const val CAM_MOVETO_ARC = 4 - const val UPDATE_REBOOT_TIMER = 5 + const val CAM_MOVETO_ARC_V1 = 4 + const val UPDATE_REBOOT_TIMER_V1 = 5 const val MIDI_SONG_V2 = 6 const val PLAYER_ANIM_SPECIFIC = 7 const val LOGOUT_WITHREASON = 8 @@ -23,7 +23,7 @@ internal object GameServerProtId { const val SET_PLAYER_OP = 19 const val UPDATE_STAT_V1 = 20 const val MESSAGE_FRIENDCHANNEL = 21 - const val CAM_LOOKAT_EASED_COORD = 22 + const val CAM_LOOKAT_EASED_COORD_V1 = 22 const val UPDATE_ZONE_FULL_FOLLOWS = 23 const val UPDATE_INV_PARTIAL = 24 const val IF_CLOSESUB = 25 @@ -40,8 +40,8 @@ internal object GameServerProtId { const val UPDATE_IGNORELIST = 36 const val LOC_MERGE = 37 const val SET_HEATMAP_ENABLED = 38 - const val CAM_LOOKAT = 39 - const val CAM_MOVETO_CYCLES = 40 + const val CAM_LOOKAT_V1 = 39 + const val CAM_MOVETO_CYCLES_V1 = 40 const val VARCLAN_ENABLE = 41 const val IF_SETNPCHEAD_ACTIVE = 42 const val OBJ_DEL = 43 @@ -105,7 +105,7 @@ internal object GameServerProtId { const val VARP_SMALL = 101 const val SERVER_TICK_END = 102 const val LOGOUT_TRANSFER = 103 - const val CAM_MOVETO = 104 + const val CAM_MOVETO_V1 = 104 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 105 const val IF_CLEARINV = 106 const val IF_SETANIM = 107 @@ -113,7 +113,7 @@ internal object GameServerProtId { const val REBUILD_NORMAL = 109 const val IF_OPENTOP = 110 const val NPC_HEADICON_SPECIFIC = 111 - const val SET_MAP_FLAG = 112 + const val SET_MAP_FLAG_V1 = 112 const val IF_SETROTATESPEED = 113 const val IF_SETOBJECT = 114 const val IF_SETNPCHEAD = 115 diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index cfd04075..ffda4669 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index a1e918b4..93a37a14 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index dd78d435..5817843e 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 453ca3d9..9e804270 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index c9ce8314..dcc688ba 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index ba733dd6..d55edf3a 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v227.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 173c3980..efbaa975 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v227.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProt.kt index f9871229..4a669a5c 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProt.kt @@ -106,11 +106,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -153,7 +153,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -169,7 +169,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProtId.kt index 2ca530be..388f4e33 100644 --- a/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-227/src/main/kotlin/net/rsprox/protocol/v227/game/outgoing/decoder/prot/GameServerProtId.kt @@ -17,7 +17,7 @@ internal object GameServerProtId { const val IF_SETTEXT = 13 const val HIDEOBJOPS = 14 const val MESSAGE_FRIENDCHANNEL = 15 - const val CAM_LOOKAT_EASED_COORD = 16 + const val CAM_LOOKAT_EASED_COORD_V1 = 16 const val SITE_SETTINGS = 17 const val CAM_TARGET_V2 = 18 const val REFLECTION_CHECKER = 19 @@ -56,7 +56,7 @@ internal object GameServerProtId { const val CAM_ROTATETO = 52 const val SOUND_AREA = 53 const val UPDATE_STOCKMARKET_SLOT = 54 - const val CAM_MOVETO = 55 + const val CAM_MOVETO_V1 = 55 const val MAP_PROJANIM_V1 = 56 const val SET_NPC_UPDATE_ORIGIN = 57 const val SET_PLAYER_OP = 58 @@ -64,7 +64,7 @@ internal object GameServerProtId { const val IF_SETANIM = 60 const val IF_SETPOSITION = 61 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 62 - const val CAM_MOVETO_CYCLES = 63 + const val CAM_MOVETO_CYCLES_V1 = 63 const val MIDI_SWAP = 64 const val VARP_LARGE = 65 const val NPC_ANIM_SPECIFIC = 66 @@ -86,7 +86,7 @@ internal object GameServerProtId { const val UPDATE_IGNORELIST = 82 const val PLAYER_ANIM_SPECIFIC = 83 const val URL_OPEN = 84 - const val CAM_MOVETO_ARC = 85 + const val CAM_MOVETO_ARC_V1 = 85 const val MESSAGE_GAME = 86 const val IF_SETEVENTS_V1 = 87 const val CLANSETTINGS_DELTA = 88 @@ -96,7 +96,7 @@ internal object GameServerProtId { const val IF_SETPLAYERMODEL_BODYTYPE = 92 const val LOC_ANIM_SPECIFIC = 93 const val CAM_ROTATEBY = 94 - const val SET_MAP_FLAG = 95 + const val SET_MAP_FLAG_V1 = 95 const val CHAT_FILTER_SETTINGS = 96 const val NPC_SPOTANIM_SPECIFIC = 97 const val IF_SETPLAYERHEAD = 98 @@ -112,13 +112,13 @@ internal object GameServerProtId { const val PROJANIM_SPECIFIC_V3 = 108 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 109 const val UNKNOWN_STRING = 110 - const val UPDATE_REBOOT_TIMER = 111 + const val UPDATE_REBOOT_TIMER_V1 = 111 const val IF_SETROTATESPEED = 112 const val SYNTH_SOUND = 113 const val VARCLAN = 114 const val SEND_PING = 115 const val IF_OPENSUB = 116 - const val CAM_LOOKAT = 117 + const val CAM_LOOKAT_V1 = 117 const val MESSAGE_PRIVATE_ECHO = 118 const val LOGOUT_WITHREASON = 119 const val LOC_ANIM = 120 diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 8b0d1ce1..eda24a84 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 99c2a696..a30af573 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index bfd7c929..0455cf67 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 30449b5a..97ec9639 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 2da6df86..a4e17cc4 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 53c48a35..812c7d4f 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v228.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt1() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index af7c1a59..7056a917 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v228.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProt.kt index 39979168..6291ddb4 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProt.kt @@ -107,11 +107,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -154,7 +154,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -170,7 +170,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProtId.kt index 185a712e..1f880187 100644 --- a/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-228/src/main/kotlin/net/rsprox/protocol/v228/game/outgoing/decoder/prot/GameServerProtId.kt @@ -30,7 +30,7 @@ internal object GameServerProtId { const val NPC_SPOTANIM_SPECIFIC = 26 const val VARP_SMALL = 27 const val MAP_PROJANIM_V1 = 28 - const val CAM_LOOKAT_EASED_COORD = 29 + const val CAM_LOOKAT_EASED_COORD_V1 = 29 const val CAM_SHAKE = 30 const val REBUILD_REGION = 31 const val IF_CLEARINV = 32 @@ -51,7 +51,7 @@ internal object GameServerProtId { const val LOGOUT = 47 const val MESSAGE_CLANCHANNEL = 48 const val UPDATE_RUNWEIGHT = 49 - const val CAM_MOVETO_ARC = 50 + const val CAM_MOVETO_ARC_V1 = 50 const val IF_SETSCROLLPOS = 51 const val PLAYER_SPOTANIM_SPECIFIC = 52 const val UNKNOWN_STRING = 53 @@ -63,7 +63,7 @@ internal object GameServerProtId { const val IF_SETPLAYERHEAD = 59 const val CLANCHANNEL_FULL = 60 const val IF_SETHIDE = 61 - const val SET_MAP_FLAG = 62 + const val SET_MAP_FLAG_V1 = 62 const val HISCORE_REPLY = 63 const val UPDATE_STOCKMARKET_SLOT = 64 const val VARP_LARGE = 65 @@ -74,14 +74,14 @@ internal object GameServerProtId { const val IF_SETPLAYERMODEL_BODYTYPE = 70 const val TRIGGER_ONDIALOGABORT = 71 const val SITE_SETTINGS = 72 - const val UPDATE_REBOOT_TIMER = 73 - const val CAM_MOVETO_CYCLES = 74 + const val UPDATE_REBOOT_TIMER_V1 = 73 + const val CAM_MOVETO_CYCLES_V1 = 74 const val UPDATE_TRADINGPOST = 75 const val UPDATE_INV_PARTIAL = 76 const val HINT_ARROW = 77 const val PLAYER_ANIM_SPECIFIC = 78 const val IF_SETROTATESPEED = 79 - const val CAM_MOVETO = 80 + const val CAM_MOVETO_V1 = 80 const val NPC_HEADICON_SPECIFIC = 81 const val MAP_ANIM = 82 const val LOC_ADD_CHANGE_V2 = 83 @@ -109,7 +109,7 @@ internal object GameServerProtId { const val MESSAGE_PRIVATE_ECHO = 105 const val HIDENPCOPS = 106 const val IF_SETPLAYERMODEL_OBJ = 107 - const val CAM_LOOKAT = 108 + const val CAM_LOOKAT_V1 = 108 const val MIDI_SONG_V2 = 109 const val CLANCHANNEL_DELTA = 110 const val UPDATE_IGNORELIST = 111 diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index f514f1ff..cdb7c718 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 571f6e65..db321b1c 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 9360dcb2..ee8cf706 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 358419d2..d23b5710 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index eff783dc..c5cd4663 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 15f39fb6..3564ccc8 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v229.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index e1a03b70..88ec1df7 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v229.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProt.kt index 8d56f95d..cf759a64 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProt.kt @@ -103,11 +103,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -150,7 +150,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -166,7 +166,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProtId.kt index e4502fd7..3cfacc91 100644 --- a/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-229/src/main/kotlin/net/rsprox/protocol/v229/game/outgoing/decoder/prot/GameServerProtId.kt @@ -17,9 +17,9 @@ internal object GameServerProtId { const val UPDATE_STOCKMARKET_SLOT = 13 const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 14 const val MESSAGE_FRIENDCHANNEL = 15 - const val CAM_LOOKAT_EASED_COORD = 16 + const val CAM_LOOKAT_EASED_COORD_V1 = 16 const val UPDATE_FRIENDLIST = 17 - const val SET_MAP_FLAG = 18 + const val SET_MAP_FLAG_V1 = 18 const val PLAYER_ANIM_SPECIFIC = 19 const val RESET_ANIMS = 20 const val CLANCHANNEL_DELTA = 21 @@ -47,11 +47,11 @@ internal object GameServerProtId { const val FRIENDLIST_LOADED = 43 const val IF_CLOSESUB = 44 const val IF_SETANIM = 45 - const val CAM_MOVETO_CYCLES = 46 + const val CAM_MOVETO_CYCLES_V1 = 46 const val SEND_PING = 47 const val SYNTH_SOUND = 48 const val OCULUS_SYNC = 49 - const val CAM_MOVETO_ARC = 50 + const val CAM_MOVETO_ARC_V1 = 50 const val IF_SETPLAYERMODEL_BASECOLOUR = 51 const val IF_CLEARINV = 52 const val IF_SETTEXT = 53 @@ -66,7 +66,7 @@ internal object GameServerProtId { const val IF_OPENSUB = 62 const val SET_PLAYER_OP = 63 const val VARCLAN_ENABLE = 64 - const val UPDATE_REBOOT_TIMER = 65 + const val UPDATE_REBOOT_TIMER_V1 = 65 const val UPDATE_ZONE_FULL_FOLLOWS = 66 const val UPDATE_IGNORELIST = 67 const val VARCLAN = 68 @@ -99,7 +99,7 @@ internal object GameServerProtId { const val IF_SETNPCHEAD = 95 const val OBJ_ENABLED_OPS = 96 const val VARCLAN_DISABLE = 97 - const val CAM_MOVETO = 98 + const val CAM_MOVETO_V1 = 98 const val OBJ_COUNT = 99 const val MAP_ANIM_SPECIFIC = 100 const val OBJ_DEL = 101 @@ -128,7 +128,7 @@ internal object GameServerProtId { const val HISCORE_REPLY = 124 const val MIDI_SONG_WITHSECONDARY = 125 const val LOGOUT_TRANSFER = 126 - const val CAM_LOOKAT = 127 + const val CAM_LOOKAT_V1 = 127 const val NPC_INFO_LARGE_V5 = 128 const val WORLDENTITY_INFO_V5 = 129 const val SET_ACTIVE_WORLD_V2 = 130 diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 2bbad96a..4f121201 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 054cc0c8..e94f9e49 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index dd8b54af..c4f43f98 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index fd089459..14a94359 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 5e4e3f93..59bef2be 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index b40b9a04..0271aa11 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v230.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt2() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 1058e97a..2a600e74 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v230.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProt.kt index 88c9c774..e88ed46c 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProt.kt @@ -101,11 +101,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -148,7 +148,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -164,7 +164,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProtId.kt index 392ec43a..9d5c7ef9 100644 --- a/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-230/src/main/kotlin/net/rsprox/protocol/v230/game/outgoing/decoder/prot/GameServerProtId.kt @@ -3,7 +3,7 @@ package net.rsprox.protocol.v230.game.outgoing.decoder.prot internal object GameServerProtId { const val SET_NPC_UPDATE_ORIGIN = 0 const val LOGOUT_TRANSFER = 1 - const val SET_MAP_FLAG = 2 + const val SET_MAP_FLAG_V1 = 2 const val VARCLAN_DISABLE = 3 const val HIDEOBJOPS = 4 const val IF_CLEARINV = 5 @@ -25,13 +25,13 @@ internal object GameServerProtId { const val UPDATE_IGNORELIST = 21 const val REFLECTION_CHECKER = 22 const val PLAYER_INFO = 23 - const val CAM_MOVETO_CYCLES = 24 + const val CAM_MOVETO_CYCLES_V1 = 24 const val MIDI_SWAP = 25 const val MIDI_SONG_STOP = 26 const val UPDATE_RUNWEIGHT = 27 const val CLANCHANNEL_DELTA = 28 const val MESSAGE_PRIVATE = 29 - const val CAM_LOOKAT = 30 + const val CAM_LOOKAT_V1 = 30 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 31 const val REBUILD_WORLDENTITY_V3 = 32 const val HISCORE_REPLY = 33 @@ -68,7 +68,7 @@ internal object GameServerProtId { const val IF_SETMODEL = 64 const val CAM_RESET = 65 const val URL_OPEN = 66 - const val CAM_MOVETO = 67 + const val CAM_MOVETO_V1 = 67 const val REBUILD_NORMAL = 68 const val LOC_MERGE = 69 const val MESSAGE_FRIENDCHANNEL = 70 @@ -92,11 +92,11 @@ internal object GameServerProtId { const val VARP_SYNC = 88 const val MAP_ANIM_SPECIFIC = 89 const val MESSAGE_GAME = 90 - const val CAM_MOVETO_ARC = 91 + const val CAM_MOVETO_ARC_V1 = 91 const val OCULUS_SYNC = 92 const val IF_SETSCROLLPOS = 93 const val IF_SETTEXT = 94 - const val CAM_LOOKAT_EASED_COORD = 95 + const val CAM_LOOKAT_EASED_COORD_V1 = 95 const val IF_SETPLAYERMODEL_BODYTYPE = 96 const val PROJANIM_SPECIFIC_V3 = 97 const val SOUND_AREA = 98 @@ -104,7 +104,7 @@ internal object GameServerProtId { const val MIDI_SONG_WITHSECONDARY = 100 const val UNKNOWN_STRING = 101 const val SYNTH_SOUND = 102 - const val UPDATE_REBOOT_TIMER = 103 + const val UPDATE_REBOOT_TIMER_V1 = 103 const val NPC_INFO_SMALL_V5 = 104 const val OBJ_DEL = 105 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 106 diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 6d0fdeb4..54ed0dcd 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index e7b325e6..0b3dc20d 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index bd1eb2b4..db492b0a 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index a7fa2370..cb6bab0c 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index c05432e8..792e94fd 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 2b438c18..892f645d 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v231.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 9a05fcbb..9d47b0dd 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v231.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProt.kt index a98e9763..77938d9c 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProt.kt @@ -106,11 +106,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -153,7 +153,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -169,7 +169,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProtId.kt index a2fe831e..62bcf2f1 100644 --- a/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-231/src/main/kotlin/net/rsprox/protocol/v231/game/outgoing/decoder/prot/GameServerProtId.kt @@ -9,7 +9,7 @@ internal object GameServerProtId { const val REFLECTION_CHECKER = 5 const val CLANSETTINGS_FULL = 6 const val LOC_ANIM = 7 - const val CAM_MOVETO_CYCLES = 8 + const val CAM_MOVETO_CYCLES_V1 = 8 const val TRIGGER_ONDIALOGABORT = 9 const val UPDATE_ZONE_FULL_FOLLOWS = 10 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 11 @@ -26,7 +26,7 @@ internal object GameServerProtId { const val OBJ_COUNT = 22 const val REBUILD_NORMAL = 23 const val IF_MOVESUB = 24 - const val UPDATE_REBOOT_TIMER = 25 + const val UPDATE_REBOOT_TIMER_V1 = 25 const val LOC_MERGE = 26 const val UPDATE_FRIENDLIST = 27 const val REBUILD_REGION = 28 @@ -40,7 +40,7 @@ internal object GameServerProtId { const val RUNCLIENTSCRIPT = 36 const val MESSAGE_PRIVATE_ECHO = 37 const val UPDATE_STAT_V2 = 38 - const val CAM_LOOKAT_EASED_COORD = 39 + const val CAM_LOOKAT_EASED_COORD_V1 = 39 const val SERVER_TICK_END = 40 const val IF_SETNPCHEAD = 41 const val IF_RESYNC_V1 = 42 @@ -67,7 +67,7 @@ internal object GameServerProtId { const val UPDATE_UID192 = 63 const val CAM_RESET = 64 const val HIDEOBJOPS = 65 - const val CAM_LOOKAT = 66 + const val CAM_LOOKAT_V1 = 66 const val MIDI_JINGLE = 67 const val FRIENDLIST_LOADED = 68 const val SEND_PING = 69 @@ -79,7 +79,7 @@ internal object GameServerProtId { const val SET_PLAYER_OP = 75 const val SET_NPC_UPDATE_ORIGIN = 76 const val NPC_INFO_LARGE_V5 = 77 - const val CAM_MOVETO = 78 + const val CAM_MOVETO_V1 = 78 const val IF_SETEVENTS_V1 = 79 const val IF_OPENTOP = 80 const val IF_SETHIDE = 81 @@ -95,7 +95,7 @@ internal object GameServerProtId { const val CAM_TARGET_V3 = 91 const val PLAYER_ANIM_SPECIFIC = 92 const val UPDATE_INV_FULL = 93 - const val SET_MAP_FLAG = 94 + const val SET_MAP_FLAG_V1 = 94 const val MESSAGE_GAME = 95 const val LOGOUT = 96 const val OCULUS_SYNC = 97 @@ -105,7 +105,7 @@ internal object GameServerProtId { const val UPDATE_IGNORELIST = 101 const val MAP_ANIM = 102 const val CAM_ROTATETO = 103 - const val CAM_MOVETO_ARC = 104 + const val CAM_MOVETO_ARC_V1 = 104 const val IF_SETPLAYERMODEL_SELF = 105 const val MIDI_SONG_V2 = 106 const val RESET_ANIMS = 107 diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index f3c8bc37..e5dc1f72 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 338539bd..f8b293f6 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index f141e139..eb04f026 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 60b1b185..77fb720e 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index f046c611..b96c08d3 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 757aec34..691fa7fd 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v232.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 1cc34725..500a46b1 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v232.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProt.kt index 07373d26..8317dd9d 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProt.kt @@ -108,11 +108,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -155,7 +155,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -171,7 +171,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProtId.kt index 1d324421..493f582b 100644 --- a/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-232/src/main/kotlin/net/rsprox/protocol/v232/game/outgoing/decoder/prot/GameServerProtId.kt @@ -18,7 +18,7 @@ internal object GameServerProtId { const val IF_SETNPCHEAD_ACTIVE = 14 const val IF_SETPLAYERMODEL_BASECOLOUR = 15 const val SET_INTERACTION_MODE = 16 - const val CAM_LOOKAT_EASED_COORD = 17 + const val CAM_LOOKAT_EASED_COORD_V1 = 17 const val CAM_ROTATETO = 18 const val CLANSETTINGS_FULL = 19 const val RESET_ANIMS = 20 @@ -33,7 +33,7 @@ internal object GameServerProtId { const val UPDATE_STAT_V2 = 29 const val OBJ_COUNT = 30 const val IF_SETROTATESPEED = 31 - const val CAM_MOVETO_ARC = 32 + const val CAM_MOVETO_ARC_V1 = 32 const val CAM_RESET = 33 const val HIDENPCOPS = 34 const val SEND_PING = 35 @@ -43,7 +43,7 @@ internal object GameServerProtId { const val UNKNOWN_STRING = 39 const val LOC_ADD_CHANGE_V2 = 40 const val IF_SETNPCHEAD = 41 - const val SET_MAP_FLAG = 42 + const val SET_MAP_FLAG_V1 = 42 const val OBJ_ADD_SPECIFIC = 43 const val IF_SETHIDE = 44 const val IF_SETOBJECT = 45 @@ -68,11 +68,11 @@ internal object GameServerProtId { const val MIDI_SWAP = 64 const val HINT_ARROW = 65 const val OCULUS_SYNC = 66 - const val CAM_LOOKAT = 67 + const val CAM_LOOKAT_V1 = 67 const val CHAT_FILTER_SETTINGS = 68 const val MINIMAP_TOGGLE = 69 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 70 - const val CAM_MOVETO = 71 + const val CAM_MOVETO_V1 = 71 const val IF_SETPLAYERMODEL_OBJ = 72 const val IF_OPENTOP = 73 const val IF_CLOSESUB = 74 @@ -80,11 +80,11 @@ internal object GameServerProtId { const val NPC_ANIM_SPECIFIC = 76 const val UPDATE_IGNORELIST = 77 const val NPC_HEADICON_SPECIFIC = 78 - const val CAM_MOVETO_CYCLES = 79 + const val CAM_MOVETO_CYCLES_V1 = 79 const val RESET_INTERACTION_MODE = 80 const val URL_OPEN = 81 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 82 - const val UPDATE_REBOOT_TIMER = 83 + const val UPDATE_REBOOT_TIMER_V1 = 83 const val VARP_RESET = 84 const val SOUND_AREA = 85 const val IF_SETPLAYERMODEL_SELF = 86 diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 7e6be68c..aef64d45 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 9ba84d1d..e529712f 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index bbfb89bd..9d5747c6 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 09777540..91440673 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 16932964..09cee29b 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 4e462cfa..05a21d91 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v233.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index ca4a7d47..811cd485 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v233.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProt.kt index 1c0ea8c8..e15a4611 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProt.kt @@ -114,11 +114,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -161,7 +161,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -178,7 +178,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProtId.kt index b6e59af9..b722bf62 100644 --- a/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-233/src/main/kotlin/net/rsprox/protocol/v233/game/outgoing/decoder/prot/GameServerProtId.kt @@ -8,10 +8,10 @@ internal object GameServerProtId { const val IF_SETPLAYERMODEL_BODYTYPE = 4 const val IF_SETSCROLLPOS = 5 const val OBJ_ADD = 6 - const val CAM_LOOKAT = 7 - const val UPDATE_REBOOT_TIMER = 8 + const val CAM_LOOKAT_V1 = 7 + const val UPDATE_REBOOT_TIMER_V1 = 8 const val UPDATE_STOCKMARKET_SLOT = 9 - const val CAM_MOVETO = 10 + const val CAM_MOVETO_V1 = 10 const val IF_SETOBJECT = 11 const val IF_SETPOSITION = 12 const val IF_SETROTATESPEED = 13 @@ -52,7 +52,7 @@ internal object GameServerProtId { const val CAM_RESET = 48 const val HIDENPCOPS = 49 const val MESSAGE_PRIVATE = 50 - const val SET_MAP_FLAG = 51 + const val SET_MAP_FLAG_V1 = 51 const val CAM_MODE = 52 const val PLAYER_SPOTANIM_SPECIFIC = 53 const val CLANCHANNEL_DELTA = 54 @@ -72,7 +72,7 @@ internal object GameServerProtId { const val IF_CLEARINV = 68 const val IF_OPENTOP = 69 const val OCULUS_SYNC = 70 - const val CAM_MOVETO_ARC = 71 + const val CAM_MOVETO_ARC_V1 = 71 const val VARCLAN_DISABLE = 72 const val LOC_ADD_CHANGE_V2 = 73 const val CHAT_FILTER_SETTINGS_PRIVATECHAT = 74 @@ -85,7 +85,7 @@ internal object GameServerProtId { const val UNKNOWN_STRING = 81 const val IF_SETTEXT = 82 const val CLANCHANNEL_FULL = 83 - const val CAM_MOVETO_CYCLES = 84 + const val CAM_MOVETO_CYCLES_V1 = 84 const val VARCLAN = 85 const val IF_MOVESUB = 86 const val IF_SETANGLE = 87 @@ -102,7 +102,7 @@ internal object GameServerProtId { const val UPDATE_STAT_V2 = 98 const val MESSAGE_CLANCHANNEL = 99 const val IF_SETPLAYERHEAD = 100 - const val CAM_LOOKAT_EASED_COORD = 101 + const val CAM_LOOKAT_EASED_COORD_V1 = 101 const val LOGOUT_WITHREASON = 102 const val CAM_TARGET_V3 = 103 const val LOGOUT_TRANSFER = 104 diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index 55e1d290..51484062 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index b18532f8..a2a60f50 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 5bff2d9f..7d7b31a0 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index 25770f6a..8b1d2964 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 5eb0e1a9..85db8b9e 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 5127ebdc..12679738 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v234.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt1() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 6c57e6eb..6269f38d 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v234.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProt.kt index a728374f..220b4221 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProt.kt @@ -108,11 +108,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -155,7 +155,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -172,7 +172,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProtId.kt index 958346a0..dc36efe4 100644 --- a/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-234/src/main/kotlin/net/rsprox/protocol/v234/game/outgoing/decoder/prot/GameServerProtId.kt @@ -30,7 +30,7 @@ internal object GameServerProtId { const val UPDATE_INV_PARTIAL = 26 const val RESET_ANIMS = 27 const val LOGOUT_WITHREASON = 28 - const val UPDATE_REBOOT_TIMER = 29 + const val UPDATE_REBOOT_TIMER_V1 = 29 const val UPDATE_ZONE_PARTIAL_FOLLOWS = 30 const val UPDATE_FRIENDCHAT_CHANNEL_FULL_V2 = 31 const val RUNCLIENTSCRIPT = 32 @@ -55,17 +55,17 @@ internal object GameServerProtId { const val IF_SETNPCHEAD = 51 const val IF_CLOSESUB = 52 const val IF_SETNPCHEAD_ACTIVE = 53 - const val CAM_MOVETO = 54 + const val CAM_MOVETO_V1 = 54 const val MIDI_SONG_STOP = 55 const val IF_SETPLAYERHEAD = 56 const val IF_MOVESUB = 57 - const val SET_MAP_FLAG = 58 + const val SET_MAP_FLAG_V1 = 58 const val MIDI_JINGLE = 59 const val PACKET_GROUP_START = 60 const val UPDATE_UID192 = 61 - const val CAM_MOVETO_CYCLES = 62 + const val CAM_MOVETO_CYCLES_V1 = 62 const val IF_CLEARINV = 63 - const val CAM_LOOKAT = 64 + const val CAM_LOOKAT_V1 = 64 const val HISCORE_REPLY = 65 const val LOC_ANIM_SPECIFIC = 66 const val MAP_ANIM = 67 @@ -117,7 +117,7 @@ internal object GameServerProtId { const val IF_SETPLAYERMODEL_OBJ = 113 const val VARCLAN_ENABLE = 114 const val IF_SETANGLE = 115 - const val CAM_LOOKAT_EASED_COORD = 116 + const val CAM_LOOKAT_EASED_COORD_V1 = 116 const val HIDELOCOPS = 117 const val MESSAGE_CLANCHANNEL = 118 const val UPDATE_TRADINGPOST = 119 @@ -126,7 +126,7 @@ internal object GameServerProtId { const val SITE_SETTINGS = 122 const val VARP_LARGE = 123 const val IF_SETMODEL = 124 - const val CAM_MOVETO_ARC = 125 + const val CAM_MOVETO_ARC_V1 = 125 const val MIDI_SONG_V2 = 126 const val IF_SETROTATESPEED = 127 const val WORLDENTITY_INFO_V6 = 128 diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt index d0bf0155..38a4af86 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt index 318edb4d..c597f523 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt index 0b4cb0a2..14216ee5 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt index e670d789..0a09059e 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt index 6a53524e..b6d06458 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt index 9de8645b..9e8b56c7 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v235.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt index 102ee7ce..7b2f0e29 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v235.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagDecoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProt.kt index 82b4f7f4..c48bfb5c 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProt.kt @@ -108,11 +108,11 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -155,7 +155,7 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -172,7 +172,7 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProtId.kt b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProtId.kt index 0296c22d..4a84e8d8 100644 --- a/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProtId.kt +++ b/protocol/osrs-235/src/main/kotlin/net/rsprox/protocol/v235/game/outgoing/decoder/prot/GameServerProtId.kt @@ -4,7 +4,7 @@ internal object GameServerProtId { const val SERVER_TICK_END = 0 const val SET_PLAYER_OP = 1 const val HISCORE_REPLY = 2 - const val UPDATE_REBOOT_TIMER = 3 + const val UPDATE_REBOOT_TIMER_V1 = 3 const val HIDENPCOPS = 4 const val REFLECTION_CHECKER = 5 const val URL_OPEN = 6 @@ -18,7 +18,7 @@ internal object GameServerProtId { const val SOUND_AREA = 14 const val CAM_ROTATETO = 15 const val CAM_TARGET_V3 = 16 - const val CAM_LOOKAT = 17 + const val CAM_LOOKAT_V1 = 17 const val IF_SETCOLOUR = 18 const val UPDATE_IGNORELIST = 19 const val MIDI_SONG_V2 = 20 @@ -26,7 +26,7 @@ internal object GameServerProtId { const val NPC_ANIM_SPECIFIC = 22 const val SET_INTERACTION_MODE = 23 const val VARP_SMALL = 24 - const val CAM_LOOKAT_EASED_COORD = 25 + const val CAM_LOOKAT_EASED_COORD_V1 = 25 const val SYNTH_SOUND = 26 const val MAP_ANIM_SPECIFIC = 27 const val CAM_ROTATEBY = 28 @@ -71,7 +71,7 @@ internal object GameServerProtId { const val PROJANIM_SPECIFIC_V4 = 67 const val CLANCHANNEL_FULL = 68 const val SITE_SETTINGS = 69 - const val SET_MAP_FLAG = 70 + const val SET_MAP_FLAG_V1 = 70 const val MESSAGE_CLANCHANNEL = 71 const val VARCLAN_ENABLE = 72 const val CLANSETTINGS_FULL = 73 @@ -107,12 +107,12 @@ internal object GameServerProtId { const val CLANSETTINGS_DELTA = 103 const val REBUILD_REGION = 104 const val UPDATE_FRIENDCHAT_CHANNEL_SINGLEUSER = 105 - const val CAM_MOVETO_CYCLES = 106 + const val CAM_MOVETO_CYCLES_V1 = 106 const val LOGOUT_TRANSFER = 107 - const val CAM_MOVETO_ARC = 108 + const val CAM_MOVETO_ARC_V1 = 108 const val UPDATE_ZONE_PARTIAL_ENCLOSED = 109 const val IF_SETPLAYERMODEL_OBJ = 110 - const val CAM_MOVETO = 111 + const val CAM_MOVETO_V1 = 111 const val UPDATE_RUNWEIGHT = 112 const val SEND_PING = 113 const val IF_SETPLAYERHEAD = 114 diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV1Decoder.kt similarity index 83% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV1Decoder.kt index 28f12b6a..7b42c2e7 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV1Decoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoord +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtEasedCoordDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD +internal class CamLookAtEasedCoordV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAtEasedCoord { + ): CamLookAtEasedCoordV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val function = buffer.g1() - return CamLookAtEasedCoord( + return CamLookAtEasedCoordV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV1Decoder.kt similarity index 76% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV1Decoder.kt index a301943a..53190372 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV1Decoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamLookAt +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamLookAtDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_LOOKAT +internal class CamLookAtV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamLookAt { + ): CamLookAtV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamLookAt( + return CamLookAtV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV1Decoder.kt similarity index 89% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV1Decoder.kt index a227deb2..74614b7a 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV1Decoder.kt @@ -4,18 +4,18 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArc +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToArcDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC +internal class CamMoveToArcV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToArc { + ): CamMoveToArcV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() @@ -24,7 +24,7 @@ internal class CamMoveToArcDecoder : ProxyMessageDecoder { val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToArc( + return CamMoveToArcV1( centerXInBuildArea, centerZInBuildArea, destinationXInBuildArea, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV1Decoder.kt similarity index 86% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV1Decoder.kt index b6f576da..ba6d4fbb 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV1Decoder.kt @@ -4,25 +4,25 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCycles +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToCyclesDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES +internal class CamMoveToCyclesV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveToCycles { + ): CamMoveToCyclesV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val duration = buffer.g2() val maintainFixedAltitude = buffer.gboolean() val function = buffer.g1() - return CamMoveToCycles( + return CamMoveToCyclesV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV1Decoder.kt similarity index 76% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV1Decoder.kt index c756d18e..5d949d2d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV1Decoder.kt @@ -4,24 +4,24 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.camera.CamMoveTo +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class CamMoveToDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.CAM_MOVETO +internal class CamMoveToV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): CamMoveTo { + ): CamMoveToV1 { val destinationXInBuildArea = buffer.g1() val destinationZInBuildArea = buffer.g1() val height = buffer.g2() val speed = buffer.g1() val acceleration = buffer.g1() - return CamMoveTo( + return CamMoveToV1( destinationXInBuildArea, destinationZInBuildArea, height, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV1Decoder.kt similarity index 77% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV1Decoder.kt index f70edf83..ebb9130b 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV1Decoder.kt @@ -3,19 +3,19 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt -internal class UpdateRebootTimerDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER +internal class UpdateRebootTimerV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): UpdateRebootTimer { + ): UpdateRebootTimerV1 { val gameCycles = buffer.g2Alt3() - return UpdateRebootTimer( + return UpdateRebootTimerV1( gameCycles, ) } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV1Decoder.kt similarity index 76% rename from protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt rename to protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV1Decoder.kt index e9751128..c38c494c 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV1Decoder.kt @@ -4,21 +4,21 @@ import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.metadata.Consistent import net.rsprox.protocol.ProxyMessageDecoder -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.session.Session import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt @Consistent -internal class SetMapFlagDecoder : ProxyMessageDecoder { - override val prot: ClientProt = GameServerProt.SET_MAP_FLAG +internal class SetMapFlagV1Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V1 override fun decode( buffer: JagByteBuf, session: Session, - ): SetMapFlag { + ): SetMapFlagV1 { val xInBuildArea = buffer.g1() val zInBuildArea = buffer.g1() - return SetMapFlag( + return SetMapFlagV1( xInBuildArea, zInBuildArea, ) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt index 043d7272..21ade2b6 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/GameServerProt.kt @@ -92,6 +92,7 @@ public enum class GameServerProt( // World entity packets SET_ACTIVE_WORLD_V2(GameServerProtId.SET_ACTIVE_WORLD_V2, 3), WORLDENTITY_INFO_V6(GameServerProtId.WORLDENTITY_INFO_V6, Prot.VAR_SHORT), + WORLDENTITY_INFO_V7(GameServerProtId.WORLDENTITY_INFO_V7, Prot.VAR_SHORT), // Map packets REBUILD_NORMAL(GameServerProtId.REBUILD_NORMAL, Prot.VAR_SHORT), @@ -108,11 +109,16 @@ public enum class GameServerProt( CAM_SHAKE(GameServerProtId.CAM_SHAKE, 4), CAM_RESET(GameServerProtId.CAM_RESET, 0), CAM_SMOOTHRESET(GameServerProtId.CAM_SMOOTHRESET, 4), - CAM_MOVETO(GameServerProtId.CAM_MOVETO, 6), - CAM_MOVETO_CYCLES(GameServerProtId.CAM_MOVETO_CYCLES, 8), - CAM_MOVETO_ARC(GameServerProtId.CAM_MOVETO_ARC, 10), - CAM_LOOKAT(GameServerProtId.CAM_LOOKAT, 6), - CAM_LOOKAT_EASED_COORD(GameServerProtId.CAM_LOOKAT_EASED_COORD, 7), + CAM_MOVETO_V1(GameServerProtId.CAM_MOVETO_V1, 6), + CAM_MOVETO_V2(GameServerProtId.CAM_MOVETO_V2, 8), + CAM_MOVETO_CYCLES_V1(GameServerProtId.CAM_MOVETO_CYCLES_V1, 8), + CAM_MOVETO_CYCLES_V2(GameServerProtId.CAM_MOVETO_CYCLES_V2, 10), + CAM_MOVETO_ARC_V1(GameServerProtId.CAM_MOVETO_ARC_V1, 10), + CAM_MOVETO_ARC_V2(GameServerProtId.CAM_MOVETO_ARC_V2, 14), + CAM_LOOKAT_V1(GameServerProtId.CAM_LOOKAT_V1, 6), + CAM_LOOKAT_V2(GameServerProtId.CAM_LOOKAT_V2, 8), + CAM_LOOKAT_EASED_COORD_V1(GameServerProtId.CAM_LOOKAT_EASED_COORD_V1, 7), + CAM_LOOKAT_EASED_COORD_V2(GameServerProtId.CAM_LOOKAT_EASED_COORD_V2, 9), CAM_ROTATEBY(GameServerProtId.CAM_ROTATEBY, 7), CAM_ROTATETO(GameServerProtId.CAM_ROTATETO, 7), CAM_MODE(GameServerProtId.CAM_MODE, 1), @@ -155,7 +161,8 @@ public enum class GameServerProt( // Misc. player state packets UPDATE_RUNWEIGHT(GameServerProtId.UPDATE_RUNWEIGHT, 2), UPDATE_RUNENERGY(GameServerProtId.UPDATE_RUNENERGY, 2), - SET_MAP_FLAG(GameServerProtId.SET_MAP_FLAG, 2), + SET_MAP_FLAG_V1(GameServerProtId.SET_MAP_FLAG_V1, 2), + SET_MAP_FLAG_V2(GameServerProtId.SET_MAP_FLAG_V2, 4), SET_PLAYER_OP(GameServerProtId.SET_PLAYER_OP, Prot.VAR_BYTE), UPDATE_STAT_V2(GameServerProtId.UPDATE_STAT_V2, 7), @@ -172,7 +179,8 @@ public enum class GameServerProt( // Misc. client state packets HINT_ARROW(GameServerProtId.HINT_ARROW, 6), RESET_ANIMS(GameServerProtId.RESET_ANIMS, 0), - UPDATE_REBOOT_TIMER(GameServerProtId.UPDATE_REBOOT_TIMER, 2), + UPDATE_REBOOT_TIMER_V1(GameServerProtId.UPDATE_REBOOT_TIMER_V1, 2), + UPDATE_REBOOT_TIMER_V2(GameServerProtId.UPDATE_REBOOT_TIMER_V2, Prot.VAR_BYTE), SET_HEATMAP_ENABLED(GameServerProtId.SET_HEATMAP_ENABLED, 1), MINIMAP_TOGGLE(GameServerProtId.MINIMAP_TOGGLE, 1), SERVER_TICK_END(GameServerProtId.SERVER_TICK_END, 0), diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt index 74e46c0e..46922d1f 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt @@ -5,12 +5,12 @@ import net.rsprot.protocol.ProtRepository import net.rsprox.cache.api.CacheProvider import net.rsprox.protocol.MessageDecoderRepository import net.rsprox.protocol.MessageDecoderRepositoryBuilder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtEasedCoordDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtEasedCoordV1Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamModeDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToArcDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToCyclesDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToArcV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToCyclesV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToV1Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamResetDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateBy import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateToDecoder @@ -85,7 +85,7 @@ import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ServerTi import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetHeatmapEnabledDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetInteractionModeDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SiteSettingsDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateRebootTimerDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateRebootTimerV1Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateUid192Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UrlOpenDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ZBufDecoder @@ -94,7 +94,7 @@ import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.ChatFilt import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.ChatFilterSettingsPrivateChatDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.MessageGameDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.RunClientScriptDecoder -import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetMapFlagDecoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetMapFlagV1Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetPlayerOpDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.TriggerOnDialogAbortDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateRunEnergyDecoder @@ -152,12 +152,12 @@ internal object ServerMessageDecoderRepository { ).apply { bind(CamRotateToDecoder()) bind(CamRotateBy()) - bind(CamLookAtEasedCoordDecoder()) - bind(CamLookAtDecoder()) + bind(CamLookAtEasedCoordV1Decoder()) + bind(CamLookAtV1Decoder()) bind(CamModeDecoder()) - bind(CamMoveToArcDecoder()) - bind(CamMoveToCyclesDecoder()) - bind(CamMoveToDecoder()) + bind(CamMoveToArcV1Decoder()) + bind(CamMoveToCyclesV1Decoder()) + bind(CamMoveToV1Decoder()) bind(CamResetDecoder()) bind(CamShakeDecoder()) bind(CamSmoothResetDecoder()) @@ -235,7 +235,7 @@ internal object ServerMessageDecoderRepository { bind(ResetAnimsDecoder()) bind(SendPingDecoder()) bind(ServerTickEndDecoder()) - bind(UpdateRebootTimerDecoder()) + bind(UpdateRebootTimerV1Decoder()) bind(SiteSettingsDecoder()) bind(UpdateUid192Decoder()) bind(UrlOpenDecoder()) @@ -247,7 +247,7 @@ internal object ServerMessageDecoderRepository { bind(ChatFilterSettingsPrivateChatDecoder()) bind(MessageGameDecoder()) bind(RunClientScriptDecoder()) - bind(SetMapFlagDecoder()) + bind(SetMapFlagV1Decoder()) bind(SetPlayerOpDecoder()) bind(TriggerOnDialogAbortDecoder()) bind(UpdateRunEnergyDecoder()) diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoord.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV1.kt similarity index 95% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoord.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV1.kt index a4069084..fd77ab6a 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoord.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV1.kt @@ -17,7 +17,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * @property function the camera easing function, allowing for finer * control over the way it moves from the start coordinate to the end. */ -public class CamLookAtEasedCoord private constructor( +public class CamLookAtEasedCoordV1 private constructor( private val destinationCoordInBuildArea: CoordInBuildArea, private val _height: UShort, private val _duration: UShort, @@ -51,7 +51,7 @@ public class CamLookAtEasedCoord private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as CamLookAtEasedCoord + other as CamLookAtEasedCoordV1 if (destinationCoordInBuildArea != other.destinationCoordInBuildArea) return false if (_height != other._height) return false @@ -70,7 +70,7 @@ public class CamLookAtEasedCoord private constructor( } override fun toString(): String { - return "CamLookAtEasedCoord(" + + return "CamLookAtEasedCoordV1(" + "destinationXInBuildArea=$destinationXInBuildArea, " + "destinationZInBuildArea=$destinationZInBuildArea, " + "height=$height, " + diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAt.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV1.kt similarity index 96% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAt.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV1.kt index 05861d6f..d14b9ae4 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAt.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV1.kt @@ -20,7 +20,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * @property acceleration the speed increase as the camera looks * towards the end coordinate. */ -public class CamLookAt private constructor( +public class CamLookAtV1 private constructor( private val destinationCoordInBuildArea: CoordInBuildArea, private val _height: UShort, private val _speed: UByte, @@ -54,7 +54,7 @@ public class CamLookAt private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as CamLookAt + other as CamLookAtV1 if (destinationCoordInBuildArea != other.destinationCoordInBuildArea) return false if (_height != other._height) return false @@ -73,7 +73,7 @@ public class CamLookAt private constructor( } override fun toString(): String { - return "CamLookAt(" + + return "CamLookAtV1(" + "destinationXInBuildArea=$destinationXInBuildArea, " + "destinationZInBuildArea=$destinationZInBuildArea, " + "height=$height, " + diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArc.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV1.kt similarity index 96% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArc.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV1.kt index 61005174..026699b9 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArc.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV1.kt @@ -7,7 +7,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre /** * Camera move to arc packet is used to move camera * to a new coordinate with finer control behind it. - * This packet differs from [CamMoveToCycles] in that it will first + * This packet differs from [CamMoveToCyclesV1] in that it will first * move through a center coordinate before going towards the destination, * creating a `)`-shape movement. An example image of this can be seen * [here](https://media.z-kris.com/2024/04/cam%20move%20eased%20circular.png) @@ -32,7 +32,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * control over the way it moves from the start coordinate to the end. */ @Suppress("DuplicatedCode") -public class CamMoveToArc private constructor( +public class CamMoveToArcV1 private constructor( private val centerCoordInBuildArea: CoordInBuildArea, private val destinationCoordInBuildArea: CoordInBuildArea, private val _height: UShort, @@ -77,7 +77,7 @@ public class CamMoveToArc private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as CamMoveToArc + other as CamMoveToArcV1 if (centerCoordInBuildArea != other.centerCoordInBuildArea) return false if (destinationCoordInBuildArea != other.destinationCoordInBuildArea) return false @@ -100,7 +100,7 @@ public class CamMoveToArc private constructor( } override fun toString(): String { - return "CamMoveToArc(" + + return "CamMoveToArcV1(" + "centerXInBuildArea=$centerXInBuildArea, " + "centerZInBuildArea=$centerZInBuildArea, " + "destinationXInBuildArea=$destinationXInBuildArea, " + diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCycles.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV1.kt similarity index 96% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCycles.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV1.kt index 9bfaa2d1..a13651bb 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCycles.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV1.kt @@ -21,7 +21,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * control over the way it moves from the start coordinate to the end. */ @Suppress("DuplicatedCode") -public class CamMoveToCycles private constructor( +public class CamMoveToCyclesV1 private constructor( private val destinationCoordInBuildArea: CoordInBuildArea, private val _height: UShort, private val _duration: UShort, @@ -58,7 +58,7 @@ public class CamMoveToCycles private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as CamMoveToCycles + other as CamMoveToCyclesV1 if (destinationCoordInBuildArea != other.destinationCoordInBuildArea) return false if (_height != other._height) return false @@ -79,7 +79,7 @@ public class CamMoveToCycles private constructor( } override fun toString(): String { - return "CamMoveToCycles(" + + return "CamMoveToCyclesV1(" + "destinationXInBuildArea=$destinationXInBuildArea, " + "destinationZInBuildArea=$destinationZInBuildArea, " + "height=$height, " + diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveTo.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV1.kt similarity index 96% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveTo.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV1.kt index 451a1ed7..0d8b35b1 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveTo.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV1.kt @@ -20,7 +20,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * @property acceleration the speed increase as the camera moves * towards the end coordinate. */ -public class CamMoveTo private constructor( +public class CamMoveToV1 private constructor( private val destinationCoordInBuildArea: CoordInBuildArea, private val _height: UShort, private val _speed: UByte, @@ -54,7 +54,7 @@ public class CamMoveTo private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as CamMoveTo + other as CamMoveToV1 if (destinationCoordInBuildArea != other.destinationCoordInBuildArea) return false if (_height != other._height) return false @@ -73,7 +73,7 @@ public class CamMoveTo private constructor( } override fun toString(): String { - return "CamMoveTo(" + + return "CamMoveToV1(" + "destinationXInBuildArea=$destinationXInBuildArea, " + "destinationZInBuildArea=$destinationZInBuildArea, " + "height=$height, " + diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimer.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV1.kt similarity index 89% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimer.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV1.kt index be52d5f8..e5eb0cda 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimer.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV1.kt @@ -12,14 +12,14 @@ import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage * The maximum possible value is 65535, which is equal to just * below 11 hours. */ -public class UpdateRebootTimer( +public class UpdateRebootTimerV1( public val gameCycles: Int, ) : IncomingServerGameMessage { override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false - other as UpdateRebootTimer + other as UpdateRebootTimerV1 return gameCycles == other.gameCycles } @@ -29,7 +29,7 @@ public class UpdateRebootTimer( } override fun toString(): String { - return "UpdateRebootTimer(" + + return "UpdateRebootTimerV1(" + "gameCycles=$gameCycles" + ")" } diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlag.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV1.kt similarity index 94% rename from protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlag.kt rename to protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV1.kt index 48b27764..e7478bc3 100644 --- a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlag.kt +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV1.kt @@ -11,7 +11,7 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildAre * @property zInBuildArea the z coordinate within the build area * to render the map flag at. */ -public class SetMapFlag private constructor( +public class SetMapFlagV1 private constructor( private val coordInBuildArea: CoordInBuildArea, ) : IncomingServerGameMessage { public constructor( @@ -30,7 +30,7 @@ public class SetMapFlag private constructor( if (this === other) return true if (javaClass != other?.javaClass) return false - other as SetMapFlag + other as SetMapFlagV1 return coordInBuildArea == other.coordInBuildArea } diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt index f3178da1..c84eb0a9 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt @@ -124,11 +124,11 @@ public class TranscriberPlugin( GameServerProt.CAM_SHAKE -> pass(message, Transcriber::camShake) GameServerProt.CAM_RESET -> pass(message, Transcriber::camReset) GameServerProt.CAM_SMOOTHRESET -> pass(message, Transcriber::camSmoothReset) - GameServerProt.CAM_MOVETO -> pass(message, Transcriber::camMoveTo) - GameServerProt.CAM_MOVETO_CYCLES -> pass(message, Transcriber::camMoveToCycles) - GameServerProt.CAM_MOVETO_ARC -> pass(message, Transcriber::camMoveToArc) - GameServerProt.CAM_LOOKAT -> pass(message, Transcriber::camLookAt) - GameServerProt.CAM_LOOKAT_EASED_COORD -> pass(message, Transcriber::camLookAtEasedCoord) + GameServerProt.CAM_MOVETO_V1 -> pass(message, Transcriber::camMoveTo) + GameServerProt.CAM_MOVETO_CYCLES_V1 -> pass(message, Transcriber::camMoveToCycles) + GameServerProt.CAM_MOVETO_ARC_V1 -> pass(message, Transcriber::camMoveToArc) + GameServerProt.CAM_LOOKAT_V1 -> pass(message, Transcriber::camLookAt) + GameServerProt.CAM_LOOKAT_EASED_COORD_V1 -> pass(message, Transcriber::camLookAtEasedCoord) GameServerProt.CAM_ROTATEBY -> pass(message, Transcriber::camRotateBy) GameServerProt.CAM_ROTATETO -> pass(message, Transcriber::camRotateTo) GameServerProt.CAM_MODE -> pass(message, Transcriber::camMode) @@ -168,7 +168,7 @@ public class TranscriberPlugin( GameServerProt.LOGOUT_TRANSFER -> pass(message, Transcriber::logoutTransfer) GameServerProt.UPDATE_RUNWEIGHT -> pass(message, Transcriber::updateRunWeight) GameServerProt.UPDATE_RUNENERGY -> pass(message, Transcriber::updateRunEnergy) - GameServerProt.SET_MAP_FLAG -> pass(message, Transcriber::setMapFlag) + GameServerProt.SET_MAP_FLAG_V1 -> pass(message, Transcriber::setMapFlag) GameServerProt.SET_PLAYER_OP -> pass(message, Transcriber::setPlayerOp) GameServerProt.UPDATE_STAT_V2 -> pass(message, Transcriber::updateStatV2) GameServerProt.UPDATE_STAT_V1 -> pass(message, Transcriber::updateStatV1) @@ -181,7 +181,7 @@ public class TranscriberPlugin( GameServerProt.UPDATE_STOCKMARKET_SLOT -> pass(message, Transcriber::updateStockMarketSlot) GameServerProt.HINT_ARROW -> pass(message, Transcriber::hintArrow) GameServerProt.RESET_ANIMS -> pass(message, Transcriber::resetAnims) - GameServerProt.UPDATE_REBOOT_TIMER -> pass(message, Transcriber::updateRebootTimer) + GameServerProt.UPDATE_REBOOT_TIMER_V1 -> pass(message, Transcriber::updateRebootTimer) GameServerProt.SET_HEATMAP_ENABLED -> pass(message, Transcriber::setHeatmapEnabled) GameServerProt.MINIMAP_TOGGLE -> pass(message, Transcriber::minimapToggle) GameServerProt.SERVER_TICK_END -> pass(message, Transcriber::serverTickEnd) 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 e2957440..1db4d668 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt @@ -112,7 +112,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettings import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPrivateChat import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -430,22 +430,22 @@ public class IndexerTranscriber( override fun rsevenStatus(message: RSevenStatus) { } - override fun camLookAt(message: CamLookAt) { + override fun camLookAt(message: CamLookAtV1) { } - override fun camLookAtEasedCoord(message: CamLookAtEasedCoord) { + override fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) { } override fun camMode(message: CamMode) { } - override fun camMoveTo(message: CamMoveTo) { + override fun camMoveTo(message: CamMoveToV1) { } - override fun camMoveToArc(message: CamMoveToArc) { + override fun camMoveToArc(message: CamMoveToArcV1) { } - override fun camMoveToCycles(message: CamMoveToCycles) { + override fun camMoveToCycles(message: CamMoveToCyclesV1) { } override fun camReset(message: CamReset) { @@ -832,7 +832,7 @@ public class IndexerTranscriber( override fun siteSettings(message: SiteSettings) { } - override fun updateRebootTimer(message: UpdateRebootTimer) { + override fun updateRebootTimer(message: UpdateRebootTimerV1) { } override fun updateUid192(message: UpdateUid192) { @@ -895,7 +895,7 @@ public class IndexerTranscriber( } } - override fun setMapFlag(message: SetMapFlag) { + override fun setMapFlag(message: SetMapFlagV1) { } override fun setPlayerOp(message: SetPlayerOp) { 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 d3343c29..c6ec4530 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt @@ -30,7 +30,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettings import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPrivateChat import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -66,17 +66,17 @@ import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFoll import net.rsprox.protocol.game.outgoing.model.zone.payload.* public interface ServerPacketTranscriber { - public fun camLookAt(message: CamLookAt) + public fun camLookAt(message: CamLookAtV1) - public fun camLookAtEasedCoord(message: CamLookAtEasedCoord) + public fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) public fun camMode(message: CamMode) - public fun camMoveTo(message: CamMoveTo) + public fun camMoveTo(message: CamMoveToV1) - public fun camMoveToArc(message: CamMoveToArc) + public fun camMoveToArc(message: CamMoveToArcV1) - public fun camMoveToCycles(message: CamMoveToCycles) + public fun camMoveToCycles(message: CamMoveToCyclesV1) public fun camReset(message: CamReset) @@ -238,7 +238,7 @@ public interface ServerPacketTranscriber { public fun siteSettings(message: SiteSettings) - public fun updateRebootTimer(message: UpdateRebootTimer) + public fun updateRebootTimer(message: UpdateRebootTimerV1) public fun updateUid192(message: UpdateUid192) @@ -258,7 +258,7 @@ public interface ServerPacketTranscriber { public fun runClientScript(message: RunClientScript) - public fun setMapFlag(message: SetMapFlag) + public fun setMapFlag(message: SetMapFlagV1) public fun setPlayerOp(message: SetPlayerOp) 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 62f6c275..8b164718 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt @@ -115,11 +115,11 @@ public enum class GameServerProt : Prot { CAM_SHAKE, CAM_RESET, CAM_SMOOTHRESET, - CAM_MOVETO, - CAM_MOVETO_CYCLES, - CAM_MOVETO_ARC, - CAM_LOOKAT, - CAM_LOOKAT_EASED_COORD, + CAM_MOVETO_V1, + CAM_MOVETO_CYCLES_V1, + CAM_MOVETO_ARC_V1, + CAM_LOOKAT_V1, + CAM_LOOKAT_EASED_COORD_V1, CAM_ROTATEBY, CAM_ROTATETO, CAM_MODE, @@ -165,7 +165,7 @@ public enum class GameServerProt : Prot { // Misc. player state packets UPDATE_RUNWEIGHT, UPDATE_RUNENERGY, - SET_MAP_FLAG, + SET_MAP_FLAG_V1, SET_PLAYER_OP, UPDATE_STAT_V2, UPDATE_STAT_V1, @@ -183,7 +183,7 @@ public enum class GameServerProt : Prot { // Misc. client state packets HINT_ARROW, RESET_ANIMS, - UPDATE_REBOOT_TIMER, + UPDATE_REBOOT_TIMER_V1, SET_HEATMAP_ENABLED, MINIMAP_TOGGLE, SERVER_TICK_END, 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 37a6202d..d00b8038 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt @@ -50,7 +50,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.client.ServerTickEnd import net.rsprox.protocol.game.outgoing.model.misc.client.SetHeatmapEnabled import net.rsprox.protocol.game.outgoing.model.misc.client.SetInteractionMode import net.rsprox.protocol.game.outgoing.model.misc.client.SiteSettings -import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimer +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateUid192 import net.rsprox.protocol.game.outgoing.model.misc.client.UrlOpen import net.rsprox.protocol.game.outgoing.model.misc.client.ZBuf @@ -59,7 +59,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettings import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPrivateChat import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript -import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlag +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -284,7 +284,7 @@ public class TextServerPacketTranscriber( return zoneCoordGrid(level, zoneX shl 3, zoneZ shl 3, name) } - override fun camLookAt(message: CamLookAt) { + override fun camLookAt(message: CamLookAtV1) { if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -301,7 +301,7 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } - override fun camLookAtEasedCoord(message: CamLookAtEasedCoord) { + override fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) { if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -323,7 +323,7 @@ public class TextServerPacketTranscriber( root.int("mode", message.mode) } - override fun camMoveTo(message: CamMoveTo) { + override fun camMoveTo(message: CamMoveToV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -340,7 +340,7 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } - override fun camMoveToArc(message: CamMoveToArc) { + override fun camMoveToArc(message: CamMoveToArcV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -359,7 +359,7 @@ public class TextServerPacketTranscriber( root.enum("easing", message.function) } - override fun camMoveToCycles(message: CamMoveToCycles) { + override fun camMoveToCycles(message: CamMoveToCyclesV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -1875,7 +1875,7 @@ public class TextServerPacketTranscriber( root.string("settings", message.settings) } - override fun updateRebootTimer(message: UpdateRebootTimer) { + override fun updateRebootTimer(message: UpdateRebootTimerV1) { if (!filters[PropertyFilter.UPDATE_REBOOT_TIMER]) return omit() root.formattedInt("gamecycles", message.gameCycles) } @@ -2165,7 +2165,7 @@ public class TextServerPacketTranscriber( } } - override fun setMapFlag(message: SetMapFlag) { + override fun setMapFlag(message: SetMapFlagV1) { if (!filters[PropertyFilter.SET_MAP_FLAG]) return omit() if (message.xInBuildArea == 0xFF && message.zInBuildArea == 0xFF) { root.any("coord", null) From 30a96e71bef5a07d953f495f1d2a48168ff96290 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 18:59:39 +0200 Subject: [PATCH 04/16] feat: new packet models and decoders --- .../camera/CamLookAtEasedCoordV2Decoder.kt | 30 +++++ .../codec/camera/CamLookAtV2Decoder.kt | 30 +++++ .../codec/camera/CamMoveToArcV2Decoder.kt | 36 ++++++ .../codec/camera/CamMoveToCyclesV2Decoder.kt | 32 +++++ .../codec/camera/CamMoveToV2Decoder.kt | 30 +++++ .../misc/client/UpdateRebootTimerV2Decoder.kt | 32 +++++ .../codec/misc/player/SetMapFlagV2Decoder.kt | 21 ++++ .../prot/ServerMessageDecoderRepository.kt | 14 +++ .../model/camera/CamLookAtEasedCoordV2.kt | 82 +++++++++++++ .../game/outgoing/model/camera/CamLookAtV2.kt | 82 +++++++++++++ .../outgoing/model/camera/CamMoveToArcV2.kt | 115 ++++++++++++++++++ .../model/camera/CamMoveToCyclesV2.kt | 93 ++++++++++++++ .../game/outgoing/model/camera/CamMoveToV2.kt | 83 +++++++++++++ .../model/misc/client/UpdateRebootTimerV2.kt | 66 ++++++++++ .../model/misc/player/SetMapFlagV2.kt | 53 ++++++++ 15 files changed, 799 insertions(+) create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV2Decoder.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV2.kt create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV2.kt diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV2Decoder.kt new file mode 100644 index 00000000..662c80f4 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtEasedCoordV2Decoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtEasedCoordV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class CamLookAtEasedCoordV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_EASED_COORD_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamLookAtEasedCoordV2 { + val height = buffer.g2Alt1() + val z = buffer.g2Alt3() + val x = buffer.g2Alt2() + val easing = buffer.g1Alt3() + val cycles = buffer.g2() + return CamLookAtEasedCoordV2( + x, + z, + height, + cycles, + easing, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV2Decoder.kt new file mode 100644 index 00000000..765dcf66 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamLookAtV2Decoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamLookAtV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class CamLookAtV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_LOOKAT_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamLookAtV2 { + val z = buffer.g2Alt2() + val rate2 = buffer.g1Alt3() + val rate = buffer.g1() + val x = buffer.g2() + val height = buffer.g2() + return CamLookAtV2( + x, + z, + height, + rate, + rate2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV2Decoder.kt new file mode 100644 index 00000000..762b574c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToArcV2Decoder.kt @@ -0,0 +1,36 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToArcV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class CamMoveToArcV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_ARC_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveToArcV2 { + val ignoreTerrain = buffer.g1Alt1() == 1 + val easing = buffer.g1() + val height = buffer.g2() + val centerZ = buffer.g2Alt3() + val destinationZ = buffer.g2() + val cycles = buffer.g2Alt1() + val centerX = buffer.g2Alt2() + val destinationX = buffer.g2() + return CamMoveToArcV2( + centerX, + centerZ, + destinationX, + destinationZ, + height, + cycles, + ignoreTerrain, + easing, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV2Decoder.kt new file mode 100644 index 00000000..dd1d7059 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToCyclesV2Decoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToCyclesV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class CamMoveToCyclesV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_CYCLES_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveToCyclesV2 { + val x = buffer.g2Alt1() + val ignoreTerrain = buffer.g1() == 1 + val easing = buffer.g1() + val cycles = buffer.g2Alt1() + val z = buffer.g2Alt3() + val height = buffer.g2Alt2() + return CamMoveToCyclesV2( + x, + z, + height, + cycles, + ignoreTerrain, + easing, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV2Decoder.kt new file mode 100644 index 00000000..0dcfda31 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/camera/CamMoveToV2Decoder.kt @@ -0,0 +1,30 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.camera.CamMoveToV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class CamMoveToV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.CAM_MOVETO_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): CamMoveToV2 { + val z = buffer.g2Alt3() + val x = buffer.g2() + val height = buffer.g2Alt1() + val rate2 = buffer.g1() + val rate = buffer.g1Alt1() + return CamMoveToV2( + x, + z, + height, + rate, + rate2, + ) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt new file mode 100644 index 00000000..85b49c25 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt @@ -0,0 +1,32 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class UpdateRebootTimerV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.UPDATE_REBOOT_TIMER_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): UpdateRebootTimerV2 { + val message = buffer.gjstr() + val gameCycles = buffer.g2Alt3() + return UpdateRebootTimerV2( + gameCycles, + when { + message.isEmpty() -> UpdateRebootTimerV2.IgnoreUpdateMessage + message == CANCEL -> UpdateRebootTimerV2.ClearUpdateMessage + else -> UpdateRebootTimerV2.SetUpdateMessage(message) + } + ) + } + + private companion object { + private const val CANCEL: String = "\u0018" + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV2Decoder.kt new file mode 100644 index 00000000..9041c769 --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/SetMapFlagV2Decoder.kt @@ -0,0 +1,21 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.protocol.ClientProt +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV2 +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt + +internal class SetMapFlagV2Decoder : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.SET_MAP_FLAG_V2 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): SetMapFlagV2 { + val coordGrid = CoordGrid(buffer.g4()) + return SetMapFlagV2(coordGrid) + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt index 46922d1f..52080014 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt @@ -7,10 +7,15 @@ import net.rsprox.protocol.MessageDecoderRepository import net.rsprox.protocol.MessageDecoderRepositoryBuilder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtV1Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtEasedCoordV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtEasedCoordV2Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamLookAtV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamModeDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToArcV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToArcV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToCyclesV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToCyclesV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamMoveToV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamResetDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateBy import net.rsprox.protocol.v236.game.outgoing.decoder.codec.camera.CamRotateToDecoder @@ -86,6 +91,7 @@ import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetHeatm import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SetInteractionModeDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.SiteSettingsDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateRebootTimerV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateRebootTimerV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UpdateUid192Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.UrlOpenDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.client.ZBufDecoder @@ -95,6 +101,7 @@ import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.ChatFilt import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.MessageGameDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.RunClientScriptDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetMapFlagV1Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetMapFlagV2Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.SetPlayerOpDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.TriggerOnDialogAbortDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.misc.player.UpdateRunEnergyDecoder @@ -153,11 +160,16 @@ internal object ServerMessageDecoderRepository { bind(CamRotateToDecoder()) bind(CamRotateBy()) bind(CamLookAtEasedCoordV1Decoder()) + bind(CamLookAtEasedCoordV2Decoder()) bind(CamLookAtV1Decoder()) + bind(CamLookAtV2Decoder()) bind(CamModeDecoder()) bind(CamMoveToArcV1Decoder()) + bind(CamMoveToArcV2Decoder()) bind(CamMoveToCyclesV1Decoder()) + bind(CamMoveToCyclesV2Decoder()) bind(CamMoveToV1Decoder()) + bind(CamMoveToV2Decoder()) bind(CamResetDecoder()) bind(CamShakeDecoder()) bind(CamSmoothResetDecoder()) @@ -236,6 +248,7 @@ internal object ServerMessageDecoderRepository { bind(SendPingDecoder()) bind(ServerTickEndDecoder()) bind(UpdateRebootTimerV1Decoder()) + bind(UpdateRebootTimerV2Decoder()) bind(SiteSettingsDecoder()) bind(UpdateUid192Decoder()) bind(UrlOpenDecoder()) @@ -248,6 +261,7 @@ internal object ServerMessageDecoderRepository { bind(MessageGameDecoder()) bind(RunClientScriptDecoder()) bind(SetMapFlagV1Decoder()) + bind(SetMapFlagV2Decoder()) bind(SetPlayerOpDecoder()) bind(TriggerOnDialogAbortDecoder()) bind(UpdateRunEnergyDecoder()) diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV2.kt new file mode 100644 index 00000000..c28b26ca --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtEasedCoordV2.kt @@ -0,0 +1,82 @@ +package net.rsprox.protocol.game.outgoing.model.camera + +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage +import net.rsprox.protocol.game.outgoing.model.camera.util.CameraEaseFunction + +/** + * Cam look at eased coord is used to make the camera look towards + * a certain coordinate with various easing functions. + * + * @property x the absolute x coordinate to look at. + * @property z the absolute z coordinate to look at. + * @property height the height of the camera + * @property cycles the duration of the movement in client cycles (20ms/cc) + * @property easing the camera easing function, allowing for finer + * control over the way it moves from the start coordinate to the end. + */ +public class CamLookAtEasedCoordV2 private constructor( + private val _x: UShort, + private val _z: UShort, + private val _height: UShort, + private val _cycles: UShort, + private val _easing: UByte, +) : IncomingServerGameMessage { + public constructor( + x: Int, + z: Int, + height: Int, + cycles: Int, + easing: Int, + ) : this( + x.toUShort(), + z.toUShort(), + height.toUShort(), + cycles.toUShort(), + easing.toUByte(), + ) + + public val x: Int + get() = _x.toInt() + public val z: Int + get() = _z.toInt() + public val height: Int + get() = _height.toInt() + public val cycles: Int + get() = _cycles.toInt() + public val easing: CameraEaseFunction + get() = CameraEaseFunction[_easing.toInt()] + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CamLookAtEasedCoordV2 + + if (_x != other._x) return false + if (_z != other._z) return false + if (_height != other._height) return false + if (_cycles != other._cycles) return false + if (_easing != other._easing) return false + + return true + } + + override fun hashCode(): Int { + var result = _x.hashCode() + result = 31 * result + _z.hashCode() + result = 31 * result + _height.hashCode() + result = 31 * result + _cycles.hashCode() + result = 31 * result + _easing.hashCode() + return result + } + + override fun toString(): String { + return "CamLookAtEasedCoordV2(" + + "x=$x, " + + "z=$z, " + + "height=$height, " + + "cycles=$cycles, " + + "easing=$easing" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV2.kt new file mode 100644 index 00000000..644ab7cd --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamLookAtV2.kt @@ -0,0 +1,82 @@ +package net.rsprox.protocol.game.outgoing.model.camera + +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage + +/** + * Cam lookat packet is used to make the camera look towards + * a certain coordinate in the root world. + * + * @property x the absolute x coordinate to look at. + * @property z the absolute z coordinate to look at. + * @property height the height of the camera + * @property rate the constant speed at which the camera looks towards + * to the new coordinate + * @property rate2 the speed increase as the camera looks + * towards the end coordinate. + */ +public class CamLookAtV2 private constructor( + private val _x: UShort, + private val _z: UShort, + private val _height: UShort, + private val _rate: UByte, + private val _rate2: UByte, +) : IncomingServerGameMessage { + public constructor( + x: Int, + z: Int, + height: Int, + rate: Int, + rate2: Int, + ) : this( + x.toUShort(), + z.toUShort(), + height.toUShort(), + rate.toUByte(), + rate2.toUByte(), + ) + + public val x: Int + get() = _x.toInt() + public val z: Int + get() = _z.toInt() + public val height: Int + get() = _height.toInt() + public val rate: Int + get() = _rate.toInt() + public val rate2: Int + get() = _rate2.toInt() + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CamLookAtV2 + + if (_x != other._x) return false + if (_z != other._z) return false + if (_height != other._height) return false + if (_rate != other._rate) return false + if (_rate2 != other._rate2) return false + + return true + } + + override fun hashCode(): Int { + var result = _x.hashCode() + result = 31 * result + _z.hashCode() + result = 31 * result + _height.hashCode() + result = 31 * result + _rate.hashCode() + result = 31 * result + _rate2.hashCode() + return result + } + + override fun toString(): String { + return "CamLookAtV2(" + + "x=$x, " + + "z=$z, " + + "height=$height, " + + "rate=$rate, " + + "rate2=$rate2" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV2.kt new file mode 100644 index 00000000..2785a3f7 --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToArcV2.kt @@ -0,0 +1,115 @@ +package net.rsprox.protocol.game.outgoing.model.camera + +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage +import net.rsprox.protocol.game.outgoing.model.camera.util.CameraEaseFunction + +/** + * Camera move to arc packet is used to move camera + * to a new coordinate with finer control behind it. + * This packet differs from [CamMoveToCyclesV2] in that it will first + * move through a center coordinate before going towards the destination, + * creating a `)`-shape movement. An example image of this can be seen + * [here](https://media.z-kris.com/2024/04/cam%20move%20eased%20circular.png) + * + * @property centerX the absolute x coordinate to move through. + * @property centerZ the absolute z coordinate to move through. + * @property destinationX the absolute x coordinate to move to. + * @property destinationZ the absolute z coordinate to move to. + * @property height the height of the camera once it arrives at the destination + * @property cycles the duration of the movement in client cycles (20ms/cc) + * @property ignoreTerrain whether the camera moves along the terrain, + * moving up and down according to bumps in the terrain. + * If true, the camera will move in a straight line from the starting position + * towards the end position, ignoring any changes in the terrain. + * @property easing the camera easing function, allowing for finer + * control over the way it moves from the start coordinate to the end. + */ +@Suppress("DuplicatedCode") +public class CamMoveToArcV2 private constructor( + private val _centerX: UShort, + private val _centerZ: UShort, + private val _destinationX: UShort, + private val _destinationZ: UShort, + private val _height: UShort, + private val _cycles: UShort, + public val ignoreTerrain: Boolean, + private val _easing: UByte, +) : IncomingServerGameMessage { + public constructor( + centerX: Int, + centerZ: Int, + destinationX: Int, + destinationZ: Int, + height: Int, + cycles: Int, + ignoreTerrain: Boolean, + easing: Int, + ) : this( + centerX.toUShort(), + centerZ.toUShort(), + destinationX.toUShort(), + destinationZ.toUShort(), + height.toUShort(), + cycles.toUShort(), + ignoreTerrain, + easing.toUByte(), + ) + + public val centerX: Int + get() = _centerX.toInt() + public val centerZ: Int + get() = _centerZ.toInt() + public val destinationX: Int + get() = _destinationX.toInt() + public val destinationZ: Int + get() = _destinationZ.toInt() + public val height: Int + get() = _height.toInt() + public val cycles: Int + get() = _cycles.toInt() + public val easing: CameraEaseFunction + get() = CameraEaseFunction[_easing.toInt()] + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CamMoveToArcV2 + + if (ignoreTerrain != other.ignoreTerrain) return false + if (_centerX != other._centerX) return false + if (_centerZ != other._centerZ) return false + if (_destinationX != other._destinationX) return false + if (_destinationZ != other._destinationZ) return false + if (_height != other._height) return false + if (_cycles != other._cycles) return false + if (_easing != other._easing) return false + + return true + } + + override fun hashCode(): Int { + var result = ignoreTerrain.hashCode() + result = 31 * result + _centerX.hashCode() + result = 31 * result + _centerZ.hashCode() + result = 31 * result + _destinationX.hashCode() + result = 31 * result + _destinationZ.hashCode() + result = 31 * result + _height.hashCode() + result = 31 * result + _cycles.hashCode() + result = 31 * result + _easing.hashCode() + return result + } + + override fun toString(): String { + return "CamMoveToArcV2(" + + "centerX=$centerX, " + + "centerZ=$centerZ, " + + "destinationX=$destinationX, " + + "destinationZ=$destinationZ, " + + "height=$height, " + + "cycles=$cycles, " + + "easing=$easing, " + + "ignoreTerrain=$ignoreTerrain" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV2.kt new file mode 100644 index 00000000..94741ae5 --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToCyclesV2.kt @@ -0,0 +1,93 @@ +package net.rsprox.protocol.game.outgoing.model.camera + +import net.rsprot.protocol.ServerProtCategory +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage +import net.rsprox.protocol.game.outgoing.model.camera.util.CameraEaseFunction + +/** + * Camera move to cycles packet is used to move camera + * to a new coordinate with finer control behind it. + * @property x the absolute x coordinate to move to. + * @property z the absolute z coordinate to move to. + * @property height the height of the camera once it arrives at the destination + * @property cycles the duration of the movement in client cycles (20ms/cc) + * @property ignoreTerrain whether the camera moves along the terrain, + * moving up and down according to bumps in the terrain. + * If true, the camera will move in a straight line from the starting position + * towards the end position, ignoring any changes in the terrain. + * @property easing the camera easing function, allowing for finer + * control over the way it moves from the start coordinate to the end. + */ +@Suppress("DuplicatedCode") +public class CamMoveToCyclesV2 private constructor( + private val _x: UShort, + private val _z: UShort, + private val _height: UShort, + private val _cycles: UShort, + public val ignoreTerrain: Boolean, + private val _easing: UByte, +) : IncomingServerGameMessage { + public constructor( + x: Int, + z: Int, + height: Int, + cycles: Int, + ignoreTerrain: Boolean, + easing: Int, + ) : this( + x.toUShort(), + z.toUShort(), + height.toUShort(), + cycles.toUShort(), + ignoreTerrain, + easing.toUByte(), + ) + + public val x: Int + get() = _x.toInt() + public val z: Int + get() = _z.toInt() + public val height: Int + get() = _height.toInt() + public val cycles: Int + get() = _cycles.toInt() + public val easing: CameraEaseFunction + get() = CameraEaseFunction[_easing.toInt()] + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CamMoveToCyclesV2 + + if (ignoreTerrain != other.ignoreTerrain) return false + if (_x != other._x) return false + if (_z != other._z) return false + if (_height != other._height) return false + if (_cycles != other._cycles) return false + if (_easing != other._easing) return false + + return true + } + + override fun hashCode(): Int { + var result = ignoreTerrain.hashCode() + result = 31 * result + _x.hashCode() + result = 31 * result + _z.hashCode() + result = 31 * result + _height.hashCode() + result = 31 * result + _cycles.hashCode() + result = 31 * result + _easing.hashCode() + return result + } + + override fun toString(): String { + return "CamMoveToCyclesV2(" + + "x=$x, " + + "z=$z, " + + "height=$height, " + + "cycles=$cycles, " + + "easing=$easing, " + + "ignoreTerrain=$ignoreTerrain" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV2.kt new file mode 100644 index 00000000..bd55c88e --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/camera/CamMoveToV2.kt @@ -0,0 +1,83 @@ +package net.rsprox.protocol.game.outgoing.model.camera + +import net.rsprot.protocol.ServerProtCategory +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage + +/** + * Cam move to packet is used to move the position of the camera + * to a specific coordinate in the root world. + * + * @property x the absolute x coordinate to move to. + * @property z the absolute z coordinate to move to. + * @property height the height of the camera + * @property rate the constant speed at which the camera moves + * to the new coordinate + * @property rate2 the speed increase as the camera moves + * towards the end coordinate. + */ +public class CamMoveToV2 private constructor( + private val _x: UShort, + private val _z: UShort, + private val _height: UShort, + private val _rate: UByte, + private val _rate2: UByte, +) : IncomingServerGameMessage { + public constructor( + x: Int, + z: Int, + height: Int, + rate: Int, + rate2: Int, + ) : this( + x.toUShort(), + z.toUShort(), + height.toUShort(), + rate.toUByte(), + rate2.toUByte(), + ) + + public val x: Int + get() = _x.toInt() + public val z: Int + get() = _z.toInt() + public val height: Int + get() = _height.toInt() + public val rate: Int + get() = _rate.toInt() + public val rate2: Int + get() = _rate2.toInt() + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as CamMoveToV2 + + if (_x != other._x) return false + if (_z != other._z) return false + if (_height != other._height) return false + if (_rate != other._rate) return false + if (_rate2 != other._rate2) return false + + return true + } + + override fun hashCode(): Int { + var result = _x.hashCode() + result = 31 * result + _z.hashCode() + result = 31 * result + _height.hashCode() + result = 31 * result + _rate.hashCode() + result = 31 * result + _rate2.hashCode() + return result + } + + override fun toString(): String { + return "CamMoveToV2(" + + "x=$x, " + + "z=$z, " + + "height=$height, " + + "rate=$rate, " + + "rate2=$rate2" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV2.kt new file mode 100644 index 00000000..7d7e8fb0 --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/client/UpdateRebootTimerV2.kt @@ -0,0 +1,66 @@ +package net.rsprox.protocol.game.outgoing.model.misc.client + +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage + +/** + * Update reboot timer is used to start the shut-down timer + * in preparation of an update, along with an optional message to show. + * @property gameCycles the number of game cycles (600ms/gc) + * until the shut-down is complete. + * If the number is set to zero, any existing reboot timers + * will be cleared out. + * The maximum possible value is 65535, which is equal to just + * below 11 hours. + */ +public class UpdateRebootTimerV2( + public val gameCycles: Int, + public val messageType: UpdateMessageType, +) : IncomingServerGameMessage { + public sealed interface UpdateMessageType + + /** + * Sets the message to show alongside the update to the [message] provided. + * @property message the message to show to the players, alongside the count-down. + * Note that if the [message] is an empty string, the [IgnoreUpdateMessage] should be used instead, + * as the client skips modifying the update message variable in this scenario. + */ + public class SetUpdateMessage( + public val message: String, + ) : UpdateMessageType + + /** + * Sets the update timer and clears any existing update message being shown to the players. + */ + public data object ClearUpdateMessage : UpdateMessageType + + /** + * Sets the update timer and ignores any existing update messages - if one was previously set, + * the message would remain untouched. + */ + public data object IgnoreUpdateMessage : UpdateMessageType + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as UpdateRebootTimerV2 + + if (gameCycles != other.gameCycles) return false + if (messageType != other.messageType) return false + + return true + } + + override fun hashCode(): Int { + var result = gameCycles + result = 31 * result + messageType.hashCode() + return result + } + + override fun toString(): String { + return "UpdateRebootTimerV2(" + + "gameCycles=$gameCycles, " + + "messageType=$messageType" + + ")" + } +} diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV2.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV2.kt new file mode 100644 index 00000000..68a208af --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/misc/player/SetMapFlagV2.kt @@ -0,0 +1,53 @@ +package net.rsprox.protocol.game.outgoing.model.misc.player + +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage + +/** + * Set map flag is used to set the red map flag on the minimap. Note that the [CoordGrid.level] property + * is unused in this packet. + * Use the no-arguments constructor to clear the map flag, or refer to [RESET] in the companion. + * @property coordGrid the coord grid to show the map flag at. + */ +public class SetMapFlagV2( + public val coordGrid: CoordGrid, +) : IncomingServerGameMessage { + public constructor( + x: Int, + z: Int, + ) : this( + CoordGrid(0, x, z), + ) + + public constructor() : this(CoordGrid.INVALID) + + public val x: Int + get() = coordGrid.x + public val z: Int + get() = coordGrid.z + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as SetMapFlagV2 + + return coordGrid == other.coordGrid + } + + override fun hashCode(): Int { + return coordGrid.hashCode() + } + + override fun toString(): String { + return "SetMapFlagV2(" + + "x=$x, " + + "z=$z" + + ")" + } + + public companion object { + @JvmStatic + public val RESET: SetMapFlagV2 = SetMapFlagV2() + } +} From ab4d5540b60657bc824ac10befb0e5f45af6aa87 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 19:10:11 +0200 Subject: [PATCH 05/16] feat: update all server prots (excl. infos) --- .../decoder/codec/buttons/IfButtonDDecoder.kt | 10 ++++----- .../decoder/codec/buttons/IfButtonTDecoder.kt | 9 ++++---- .../codec/buttons/IfRunScriptDecoder.kt | 8 +++---- .../events/EventCameraPositionDecoder.kt | 4 ++-- .../codec/events/EventKeyboardDecoder.kt | 4 ++-- .../codec/events/EventMouseClickV2Decoder.kt | 8 +++---- .../friendchat/FriendChatSetRankDecoder.kt | 2 +- .../decoder/codec/locs/OpLoc1Decoder.kt | 6 ++--- .../decoder/codec/locs/OpLoc2Decoder.kt | 8 +++---- .../decoder/codec/locs/OpLoc3Decoder.kt | 6 ++--- .../decoder/codec/locs/OpLoc4Decoder.kt | 6 ++--- .../decoder/codec/locs/OpLoc5Decoder.kt | 8 +++---- .../decoder/codec/locs/OpLocTDecoder.kt | 12 +++++----- .../codec/misc/client/SendPingReplyDecoder.kt | 8 +++---- .../codec/misc/user/ClickWorldMapDecoder.kt | 2 +- .../codec/misc/user/IfCrmViewClickDecoder.kt | 12 +++++----- .../codec/misc/user/MoveGameClickDecoder.kt | 4 ++-- .../misc/user/MoveMinimapClickDecoder.kt | 4 ++-- .../codec/misc/user/TeleportDecoder.kt | 8 +++---- .../decoder/codec/npcs/OpNpc1Decoder.kt | 2 +- .../decoder/codec/npcs/OpNpc3Decoder.kt | 2 +- .../decoder/codec/npcs/OpNpc4Decoder.kt | 4 ++-- .../decoder/codec/npcs/OpNpc5Decoder.kt | 4 ++-- .../decoder/codec/npcs/OpNpc6Decoder.kt | 2 +- .../decoder/codec/npcs/OpNpcTDecoder.kt | 8 +++---- .../decoder/codec/objs/OpObj1Decoder.kt | 6 ++--- .../decoder/codec/objs/OpObj2Decoder.kt | 6 ++--- .../decoder/codec/objs/OpObj3Decoder.kt | 6 ++--- .../decoder/codec/objs/OpObj4Decoder.kt | 4 ++-- .../decoder/codec/objs/OpObj5Decoder.kt | 8 +++---- .../decoder/codec/objs/OpObj6Decoder.kt | 4 ++-- .../decoder/codec/objs/OpObjTDecoder.kt | 14 ++++++------ .../decoder/codec/players/OpPlayer1Decoder.kt | 4 ++-- .../decoder/codec/players/OpPlayer2Decoder.kt | 2 +- .../decoder/codec/players/OpPlayer3Decoder.kt | 4 ++-- .../decoder/codec/players/OpPlayer4Decoder.kt | 2 +- .../decoder/codec/players/OpPlayer5Decoder.kt | 4 ++-- .../decoder/codec/players/OpPlayer6Decoder.kt | 4 ++-- .../decoder/codec/players/OpPlayer7Decoder.kt | 2 +- .../decoder/codec/players/OpPlayer8Decoder.kt | 4 ++-- .../decoder/codec/players/OpPlayerTDecoder.kt | 8 +++---- .../codec/resumed/ResumePauseButtonDecoder.kt | 6 ++--- .../worldentities/OpWorldEntity1Decoder.kt | 4 ++-- .../worldentities/OpWorldEntity2Decoder.kt | 4 ++-- .../worldentities/OpWorldEntity3Decoder.kt | 2 +- .../worldentities/OpWorldEntity4Decoder.kt | 4 ++-- .../worldentities/OpWorldEntity5Decoder.kt | 4 ++-- .../worldentities/OpWorldEntityTDecoder.kt | 10 ++++----- .../codec/interfaces/IfMoveSubDecoder.kt | 4 ++-- .../codec/interfaces/IfOpenSubDecoder.kt | 6 ++--- .../codec/interfaces/IfOpenTopDecoder.kt | 2 +- .../codec/interfaces/IfSetAngleDecoder.kt | 4 ++-- .../codec/interfaces/IfSetAnimDecoder.kt | 6 ++--- .../codec/interfaces/IfSetColourDecoder.kt | 6 ++--- .../codec/interfaces/IfSetEventsV2Decoder.kt | 10 ++++----- .../codec/interfaces/IfSetHideDecoder.kt | 4 ++-- .../codec/interfaces/IfSetModelDecoder.kt | 6 ++--- .../interfaces/IfSetNpcHeadActiveDecoder.kt | 6 ++--- .../codec/interfaces/IfSetNpcHeadDecoder.kt | 2 +- .../codec/interfaces/IfSetObjectDecoder.kt | 8 +++---- .../interfaces/IfSetPlayerHeadDecoder.kt | 4 ++-- .../IfSetPlayerModelBaseColourDecoder.kt | 4 ++-- .../IfSetPlayerModelBodyTypeDecoder.kt | 2 +- .../interfaces/IfSetPlayerModelObjDecoder.kt | 2 +- .../interfaces/IfSetPlayerModelSelfDecoder.kt | 6 ++--- .../codec/interfaces/IfSetPositionDecoder.kt | 4 ++-- .../interfaces/IfSetRotateSpeedDecoder.kt | 8 +++---- .../codec/interfaces/IfSetScrollPosDecoder.kt | 6 ++--- .../decoder/codec/inv/UpdateInvFullDecoder.kt | 4 ++-- .../codec/inv/UpdateInvStopTransmitDecoder.kt | 2 +- .../decoder/codec/map/RebuildRegionDecoder.kt | 4 ++-- .../decoder/codec/map/StaticRebuildDecoder.kt | 6 ++--- .../misc/client/UpdateRebootTimerV2Decoder.kt | 2 +- .../misc/player/ChatFilterSettingsDecoder.kt | 2 +- .../codec/misc/player/SetPlayerOpDecoder.kt | 4 ++-- .../codec/misc/player/UpdateStatV2Decoder.kt | 4 ++-- .../decoder/codec/sound/MidiJingleDecoder.kt | 4 ++-- .../codec/sound/MidiSongStopDecoder.kt | 4 ++-- .../decoder/codec/sound/MidiSongV2Decoder.kt | 6 ++--- .../sound/MidiSongWithSecondaryDecoder.kt | 10 ++++----- .../decoder/codec/sound/MidiSwapDecoder.kt | 8 +++---- .../codec/specific/LocAnimSpecificDecoder.kt | 6 ++--- .../codec/specific/MapAnimSpecificDecoder.kt | 6 ++--- .../codec/specific/NpcAnimSpecificDecoder.kt | 4 ++-- .../specific/NpcHeadIconSpecificDecoder.kt | 8 +++---- .../specific/NpcSpotAnimSpecificDecoder.kt | 8 +++---- .../codec/specific/ObjAddSpecificDecoder.kt | 16 +++++++------- .../codec/specific/ObjCountSpecificDecoder.kt | 6 ++--- .../specific/ObjCustomiseSpecificDecoder.kt | 14 ++++++------ .../codec/specific/ObjDelSpecificDecoder.kt | 4 ++-- .../specific/ObjEnabledOpsSpecificDecoder.kt | 6 ++--- .../specific/ObjUncustomiseSpecificDecoder.kt | 6 ++--- .../specific/PlayerAnimSpecificDecoder.kt | 4 ++-- .../specific/PlayerSpotAnimSpecificDecoder.kt | 6 ++--- .../specific/ProjAnimSpecificV4Decoder.kt | 16 +++++++------- .../decoder/codec/varp/VarpLargeDecoder.kt | 4 ++-- .../decoder/codec/varp/VarpSmallDecoder.kt | 4 ++-- .../header/UpdateZoneFullFollowsDecoder.kt | 4 ++-- .../UpdateZonePartialEnclosedDecoder.kt | 22 +++++++++---------- .../header/UpdateZonePartialFollowsDecoder.kt | 4 ++-- .../zone/payload/LocAddChangeV2Decoder.kt | 12 +++++----- .../codec/zone/payload/LocAnimDecoder.kt | 4 ++-- .../codec/zone/payload/LocDelDecoder.kt | 4 ++-- .../codec/zone/payload/LocMergeDecoder.kt | 18 +++++++-------- .../codec/zone/payload/MapAnimDecoder.kt | 6 ++--- .../zone/payload/MapProjAnimV2Decoder.kt | 18 +++++++-------- .../codec/zone/payload/ObjAddDecoder.kt | 12 +++++----- .../codec/zone/payload/ObjCountDecoder.kt | 8 +++---- .../codec/zone/payload/ObjCustomiseDecoder.kt | 14 ++++++------ .../codec/zone/payload/ObjDelDecoder.kt | 4 ++-- .../zone/payload/ObjEnabledOpsDecoder.kt | 6 ++--- .../zone/payload/ObjUncustomiseDecoder.kt | 4 ++-- .../codec/zone/payload/SoundAreaDecoder.kt | 12 +++++----- 113 files changed, 349 insertions(+), 348 deletions(-) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt index a02c2b57..63335d43 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonDDecoder.kt @@ -3,7 +3,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt import net.rsprot.protocol.util.gCombinedIdAlt1 -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.buttons.IfButtonD import net.rsprox.protocol.session.Session @@ -16,12 +16,12 @@ public class IfButtonDDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfButtonD { + val targetCombinedId = buffer.gCombinedIdAlt3() + val selectedObj = buffer.g2Alt3() val targetObj = buffer.g2Alt1() - val targetCombinedId = buffer.gCombinedIdAlt1() - val selectedObj = buffer.g2() + val targetSub = buffer.g2Alt3() + val selectedCombinedId = buffer.gCombinedIdAlt1() val selectedSub = buffer.g2Alt2() - val selectedCombinedId = buffer.gCombinedIdAlt2() - val targetSub = buffer.g2Alt1() return IfButtonD( selectedCombinedId, selectedSub, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt index 0c7347c0..e449ad9c 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfButtonTDecoder.kt @@ -2,6 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.buttons.IfButtonT @@ -15,12 +16,12 @@ public class IfButtonTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfButtonT { - val targetCombinedId = buffer.gCombinedIdAlt3() - val selectedSub = buffer.g2Alt2() - val targetSub = buffer.g2Alt1() + val targetSub = buffer.g2() val selectedObj = buffer.g2Alt1() - val selectedCombinedId = buffer.gCombinedIdAlt3() + val selectedSub = buffer.g2Alt2() + val selectedCombinedId = buffer.gCombinedIdAlt2() val targetObj = buffer.g2Alt3() + val targetCombinedId = buffer.gCombinedIdAlt3() return IfButtonT( selectedCombinedId, selectedSub, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt index e794c3c3..ba1ccfa3 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/buttons/IfRunScriptDecoder.kt @@ -3,7 +3,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.buttons import net.rsprot.buffer.JagByteBuf import net.rsprot.buffer.extensions.toByteArray import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.buttons.IfRunScript import net.rsprox.protocol.session.Session @@ -18,10 +18,10 @@ public class IfRunScriptDecoder : ProxyMessageDecoder { ): IfRunScript { // Function is method(int combinedId, int sub, int obj, int script, Object[] args) // The order of argument does not seem to change (based on two revisions) - val script = buffer.g4Alt1() - val sub = buffer.g2Alt1() - val combinedId = buffer.gCombinedIdAlt1() val obj = buffer.g2Alt1() + val combinedId = buffer.gCombinedIdAlt3() + val script = buffer.g4Alt2() + val sub = buffer.g2Alt2() val bytes = buffer.buffer.toByteArray() return IfRunScript( combinedId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt index 118dce5d..537abfa7 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/events/EventCameraPositionDecoder.kt @@ -14,8 +14,8 @@ public class EventCameraPositionDecoder : ProxyMessageDecoder { val keys = ByteArray(count) var lastTransmittedKeyPress: Int = -1 for (i in 0.. { buffer: JagByteBuf, session: Session, ): EventMouseClickV2 { - val x = buffer.g2() - val y = buffer.g2() - val code = buffer.g1Alt1() - val packed = buffer.g2Alt2() + val code = buffer.g1Alt2() + val y = buffer.g2Alt2() + val x = buffer.g2Alt2() + val packed = buffer.g2Alt1() val rightClick = packed and 0x1 != 0 val lastTransmittedMouseClick = packed ushr 1 return EventMouseClickV2( diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt index 44c7bf78..4b177a65 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/friendchat/FriendChatSetRankDecoder.kt @@ -14,7 +14,7 @@ public class FriendChatSetRankDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): FriendChatSetRank { - val rank = buffer.g1Alt3() + val rank = buffer.g1Alt1() val name = buffer.gjstr() return FriendChatSetRank( name, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt index 9d1e6611..ed746e7d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc1Decoder.kt @@ -14,10 +14,10 @@ public class OpLoc1Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLoc { + val controlKey = buffer.g1Alt1() == 1 + val z = buffer.g2Alt3() + val id = buffer.g2() val x = buffer.g2Alt2() - val z = buffer.g2Alt1() - val controlKey = buffer.g1Alt2() == 1 - val id = buffer.g2Alt3() return OpLoc( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt index 56c27005..676510bc 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc2Decoder.kt @@ -14,10 +14,10 @@ public class OpLoc2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLoc { - val x = buffer.g2Alt3() - val z = buffer.g2Alt3() - val controlKey = buffer.g1Alt3() == 1 - val id = buffer.g2() + val x = buffer.g2() + val id = buffer.g2Alt3() + val z = buffer.g2() + val controlKey = buffer.g1() == 1 return OpLoc( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt index e1c4fa68..abf9eed5 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc3Decoder.kt @@ -14,10 +14,10 @@ public class OpLoc3Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLoc { + val id = buffer.g2Alt2() val z = buffer.g2Alt1() - val id = buffer.g2Alt1() - val x = buffer.g2Alt3() - val controlKey = buffer.g1Alt3() == 1 + val x = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 return OpLoc( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt index 8e6de63b..c950f032 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc4Decoder.kt @@ -14,10 +14,10 @@ public class OpLoc4Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLoc { - val x = buffer.g2Alt2() + val z = buffer.g2() + val controlKey = buffer.g1() == 1 val id = buffer.g2Alt1() - val z = buffer.g2Alt2() - val controlKey = buffer.g1Alt2() == 1 + val x = buffer.g2Alt2() return OpLoc( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt index cd827fdd..7f9a9559 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLoc5Decoder.kt @@ -14,10 +14,10 @@ public class OpLoc5Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLoc { - val x = buffer.g2() - val controlKey = buffer.g1Alt1() == 1 - val z = buffer.g2Alt2() - val id = buffer.g2Alt2() + val id = buffer.g2Alt3() + val z = buffer.g2Alt1() + val controlKey = buffer.g1() == 1 + val x = buffer.g2Alt2() return OpLoc( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt index bee640b0..a7579407 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/locs/OpLocTDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.locs import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.locs.OpLocT import net.rsprox.protocol.session.Session @@ -15,13 +15,13 @@ public class OpLocTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpLocT { + val selectedSub = buffer.g2Alt3() + val x = buffer.g2Alt3() + val selectedCombinedId = buffer.gCombinedIdAlt2() + val controlKey = buffer.g1Alt1() == 1 + val id = buffer.g2() val z = buffer.g2() val selectedObj = buffer.g2Alt2() - val x = buffer.g2() - val controlKey = buffer.g1() == 1 - val selectedCombinedId = buffer.gCombinedIdAlt1() - val selectedSub = buffer.g2Alt2() - val id = buffer.g2Alt2() return OpLocT( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt index 7460db43..9fdd8eff 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/client/SendPingReplyDecoder.kt @@ -14,10 +14,10 @@ public class SendPingReplyDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): SendPingReply { - val value1 = buffer.g4Alt1() - val value2 = buffer.g4() - val fps = buffer.g1Alt2() - val gcPercentTime = buffer.g1Alt3() + val value1 = buffer.g4() + val value2 = buffer.g4Alt3() + val gcPercentTime = buffer.g1Alt1() + val fps = buffer.g1Alt3() return SendPingReply( fps, gcPercentTime, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt index 0cfae719..7705578f 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/ClickWorldMapDecoder.kt @@ -15,7 +15,7 @@ public class ClickWorldMapDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ClickWorldMap { - val packed = buffer.g4Alt3() + val packed = buffer.g4() return ClickWorldMap(CoordGrid(packed)) } } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt index 7eaf61f9..ed5a1038 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/IfCrmViewClickDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.misc.user import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.misc.user.IfCrmViewClick import net.rsprox.protocol.session.Session @@ -16,11 +16,11 @@ public class IfCrmViewClickDecoder : ProxyMessageDecoder { session: Session, ): IfCrmViewClick { val serverTarget = buffer.g4Alt1() - val sub = buffer.g2Alt1() - val behaviour3 = buffer.g4Alt3() - val behaviour2 = buffer.g4Alt1() - val behaviour1 = buffer.g4Alt3() - val combinedId = buffer.gCombinedIdAlt1() + val sub = buffer.g2Alt2() + val behaviour3 = buffer.g4Alt2() + val behaviour2 = buffer.g4() + val behaviour1 = buffer.g4Alt1() + val combinedId = buffer.gCombinedIdAlt2() return IfCrmViewClick( serverTarget, combinedId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt index 0ef32128..e326ba58 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveGameClickDecoder.kt @@ -14,9 +14,9 @@ public class MoveGameClickDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MoveGameClick { - val keyCombination = buffer.g1Alt3() val z = buffer.g2Alt3() - val x = buffer.g2Alt3() + val x = buffer.g2() + val keyCombination = buffer.g1Alt3() return MoveGameClick( x, z, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt index cbbec660..ba86f026 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/MoveMinimapClickDecoder.kt @@ -15,9 +15,9 @@ public class MoveMinimapClickDecoder : ProxyMessageDecoder { session: Session, ): MoveMinimapClick { // The x, z and keyCombination get scrambled between revisions - val keyCombination = buffer.g1Alt3() val z = buffer.g2Alt3() - val x = buffer.g2Alt3() + val x = buffer.g2() + val keyCombination = buffer.g1Alt3() // The arguments below are consistent across revisions val minimapWidth = buffer.g1() diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt index 185013d2..b47fdf18 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/misc/user/TeleportDecoder.kt @@ -14,10 +14,10 @@ public class TeleportDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): Teleport { - val x = buffer.g2Alt3() - val z = buffer.g2Alt2() - val oculusSyncValue = buffer.g4Alt2() - val level = buffer.g1Alt1() + val level = buffer.g1() + val z = buffer.g2Alt3() + val oculusSyncValue = buffer.g4Alt1() + val x = buffer.g2() return Teleport( oculusSyncValue, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt index 801806e3..983f9bfc 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc1Decoder.kt @@ -14,8 +14,8 @@ public class OpNpc1Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpc { - val controlKey = buffer.g1Alt1() == 1 val index = buffer.g2Alt1() + val controlKey = buffer.g1Alt1() == 1 return OpNpc( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt index 80e28d08..179c0742 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc3Decoder.kt @@ -14,8 +14,8 @@ public class OpNpc3Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpc { - val controlKey = buffer.g1() == 1 val index = buffer.g2Alt1() + val controlKey = buffer.g1Alt1() == 1 return OpNpc( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt index 79851e46..1078f3a4 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc4Decoder.kt @@ -14,8 +14,8 @@ public class OpNpc4Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpc { - val index = buffer.g2Alt3() - val controlKey = buffer.g1() == 1 + val index = buffer.g2Alt1() + val controlKey = buffer.g1Alt2() == 1 return OpNpc( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt index a399549f..cac1fd59 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc5Decoder.kt @@ -14,8 +14,8 @@ public class OpNpc5Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpc { - val index = buffer.g2Alt2() - val controlKey = buffer.g1Alt2() == 1 + val index = buffer.g2Alt1() + val controlKey = buffer.g1Alt3() == 1 return OpNpc( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt index 10b521f3..566debfc 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpc6Decoder.kt @@ -14,7 +14,7 @@ public class OpNpc6Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpc6 { - val id = buffer.g2Alt2() + val id = buffer.g2Alt1() return OpNpc6(id) } } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt index d94d357b..6baca0c3 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/npcs/OpNpcTDecoder.kt @@ -15,11 +15,11 @@ public class OpNpcTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpNpcT { - val selectedObj = buffer.g2Alt3() + val index = buffer.g2Alt2() + val selectedSub = buffer.g2Alt3() val selectedCombinedId = buffer.gCombinedIdAlt3() - val selectedSub = buffer.g2Alt1() - val controlKey = buffer.g1Alt3() == 1 - val index = buffer.g2Alt3() + val controlKey = buffer.g1Alt1() == 1 + val selectedObj = buffer.g2Alt2() return OpNpcT( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt index 80f59a1d..1b74fa8c 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj1Decoder.kt @@ -14,10 +14,10 @@ public class OpObj1Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj { - val controlKey = buffer.g1Alt3() == 1 - val x = buffer.g2Alt2() + val id = buffer.g2() + val x = buffer.g2Alt1() val z = buffer.g2() - val id = buffer.g2Alt2() + val controlKey = buffer.g1Alt3() == 1 return OpObj( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt index b22237b2..f719620c 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj2Decoder.kt @@ -14,10 +14,10 @@ public class OpObj2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj { - val z = buffer.g2Alt3() - val x = buffer.g2() + val x = buffer.g2Alt2() val controlKey = buffer.g1Alt1() == 1 - val id = buffer.g2Alt3() + val z = buffer.g2Alt1() + val id = buffer.g2Alt1() return OpObj( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt index aebe315f..e14de2c2 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj3Decoder.kt @@ -14,10 +14,10 @@ public class OpObj3Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj { - val x = buffer.g2Alt2() + val id = buffer.g2Alt1() + val z = buffer.g2Alt2() val controlKey = buffer.g1Alt2() == 1 - val id = buffer.g2Alt3() - val z = buffer.g2Alt1() + val x = buffer.g2() return OpObj( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt index 18164ecc..2838a537 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj4Decoder.kt @@ -14,10 +14,10 @@ public class OpObj4Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj { - val z = buffer.g2() + val z = buffer.g2Alt1() val controlKey = buffer.g1Alt2() == 1 val id = buffer.g2() - val x = buffer.g2Alt3() + val x = buffer.g2() return OpObj( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt index 59f81800..85480295 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj5Decoder.kt @@ -14,10 +14,10 @@ public class OpObj5Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj { - val id = buffer.g2Alt1() - val x = buffer.g2Alt3() - val z = buffer.g2Alt2() - val controlKey = buffer.g1Alt3() == 1 + val z = buffer.g2Alt3() + val controlKey = buffer.g1Alt2() == 1 + val x = buffer.g2Alt1() + val id = buffer.g2Alt2() return OpObj( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt index 26199e9a..249cf635 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObj6Decoder.kt @@ -14,9 +14,9 @@ public class OpObj6Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObj6 { - val id = buffer.g2() val z = buffer.g2Alt1() - val x = buffer.g2Alt1() + val id = buffer.g2Alt2() + val x = buffer.g2Alt2() return OpObj6( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt index 860fc839..9fef6605 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/objs/OpObjTDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.objs import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.objs.OpObjT import net.rsprox.protocol.session.Session @@ -15,13 +15,13 @@ public class OpObjTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpObjT { - val x = buffer.g2Alt3() + val selectedCombinedId = buffer.gCombinedIdAlt2() + val z = buffer.g2Alt2() + val id = buffer.g2Alt3() val controlKey = buffer.g1Alt2() == 1 - val selectedObj = buffer.g2Alt3() - val z = buffer.g2Alt1() - val id = buffer.g2() - val selectedCombinedId = buffer.gCombinedIdAlt1() - val selectedSub = buffer.g2Alt3() + val selectedObj = buffer.g2() + val x = buffer.g2Alt1() + val selectedSub = buffer.g2() return OpObjT( id, x, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt index 77d48601..49cb575b 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer1Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer1Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val controlKey = buffer.g1Alt3() == 1 - val index = buffer.g2() + val index = buffer.g2Alt1() + val controlKey = buffer.g1() == 1 return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt index 5a7ea0fe..9ffa0913 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer2Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val controlKey = buffer.g1() == 1 val index = buffer.g2() + val controlKey = buffer.g1() == 1 return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt index 1ad5f65e..457e5ee7 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer3Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer3Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val controlKey = buffer.g1Alt3() == 1 - val index = buffer.g2() + val index = buffer.g2Alt1() + val controlKey = buffer.g1() == 1 return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt index e93f40be..3a4d3018 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer4Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer4Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val index = buffer.g2() val controlKey = buffer.g1Alt2() == 1 + val index = buffer.g2Alt2() return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt index e965ebf4..f8c1d416 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer5Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer5Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val index = buffer.g2Alt3() - val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt index d1b9fa93..45fc16ba 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer6Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer6Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val index = buffer.g2() - val controlKey = buffer.g1Alt2() == 1 + val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2Alt3() return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt index 637c7957..92efc613 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer7Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer7Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val index = buffer.g2Alt2() val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2Alt3() return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt index a6e8b903..2d0efd09 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayer8Decoder.kt @@ -14,8 +14,8 @@ public class OpPlayer8Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayer { - val controlKey = buffer.g1() == 1 - val index = buffer.g2Alt2() + val index = buffer.g2() + val controlKey = buffer.g1Alt2() == 1 return OpPlayer( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt index 638f231f..04836236 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/players/OpPlayerTDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.players import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.players.OpPlayerT import net.rsprox.protocol.session.Session @@ -15,11 +15,11 @@ public class OpPlayerTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpPlayerT { + val controlKey = buffer.g1() == 1 val selectedSub = buffer.g2Alt2() + val selectedObj = buffer.g2Alt2() + val selectedCombinedId = buffer.gCombinedIdAlt3() val index = buffer.g2() - val selectedCombinedId = buffer.gCombinedIdAlt1() - val selectedObj = buffer.g2Alt3() - val controlKey = buffer.g1() == 1 return OpPlayerT( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt index e6a1aa3d..6632e95f 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/resumed/ResumePauseButtonDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.resumed import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.resumed.ResumePauseButton import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ public class ResumePauseButtonDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ResumePauseButton { - val sub = buffer.g2Alt1() - val combinedId = buffer.gCombinedIdAlt1() + val sub = buffer.g2Alt2() + val combinedId = buffer.gCombinedIdAlt3() return ResumePauseButton( combinedId, sub, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt index 46b42b05..623b6b51 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity1Decoder.kt @@ -14,8 +14,8 @@ public class OpWorldEntity1Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpWorldEntity { - val controlKey = buffer.g1Alt2() == 1 - val index = buffer.g2Alt2() + val controlKey = buffer.g1() == 1 + val index = buffer.g2Alt1() return OpWorldEntity( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt index fa1f78db..8d23a52a 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity2Decoder.kt @@ -14,8 +14,8 @@ public class OpWorldEntity2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpWorldEntity { - val controlKey = buffer.g1() == 1 - val index = buffer.g2Alt3() + val index = buffer.g2Alt1() + val controlKey = buffer.g1Alt3() == 1 return OpWorldEntity( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt index ac30795f..959ea92b 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity3Decoder.kt @@ -15,7 +15,7 @@ public class OpWorldEntity3Decoder : ProxyMessageDecoder { session: Session, ): OpWorldEntity { val controlKey = buffer.g1Alt1() == 1 - val index = buffer.g2Alt3() + val index = buffer.g2Alt1() return OpWorldEntity( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt index e518d849..5ce6e8f4 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity4Decoder.kt @@ -14,8 +14,8 @@ public class OpWorldEntity4Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpWorldEntity { - val controlKey = buffer.g1Alt2() == 1 - val index = buffer.g2() + val index = buffer.g2Alt3() + val controlKey = buffer.g1Alt1() == 1 return OpWorldEntity( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt index 1fedba2d..4ad861fd 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntity5Decoder.kt @@ -14,8 +14,8 @@ public class OpWorldEntity5Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpWorldEntity { - val index = buffer.g2Alt2() - val controlKey = buffer.g1Alt3() == 1 + val index = buffer.g2() + val controlKey = buffer.g1Alt1() == 1 return OpWorldEntity( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt index 8ec326bc..e8059310 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/incoming/decoder/codec/worldentities/OpWorldEntityTDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.incoming.decoder.codec.worldentities import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprot.protocol.util.gCombinedId import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.incoming.model.worldentities.OpWorldEntityT import net.rsprox.protocol.session.Session @@ -15,11 +15,11 @@ public class OpWorldEntityTDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): OpWorldEntityT { - val selectedObj = buffer.g2Alt1() - val controlKey = buffer.g1Alt2() == 1 - val selectedCombinedId = buffer.gCombinedIdAlt3() + val selectedSub = buffer.g2() + val selectedCombinedId = buffer.gCombinedId() val index = buffer.g2Alt3() - val selectedSub = buffer.g2Alt2() + val selectedObj = buffer.g2Alt2() + val controlKey = buffer.g1Alt3() == 1 return OpWorldEntityT( index, controlKey, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt index c5f49b2b..e8e05636 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfMoveSubDecoder.kt @@ -2,8 +2,8 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfMoveSub import net.rsprox.protocol.session.Session @@ -16,8 +16,8 @@ internal class IfMoveSubDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfMoveSub { + val destinationCombinedId = buffer.gCombinedIdAlt3() val sourceCombinedId = buffer.gCombinedIdAlt2() - val destinationCombinedId = buffer.gCombinedIdAlt1() return IfMoveSub( sourceCombinedId.interfaceId, sourceCombinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt index 3cf68e60..56a4b1f3 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenSubDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfOpenSub import net.rsprox.protocol.session.Session @@ -15,9 +15,9 @@ internal class IfOpenSubDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfOpenSub { - val interfaceId = buffer.g2() + val combinedId = buffer.gCombinedIdAlt3() val type = buffer.g1Alt3() - val combinedId = buffer.gCombinedIdAlt2() + val interfaceId = buffer.g2() return IfOpenSub( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt index d5babce5..1b8792f1 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfOpenTopDecoder.kt @@ -14,7 +14,7 @@ internal class IfOpenTopDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfOpenTop { - val interfaceId = buffer.g2Alt3() + val interfaceId = buffer.g2() return IfOpenTop( interfaceId, ) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAngleDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAngleDecoder.kt index 40971133..dc9afaf9 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAngleDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAngleDecoder.kt @@ -15,9 +15,9 @@ internal class IfSetAngleDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetAngle { - val zoom = buffer.g2Alt1() val angleY = buffer.g2Alt2() - val angleX = buffer.g2Alt1() + val angleX = buffer.g2() + val zoom = buffer.g2Alt1() val combinedId = buffer.gCombinedIdAlt3() return IfSetAngle( combinedId.interfaceId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt index 08ce3c4d..d05ba08a 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetAnimDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedId import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetAnim import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetAnimDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetAnim { - val anim = buffer.g2sAlt2() - val combinedId = buffer.gCombinedIdAlt1() + val combinedId = buffer.gCombinedId() + val anim = buffer.g2s() return IfSetAnim( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt index eabee7c0..029dbd67 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetColourDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetColour import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetColourDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetColour { - val colour15BitPacked = buffer.g2Alt2() - val combinedId = buffer.gCombinedIdAlt2() + val combinedId = buffer.gCombinedIdAlt3() + val colour15BitPacked = buffer.g2Alt3() return IfSetColour( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt index b45a4dba..2727165d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetEventsV2Decoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt1 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetEventsV2 import net.rsprox.protocol.session.Session @@ -15,11 +15,11 @@ internal class IfSetEventsV2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetEventsV2 { - val events1 = buffer.g4Alt2() - val combinedId = buffer.gCombinedIdAlt2() + val combinedId = buffer.gCombinedIdAlt1() + val start = buffer.g2() + val end = buffer.g2Alt1() val events2 = buffer.g4Alt3() - val start = buffer.g2Alt2() - val end = buffer.g2() + val events1 = buffer.g4() return IfSetEventsV2( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt index fc8234dc..a9d56fc4 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetHideDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedId import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetHide import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetHideDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetHide { + val combinedId = buffer.gCombinedId() val hidden = buffer.g1Alt1() == 1 - val combinedId = buffer.gCombinedIdAlt1() return IfSetHide( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt index 10c506ba..db9cd500 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetModelDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedId +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetModel import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetModelDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetModel { - val model = buffer.g2Alt3() - val combinedId = buffer.gCombinedId() + val model = buffer.g2Alt1() + val combinedId = buffer.gCombinedIdAlt3() return IfSetModel( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt index 39cd4174..f5206059 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetNpcHeadActiveDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt1 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetNpcHeadActive import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetNpcHeadActiveDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetNpcHead { - val npc = buffer.g2Alt3() val combinedId = buffer.gCombinedIdAlt1() + val npc = buffer.g2() return IfSetNpcHead( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt index a5cf0450..8492f640 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetObjectDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetObject import net.rsprox.protocol.session.Session @@ -15,9 +15,9 @@ internal class IfSetObjectDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetObject { - val obj = buffer.g2Alt2() - val count = buffer.g4Alt3() - val combinedId = buffer.gCombinedIdAlt1() + val count = buffer.g4Alt2() + val combinedId = buffer.gCombinedIdAlt2() + val obj = buffer.g2Alt1() return IfSetObject( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt index be15f97c..498862ae 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerHeadDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt1 +import net.rsprot.protocol.util.gCombinedIdAlt2 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerHead import net.rsprox.protocol.session.Session @@ -15,7 +15,7 @@ internal class IfSetPlayerHeadDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetPlayerHead { - val combinedId = buffer.gCombinedIdAlt1() + val combinedId = buffer.gCombinedIdAlt2() return IfSetPlayerHead( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt index 086edc1a..816b9b65 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetPlayerModelBaseColourDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetPlayerModelBaseColour import net.rsprox.protocol.session.Session @@ -16,7 +16,7 @@ internal class IfSetPlayerModelBaseColourDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetPosition { - val y = buffer.g2sAlt3() val combinedId = buffer.gCombinedIdAlt1() - val x = buffer.g2sAlt2() + val y = buffer.g2sAlt1() + val x = buffer.g2s() return IfSetPosition( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt index d89d054e..d8dac508 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetRotateSpeedDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt3 +import net.rsprot.protocol.util.gCombinedIdAlt1 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetRotateSpeed import net.rsprox.protocol.session.Session @@ -15,9 +15,9 @@ internal class IfSetRotateSpeedDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetRotateSpeed { - val xSpeed = buffer.g2Alt3() - val ySpeed = buffer.g2Alt3() - val combinedId = buffer.gCombinedIdAlt3() + val combinedId = buffer.gCombinedIdAlt1() + val ySpeed = buffer.g2() + val xSpeed = buffer.g2() return IfSetRotateSpeed( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt index 2432b6e6..3870b283 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/interfaces/IfSetScrollPosDecoder.kt @@ -2,7 +2,7 @@ package net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces import net.rsprot.buffer.JagByteBuf import net.rsprot.protocol.ClientProt -import net.rsprot.protocol.util.gCombinedIdAlt2 +import net.rsprot.protocol.util.gCombinedIdAlt3 import net.rsprox.protocol.ProxyMessageDecoder import net.rsprox.protocol.game.outgoing.model.interfaces.IfSetScrollPos import net.rsprox.protocol.session.Session @@ -15,8 +15,8 @@ internal class IfSetScrollPosDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): IfSetScrollPos { - val combinedId = buffer.gCombinedIdAlt2() - val scrollPos = buffer.g2() + val combinedId = buffer.gCombinedIdAlt3() + val scrollPos = buffer.g2Alt1() return IfSetScrollPos( combinedId.interfaceId, combinedId.componentId, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt index 14a8b8a2..12dec608 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvFullDecoder.kt @@ -21,11 +21,11 @@ internal class UpdateInvFullDecoder : ProxyMessageDecoder { val objs = buildList { for (i in 0..= 0xFF) { count = buffer.g4() } + val id = buffer.g2Alt2() add(UpdateInvFull.Obj(id - 1, count)) } } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt index 7ab11023..81b1369c 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/inv/UpdateInvStopTransmitDecoder.kt @@ -14,7 +14,7 @@ internal class UpdateInvStopTransmitDecoder : ProxyMessageDecoder { session: Session, ): RebuildRegion { val zoneZ = buffer.g2() - val reload = buffer.g1Alt1() == 1 - val zoneX = buffer.g2Alt2() + val zoneX = buffer.g2Alt3() + val reload = buffer.g1Alt3() == 1 val xteaCount = buffer.g2() val buildArea = BuildArea() buffer.buffer.toBitBuf().use { bitBuf -> diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/StaticRebuildDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/StaticRebuildDecoder.kt index 8a37137e..4db6cb2d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/StaticRebuildDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/map/StaticRebuildDecoder.kt @@ -50,9 +50,9 @@ internal class StaticRebuildDecoder( } else { null } - val zoneX = buffer.g2() - val zoneZ = buffer.g2Alt3() - val worldArea = buffer.g2sAlt3() + val zoneZ = buffer.g2() + val zoneX = buffer.g2Alt3() + val worldArea = buffer.g2sAlt1() val xteaCount = buffer.g2() val keys = buildList { diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt index 85b49c25..5dd29ddc 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/client/UpdateRebootTimerV2Decoder.kt @@ -15,7 +15,7 @@ internal class UpdateRebootTimerV2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): SetPlayerOp { - val id = buffer.g1Alt2() - val priority = buffer.g1() == 1 + val priority = buffer.g1Alt3() == 1 val op = buffer.gjstr() + val id = buffer.g1Alt1() return SetPlayerOp( id, priority, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt index bdad8038..53a69b2d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/misc/player/UpdateStatV2Decoder.kt @@ -14,10 +14,10 @@ internal class UpdateStatV2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): UpdateStatV2 { - val currentLevel = buffer.g1Alt1() + val experience = buffer.g4Alt1() val invisibleBoostedLevel = buffer.g1Alt3() val stat = buffer.g1Alt1() - val experience = buffer.g4() + val currentLevel = buffer.g1Alt1() return UpdateStatV2( stat, currentLevel, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt index b4d39082..a529b143 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiJingleDecoder.kt @@ -14,8 +14,8 @@ internal class MidiJingleDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MidiJingle { - val id = buffer.g2() - val lengthInMillis = buffer.g3Alt2() + val id = buffer.g2Alt1() + val lengthInMillis = buffer.g3Alt1() return MidiJingle( id, lengthInMillis, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt index 59e27a08..baaa8510 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongStopDecoder.kt @@ -14,8 +14,8 @@ internal class MidiSongStopDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MidiSongStop { - val fadeOutSpeed = buffer.g2() - val fadeOutDelay = buffer.g2Alt3() + val fadeOutDelay = buffer.g2Alt1() + val fadeOutSpeed = buffer.g2Alt3() return MidiSongStop( fadeOutDelay, fadeOutSpeed, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt index fd3df6f6..e48ea38a 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongV2Decoder.kt @@ -14,11 +14,11 @@ internal class MidiSongV2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MidiSongV2 { - val fadeOutSpeed = buffer.g2Alt3() val fadeOutDelay = buffer.g2Alt1() + val fadeOutSpeed = buffer.g2Alt3() + val fadeInDelay = buffer.g2Alt2() val fadeInSpeed = buffer.g2() - val id = buffer.g2Alt2() - val fadeInDelay = buffer.g2Alt1() + val id = buffer.g2Alt3() return MidiSongV2( id, fadeOutDelay, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt index c1826d53..1392324e 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/sound/MidiSongWithSecondaryDecoder.kt @@ -14,12 +14,12 @@ internal class MidiSongWithSecondaryDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MidiSwap { - val fadeInSpeed = buffer.g2Alt2() - val fadeInDelay = buffer.g2Alt3() - val fadeOutDelay = buffer.g2Alt3() - val fadeOutSpeed = buffer.g2() + val fadeOutDelay = buffer.g2Alt1() + val fadeInDelay = buffer.g2() + val fadeOutSpeed = buffer.g2Alt2() + val fadeInSpeed = buffer.g2Alt1() return MidiSwap( fadeOutDelay, fadeOutSpeed, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt index a17d8e39..c90a20fd 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/LocAnimSpecificDecoder.kt @@ -16,9 +16,9 @@ internal class LocAnimSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): LocAnimSpecific { - val coordInBuildArea = CoordInBuildArea(buffer.g3Alt1()) - val locProperties = LocProperties(buffer.g1Alt3()) - val id = buffer.g2() + val locProperties = LocProperties(buffer.g1Alt2()) + val id = buffer.g2Alt2() + val coordInBuildArea = CoordInBuildArea(buffer.g3()) return LocAnimSpecific( id, coordInBuildArea, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt index a5128da7..b933c2e5 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/MapAnimSpecificDecoder.kt @@ -15,10 +15,10 @@ internal class MapAnimSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MapAnimSpecific { - val coordInBuildArea = CoordInBuildArea(buffer.g3Alt3()) + val delay = buffer.g2Alt2() + val height = buffer.g1() val id = buffer.g2Alt2() - val delay = buffer.g2Alt3() - val height = buffer.g1Alt3() + val coordInBuildArea = CoordInBuildArea(buffer.g3Alt2()) return MapAnimSpecific( id, delay, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt index 83fd3edd..58f9c2ad 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcAnimSpecificDecoder.kt @@ -14,9 +14,9 @@ internal class NpcAnimSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): NpcAnimSpecific { + val id = buffer.g2Alt3() + val delay = buffer.g1Alt2() val index = buffer.g2Alt3() - val delay = buffer.g1Alt3() - val id = buffer.g2Alt1() return NpcAnimSpecific( index, id, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt index 858e86ce..768e9445 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/NpcHeadIconSpecificDecoder.kt @@ -14,10 +14,10 @@ internal class NpcHeadIconSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjAddSpecific { - val timeUntilDespawn = buffer.g2Alt3() - val neverBecomesPublic = buffer.g1() == 1 - val coordGrid = CoordGrid(buffer.g4Alt3()) - val id = buffer.g2() - val timeUntilPublic = buffer.g2Alt2() - val opFlags = OpFlags(buffer.g1Alt2()) - val ownershipType = buffer.g1Alt2() - val quantity = buffer.g4() + val coordGrid = CoordGrid(buffer.g4Alt1()) + val timeUntilPublic = buffer.g2Alt3() + val timeUntilDespawn = buffer.g2Alt2() + val quantity = buffer.g4Alt3() + val id = buffer.g2Alt1() + val neverBecomesPublic = buffer.g1Alt3() == 1 + val ownershipType = buffer.g1Alt3() + val opFlags = OpFlags(buffer.g1Alt1()) return ObjAddSpecific( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt index e6c17733..a2f378dd 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCountSpecificDecoder.kt @@ -15,10 +15,10 @@ internal class ObjCountSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjCountSpecific { + val oldQuantity = buffer.g4Alt2() + val newQuantity = buffer.g4Alt2() val id = buffer.g2() - val oldQuantity = buffer.g4Alt1() - val coordGrid = CoordGrid(buffer.g4()) - val newQuantity = buffer.g4Alt3() + val coordGrid = CoordGrid(buffer.g4Alt1()) return ObjCountSpecific( id, oldQuantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt index cde21c9d..7ddb271d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjCustomiseSpecificDecoder.kt @@ -15,14 +15,14 @@ internal class ObjCustomiseSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjDelSpecific { + val quantity = buffer.g4Alt2() val coordGrid = CoordGrid(buffer.g4Alt3()) - val quantity = buffer.g4Alt1() - val id = buffer.g2Alt2() + val id = buffer.g2Alt1() return ObjDelSpecific( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt index 1d78c3f8..576f111d 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/specific/ObjEnabledOpsSpecificDecoder.kt @@ -16,9 +16,9 @@ internal class ObjEnabledOpsSpecificDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): VarpLarge { - val id = buffer.g2Alt1() - val value = buffer.g4Alt3() + val value = buffer.g4Alt1() + val id = buffer.g2Alt3() return VarpLarge( id, value, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt index 746b7ad9..a37c2a95 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/varp/VarpSmallDecoder.kt @@ -14,8 +14,8 @@ internal class VarpSmallDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): VarpSmall { - val value = buffer.g1s() - val id = buffer.g2Alt3() + val id = buffer.g2Alt1() + val value = buffer.g1sAlt2() return VarpSmall( id, value, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt index 97524937..75b63eb7 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZoneFullFollowsDecoder.kt @@ -14,9 +14,9 @@ internal class UpdateZoneFullFollowsDecoder : ProxyMessageDecoder, ) { OBJ_DEL(ObjDelDecoder()), - OBJ_COUNT(ObjCountDecoder()), - LOC_MERGE(LocMergeDecoder()), - LOC_ADD_CHANGE_V2(LocAddChangeV2Decoder()), - OBJ_ENABLED_OPS(ObjEnabledOpsDecoder()), MAP_ANIM(MapAnimDecoder()), - SOUND_AREA(SoundAreaDecoder()), - LOC_ANIM(LocAnimDecoder()), - OBJ_CUSTOMISE(ObjCustomiseDecoder()), + OBJ_COUNT(ObjCountDecoder()), LOC_DEL(LocDelDecoder()), - OBJ_UNCUSTOMISE(ObjUncustomiseDecoder()), MAP_PROJANIM_V2(MapProjAnimV2Decoder()), + OBJ_ENABLED_OPS(ObjEnabledOpsDecoder()), OBJ_ADD(ObjAddDecoder()), + OBJ_CUSTOMISE(ObjCustomiseDecoder()), + LOC_ANIM(LocAnimDecoder()), + OBJ_UNCUSTOMISE(ObjUncustomiseDecoder()), + LOC_MERGE(LocMergeDecoder()), + LOC_ADD_CHANGE_V2(LocAddChangeV2Decoder()), + SOUND_AREA(SoundAreaDecoder()), } } diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt index c0199e96..8a56a643 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/header/UpdateZonePartialFollowsDecoder.kt @@ -14,9 +14,9 @@ internal class UpdateZonePartialFollowsDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): LocAddChangeV2 { - val opOverrideCount = buffer.g1Alt2() + val opFlags = OpFlags(buffer.g1Alt1()) + val locProperties = LocProperties(buffer.g1Alt1()) + val opOverrideCount = buffer.g1Alt3() val opOverrides: Map? = if (opOverrideCount > 0) { buildMap { for (i in 0.. { } else { null } - val locProperties = LocProperties(buffer.g1Alt2()) - val opFlags = OpFlags(buffer.g1Alt1()) - val id = buffer.g2Alt2() - val coordInZone = CoordInZone(buffer.g1Alt1()) + val coordInZone = CoordInZone(buffer.g1()) + val id = buffer.g2Alt1() return LocAddChangeV2( id, coordInZone, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAnimDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAnimDecoder.kt index b28187e7..147ca080 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAnimDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocAnimDecoder.kt @@ -16,9 +16,9 @@ internal class LocAnimDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): LocAnim { - val locProperties = LocProperties(buffer.g1Alt2()) + val locProperties = LocProperties(buffer.g1Alt3()) val id = buffer.g2Alt3() - val coordInZone = CoordInZone(buffer.g1Alt2()) + val coordInZone = CoordInZone(buffer.g1Alt1()) return LocAnim( id, coordInZone, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt index 74bbd3ac..5432deef 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocDelDecoder.kt @@ -16,8 +16,8 @@ internal class LocDelDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): LocDel { - val locProperties = LocProperties(buffer.g1()) - val coordInZone = CoordInZone(buffer.g1Alt3()) + val coordInZone = CoordInZone(buffer.g1Alt1()) + val locProperties = LocProperties(buffer.g1Alt1()) return LocDel( coordInZone, locProperties, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt index a4bcc72c..d40eab26 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/LocMergeDecoder.kt @@ -16,16 +16,16 @@ internal class LocMergeDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): LocMerge { - val locProperties = LocProperties(buffer.g1()) - val minZ = buffer.g1sAlt1() - val start = buffer.g2Alt2() - val index = buffer.g2Alt2() - val maxZ = buffer.g1sAlt3() - val minX = buffer.g1sAlt3() - val end = buffer.g2() - val coordInZone = CoordInZone(buffer.g1Alt1()) - val id = buffer.g2Alt1() + val minZ = buffer.g1sAlt3() val maxX = buffer.g1sAlt2() + val maxZ = buffer.g1sAlt1() + val end = buffer.g2() + val index = buffer.g2Alt1() + val start = buffer.g2Alt1() + val coordInZone = CoordInZone(buffer.g1()) + val id = buffer.g2Alt3() + val minX = buffer.g1sAlt3() + val locProperties = LocProperties(buffer.g1Alt3()) return LocMerge( index, id, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt index ef6f5a00..aa496fa6 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapAnimDecoder.kt @@ -15,10 +15,10 @@ internal class MapAnimDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MapAnim { + val height = buffer.g1() + val delay = buffer.g2Alt1() val id = buffer.g2() - val height = buffer.g1Alt3() - val delay = buffer.g2() - val coordInZone = CoordInZone(buffer.g1Alt1()) + val coordInZone = CoordInZone(buffer.g1Alt3()) return MapAnim( id, delay, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt index 51cc1e13..03d42363 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/MapProjAnimV2Decoder.kt @@ -16,17 +16,17 @@ internal class MapProjAnimV2Decoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): MapProjAnimV2 { - val sourceIndex = buffer.g3sAlt2() - val targetIndex = buffer.g3sAlt2() val startTime = buffer.g2Alt1() - val coordInZone = CoordInZone(buffer.g1Alt1()) - val endHeight = buffer.g2Alt3() - val angle = buffer.g1Alt1() + val targetIndex = buffer.g3sAlt2() + val sourceIndex = buffer.g3sAlt3() + val coordInZone = CoordInZone(buffer.g1()) + val progress = buffer.g2Alt3() + val endTime = buffer.g2Alt2() + val endHeight = buffer.g2Alt1() + val id = buffer.g2Alt1() + val angle = buffer.g1() val startHeight = buffer.g2() - val progress = buffer.g2Alt1() - val endTime = buffer.g2Alt3() - val end = CoordGrid(buffer.g4Alt3()) - val id = buffer.g2Alt2() + val end = CoordGrid(buffer.g4Alt1()) return MapProjAnimV2( id, startHeight, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt index 9c32897c..ab7e1ea4 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjAddDecoder.kt @@ -16,14 +16,14 @@ internal class ObjAddDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjAdd { - val timeUntilPublic = buffer.g2Alt2() - val coordInZone = CoordInZone(buffer.g1Alt3()) - val neverBecomesPublic = buffer.g1Alt3() == 1 val opFlags = OpFlags(buffer.g1Alt3()) - val ownershipType = buffer.g1Alt1() - val id = buffer.g2Alt1() + val id = buffer.g2() + val timeUntilPublic = buffer.g2Alt1() + val neverBecomesPublic = buffer.g1Alt2() == 1 val quantity = buffer.g4Alt1() - val timeUntilDespawn = buffer.g2() + val timeUntilDespawn = buffer.g2Alt1() + val ownershipType = buffer.g1Alt1() + val coordInZone = CoordInZone(buffer.g1Alt3()) return ObjAdd( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt index 93d5edb9..24a594aa 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCountDecoder.kt @@ -15,10 +15,10 @@ internal class ObjCountDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjCount { - val id = buffer.g2Alt3() - val oldQuantity = buffer.g4Alt3() - val newQuantity = buffer.g4Alt1() - val coordInZone = CoordInZone(buffer.g1Alt2()) + val newQuantity = buffer.g4() + val oldQuantity = buffer.g4Alt1() + val coordInZone = CoordInZone(buffer.g1()) + val id = buffer.g2Alt1() return ObjCount( id, oldQuantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt index 2c6bdbc8..3129d2fa 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjCustomiseDecoder.kt @@ -15,14 +15,14 @@ internal class ObjCustomiseDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjCustomise { - val coordInZone = CoordInZone(buffer.g1Alt3()) - val recolIndex = buffer.g2sAlt3() - val quantity = buffer.g4Alt1() - val id = buffer.g2Alt3() - val retexIndex = buffer.g2sAlt1() - val model = buffer.g2Alt3() - val recol = buffer.g2sAlt1() + val retexIndex = buffer.g2s() val retex = buffer.g2sAlt1() + val model = buffer.g2() + val recol = buffer.g2sAlt2() + val coordInZone = CoordInZone(buffer.g1Alt3()) + val id = buffer.g2Alt1() + val quantity = buffer.g4() + val recolIndex = buffer.g2s() return ObjCustomise( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt index b55bb731..e1a0b3fb 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjDelDecoder.kt @@ -15,9 +15,9 @@ internal class ObjDelDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjDel { - val id = buffer.g2() - val coordInZone = CoordInZone(buffer.g1Alt1()) + val coordInZone = CoordInZone(buffer.g1Alt3()) val quantity = buffer.g4Alt1() + val id = buffer.g2Alt1() return ObjDel( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt index e4c8c9ee..2df14826 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjEnabledOpsDecoder.kt @@ -16,9 +16,9 @@ internal class ObjEnabledOpsDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjEnabledOps { - val coordInZone = CoordInZone(buffer.g1Alt2()) - val opFlags = OpFlags(buffer.g1()) - val id = buffer.g2() + val opFlags = OpFlags(buffer.g1Alt2()) + val coordInZone = CoordInZone(buffer.g1()) + val id = buffer.g2Alt3() return ObjEnabledOps( id, opFlags, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt index 6bfa28bc..a3110c44 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/ObjUncustomiseDecoder.kt @@ -15,9 +15,9 @@ internal class ObjUncustomiseDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): ObjUncustomise { - val coordInZone = CoordInZone(buffer.g1()) val quantity = buffer.g4Alt3() - val id = buffer.g2Alt3() + val id = buffer.g2() + val coordInZone = CoordInZone(buffer.g1Alt3()) return ObjUncustomise( id, quantity, diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt index d13aa0fd..8f133008 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/zone/payload/SoundAreaDecoder.kt @@ -15,12 +15,12 @@ internal class SoundAreaDecoder : ProxyMessageDecoder { buffer: JagByteBuf, session: Session, ): SoundArea { - val radius = buffer.g1() - val coordInZone = CoordInZone(buffer.g1Alt2()) - val size = buffer.g1Alt3() - val id = buffer.g2Alt2() - val loops = buffer.g1Alt3() - val delay = buffer.g1Alt3() + val loops = buffer.g1Alt2() + val size = buffer.g1() + val delay = buffer.g1Alt1() + val coordInZone = CoordInZone(buffer.g1Alt3()) + val radius = buffer.g1Alt1() + val id = buffer.g2Alt3() return SoundArea( id, delay, From 7e99b07d86ff1a98f780ddfcc5ca60d7d4189a71 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 19:17:10 +0200 Subject: [PATCH 06/16] feat: player info --- .../model/info/playerinfo/PlayerInfoClient.kt | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt index ed57d324..db3f2595 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/playerinfo/PlayerInfoClient.kt @@ -294,50 +294,50 @@ internal class PlayerInfoClient( flags: Int, blocks: MutableList, ) { - if (flags and APPEARANCE != 0) { - val len = buffer.g1Alt1() - val data = ByteArray(len) - buffer.gdataAlt3(data) - decodeAppearance(Unpooled.wrappedBuffer(data).toJagByteBuf(), blocks) + if (flags and HITS != 0) { + decodeHit(buffer, blocks) } - if (flags and TEMP_MOVE_SPEED != 0) { - decodeTemporaryMoveSpeed(buffer, blocks) + if (flags and NAME_EXTRAS != 0) { + decodeNameExtras(buffer, blocks) + } + if (flags and FACE_PATHINGENTITY != 0) { + decodeFacePathingEntity(buffer, blocks) } if (flags and TINTING != 0) { decodeTinting(buffer, blocks) } - if (flags and FACE_ANGLE != 0) { - decodeFaceAngle(buffer, blocks) - } if (flags and SEQUENCE != 0) { decodeSequence(buffer, blocks) } - if (flags and SAY != 0) { - decodeSay(buffer, blocks) - } if (flags and CHAT != 0) { decodeChat(buffer, blocks) } - if (flags and HITS != 0) { - decodeHit(buffer, blocks) + if (flags and FACE_ANGLE != 0) { + decodeFaceAngle(buffer, blocks) } - if (flags and MOVE_SPEED != 0) { - decodeMoveSpeed(buffer, blocks) + if (flags and EXACT_MOVE != 0) { + decodeExactMove(buffer, blocks) } if (flags and CHAT_OLD != 0) { throw IllegalStateException("Old chat used!") } - if (flags and SPOTANIM != 0) { - decodeSpotanims(buffer, blocks) + if (flags and SAY != 0) { + decodeSay(buffer, blocks) } - if (flags and NAME_EXTRAS != 0) { - decodeNameExtras(buffer, blocks) + if (flags and TEMP_MOVE_SPEED != 0) { + decodeTemporaryMoveSpeed(buffer, blocks) } - if (flags and EXACT_MOVE != 0) { - decodeExactMove(buffer, blocks) + if (flags and MOVE_SPEED != 0) { + decodeMoveSpeed(buffer, blocks) } - if (flags and FACE_PATHINGENTITY != 0) { - decodeFacePathingEntity(buffer, blocks) + if (flags and SPOTANIM != 0) { + decodeSpotanims(buffer, blocks) + } + if (flags and APPEARANCE != 0) { + val len = buffer.g1() + val data = ByteArray(len) + buffer.gdata(data) + decodeAppearance(Unpooled.wrappedBuffer(data).toJagByteBuf(), blocks) } } @@ -345,21 +345,21 @@ internal class PlayerInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - blocks += MoveSpeedExtendedInfo(buffer.g1sAlt1()) + blocks += MoveSpeedExtendedInfo(buffer.g1s()) } private fun decodeTemporaryMoveSpeed( buffer: JagByteBuf, blocks: MutableList, ) { - blocks += TemporaryMoveSpeedExtendedInfo(buffer.g1sAlt2()) + blocks += TemporaryMoveSpeedExtendedInfo(buffer.g1sAlt1()) } private fun decodeSequence( buffer: JagByteBuf, blocks: MutableList, ) { - val id = buffer.g2Alt1() + val id = buffer.g2() val delay = buffer.g1Alt1() blocks += SequenceExtendedInfo(id, delay) } @@ -377,7 +377,7 @@ internal class PlayerInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - blocks += FaceAngleExtendedInfo(buffer.g2()) + blocks += FaceAngleExtendedInfo(buffer.g2Alt1()) } private fun decodeSay( @@ -402,11 +402,11 @@ internal class PlayerInfoClient( blocks: MutableList, ) { val colourAndEffectsPacked = buffer.g2Alt2() - val modIcon = buffer.g1Alt2() - val autotyper = buffer.g1Alt2() == 1 - val huffmanLength = buffer.g1Alt3() + val modIcon = buffer.g1Alt3() + val autotyper = buffer.g1() == 1 + val huffmanLength = buffer.g1Alt2() val data = ByteArray(huffmanLength) - buffer.gdataAlt1(data) + buffer.gdata(data) val text = huffmanCodec.decode(Unpooled.wrappedBuffer(data)) val colour = colourAndEffectsPacked ushr 8 val effects = colourAndEffectsPacked and 0xFF @@ -415,7 +415,7 @@ internal class PlayerInfoClient( if (patternLength in 1..8) { val array = ByteArray(patternLength) for (i in 0.., ) { - val deltaX1 = buffer.g1sAlt3() - val deltaZ1 = buffer.g1s() - val deltaX2 = buffer.g1s() + val deltaX1 = buffer.g1sAlt2() + val deltaZ1 = buffer.g1sAlt1() + val deltaX2 = buffer.g1sAlt1() val deltaZ2 = buffer.g1sAlt1() - val delay1 = buffer.g2Alt2() - val delay2 = buffer.g2() - val direction = buffer.g2Alt3() + val delay1 = buffer.g2Alt3() + val delay2 = buffer.g2Alt3() + val direction = buffer.g2Alt1() blocks += ExactMoveExtendedInfo( deltaX1, @@ -460,11 +460,11 @@ internal class PlayerInfoClient( blocks: MutableList, ) { val spotanims = mutableMapOf() - val count = buffer.g1() + val count = buffer.g1Alt2() for (i in 0.., ) { - val hitCount = buffer.g1Alt2() + val hitCount = buffer.g1() val hits = ArrayList(hitCount) for (i in 0..(headbarCount) for (i in 0.. 0) { - buffer.g1Alt1() + buffer.g1() } else { startFill } @@ -561,12 +561,12 @@ internal class PlayerInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val start = buffer.g2Alt2() - val end = buffer.g2Alt2() + val start = buffer.g2Alt1() + val end = buffer.g2Alt3() val hue = buffer.g1sAlt3() val saturation = buffer.g1sAlt1() - val lightness = buffer.g1sAlt3() - val weight = buffer.g1Alt1() + val lightness = buffer.g1sAlt2() + val weight = buffer.g1Alt2() blocks += TintingExtendedInfo( start, @@ -1034,22 +1034,22 @@ internal class PlayerInfoClient( private const val CUR_CYCLE_INACTIVE = 0x1 private const val NEXT_CYCLE_INACTIVE = 0x2 - private const val EXTENDED_SHORT = 0x1 - private const val EXTENDED_MEDIUM = 0x100 + private const val EXTENDED_SHORT = 0x20 + private const val EXTENDED_MEDIUM = 0x800 - private const val CHAT_OLD = 0x2 - private const val APPEARANCE = 0x4 - private const val FACE_PATHINGENTITY = 0x8 + private const val SAY = 0x1 + private const val HITS = 0x2 + private const val FACE_ANGLE = 0x4 + private const val CHAT_OLD = 0x8 private const val SEQUENCE = 0x10 - private const val SAY = 0x20 - private const val HITS = 0x40 - private const val FACE_ANGLE = 0x80 - private const val EXACT_MOVE = 0x200 - private const val NAME_EXTRAS = 0x400 - private const val MOVE_SPEED = 0x800 - private const val CHAT = 0x1000 - private const val TINTING = 0x2000 - private const val TEMP_MOVE_SPEED = 0x4000 + private const val APPEARANCE = 0x40 + private const val FACE_PATHINGENTITY = 0x80 + private const val EXACT_MOVE = 0x100 + private const val CHAT = 0x200 + private const val TEMP_MOVE_SPEED = 0x400 + private const val TINTING = 0x1000 + private const val MOVE_SPEED = 0x2000 + private const val NAME_EXTRAS = 0x4000 private const val SPOTANIM = 0x10000 private class Player { From ec5538aec16dc61a26a5c5fbb76a8dd90970c9ae Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 19:31:27 +0200 Subject: [PATCH 07/16] feat: npc info --- .../model/info/npcinfo/NpcInfoClient.kt | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt index 1f1e3429..81f5416a 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/npcinfo/NpcInfoClient.kt @@ -139,32 +139,29 @@ internal class NpcInfoClient( this.extendedInfoBlocks[index] = blocks - if (flag and LEVEL_CHANGE != 0) { - decodeCombatLevelChange(buffer, blocks) - } - if (flag and HEADICON_CUSTOMISATION != 0) { - decodeHeadiconCustomisation(buffer, blocks) - } - if (flag and FACE_ANGLE != 0) { - decodeFaceAngle(buffer, blocks) + if (flag and EXACT_MOVE != 0) { + decodeExactMove(buffer, blocks) } - if (flag and SEQUENCE != 0) { - decodeSequence(buffer, blocks) + if (flag and OLD_SPOTANIM_UNUSED != 0) { + throw IllegalStateException("Old spotanim used!") } if (flag and OPS != 0) { decodeEnabledOps(buffer, blocks) } - if (flag and OLD_SPOTANIM_UNUSED != 0) { - throw IllegalStateException("Old spotanim used!") - } - if (flag and BAS_CHANGE != 0) { - decodeBaseAnimationSet(buffer, blocks) + if (flag and TRANSFORMATION != 0) { + decodeTransformation(buffer, blocks, npc) } if (flag and HEAD_CUSTOMISATION != 0) { decodeHeadCustomisation(npc.id, buffer, blocks) } - if (flag and BODY_CUSTOMISATION != 0) { - decodeBodyCustomisation(npc.id, buffer, blocks) + if (flag and NAME_CHANGE != 0) { + decodeNameChange(buffer, blocks) + } + if (flag and TINTING != 0) { + decodeTinting(buffer, blocks) + } + if (flag and SEQUENCE != 0) { + decodeSequence(buffer, blocks) } if (flag and SAY != 0) { decodeSay(buffer, blocks) @@ -172,27 +169,30 @@ internal class NpcInfoClient( if (flag and SPOTANIM != 0) { decodeSpotanim(buffer, blocks) } + if (flag and FACE_ANGLE != 0) { + decodeFaceAngle(buffer, blocks) + } + if (flag and HITS != 0) { + decodeHits(buffer, blocks) + } + if (flag and LEVEL_CHANGE != 0) { + decodeCombatLevelChange(buffer, blocks) + } + if (flag and BODY_CUSTOMISATION != 0) { + decodeBodyCustomisation(npc.id, buffer, blocks) + } if (flag and FACE_PATHINGENTITY != 0) { decodeFacePathingEntity(buffer, blocks) } - if (flag and TRANSFORMATION != 0) { - decodeTransformation(buffer, blocks, npc) + if (flag and BAS_CHANGE != 0) { + decodeBaseAnimationSet(buffer, blocks) } - if (flag and EXACT_MOVE != 0) { - decodeExactMove(buffer, blocks) + if (flag and HEADICON_CUSTOMISATION != 0) { + decodeHeadiconCustomisation(buffer, blocks) } if (flag and OLD_FACE_COORD_UNUSED != 0) { throw IllegalStateException("Old face coord used!") } - if (flag and TINTING != 0) { - decodeTinting(buffer, blocks) - } - if (flag and HITS != 0) { - decodeHits(buffer, blocks) - } - if (flag and NAME_CHANGE != 0) { - decodeNameChange(buffer, blocks) - } } } @@ -200,22 +200,22 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val flag = buffer.g4Alt3() - val turnLeftAnim = if (flag and 0x1 != 0) buffer.g2Alt1() else null - val turnRightAnim = if (flag and 0x2 != 0) buffer.g2() else null - val walkAnim = if (flag and 0x4 != 0) buffer.g2Alt1() else null - val walkAnimBack = if (flag and 0x8 != 0) buffer.g2Alt3() else null - val walkAnimLeft = if (flag and 0x10 != 0) buffer.g2Alt1() else null + val flag = buffer.g4Alt1() + val turnLeftAnim = if (flag and 0x1 != 0) buffer.g2Alt2() else null + val turnRightAnim = if (flag and 0x2 != 0) buffer.g2Alt1() else null + val walkAnim = if (flag and 0x4 != 0) buffer.g2() else null + val walkAnimBack = if (flag and 0x8 != 0) buffer.g2Alt1() else null + val walkAnimLeft = if (flag and 0x10 != 0) buffer.g2Alt2() else null val walkAnimRight = if (flag and 0x20 != 0) buffer.g2() else null - val runAnim = if (flag and 0x40 != 0) buffer.g2() else null + val runAnim = if (flag and 0x40 != 0) buffer.g2Alt3() else null val runAnimBack = if (flag and 0x80 != 0) buffer.g2Alt1() else null - val runAnimLeft = if (flag and 0x100 != 0) buffer.g2Alt3() else null - val runAnimRight = if (flag and 0x200 != 0) buffer.g2Alt2() else null - val crawlAnim = if (flag and 0x400 != 0) buffer.g2Alt3() else null - val crawlAnimBack = if (flag and 0x800 != 0) buffer.g2() else null - val crawlAnimLeft = if (flag and 0x1000 != 0) buffer.g2Alt1() else null - val crawlAnimRight = if (flag and 0x2000 != 0) buffer.g2() else null - val readyAnim = if (flag and 0x4000 != 0) buffer.g2Alt1() else null + val runAnimLeft = if (flag and 0x100 != 0) buffer.g2Alt1() else null + val runAnimRight = if (flag and 0x200 != 0) buffer.g2Alt1() else null + val crawlAnim = if (flag and 0x400 != 0) buffer.g2() else null + val crawlAnimBack = if (flag and 0x800 != 0) buffer.g2Alt3() else null + val crawlAnimLeft = if (flag and 0x1000 != 0) buffer.g2Alt2() else null + val crawlAnimRight = if (flag and 0x2000 != 0) buffer.g2Alt2() else null + val readyAnim = if (flag and 0x4000 != 0) buffer.g2Alt2() else null blocks += BaseAnimationSetExtendedInfo( turnLeftAnim, @@ -302,10 +302,10 @@ internal class NpcInfoClient( continue } val startTime = buffer.gSmart1or2() - val startFill = buffer.g1Alt2() + val startFill = buffer.g1Alt1() val endFill = if (endTime > 0) { - buffer.g1Alt3() + buffer.g1() } else { startFill } @@ -326,11 +326,11 @@ internal class NpcInfoClient( blocks: MutableList, ) { val spotanims = mutableMapOf() - val count = buffer.g1Alt3() + val count = buffer.g1Alt1() for (i in 0.., ) { val id = buffer.g2Alt1() - val delay = buffer.g1Alt2() + val delay = buffer.g1Alt3() blocks += SequenceExtendedInfo(id, delay) } @@ -351,7 +351,7 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val level = buffer.g4() + val level = buffer.g4Alt2() blocks += CombatLevelChangeExtendedInfo(level) } @@ -359,11 +359,11 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val start = buffer.g2Alt2() + val start = buffer.g2Alt3() val end = buffer.g2Alt2() - val hue = buffer.g1Alt2() - val saturation = buffer.g1Alt3() - val lightness = buffer.g1Alt2() + val hue = buffer.g1() + val saturation = buffer.g1Alt2() + val lightness = buffer.g1Alt3() val weight = buffer.g1Alt3() blocks += TintingExtendedInfo( @@ -381,7 +381,7 @@ internal class NpcInfoClient( blocks: MutableList, npc: Npc, ) { - val id = buffer.g2Alt3() + val id = buffer.g2Alt2() blocks += TransformationExtendedInfo(id) npc.id = id } @@ -390,7 +390,7 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val flag = buffer.g1Alt3() + val flag = buffer.g1() blocks += EnabledOpsExtendedInfo(flag) } @@ -398,8 +398,8 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - var index = buffer.g2Alt2() - index += buffer.g1() shl 16 + var index = buffer.g2Alt3() + index += buffer.g1Alt1() shl 16 blocks += FacePathingEntityExtendedInfo(index) } @@ -408,17 +408,17 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val flag = buffer.g1Alt1() + val flag = buffer.g1() if (flag and 0x1 != 0) { blocks += BodyCustomisationExtendedInfo(ResetCustomisation) return } val models = if (flag and 0x2 != 0) { - val count = buffer.g1Alt1() + val count = buffer.g1Alt3() val models = ArrayList(count) for (i in 0..(length) for (i in 0..(length) for (i in 0.., ) { - val flag = buffer.g1Alt2() + val flag = buffer.g1() if (flag and 0x1 != 0) { blocks += BodyCustomisationExtendedInfo(ResetCustomisation) return @@ -487,7 +487,7 @@ internal class NpcInfoClient( val count = buffer.g1Alt1() val models = ArrayList(count) for (i in 0..(length) for (i in 0..(length) for (i in 0.., ) { val deltaX1 = buffer.g1sAlt3() - val deltaZ1 = buffer.g1s() + val deltaZ1 = buffer.g1sAlt1() val deltaX2 = buffer.g1sAlt3() - val deltaZ2 = buffer.g1sAlt3() - val delay1 = buffer.g2Alt2() - val delay2 = buffer.g2Alt2() - val direction = buffer.g2Alt3() + val deltaZ2 = buffer.g1s() + val delay1 = buffer.g2Alt1() + val delay2 = buffer.g2Alt3() + val direction = buffer.g2() blocks += ExactMoveExtendedInfo( deltaX1, @@ -603,7 +603,7 @@ internal class NpcInfoClient( buffer: JagByteBuf, blocks: MutableList, ) { - val angle = buffer.g2Alt2() + val angle = buffer.g2() val instant = buffer.g1() == 1 blocks += FaceAngleExtendedInfo(angle, instant) } @@ -718,15 +718,15 @@ internal class NpcInfoClient( transmittedNPC[transmittedNPCCount++] = index npc.lastTransmitCycle = cycle + npc.id = buffer.gBits(14) val deltaX = decodeDelta(large, buffer) + val deltaZ = decodeDelta(large, buffer) + val jump = buffer.gBits(1) val hasSpawnCycle = buffer.gBits(1) == 1 if (hasSpawnCycle) { npc.spawnCycle = buffer.gBits(32) } val angle = NPC_TURN_ANGLES[buffer.gBits(3)] - val jump = buffer.gBits(1) - val deltaZ = decodeDelta(large, buffer) - npc.id = buffer.gBits(14) val extendedInfo = buffer.gBits(1) if (isNew) { npc.turnAngle = angle @@ -849,27 +849,27 @@ internal class NpcInfoClient( private companion object { private val NPC_TURN_ANGLES = intArrayOf(768, 1024, 1280, 512, 1536, 256, 0, 1792) - private const val EXTENDED_SHORT: Int = 0x10 - private const val EXTENDED_MEDIUM: Int = 0x800 - - private const val OLD_SPOTANIM_UNUSED: Int = 0x1 - private const val SEQUENCE: Int = 0x2 - private const val HITS: Int = 0x4 - private const val TRANSFORMATION: Int = 0x8 - private const val OLD_FACE_COORD_UNUSED: Int = 0x20 - private const val SAY: Int = 0x40 - private const val FACE_PATHINGENTITY: Int = 0x80 - private const val TINTING: Int = 0x100 + private const val EXTENDED_SHORT: Int = 0x20 + private const val EXTENDED_MEDIUM: Int = 0x100 + + private const val SEQUENCE: Int = 0x1 + private const val OLD_FACE_COORD_UNUSED: Int = 0x2 + private const val OLD_SPOTANIM_UNUSED: Int = 0x4 + private const val FACE_PATHINGENTITY: Int = 0x8 + private const val SAY: Int = 0x10 + private const val TRANSFORMATION: Int = 0x40 + private const val HITS: Int = 0x80 private const val LEVEL_CHANGE: Int = 0x200 - private const val HEAD_CUSTOMISATION: Int = 0x400 - private const val NAME_CHANGE: Int = 0x1000 - private const val BODY_CUSTOMISATION: Int = 0x2000 - private const val EXACT_MOVE: Int = 0x4000 - private const val OPS: Int = 0x8000 - private const val HEADICON_CUSTOMISATION: Int = 0x10000 + private const val NAME_CHANGE: Int = 0x400 + private const val HEAD_CUSTOMISATION: Int = 0x800 + private const val EXACT_MOVE: Int = 0x1000 + private const val OPS: Int = 0x2000 + private const val BODY_CUSTOMISATION: Int = 0x4000 + private const val TINTING: Int = 0x8000 + private const val SPOTANIM: Int = 0x10000 private const val FACE_ANGLE: Int = 0x20000 - private const val SPOTANIM: Int = 0x40000 - private const val BAS_CHANGE: Int = 0x80000 + private const val BAS_CHANGE: Int = 0x40000 + private const val HEADICON_CUSTOMISATION: Int = 0x80000 private enum class UpdateType { IDLE, From 094b6813b00df24fb2a302ef8fc2e5bc167d2577 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 19:38:33 +0200 Subject: [PATCH 08/16] feat: worldentity info --- .../worldentityinfo/WorldEntityInfoClient.kt | 148 +++++++++++++++++- .../info/worldentityinfo/WorldEntityInfoV7.kt | 23 +++ .../rsprox/transcriber/TranscriberPlugin.kt | 1 + .../transcriber/indexer/IndexerTranscriber.kt | 3 + .../interfaces/ServerPacketTranscriber.kt | 2 + .../rsprox/transcriber/prot/GameServerProt.kt | 1 + .../text/TextServerPacketTranscriber.kt | 4 + 7 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/info/worldentityinfo/WorldEntityInfoV7.kt diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt index 5c6889fc..4aafeb38 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt @@ -14,6 +14,7 @@ import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityI import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV4 import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV5 import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV6 +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfoV7 import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityMoveSpeed import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityUpdateType @@ -31,7 +32,10 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { ): WorldEntityInfo { updates.clear() earlyRemovals.clear() - if (version >= 6) { + if (version >= 7) { + decodeHighResolutionV5(buffer) + decodeLowResolutionV5(buffer, baseCoord) + } else if (version >= 6) { decodeHighResolutionV4(buffer) decodeLowResolutionV4(buffer, baseCoord) } else if (version >= 5) { @@ -52,6 +56,7 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { 4 -> WorldEntityInfoV4(updates) 5 -> WorldEntityInfoV5(earlyRemovals, updates) 6 -> WorldEntityInfoV6(earlyRemovals, updates) + 7 -> WorldEntityInfoV7(earlyRemovals, updates) else -> error("Invalid version: $version") } } @@ -220,7 +225,7 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { } this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index if (opcode == 1) { - val extendedInfo = decodeWorldEntityInfoExtendedInfo(buffer) + val extendedInfo = decodeWorldEntityInfoExtendedInfoUnobfuscated(buffer) if (extendedInfo.isEmpty()) { updates[index] = WorldEntityUpdateType.Idle } else { @@ -240,7 +245,63 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { worldEntity.coordFine = next worldEntity.angle = (worldEntity.angle + angle) and 2047 } - val extendedInfo = decodeWorldEntityInfoExtendedInfo(buffer) + val extendedInfo = decodeWorldEntityInfoExtendedInfoUnobfuscated(buffer) + updates[index] = + WorldEntityUpdateType.ActiveV3( + worldEntity.angle, + worldEntity.coordFine, + teleport, + extendedInfo, + ) + } + } + private fun decodeHighResolutionV5(buffer: JagByteBuf) { + val count = buffer.g1() + if (count < transmittedWorldEntityCount) { + for (i in count.. transmittedWorldEntityCount) { + throw RuntimeException("dang!") + } + this.transmittedWorldEntityCount = 0 + for (i in 0.. { + private fun decodeWorldEntityInfoExtendedInfoUnobfuscated(buffer: JagByteBuf): List { val flags = buffer.g1() if (flags == 0) { return emptyList() } val blocks = mutableListOf() - if (flags and 0x1 != 0) { + if (flags and 0x2 != 0) { val id = buffer.g2() val delay = buffer.g1() blocks += SequenceExtendedInfo(id, delay) } + if (flags and 0x1 != 0) { + blocks += EnabledOpsExtendedInfo(buffer.g1()) + } + return blocks + } + + private fun decodeWorldEntityInfoExtendedInfoObfuscated( + buffer: JagByteBuf, + flags: Int, + ): List { + if (flags == 0) { + return emptyList() + } + val blocks = mutableListOf() if (flags and 0x2 != 0) { + val id = buffer.g2Alt2() + val delay = buffer.g1Alt3() + blocks += SequenceExtendedInfo(id, delay) + } + + if (flags and 0x1 != 0) { blocks += EnabledOpsExtendedInfo(buffer.g1()) } return blocks @@ -460,7 +541,7 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { coordFine, angle, ) - val extendedInfo = decodeWorldEntityInfoExtendedInfo(buffer) + val extendedInfo = decodeWorldEntityInfoExtendedInfoUnobfuscated(buffer) this.worldEntity[index] = worldEntity this.updates[index] = WorldEntityUpdateType.LowResolutionToHighResolutionV4( @@ -475,6 +556,61 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { } } + private fun decodeLowResolutionV5( + buffer: JagByteBuf, + baseCoord: CoordGrid, + ) { + while (buffer.isReadable) { + val index = buffer.g2() + this.transmittedWorldEntity[this.transmittedWorldEntityCount++] = index + val packedSize = buffer.g1() + val extendedInfoFlags = buffer.g1() + val priority = buffer.g1Alt2() + val id = buffer.g2sAlt2() + + var coordFine = CoordFine(0, 0, 0) + var angle = 0 + val bitpackedAngledCoordFineOpcodes = buffer.g1s() + if (bitpackedAngledCoordFineOpcodes != 0) { + val deltaX = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 0) + val deltaY = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 2) + val deltaZ = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 4) + angle = decodeAngledCoordFineComponent(buffer, bitpackedAngledCoordFineOpcodes, 6) + coordFine = CoordFine(coordFine.x + deltaX, coordFine.y + deltaY, coordFine.z + deltaZ) + } + coordFine = + CoordFine( + (baseCoord.x shl 7) + coordFine.x, + coordFine.y, + (baseCoord.z shl 7) + coordFine.z, + ) + + val sizeX = packedSize ushr 4 and 0xF + val sizeZ = packedSize and 0xF + val worldEntity = + WorldEntityV3( + index, + id, + sizeX, + sizeZ, + priority, + coordFine, + angle, + ) + val extendedInfo = decodeWorldEntityInfoExtendedInfoObfuscated(buffer, extendedInfoFlags) + this.worldEntity[index] = worldEntity + this.updates[index] = + WorldEntityUpdateType.LowResolutionToHighResolutionV4( + id, + sizeX, + sizeZ, + angle, + priority, + coordFine, + extendedInfo, + ) + } + } @Suppress("unused") private class WorldEntityV1( val index: Int, diff --git a/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/info/worldentityinfo/WorldEntityInfoV7.kt b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/info/worldentityinfo/WorldEntityInfoV7.kt new file mode 100644 index 00000000..82af120d --- /dev/null +++ b/protocol/src/main/kotlin/net/rsprox/protocol/game/outgoing/model/info/worldentityinfo/WorldEntityInfoV7.kt @@ -0,0 +1,23 @@ +package net.rsprox.protocol.game.outgoing.model.info.worldentityinfo + +public class WorldEntityInfoV7( + public val earlyRemovals: Set, + override val updates: Map, +) : WorldEntityInfo { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as WorldEntityInfoV5 + + return updates == other.updates + } + + override fun hashCode(): Int { + return updates.hashCode() + } + + override fun toString(): String { + return "WorldEntityInfoV7(earlyRemovals=$earlyRemovals, updates=$updates)" + } +} diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt index c84eb0a9..fef17fa5 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt @@ -205,6 +205,7 @@ public class TranscriberPlugin( GameServerProt.SET_INTERACTION_MODE -> pass(message, Transcriber::setInteractionMode) GameServerProt.RESET_INTERACTION_MODE -> pass(message, Transcriber::resetInteractionMode) GameServerProt.WORLDENTITY_INFO_V6 -> pass(message, Transcriber::worldEntityInfoV6) + GameServerProt.WORLDENTITY_INFO_V7 -> pass(message, Transcriber::worldEntityInfoV7) GameServerProt.ACCOUNT_FLAGS -> pass(message, Transcriber::accountFlags) GameServerProt.ZBUF -> pass(message, Transcriber::zbuf) } 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 1db4d668..0f26e9e8 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt @@ -535,6 +535,9 @@ public class IndexerTranscriber( override fun worldEntityInfoV6(message: WorldEntityInfoV6) { } + override fun worldEntityInfoV7(message: WorldEntityInfoV7) { + } + override fun ifClearInv(message: IfClearInv) { incrementInterfaceId(message.interfaceId) } 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 c6ec4530..e41d7381 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt @@ -136,6 +136,8 @@ public interface ServerPacketTranscriber { public fun worldEntityInfoV6(message: WorldEntityInfoV6) + public fun worldEntityInfoV7(message: WorldEntityInfoV7) + public fun ifClearInv(message: IfClearInv) public fun ifCloseSub(message: IfCloseSub) 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 8b164718..792ab785 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt @@ -91,6 +91,7 @@ public enum class GameServerProt : Prot { CLEAR_ENTITIES, SET_ACTIVE_WORLD_V2, SET_ACTIVE_WORLD_V1, + WORLDENTITY_INFO_V7, WORLDENTITY_INFO_V6, WORLDENTITY_INFO_V5, WORLDENTITY_INFO_V4, 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 d00b8038..95ddbfd3 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt @@ -872,6 +872,10 @@ public class TextServerPacketTranscriber( worldEntityInfo(message) } + override fun worldEntityInfoV7(message: WorldEntityInfoV7) { + worldEntityInfo(message) + } + private fun useDecimalWorldEntityCoords(): Boolean { return settings[Setting.WORLDENTITY_INFO_DECIMAL_COORDS] && !settings[Setting.CONVERT_COORD_TO_JAGCOORD] From 03c16a5ac3de550d634fb23c7a25eb21f291af3b Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 19:46:01 +0200 Subject: [PATCH 09/16] refactor: v1 transcriber methods --- .../net/rsprox/transcriber/TranscriberPlugin.kt | 14 +++++++------- .../transcriber/indexer/IndexerTranscriber.kt | 14 +++++++------- .../interfaces/ServerPacketTranscriber.kt | 14 +++++++------- .../text/TextServerPacketTranscriber.kt | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt index fef17fa5..896c0485 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt @@ -124,11 +124,11 @@ public class TranscriberPlugin( GameServerProt.CAM_SHAKE -> pass(message, Transcriber::camShake) GameServerProt.CAM_RESET -> pass(message, Transcriber::camReset) GameServerProt.CAM_SMOOTHRESET -> pass(message, Transcriber::camSmoothReset) - GameServerProt.CAM_MOVETO_V1 -> pass(message, Transcriber::camMoveTo) - GameServerProt.CAM_MOVETO_CYCLES_V1 -> pass(message, Transcriber::camMoveToCycles) - GameServerProt.CAM_MOVETO_ARC_V1 -> pass(message, Transcriber::camMoveToArc) - GameServerProt.CAM_LOOKAT_V1 -> pass(message, Transcriber::camLookAt) - GameServerProt.CAM_LOOKAT_EASED_COORD_V1 -> pass(message, Transcriber::camLookAtEasedCoord) + GameServerProt.CAM_MOVETO_V1 -> pass(message, Transcriber::camMoveToV1) + GameServerProt.CAM_MOVETO_CYCLES_V1 -> pass(message, Transcriber::camMoveToCyclesV1) + GameServerProt.CAM_MOVETO_ARC_V1 -> pass(message, Transcriber::camMoveToArcV1) + GameServerProt.CAM_LOOKAT_V1 -> pass(message, Transcriber::camLookAtV1) + GameServerProt.CAM_LOOKAT_EASED_COORD_V1 -> pass(message, Transcriber::camLookAtEasedCoordV1) GameServerProt.CAM_ROTATEBY -> pass(message, Transcriber::camRotateBy) GameServerProt.CAM_ROTATETO -> pass(message, Transcriber::camRotateTo) GameServerProt.CAM_MODE -> pass(message, Transcriber::camMode) @@ -168,7 +168,7 @@ public class TranscriberPlugin( GameServerProt.LOGOUT_TRANSFER -> pass(message, Transcriber::logoutTransfer) GameServerProt.UPDATE_RUNWEIGHT -> pass(message, Transcriber::updateRunWeight) GameServerProt.UPDATE_RUNENERGY -> pass(message, Transcriber::updateRunEnergy) - GameServerProt.SET_MAP_FLAG_V1 -> pass(message, Transcriber::setMapFlag) + GameServerProt.SET_MAP_FLAG_V1 -> pass(message, Transcriber::setMapFlagV1) GameServerProt.SET_PLAYER_OP -> pass(message, Transcriber::setPlayerOp) GameServerProt.UPDATE_STAT_V2 -> pass(message, Transcriber::updateStatV2) GameServerProt.UPDATE_STAT_V1 -> pass(message, Transcriber::updateStatV1) @@ -181,7 +181,7 @@ public class TranscriberPlugin( GameServerProt.UPDATE_STOCKMARKET_SLOT -> pass(message, Transcriber::updateStockMarketSlot) GameServerProt.HINT_ARROW -> pass(message, Transcriber::hintArrow) GameServerProt.RESET_ANIMS -> pass(message, Transcriber::resetAnims) - GameServerProt.UPDATE_REBOOT_TIMER_V1 -> pass(message, Transcriber::updateRebootTimer) + GameServerProt.UPDATE_REBOOT_TIMER_V1 -> pass(message, Transcriber::updateRebootTimerV1) GameServerProt.SET_HEATMAP_ENABLED -> pass(message, Transcriber::setHeatmapEnabled) GameServerProt.MINIMAP_TOGGLE -> pass(message, Transcriber::minimapToggle) GameServerProt.SERVER_TICK_END -> pass(message, Transcriber::serverTickEnd) 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 0f26e9e8..b32c7d4e 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt @@ -430,22 +430,22 @@ public class IndexerTranscriber( override fun rsevenStatus(message: RSevenStatus) { } - override fun camLookAt(message: CamLookAtV1) { + override fun camLookAtV1(message: CamLookAtV1) { } - override fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) { + override fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) { } override fun camMode(message: CamMode) { } - override fun camMoveTo(message: CamMoveToV1) { + override fun camMoveToV1(message: CamMoveToV1) { } - override fun camMoveToArc(message: CamMoveToArcV1) { + override fun camMoveToArcV1(message: CamMoveToArcV1) { } - override fun camMoveToCycles(message: CamMoveToCyclesV1) { + override fun camMoveToCyclesV1(message: CamMoveToCyclesV1) { } override fun camReset(message: CamReset) { @@ -835,7 +835,7 @@ public class IndexerTranscriber( override fun siteSettings(message: SiteSettings) { } - override fun updateRebootTimer(message: UpdateRebootTimerV1) { + override fun updateRebootTimerV1(message: UpdateRebootTimerV1) { } override fun updateUid192(message: UpdateUid192) { @@ -898,7 +898,7 @@ public class IndexerTranscriber( } } - override fun setMapFlag(message: SetMapFlagV1) { + override fun setMapFlagV1(message: SetMapFlagV1) { } override fun setPlayerOp(message: SetPlayerOp) { 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 e41d7381..e75da4ea 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt @@ -66,17 +66,17 @@ import net.rsprox.protocol.game.outgoing.model.zone.header.UpdateZonePartialFoll import net.rsprox.protocol.game.outgoing.model.zone.payload.* public interface ServerPacketTranscriber { - public fun camLookAt(message: CamLookAtV1) + public fun camLookAtV1(message: CamLookAtV1) - public fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) + public fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) public fun camMode(message: CamMode) - public fun camMoveTo(message: CamMoveToV1) + public fun camMoveToV1(message: CamMoveToV1) - public fun camMoveToArc(message: CamMoveToArcV1) + public fun camMoveToArcV1(message: CamMoveToArcV1) - public fun camMoveToCycles(message: CamMoveToCyclesV1) + public fun camMoveToCyclesV1(message: CamMoveToCyclesV1) public fun camReset(message: CamReset) @@ -240,7 +240,7 @@ public interface ServerPacketTranscriber { public fun siteSettings(message: SiteSettings) - public fun updateRebootTimer(message: UpdateRebootTimerV1) + public fun updateRebootTimerV1(message: UpdateRebootTimerV1) public fun updateUid192(message: UpdateUid192) @@ -260,7 +260,7 @@ public interface ServerPacketTranscriber { public fun runClientScript(message: RunClientScript) - public fun setMapFlag(message: SetMapFlagV1) + public fun setMapFlagV1(message: SetMapFlagV1) public fun setPlayerOp(message: SetPlayerOp) 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 95ddbfd3..a8a841d8 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt @@ -284,7 +284,7 @@ public class TextServerPacketTranscriber( return zoneCoordGrid(level, zoneX shl 3, zoneZ shl 3, name) } - override fun camLookAt(message: CamLookAtV1) { + override fun camLookAtV1(message: CamLookAtV1) { if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -301,7 +301,7 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } - override fun camLookAtEasedCoord(message: CamLookAtEasedCoordV1) { + override fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) { if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -323,7 +323,7 @@ public class TextServerPacketTranscriber( root.int("mode", message.mode) } - override fun camMoveTo(message: CamMoveToV1) { + override fun camMoveToV1(message: CamMoveToV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -340,7 +340,7 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } - override fun camMoveToArc(message: CamMoveToArcV1) { + override fun camMoveToArcV1(message: CamMoveToArcV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -359,7 +359,7 @@ public class TextServerPacketTranscriber( root.enum("easing", message.function) } - override fun camMoveToCycles(message: CamMoveToCyclesV1) { + override fun camMoveToCyclesV1(message: CamMoveToCyclesV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { @@ -1879,7 +1879,7 @@ public class TextServerPacketTranscriber( root.string("settings", message.settings) } - override fun updateRebootTimer(message: UpdateRebootTimerV1) { + override fun updateRebootTimerV1(message: UpdateRebootTimerV1) { if (!filters[PropertyFilter.UPDATE_REBOOT_TIMER]) return omit() root.formattedInt("gamecycles", message.gameCycles) } @@ -2169,7 +2169,7 @@ public class TextServerPacketTranscriber( } } - override fun setMapFlag(message: SetMapFlagV1) { + override fun setMapFlagV1(message: SetMapFlagV1) { if (!filters[PropertyFilter.SET_MAP_FLAG]) return omit() if (message.xInBuildArea == 0xFF && message.zInBuildArea == 0xFF) { root.any("coord", null) From ed85aacb4227c4fcf2a845e8b395ad1f975969de Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 20:08:41 +0200 Subject: [PATCH 10/16] feat: add support for transcribing new packets --- .../rsprox/transcriber/TranscriberPlugin.kt | 7 ++ .../transcriber/indexer/IndexerTranscriber.kt | 31 +++++++ .../interfaces/ServerPacketTranscriber.kt | 15 ++++ .../rsprox/transcriber/prot/GameServerProt.kt | 7 ++ .../rsprox/transcriber/state/SessionState.kt | 5 ++ .../net/rsprox/transcriber/state/World.kt | 3 +- .../text/TextServerPacketTranscriber.kt | 84 ++++++++++++++++++- 7 files changed, 148 insertions(+), 4 deletions(-) diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt index 896c0485..cbd4448a 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/TranscriberPlugin.kt @@ -125,10 +125,15 @@ public class TranscriberPlugin( GameServerProt.CAM_RESET -> pass(message, Transcriber::camReset) GameServerProt.CAM_SMOOTHRESET -> pass(message, Transcriber::camSmoothReset) GameServerProt.CAM_MOVETO_V1 -> pass(message, Transcriber::camMoveToV1) + GameServerProt.CAM_MOVETO_V2 -> pass(message, Transcriber::camMoveToV2) GameServerProt.CAM_MOVETO_CYCLES_V1 -> pass(message, Transcriber::camMoveToCyclesV1) + GameServerProt.CAM_MOVETO_CYCLES_V2 -> pass(message, Transcriber::camMoveToCyclesV2) GameServerProt.CAM_MOVETO_ARC_V1 -> pass(message, Transcriber::camMoveToArcV1) + GameServerProt.CAM_MOVETO_ARC_V2 -> pass(message, Transcriber::camMoveToArcV2) GameServerProt.CAM_LOOKAT_V1 -> pass(message, Transcriber::camLookAtV1) + GameServerProt.CAM_LOOKAT_V2 -> pass(message, Transcriber::camLookAtV2) GameServerProt.CAM_LOOKAT_EASED_COORD_V1 -> pass(message, Transcriber::camLookAtEasedCoordV1) + GameServerProt.CAM_LOOKAT_EASED_COORD_V2 -> pass(message, Transcriber::camLookAtEasedCoordV2) GameServerProt.CAM_ROTATEBY -> pass(message, Transcriber::camRotateBy) GameServerProt.CAM_ROTATETO -> pass(message, Transcriber::camRotateTo) GameServerProt.CAM_MODE -> pass(message, Transcriber::camMode) @@ -169,6 +174,7 @@ public class TranscriberPlugin( GameServerProt.UPDATE_RUNWEIGHT -> pass(message, Transcriber::updateRunWeight) GameServerProt.UPDATE_RUNENERGY -> pass(message, Transcriber::updateRunEnergy) GameServerProt.SET_MAP_FLAG_V1 -> pass(message, Transcriber::setMapFlagV1) + GameServerProt.SET_MAP_FLAG_V2 -> pass(message, Transcriber::setMapFlagV2) GameServerProt.SET_PLAYER_OP -> pass(message, Transcriber::setPlayerOp) GameServerProt.UPDATE_STAT_V2 -> pass(message, Transcriber::updateStatV2) GameServerProt.UPDATE_STAT_V1 -> pass(message, Transcriber::updateStatV1) @@ -182,6 +188,7 @@ public class TranscriberPlugin( GameServerProt.HINT_ARROW -> pass(message, Transcriber::hintArrow) GameServerProt.RESET_ANIMS -> pass(message, Transcriber::resetAnims) GameServerProt.UPDATE_REBOOT_TIMER_V1 -> pass(message, Transcriber::updateRebootTimerV1) + GameServerProt.UPDATE_REBOOT_TIMER_V2 -> pass(message, Transcriber::updateRebootTimerV2) GameServerProt.SET_HEATMAP_ENABLED -> pass(message, Transcriber::setHeatmapEnabled) GameServerProt.MINIMAP_TOGGLE -> pass(message, Transcriber::minimapToggle) GameServerProt.SERVER_TICK_END -> pass(message, Transcriber::serverTickEnd) 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 b32c7d4e..1e0d50ba 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/indexer/IndexerTranscriber.kt @@ -113,6 +113,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPri import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV2 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -433,21 +434,36 @@ public class IndexerTranscriber( override fun camLookAtV1(message: CamLookAtV1) { } + override fun camLookAtV2(message: CamLookAtV2) { + } + override fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) { } + override fun camLookAtEasedCoordV2(message: CamLookAtEasedCoordV2) { + } + override fun camMode(message: CamMode) { } override fun camMoveToV1(message: CamMoveToV1) { } + override fun camMoveToV2(message: CamMoveToV2) { + } + override fun camMoveToArcV1(message: CamMoveToArcV1) { } + override fun camMoveToArcV2(message: CamMoveToArcV2) { + } + override fun camMoveToCyclesV1(message: CamMoveToCyclesV1) { } + override fun camMoveToCyclesV2(message: CamMoveToCyclesV2) { + } + override fun camReset(message: CamReset) { } @@ -838,6 +854,18 @@ public class IndexerTranscriber( override fun updateRebootTimerV1(message: UpdateRebootTimerV1) { } + override fun updateRebootTimerV2(message: UpdateRebootTimerV2) { + when (val mes = message.messageType) { + UpdateRebootTimerV2.ClearUpdateMessage -> { + } + UpdateRebootTimerV2.IgnoreUpdateMessage -> { + } + is UpdateRebootTimerV2.SetUpdateMessage -> { + binaryIndex.increment(IndexedType.MESSAGE_GAME, mes.message) + } + } + } + override fun updateUid192(message: UpdateUid192) { } @@ -901,6 +929,9 @@ public class IndexerTranscriber( override fun setMapFlagV1(message: SetMapFlagV1) { } + override fun setMapFlagV2(message: SetMapFlagV2) { + } + override fun setPlayerOp(message: SetPlayerOp) { } 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 e75da4ea..d4cb5138 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/interfaces/ServerPacketTranscriber.kt @@ -31,6 +31,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPri import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV2 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -68,16 +69,26 @@ import net.rsprox.protocol.game.outgoing.model.zone.payload.* public interface ServerPacketTranscriber { public fun camLookAtV1(message: CamLookAtV1) + public fun camLookAtV2(message: CamLookAtV2) + public fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) + public fun camLookAtEasedCoordV2(message: CamLookAtEasedCoordV2) + public fun camMode(message: CamMode) public fun camMoveToV1(message: CamMoveToV1) + public fun camMoveToV2(message: CamMoveToV2) + public fun camMoveToArcV1(message: CamMoveToArcV1) + public fun camMoveToArcV2(message: CamMoveToArcV2) + public fun camMoveToCyclesV1(message: CamMoveToCyclesV1) + public fun camMoveToCyclesV2(message: CamMoveToCyclesV2) + public fun camReset(message: CamReset) public fun camRotateBy(message: CamRotateBy) @@ -242,6 +253,8 @@ public interface ServerPacketTranscriber { public fun updateRebootTimerV1(message: UpdateRebootTimerV1) + public fun updateRebootTimerV2(message: UpdateRebootTimerV2) + public fun updateUid192(message: UpdateUid192) public fun urlOpen(message: UrlOpen) @@ -262,6 +275,8 @@ public interface ServerPacketTranscriber { public fun setMapFlagV1(message: SetMapFlagV1) + public fun setMapFlagV2(message: SetMapFlagV2) + public fun setPlayerOp(message: SetPlayerOp) public fun triggerOnDialogAbort(message: TriggerOnDialogAbort) 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 792ab785..2c7502ff 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/prot/GameServerProt.kt @@ -117,10 +117,15 @@ public enum class GameServerProt : Prot { CAM_RESET, CAM_SMOOTHRESET, CAM_MOVETO_V1, + CAM_MOVETO_V2, CAM_MOVETO_CYCLES_V1, + CAM_MOVETO_CYCLES_V2, CAM_MOVETO_ARC_V1, + CAM_MOVETO_ARC_V2, CAM_LOOKAT_V1, + CAM_LOOKAT_V2, CAM_LOOKAT_EASED_COORD_V1, + CAM_LOOKAT_EASED_COORD_V2, CAM_ROTATEBY, CAM_ROTATETO, CAM_MODE, @@ -167,6 +172,7 @@ public enum class GameServerProt : Prot { UPDATE_RUNWEIGHT, UPDATE_RUNENERGY, SET_MAP_FLAG_V1, + SET_MAP_FLAG_V2, SET_PLAYER_OP, UPDATE_STAT_V2, UPDATE_STAT_V1, @@ -185,6 +191,7 @@ public enum class GameServerProt : Prot { HINT_ARROW, RESET_ANIMS, UPDATE_REBOOT_TIMER_V1, + UPDATE_REBOOT_TIMER_V2, SET_HEATMAP_ENABLED, MINIMAP_TOGGLE, SERVER_TICK_END, diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/state/SessionState.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/state/SessionState.kt index 120335fd..82d9325b 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/state/SessionState.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/state/SessionState.kt @@ -88,6 +88,10 @@ public class SessionState( return worlds[id] } + public fun getRootWorldActiveLevel(): Int { + return getWorld(-1).activeLevel + } + public fun getActiveWorld(): World { return worlds[activeWorldId] ?: error("World $activeWorldId not available.") } @@ -98,6 +102,7 @@ public class SessionState( ) { this.activeWorldId = id this.activeLevel = level + getWorldOrNull(id)?.activeLevel = level } public fun incrementCycle() { diff --git a/transcriber/src/main/kotlin/net/rsprox/transcriber/state/World.kt b/transcriber/src/main/kotlin/net/rsprox/transcriber/state/World.kt index d10aa16a..429099c6 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/state/World.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/state/World.kt @@ -25,6 +25,7 @@ public class World( public var coord: CoordGrid = CoordGrid.INVALID private val npcs: MutableMap = mutableMapOf() private var rebuildRegionBuildArea: BuildArea? = null + public var activeLevel: Int = 0 private val settings: SettingSet get() = settingSetStore.getActive() @@ -37,7 +38,7 @@ public class World( this.buildAreaSouthWestCoord = southWestCoord } - public fun activeLevel(): Int { + public fun activeZoneLevel(): Int { return this.activeZoneSouthWestCoord.level } 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 a8a841d8..87e7046c 100644 --- a/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt +++ b/transcriber/src/main/kotlin/net/rsprox/transcriber/text/TextServerPacketTranscriber.kt @@ -51,6 +51,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.client.SetHeatmapEnabled import net.rsprox.protocol.game.outgoing.model.misc.client.SetInteractionMode import net.rsprox.protocol.game.outgoing.model.misc.client.SiteSettings import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV1 +import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateRebootTimerV2 import net.rsprox.protocol.game.outgoing.model.misc.client.UpdateUid192 import net.rsprox.protocol.game.outgoing.model.misc.client.UrlOpen import net.rsprox.protocol.game.outgoing.model.misc.client.ZBuf @@ -60,6 +61,7 @@ import net.rsprox.protocol.game.outgoing.model.misc.player.ChatFilterSettingsPri import net.rsprox.protocol.game.outgoing.model.misc.player.MessageGame import net.rsprox.protocol.game.outgoing.model.misc.player.RunClientScript import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV1 +import net.rsprox.protocol.game.outgoing.model.misc.player.SetMapFlagV2 import net.rsprox.protocol.game.outgoing.model.misc.player.SetPlayerOp import net.rsprox.protocol.game.outgoing.model.misc.player.TriggerOnDialogAbort import net.rsprox.protocol.game.outgoing.model.misc.player.UpdateRunEnergy @@ -301,6 +303,15 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } + override fun camLookAtV2(message: CamLookAtV2) { + if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() + val coord = CoordGrid(sessionState.getRootWorldActiveLevel(), message.x, message.z) + root.coordGrid(coord) + root.int("height", message.height) + root.int("rate", message.rate) + root.int("rate2", message.rate2) + } + override fun camLookAtEasedCoordV1(message: CamLookAtEasedCoordV1) { if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) @@ -318,6 +329,15 @@ public class TextServerPacketTranscriber( root.enum("easing", message.function) } + override fun camLookAtEasedCoordV2(message: CamLookAtEasedCoordV2) { + if (!filters[PropertyFilter.CAM_LOOKAT]) return omit() + val coord = CoordGrid(sessionState.getRootWorldActiveLevel(), message.x, message.z) + root.coordGrid(coord) + root.int("height", message.height) + root.int("cycles", message.cycles) + root.enum("easing", message.easing) + } + override fun camMode(message: CamMode) { if (!filters[PropertyFilter.CAM_MODE]) return omit() root.int("mode", message.mode) @@ -340,25 +360,48 @@ public class TextServerPacketTranscriber( root.int("rate2", message.acceleration) } + override fun camMoveToV2(message: CamMoveToV2) { + if (!filters[PropertyFilter.CAM_MOVETO]) return omit() + val coord = CoordGrid(sessionState.getRootWorldActiveLevel(), message.x, message.z) + root.coordGrid(coord) + root.int("height", message.height) + root.int("rate", message.rate) + root.int("rate2", message.rate2) + } + override fun camMoveToArcV1(message: CamMoveToArcV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() + root.coordGrid("centercoord", buildAreaCoordGrid(message.centerXInBuildArea, message.centerZInBuildArea)) val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) if (coordInBuildArea.invalid()) { root.any( - "outofboundsbuildareacoord", + "outofboundsdestinationbuildareacoord", "[zoneX=${coordInBuildArea.zoneX}, xInZone=${coordInBuildArea.xInZone}, " + "zoneZ=${coordInBuildArea.zoneZ}, zInZone=${coordInBuildArea.zInZone}]", ) } else { - root.coordGrid(buildAreaCoordGrid(coordInBuildArea.xInBuildArea, coordInBuildArea.zInBuildArea)) + root.coordGrid("destinationcoord", + buildAreaCoordGrid(coordInBuildArea.xInBuildArea, coordInBuildArea.zInBuildArea)) } root.int("height", message.height) - root.coordGrid("tertiarycoord", buildAreaCoordGrid(message.centerXInBuildArea, message.centerZInBuildArea)) root.int("cycles", message.duration) root.boolean("ignoreterrain", message.ignoreTerrain) root.enum("easing", message.function) } + override fun camMoveToArcV2(message: CamMoveToArcV2) { + if (!filters[PropertyFilter.CAM_MOVETO]) return omit() + val center = CoordGrid(sessionState.getRootWorldActiveLevel(), message.centerX, message.centerZ) + + root.coordGrid("centercoord", center) + val destination = CoordGrid(sessionState.getRootWorldActiveLevel(), message.destinationX, message.destinationZ) + root.coordGrid("destinationcoord", destination) + root.int("height", message.height) + root.int("cycles", message.cycles) + root.boolean("ignoreterrain", message.ignoreTerrain) + root.enum("easing", message.easing) + } + override fun camMoveToCyclesV1(message: CamMoveToCyclesV1) { if (!filters[PropertyFilter.CAM_MOVETO]) return omit() val coordInBuildArea = CoordInBuildArea(message.destinationXInBuildArea, message.destinationZInBuildArea) @@ -377,6 +420,16 @@ public class TextServerPacketTranscriber( root.enum("easing", message.function) } + override fun camMoveToCyclesV2(message: CamMoveToCyclesV2) { + if (!filters[PropertyFilter.CAM_MOVETO]) return omit() + val coord = CoordGrid(sessionState.getRootWorldActiveLevel(), message.x, message.z) + root.coordGrid(coord) + root.int("height", message.height) + root.int("cycles", message.cycles) + root.boolean("ignoreterrain", message.ignoreTerrain) + root.enum("easing", message.easing) + } + override fun camReset(message: CamReset) { if (!filters[PropertyFilter.CAM_RESET]) return omit() } @@ -1884,6 +1937,22 @@ public class TextServerPacketTranscriber( root.formattedInt("gamecycles", message.gameCycles) } + override fun updateRebootTimerV2(message: UpdateRebootTimerV2) { + if (!filters[PropertyFilter.UPDATE_REBOOT_TIMER]) return omit() + root.formattedInt("gamecycles", message.gameCycles) + when (val mes = message.messageType) { + UpdateRebootTimerV2.ClearUpdateMessage -> { + root.any("clear_message", "true") + } + UpdateRebootTimerV2.IgnoreUpdateMessage -> { + root.any("ignore_message", true) + } + is UpdateRebootTimerV2.SetUpdateMessage -> { + root.string("message", mes.message) + } + } + } + override fun updateUid192(message: UpdateUid192) { if (!filters[PropertyFilter.UPDATE_UID192]) return omit() root.string("uid", message.uid.toString(Charsets.UTF_8)) @@ -2178,6 +2247,15 @@ public class TextServerPacketTranscriber( } } + override fun setMapFlagV2(message: SetMapFlagV2) { + if (!filters[PropertyFilter.SET_MAP_FLAG]) return omit() + if (message.coordGrid.packed == -1) { + root.any("coord", null) + } else { + root.coordGrid(message.coordGrid) + } + } + override fun setPlayerOp(message: SetPlayerOp) { if (!filters[PropertyFilter.SET_PLAYER_OP]) return omit() root.int("id", message.id) From b12407a4d5cdbf4a93cdf819ae1a9415d8da28ee Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 20:11:09 +0200 Subject: [PATCH 11/16] feat: 236 special exception packets --- .../kotlin/net/rsprox/proxy/client/ClientGameHandler.kt | 6 ++++++ .../kotlin/net/rsprox/proxy/server/ServerGameHandler.kt | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/client/ClientGameHandler.kt b/proxy/src/main/kotlin/net/rsprox/proxy/client/ClientGameHandler.kt index 3414dbce..a4b35535 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/client/ClientGameHandler.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/client/ClientGameHandler.kt @@ -142,6 +142,12 @@ public class ClientGameHandler( replacement.p1Alt2(0) replacement.p3Alt3(delta) } + 236 -> { + buffer.g1Alt1() // Key + val delta = buffer.g3Alt2() + replacement.p1Alt1(0) + replacement.p3Alt2(delta) + } } } diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/server/ServerGameHandler.kt b/proxy/src/main/kotlin/net/rsprox/proxy/server/ServerGameHandler.kt index 8e1fd78a..da2d7420 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/server/ServerGameHandler.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/server/ServerGameHandler.kt @@ -214,6 +214,11 @@ public class ServerGameHandler( buf.skipRead(1) targetComponent = buf.gCombinedIdAlt2() } + 236 -> { + targetComponent = buf.gCombinedIdAlt3() + buf.skipRead(1) + interfaceId = buf.g2() + } else -> { error("Unsupported revision: $revision") From 389d4abfaf6629767257dcd993e26f052bde69b7 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 20:12:30 +0200 Subject: [PATCH 12/16] feat: set current revision to 236 --- .../kotlin/net/rsprox/proxy/config/RSProx.kt | 4 ++-- .../net/rsprox/proxy/plugin/DecoderLoader.kt | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/config/RSProx.kt b/proxy/src/main/kotlin/net/rsprox/proxy/config/RSProx.kt index 3c1c8f35..76751d60 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/config/RSProx.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/config/RSProx.kt @@ -19,8 +19,8 @@ internal val BINARY_CREDENTIALS: Path = BINARY_CREDENTIALS_FOLDER.resolve("binar internal val FAKE_CERTIFICATE_FILE: Path = SIGN_KEY_DIRECTORY.resolve("fake-cert.jks") internal val JAGEX_ACCOUNTS_FILE: Path = CONFIGURATION_PATH.resolve("jagex-accounts.properties") internal val RUNELITE_LAUNCHER_REPO_DIRECTORY: Path = CONFIGURATION_PATH.resolve("runelite-launcher") -internal const val CURRENT_REVISION: Int = 235 -internal const val LATEST_SUPPORTED_PLUGIN: Int = 235 +internal const val CURRENT_REVISION: Int = 236 +internal const val LATEST_SUPPORTED_PLUGIN: Int = 236 /** * Http server port needs to be hard-coded as we modify it in a few RuneLite classes directly. diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/plugin/DecoderLoader.kt b/proxy/src/main/kotlin/net/rsprox/proxy/plugin/DecoderLoader.kt index b5c1563c..2fa82e3b 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/plugin/DecoderLoader.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/plugin/DecoderLoader.kt @@ -56,6 +56,10 @@ import net.rsprox.protocol.v235.ClientPacketDecoderServiceV235 import net.rsprox.protocol.v235.GameClientProtProviderV235 import net.rsprox.protocol.v235.GameServerProtProviderV235 import net.rsprox.protocol.v235.ServerPacketDecoderServiceV235 +import net.rsprox.protocol.v236.ClientPacketDecoderServiceV236 +import net.rsprox.protocol.v236.GameClientProtProviderV236 +import net.rsprox.protocol.v236.GameServerProtProviderV236 +import net.rsprox.protocol.v236.ServerPacketDecoderServiceV236 import net.rsprox.proxy.huffman.HuffmanProvider import net.rsprox.transcriber.prot.GameClientProt import net.rsprox.transcriber.prot.GameServerProt @@ -185,6 +189,7 @@ public class DecoderLoader { 233 to Callable { loadRevision233(huffmanCodec, cache) }, 234 to Callable { loadRevision234(huffmanCodec, cache) }, 235 to Callable { loadRevision235(huffmanCodec, cache) }, + 236 to Callable { loadRevision236(huffmanCodec, cache) }, ) } @@ -370,6 +375,20 @@ public class DecoderLoader { ) } + private fun loadRevision236( + huffmanCodec: HuffmanCodec, + cache: CacheProvider, + ): RevisionDecoder { + logger.debug { "Loading revision 236 decoders" } + return RevisionDecoder( + 236, + ClientPacketDecoderServiceV236(huffmanCodec), + ServerPacketDecoderServiceV236(huffmanCodec, cache), + GameClientProtProviderV236, + GameServerProtProviderV236, + ) + } + public fun getDecoder( revision: Int, cache: CacheProvider, From aeed0d7e8638e9a316bc2ba6044485db2853eafd Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 20:12:51 +0200 Subject: [PATCH 13/16] fix: unpin runelite --- proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt | 1 + .../net/rsprox/proxy/runelite/RuneliteLauncher.kt | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt b/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt index fe9a3552..489b24d8 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt @@ -318,6 +318,7 @@ public class ProxyService( 232 -> "89ed5837e047eeaa3d5528f6b684f0264d9d5a60" 233 -> "cea91b9921a3647683ba8a5c22ec75c752c91b07" 234 -> "8e9f9cce7a5cbe205f7a7a84f8e329d25e810f5d" + 235 -> "205a25ff767fdfe8a461a18e1541ef20a90b0120" else -> null } } diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/runelite/RuneliteLauncher.kt b/proxy/src/main/kotlin/net/rsprox/proxy/runelite/RuneliteLauncher.kt index 6e3bff7e..4267a5a0 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/runelite/RuneliteLauncher.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/runelite/RuneliteLauncher.kt @@ -81,13 +81,13 @@ public class RuneliteLauncher { // Pick the correct bootstrap commit from here: // https://github.com/runelite/static.runelite.net/commits/gh-pages/bootstrap.json val repository = "https://raw.githubusercontent.com/runelite/static.runelite.net" - val commit = "205a25ff767fdfe8a461a18e1541ef20a90b0120" - val bootstrapUrl = "$repository/$commit/bootstrap.json" - val bootstrapSigUrl = "$repository/$commit/bootstrap.json.sha256" + // val commit = "205a25ff767fdfe8a461a18e1541ef20a90b0120" + // val bootstrapUrl = "$repository/$commit/bootstrap.json" + // val bootstrapSigUrl = "$repository/$commit/bootstrap.json.sha256" // Any other time, just rely on the latest bootstrap. - // val bootstrapUrl = "https://static.runelite.net/bootstrap.json" - // val bootstrapSigUrl = "https://static.runelite.net/bootstrap.json.sha256" + val bootstrapUrl = "https://static.runelite.net/bootstrap.json" + val bootstrapSigUrl = "https://static.runelite.net/bootstrap.json.sha256" val primaryArgs = listOf( getJava(), From 9b7470d013b889aafd7ac859d74fccaf01df6373 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 21:08:50 +0200 Subject: [PATCH 14/16] fix: allow latest supported native before it is enforced --- .../src/main/kotlin/net/rsprox/gui/components/LaunchBar.kt | 2 +- proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt | 4 ++-- proxy/src/main/kotlin/net/rsprox/proxy/target/ProxyTarget.kt | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gui/proxy-tool/src/main/kotlin/net/rsprox/gui/components/LaunchBar.kt b/gui/proxy-tool/src/main/kotlin/net/rsprox/gui/components/LaunchBar.kt index 1cb8acd4..bb648954 100644 --- a/gui/proxy-tool/src/main/kotlin/net/rsprox/gui/components/LaunchBar.kt +++ b/gui/proxy-tool/src/main/kotlin/net/rsprox/gui/components/LaunchBar.kt @@ -343,7 +343,7 @@ public class LaunchBar( ) = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus).apply { if (value is ProxyTargetConfig) { text = - if (value.revision != null) { + if (value.revision != null && value.revision != "latest_supported") { "${value.name} (${value.revision})" } else { value.name diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt b/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt index 489b24d8..a8a00550 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/ProxyService.kt @@ -213,7 +213,7 @@ public class ProxyService( javConfigUrl = overriddenJavConfig ?: "https://oldschool.config.runescape.com/jav_config.ws", modulus = null, varpCount = YamlProxyTargetConfig.DEFAULT_VARP_COUNT, - revision = null, + revision = "latest_supported", runeliteBootstrapCommitHash = null, runeliteGamepackUrl = null, binaryFolder = "Old School RuneScape", @@ -740,7 +740,7 @@ public class ProxyService( } val targetRev = target.config.revision val binary = - if (targetRev == null) { + if (targetRev == null || targetRev == "latest_supported") { JagexNativeClientDownloader.download(nativeClientType) } else { getHistoricNativeClient(targetRev, nativeClientType) diff --git a/proxy/src/main/kotlin/net/rsprox/proxy/target/ProxyTarget.kt b/proxy/src/main/kotlin/net/rsprox/proxy/target/ProxyTarget.kt index 0b0e686b..cbd93776 100644 --- a/proxy/src/main/kotlin/net/rsprox/proxy/target/ProxyTarget.kt +++ b/proxy/src/main/kotlin/net/rsprox/proxy/target/ProxyTarget.kt @@ -38,6 +38,9 @@ public class ProxyTarget( } public fun revisionNum(channel: Channel): Int { + if (config.revision == "latest_supported") { + return CURRENT_REVISION + } val overriddenRevision = config.revision ?.split(".") From 438a9cdb21c48547e5b6c53b6e2b133e99a22163 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 21:12:03 +0200 Subject: [PATCH 15/16] docs: update readme to latest revision --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ca40f2b4..16dcf1f7 100644 --- a/README.md +++ b/README.md @@ -249,8 +249,8 @@ The YAML format expects one object per target. When the file is stored locally i ```yaml config: - name: Blurite - jav_config_url: https://client.blurite.io/jav_local_227.ws - revision: 227.3 + jav_config_url: https://client.blurite.io/jav_local_226.ws + revision: 236.1 modulus: d2a780dccbcf534dc61a36deff725aabf9f46fc9ea298ac8c39b89b5bcb5d0817f8c9f59621187d448da9949aca848d0b2acae50c3122b7da53a79e6fe87ff76b675bcbf5bc18fbd2c9ed8f4cff2b7140508049eb119259af888eb9d20e8cea8a4384b06589483bcda11affd8d67756bc93a4d786494cdf7b634e3228b64116d - name: Local Test World jav_config_url: https://example.com/jav_config.ws @@ -262,8 +262,8 @@ If you are hosting the configuration yourself on a url and prefer a shorter docu ```yaml - name: Blurite - jav_config_url: https://client.blurite.io/jav_local_227.ws - revision: 227.3 + jav_config_url: https://client.blurite.io/jav_local_236.ws + revision: 236.1 ``` Properties breakdown: From 695ab790aee9c44d23364e16a31efe74f269d873 Mon Sep 17 00:00:00 2001 From: Kris Date: Tue, 3 Feb 2026 22:12:28 +0200 Subject: [PATCH 16/16] fix: worldentity_info_v7 decoder --- .../codec/info/WorldEntityInfoV7Decoder.kt | 112 ++++++++++++++++++ .../prot/ServerMessageDecoderRepository.kt | 2 + .../worldentityinfo/WorldEntityInfoClient.kt | 4 +- 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV7Decoder.kt diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV7Decoder.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV7Decoder.kt new file mode 100644 index 00000000..be7a863c --- /dev/null +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/codec/info/WorldEntityInfoV7Decoder.kt @@ -0,0 +1,112 @@ +package net.rsprox.protocol.v236.game.outgoing.decoder.codec.info + +import net.rsprot.buffer.JagByteBuf +import net.rsprot.compression.HuffmanCodec +import net.rsprot.protocol.ClientProt +import net.rsprox.cache.api.CacheProvider +import net.rsprox.protocol.ProxyMessageDecoder +import net.rsprox.protocol.common.CoordGrid +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityInfo +import net.rsprox.protocol.game.outgoing.model.info.worldentityinfo.WorldEntityUpdateType +import net.rsprox.protocol.session.Session +import net.rsprox.protocol.session.allocateWorld +import net.rsprox.protocol.session.getActiveWorld +import net.rsprox.protocol.session.getWorld +import net.rsprox.protocol.v236.game.outgoing.decoder.prot.GameServerProt +import net.rsprox.protocol.v236.game.outgoing.model.info.npcinfo.NpcInfoClient +import net.rsprox.protocol.v236.game.outgoing.model.info.playerinfo.PlayerInfoClient +import net.rsprox.protocol.v236.game.outgoing.model.info.worldentityinfo.WorldEntityInfoClient + +internal class WorldEntityInfoV7Decoder( + private val huffmanCodec: HuffmanCodec, + private val cache: CacheProvider, +) : ProxyMessageDecoder { + override val prot: ClientProt = GameServerProt.WORLDENTITY_INFO_V7 + + override fun decode( + buffer: JagByteBuf, + session: Session, + ): WorldEntityInfo { + val activeWorld = session.getActiveWorld() + val world = session.getWorld(activeWorld) + val message = + world.worldEntity.decode( + buffer, + CoordGrid(world.level, world.baseX, world.baseZ), + 7, + ) + for ((index, update) in message.updates) { + when (update) { + is WorldEntityUpdateType.ActiveV2 -> { + } + WorldEntityUpdateType.HighResolutionToLowResolution -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV2 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + WorldEntityUpdateType.Idle -> { + // noop + } + + is WorldEntityUpdateType.ActiveV1 -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV1 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + + is WorldEntityUpdateType.LowResolutionToHighResolutionV3 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + + is WorldEntityUpdateType.ActiveV3 -> { + } + is WorldEntityUpdateType.ExtendedInfoOnly -> { + } + is WorldEntityUpdateType.LowResolutionToHighResolutionV4 -> { + session.allocateWorld( + index, + PlayerInfoClient( + session.localPlayerIndex, + huffmanCodec, + ), + NpcInfoClient(cache), + WorldEntityInfoClient(), + update.sizeX, + update.sizeZ, + ) + } + } + } + return message + } +} diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt index 52080014..e27d80b0 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/decoder/prot/ServerMessageDecoderRepository.kt @@ -40,6 +40,7 @@ import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.NpcInfoSmallV5D import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.PlayerInfoDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.SetNpcUpdateOriginDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.WorldEntityInfoV6Decoder +import net.rsprox.protocol.v236.game.outgoing.decoder.codec.info.WorldEntityInfoV7Decoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.* import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfClearInvDecoder import net.rsprox.protocol.v236.game.outgoing.decoder.codec.interfaces.IfCloseSubDecoder @@ -195,6 +196,7 @@ internal object ServerMessageDecoderRepository { bind(NpcInfoLargeV5Decoder()) bind(SetNpcUpdateOriginDecoder()) bind(WorldEntityInfoV6Decoder(huffmanCodec, cache)) + bind(WorldEntityInfoV7Decoder(huffmanCodec, cache)) bind(IfClearInvDecoder()) bind(IfCloseSubDecoder()) diff --git a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt index 4aafeb38..fd8aab13 100644 --- a/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt +++ b/protocol/osrs-236/src/main/kotlin/net/rsprox/protocol/v236/game/outgoing/model/info/worldentityinfo/WorldEntityInfoClient.kt @@ -585,8 +585,8 @@ public class WorldEntityInfoClient : WorldEntityInfoDecoder { (baseCoord.z shl 7) + coordFine.z, ) - val sizeX = packedSize ushr 4 and 0xF - val sizeZ = packedSize and 0xF + val sizeX = (packedSize ushr 4 and 0xF) * 8 + val sizeZ = (packedSize and 0xF) * 8 val worldEntity = WorldEntityV3( index,