1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-20 23:17:45 +00:00

Implement GM speed command, and make GM invis command actually toggle invis status

This commit is contained in:
The Dax 2025-06-19 09:53:21 -04:00 committed by Joshua Goins
parent 749b499db6
commit 1edcdf3de6
4 changed files with 20 additions and 1 deletions

View file

@ -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

View file

@ -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]

View file

@ -140,6 +140,7 @@ impl Default for ServerZoneIpcSegment {
pub enum GameMasterCommandType {
SetLevel = 0x1,
ChangeWeather = 0x6,
Speed = 0x9,
ToggleInvisibility = 0xD,
ToggleWireframe = 0x26,
ChangeTerritory = 0x58,

View file

@ -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