From 9f0505cdc9edefb71aadeca8e41b65c8a0e2d6e9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 31 Dec 2024 22:17:09 -0800 Subject: [PATCH] expand on id types with enums --- src/v1.rs | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 5 deletions(-) diff --git a/src/v1.rs b/src/v1.rs index 8600e76..762c0af 100644 --- a/src/v1.rs +++ b/src/v1.rs @@ -69,8 +69,29 @@ pub struct TimedOutputEvent{ // sound #[binrw] #[brw(little)] +pub enum SoundType{ + #[brw(magic=101u32)] + TrackGround, + #[brw(magic=102u32)] + TrackLadder, + #[brw(magic=103u32)] + TrackWater, + #[brw(magic=104u32)] + TrackAir, + #[brw(magic=201u32)] + JumpGround, + #[brw(magic=202u32)] + JumpLadder, + #[brw(magic=301u32)] + SmashGround, + #[brw(magic=302u32)] + SmashWall, +} +#[binrw] +#[brw(little)] pub struct SoundEvent{ - pub sound_type:u32, + pub sound_type:SoundType, + /// Roblox enum pub material:u32, } #[binrw] @@ -163,10 +184,51 @@ pub enum RunEventType{ } #[binrw] #[brw(little)] +pub enum Mode{ + #[brw(magic=0i32)] + Main, + #[brw(magic=1i32)] + Bonus, + #[brw(magic=-1i32)] + All, + #[brw(magic=-2i32)] + Invalid, + #[brw(magic=-3i32)] + InProgress, +} +#[binrw] +#[brw(little)] +pub enum FlagReason{ + #[brw(magic=0u32)] + Anticheat, + #[brw(magic=1u32)] + StyleChange, + #[brw(magic=2u32)] + Clock, + #[brw(magic=3u32)] + Pause, + #[brw(magic=4u32)] + Flying, + #[brw(magic=5u32)] + Gravity, + #[brw(magic=6u32)] + Timescale, + #[brw(magic=7u32)] + Timetravel, + #[brw(magic=8u32)] + Teleport, + #[brw(magic=9u32)] + Practice, + // b"data" + #[brw(magic=1635017060u32)] + None, +} +#[binrw] +#[brw(little)] pub struct RunEvent{ run_event_type:RunEventType, - mode_id:i32, - flag_reason_id:u32, + mode:Mode, + flag_reason:FlagReason, } #[binrw] #[brw(little)] @@ -179,8 +241,16 @@ pub struct TimedRunEvent{ // camera #[binrw] #[brw(little)] +pub enum CameraEventType{ + #[brw(magic=0u32)] + CameraPunch, + #[brw(magic=1u32)] + Transform, +} +#[binrw] +#[brw(little)] pub struct CameraEvent{ - pub camera_event_id:u32, + pub camera_event_type:CameraEventType, pub value:Vector3, } #[binrw] @@ -194,8 +264,22 @@ pub struct TimedCameraEvent{ // setting #[binrw] #[brw(little)] +pub enum SettingType{ + #[brw(magic=0u32)] + FieldOfView, + #[brw(magic=1u32)] + Sensitivity, + #[brw(magic=2u32)] + VerticalSensitivityMultiplier, + #[brw(magic=3u32)] + AbsoluteSensitivity, + #[brw(magic=4u32)] + TurnSpeed, +} +#[binrw] +#[brw(little)] pub struct SettingEvent{ - pub setting_id:u32, + pub setting_type:SettingType, #[br(map=read_trey_double)] pub value:f64, }