mirror of
https://github.com/redstrate/Kawari.git
synced 2025-07-19 11:17:46 +00:00
Add ObjectSpawn IPC opcode
The struct itself is all kinds of wrong as I blindly copied it from Sapphire, so I wouldn't depend on it just yet.
This commit is contained in:
parent
7cfa20052d
commit
c04cfdf5da
3 changed files with 46 additions and 0 deletions
|
@ -259,6 +259,11 @@
|
||||||
"name": "ContentFinderFound2",
|
"name": "ContentFinderFound2",
|
||||||
"opcode": 619,
|
"opcode": 619,
|
||||||
"size": 812
|
"size": 812
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ObjectSpawn",
|
||||||
|
"opcode": 425,
|
||||||
|
"size": 64
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ClientZoneIpcType": [
|
"ClientZoneIpcType": [
|
||||||
|
|
|
@ -88,6 +88,9 @@ pub use config::Config;
|
||||||
mod event_yield_handler;
|
mod event_yield_handler;
|
||||||
pub use event_yield_handler::EventYieldHandler;
|
pub use event_yield_handler::EventYieldHandler;
|
||||||
|
|
||||||
|
mod object_spawn;
|
||||||
|
pub use object_spawn::ObjectSpawn;
|
||||||
|
|
||||||
use crate::COMPLETED_QUEST_BITMASK_SIZE;
|
use crate::COMPLETED_QUEST_BITMASK_SIZE;
|
||||||
use crate::common::ObjectTypeId;
|
use crate::common::ObjectTypeId;
|
||||||
use crate::common::Position;
|
use crate::common::Position;
|
||||||
|
@ -436,6 +439,8 @@ pub enum ServerZoneIpcData {
|
||||||
},
|
},
|
||||||
#[br(pre_assert(*magic == ServerZoneIpcType::ContentFinderFound2))]
|
#[br(pre_assert(*magic == ServerZoneIpcType::ContentFinderFound2))]
|
||||||
ContentFinderFound2 { unk1: [u8; 8] },
|
ContentFinderFound2 { unk1: [u8; 8] },
|
||||||
|
#[br(pre_assert(*magic == ServerZoneIpcType::ObjectSpawn))]
|
||||||
|
ObjectSpawn(ObjectSpawn),
|
||||||
Unknown {
|
Unknown {
|
||||||
#[br(count = size - 32)]
|
#[br(count = size - 32)]
|
||||||
unk: Vec<u8>,
|
unk: Vec<u8>,
|
||||||
|
@ -872,6 +877,10 @@ mod tests {
|
||||||
unk4: 0,
|
unk4: 0,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::ObjectSpawn,
|
||||||
|
ServerZoneIpcData::ObjectSpawn(ObjectSpawn::default()),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
for (opcode, data) in &ipc_types {
|
for (opcode, data) in &ipc_types {
|
||||||
|
|
32
src/ipc/zone/object_spawn.rs
Normal file
32
src/ipc/zone/object_spawn.rs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
use binrw::binrw;
|
||||||
|
|
||||||
|
use crate::common::{Position, read_quantized_rotation, write_quantized_rotation};
|
||||||
|
|
||||||
|
// TODO: this is all kinds of wrong, take the fields with a grain of salt
|
||||||
|
#[binrw]
|
||||||
|
#[brw(little)]
|
||||||
|
#[derive(Debug, Clone, Default)]
|
||||||
|
pub struct ObjectSpawn {
|
||||||
|
pub index: u8,
|
||||||
|
pub kind: u8,
|
||||||
|
#[brw(pad_after = 1)] // padding, or part of flag?
|
||||||
|
pub flag: u8,
|
||||||
|
pub base_id: u32,
|
||||||
|
pub entity_id: u32,
|
||||||
|
pub layout_id: u32,
|
||||||
|
pub content_id: u32,
|
||||||
|
pub owner_id: u32,
|
||||||
|
pub bind_layout_id: u32,
|
||||||
|
pub scale: f32,
|
||||||
|
pub shared_group_timeline_state: u16,
|
||||||
|
#[br(map = read_quantized_rotation)]
|
||||||
|
#[bw(map = write_quantized_rotation)]
|
||||||
|
pub rotation: f32,
|
||||||
|
pub fate: u16,
|
||||||
|
pub permission_invisibility: u8,
|
||||||
|
pub args1: u8,
|
||||||
|
pub args2: u32,
|
||||||
|
pub args3: u32,
|
||||||
|
pub unk1: u32,
|
||||||
|
pub position: Position,
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue