diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index 65a321d..fa4c0de 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -568,15 +568,27 @@ async fn client_loop( GameMasterCommandType::ChangeWeather => { connection.change_weather(*arg0 as u16).await } + GameMasterCommandType::Speed => { + // TODO: Maybe allow setting the speed of a targeted player too? + connection + .actor_control_self(ActorControlSelf { + category: + ActorControlCategory::Flee { + speed: *arg0 as u16, + }, + }) + .await + } GameMasterCommandType::ChangeTerritory => { connection.change_zone(*arg0 as u16).await } GameMasterCommandType::ToggleInvisibility => { + connection.player_data.gm_invisible = !connection.player_data.gm_invisible; connection .actor_control_self(ActorControlSelf { category: ActorControlCategory::ToggleInvisibility { - invisible: true, + invisible: connection.player_data.gm_invisible, }, }) .await diff --git a/src/ipc/zone/actor_control.rs b/src/ipc/zone/actor_control.rs index 6ba078d..7e375b1 100644 --- a/src/ipc/zone/actor_control.rs +++ b/src/ipc/zone/actor_control.rs @@ -69,6 +69,11 @@ pub enum ActorControlCategory { insufficient_gil: u32, aetheryte_id: u32, }, + #[brw(magic=0x1Bu16)] + Flee { + #[brw(pad_before = 2)] // padding + speed: u16, + } } #[binrw] diff --git a/src/ipc/zone/mod.rs b/src/ipc/zone/mod.rs index 706519e..ab4f079 100644 --- a/src/ipc/zone/mod.rs +++ b/src/ipc/zone/mod.rs @@ -140,6 +140,7 @@ impl Default for ServerZoneIpcSegment { pub enum GameMasterCommandType { SetLevel = 0x1, ChangeWeather = 0x6, + Speed = 0x9, ToggleInvisibility = 0xD, ToggleWireframe = 0x26, ChangeTerritory = 0x58, diff --git a/src/world/connection.rs b/src/world/connection.rs index e15763f..b8416d3 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -61,6 +61,7 @@ pub struct PlayerData { pub teleport_query: TeleportQuery, pub gm_rank: GameMasterRank, + pub gm_invisible: bool, } /// Represents a single connection between an instance of the client and the world server