Merge pull request 'Added 0x83 (LobbyList), LobbyEntry, 0x84 (LobbySelect)' (#23) from changing_lobbies into master
Reviewed-by: jake <jake@sharnoth.com>
This commit is contained in:
		
						commit
						82f87da7aa
					
				| @ -10,6 +10,7 @@ use std::io::Read; | ||||
| 
 | ||||
| const BLOCK_MENU_ID: u32 = 1; | ||||
| pub const ROOM_MENU_ID: u32 = 2; | ||||
| pub const LOBBY_MENU_ID: u32 = 3; | ||||
| 
 | ||||
| #[pso_packet(0x03)] | ||||
| pub struct ShipWelcome { | ||||
| @ -89,6 +90,12 @@ pub struct MenuSelect { | ||||
|     pub item: u32, | ||||
| } | ||||
| 
 | ||||
| #[pso_packet(0x84)] | ||||
| pub struct LobbySelect { | ||||
|     pub menu: u32, | ||||
|     pub lobby: u32, | ||||
| } | ||||
| 
 | ||||
| #[pso_packet(0xE7)] | ||||
| pub struct FullCharacter { | ||||
|     #[no_debug] | ||||
| @ -365,3 +372,41 @@ pub struct RoomListResponse { | ||||
|     pub baseroom: RoomList, | ||||
|     pub rooms: Vec<RoomList>, | ||||
| } | ||||
| 
 | ||||
| #[derive(PSOPacketData, Clone, Copy, Default)] | ||||
| pub struct LobbyEntry { | ||||
|     menu_id: u32, | ||||
|     item_id: u32, | ||||
|     padding: u32, | ||||
| } | ||||
| 
 | ||||
| impl LobbyEntry { | ||||
|     pub fn new(menu_id: u32, lobby_id: u32) -> LobbyEntry { | ||||
|         LobbyEntry { | ||||
|             menu_id: menu_id, | ||||
|             item_id: lobby_id, | ||||
|             padding: 0, | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #[pso_packet(0x83, manual_flag)] | ||||
| pub struct LobbyList { | ||||
|     flag: u32, | ||||
|     entries: [LobbyEntry; 16], | ||||
| } | ||||
| 
 | ||||
| impl LobbyList { | ||||
|     pub fn new() -> LobbyList { | ||||
|         let lobbies = (0..16).fold([LobbyEntry::default(); 16], | ||||
|             |mut acc, index| { | ||||
|                 acc[index].menu_id = LOBBY_MENU_ID; | ||||
|                 acc[index].item_id = index as u32; | ||||
|                 acc | ||||
|             }); | ||||
|         LobbyList { | ||||
|             flag: 0x0F, | ||||
|             entries: lobbies, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user