From 4b8eb80f1f978ce55b18eda7c67760c412aa6c2c Mon Sep 17 00:00:00 2001 From: Andy Newjack Date: Wed, 18 Mar 2020 01:32:05 -0300 Subject: [PATCH 1/2] room list request and response packets --- src/packet/ship.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/packet/ship.rs b/src/packet/ship.rs index acd1ae5..088f30b 100644 --- a/src/packet/ship.rs +++ b/src/packet/ship.rs @@ -8,6 +8,7 @@ use crate::character::character as character; use std::io::Read; const BLOCK_MENU_ID: u32 = 1; +pub const ROOM_MENU_ID: u32 = 2; #[pso_packet(0x03)] pub struct ShipWelcome { @@ -336,3 +337,33 @@ pub struct ViewInfoboardResponse { pub struct WriteInfoboard { pub message: String, } + +#[pso_packet(0x08)] +pub struct RoomListRequest { + +} + +#[derive(PSOPacketData, Clone)] +pub struct BaseRoom { + pub menu_id: u32, + pub title_id: u32, + pub zero: u16, + pub menu_title: [u16; 17], +} + +#[derive(PSOPacketData, Clone)] +pub struct RoomList { + pub menu_id: u32, + pub item_id: u32, + pub difficulty: u8, + pub players: u8, + pub name: [u16; 16], + pub episode: u8, + pub flags: u8, +} + +#[pso_packet(0x08)] +pub struct RoomListResponse { + pub baseroom: BaseRoom, + pub rooms: Vec, +} From 7ebdc5ffb18bdba11c3793556634c9bd81d80e0e Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 18 Mar 2020 21:36:43 -0300 Subject: [PATCH 2/2] remove BaseRoom struct --- src/packet/ship.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/packet/ship.rs b/src/packet/ship.rs index 088f30b..b62e58e 100644 --- a/src/packet/ship.rs +++ b/src/packet/ship.rs @@ -343,14 +343,6 @@ pub struct RoomListRequest { } -#[derive(PSOPacketData, Clone)] -pub struct BaseRoom { - pub menu_id: u32, - pub title_id: u32, - pub zero: u16, - pub menu_title: [u16; 17], -} - #[derive(PSOPacketData, Clone)] pub struct RoomList { pub menu_id: u32, @@ -364,6 +356,6 @@ pub struct RoomList { #[pso_packet(0x08)] pub struct RoomListResponse { - pub baseroom: BaseRoom, + pub baseroom: RoomList, pub rooms: Vec, }