mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-08 17:37:46 +00:00
Fix and check more packet sizes
This commit is contained in:
parent
55c1e84cc5
commit
b01ec22950
2 changed files with 48 additions and 17 deletions
|
@ -8,7 +8,7 @@
|
||||||
{
|
{
|
||||||
"name": "InitZone",
|
"name": "InitZone",
|
||||||
"opcode": 699,
|
"opcode": 699,
|
||||||
"size": 103
|
"size": 112
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ActorControlSelf",
|
"name": "ActorControlSelf",
|
||||||
|
|
|
@ -166,8 +166,8 @@ pub enum ServerZoneIpcData {
|
||||||
/// Sent by the server when they send a chat message
|
/// Sent by the server when they send a chat message
|
||||||
ServerChatMessage {
|
ServerChatMessage {
|
||||||
unk: u8, // channel?
|
unk: u8, // channel?
|
||||||
#[brw(pad_after = 775)]
|
#[brw(pad_after = 774)]
|
||||||
#[br(count = 775)]
|
#[br(count = 774)]
|
||||||
#[br(map = read_string)]
|
#[br(map = read_string)]
|
||||||
#[bw(map = write_string)]
|
#[bw(map = write_string)]
|
||||||
message: String,
|
message: String,
|
||||||
|
@ -375,14 +375,26 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn world_ipc_sizes() {
|
fn world_ipc_sizes() {
|
||||||
let ipc_types = [
|
let ipc_types = [
|
||||||
(
|
|
||||||
ServerZoneIpcType::ActorControlSelf,
|
|
||||||
ServerZoneIpcData::ActorControlSelf(ActorControlSelf::default()),
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::InitializeChat,
|
ServerZoneIpcType::InitializeChat,
|
||||||
ServerZoneIpcData::InitializeChat { unk: [0; 8] },
|
ServerZoneIpcData::InitializeChat { unk: [0; 8] },
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::InitResponse,
|
||||||
|
ServerZoneIpcData::InitResponse {
|
||||||
|
unk1: 0,
|
||||||
|
character_id: 0,
|
||||||
|
unk2: 0,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::InitZone,
|
||||||
|
ServerZoneIpcData::InitZone(InitZone::default()),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::ActorControlSelf,
|
||||||
|
ServerZoneIpcData::ActorControlSelf(ActorControlSelf::default()),
|
||||||
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::PlayerStats,
|
ServerZoneIpcType::PlayerStats,
|
||||||
ServerZoneIpcData::PlayerStats(PlayerStats::default()),
|
ServerZoneIpcData::PlayerStats(PlayerStats::default()),
|
||||||
|
@ -399,18 +411,37 @@ mod tests {
|
||||||
ServerZoneIpcType::PlayerSpawn,
|
ServerZoneIpcType::PlayerSpawn,
|
||||||
ServerZoneIpcData::PlayerSpawn(PlayerSpawn::default()),
|
ServerZoneIpcData::PlayerSpawn(PlayerSpawn::default()),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::LogOutComplete,
|
||||||
|
ServerZoneIpcData::LogOutComplete { unk: [0; 8] },
|
||||||
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::ActorSetPos,
|
ServerZoneIpcType::ActorSetPos,
|
||||||
ServerZoneIpcData::ActorSetPos(ActorSetPos::default()),
|
ServerZoneIpcData::ActorSetPos(ActorSetPos::default()),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::NpcSpawn,
|
ServerZoneIpcType::ServerChatMessage,
|
||||||
ServerZoneIpcData::NpcSpawn(NpcSpawn::default()),
|
ServerZoneIpcData::ServerChatMessage {
|
||||||
|
unk: 0,
|
||||||
|
message: String::new(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::PrepareZoning,
|
||||||
|
ServerZoneIpcData::PrepareZoning { unk: [0; 4] },
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::ActorControl,
|
ServerZoneIpcType::ActorControl,
|
||||||
ServerZoneIpcData::ActorControl(ActorControl::default()),
|
ServerZoneIpcData::ActorControl(ActorControl::default()),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::ActorMove,
|
||||||
|
ServerZoneIpcData::ActorMove(ActorMove::default()),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
ServerZoneIpcType::NpcSpawn,
|
||||||
|
ServerZoneIpcData::NpcSpawn(NpcSpawn::default()),
|
||||||
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::StatusEffectList,
|
ServerZoneIpcType::StatusEffectList,
|
||||||
ServerZoneIpcData::StatusEffectList(StatusEffectList::default()),
|
ServerZoneIpcData::StatusEffectList(StatusEffectList::default()),
|
||||||
|
@ -419,10 +450,6 @@ mod tests {
|
||||||
ServerZoneIpcType::WeatherChange,
|
ServerZoneIpcType::WeatherChange,
|
||||||
ServerZoneIpcData::WeatherChange(WeatherChange::default()),
|
ServerZoneIpcData::WeatherChange(WeatherChange::default()),
|
||||||
),
|
),
|
||||||
(
|
|
||||||
ServerZoneIpcType::ActorControl,
|
|
||||||
ServerZoneIpcData::ActorControl(ActorControl::default()),
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::ItemInfo,
|
ServerZoneIpcType::ItemInfo,
|
||||||
ServerZoneIpcData::ItemInfo(ItemInfo::default()),
|
ServerZoneIpcData::ItemInfo(ItemInfo::default()),
|
||||||
|
@ -440,12 +467,16 @@ mod tests {
|
||||||
ServerZoneIpcData::EventStart(EventStart::default()),
|
ServerZoneIpcData::EventStart(EventStart::default()),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::ActionResult,
|
ServerZoneIpcType::UpdateHpMpTp,
|
||||||
ServerZoneIpcData::ActionResult(ActionResult::default()),
|
ServerZoneIpcData::UpdateHpMpTp {
|
||||||
|
hp: 0,
|
||||||
|
mp: 0,
|
||||||
|
unk: 0,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
ServerZoneIpcType::ActorMove,
|
ServerZoneIpcType::ActionResult,
|
||||||
ServerZoneIpcData::ActorMove(ActorMove::default()),
|
ServerZoneIpcData::ActionResult(ActionResult::default()),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue