From fc7338356babf5838080d4fd3d18cae12d6b262b Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 4 Nov 2019 20:26:37 -0800 Subject: [PATCH] packets no longer need flag explicitly defined --- src/login/character.rs | 12 ++---------- src/login/login.rs | 4 ---- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/login/character.rs b/src/login/character.rs index cbd234b..d0347eb 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -213,7 +213,6 @@ impl CharacterServerState { fn send_ship_list(&mut self, _id: ClientId, _pkt: &Login) -> Result, CharacterError> { Ok(vec![SendCharacterPacket::Timestamp(Timestamp::new(chrono::Utc::now())), SendCharacterPacket::ShipList(ShipList { - flag: 0, ships: self.ships.iter().enumerate().map(|(i, s)| { ShipListEntry { menu: SHIP_MENU_ID, @@ -252,14 +251,12 @@ impl CharacterServerState { let chars = client.characters.as_ref().unwrap(); Ok(if let Some(char) = &chars[select.slot as usize] { vec![SendCharacterPacket::CharacterPreview(CharacterPreview { - flag: 0, slot: select.slot, character: char.character.as_select_screen(), })] } else { vec![SendCharacterPacket::CharAck(CharAck { - flag: 0, slot: select.slot, code: 2, })] @@ -274,7 +271,6 @@ impl CharacterServerState { user.team_id.unwrap_or(1), client.security_data)), SendCharacterPacket::CharAck(CharAck { - flag: 0, slot: select.slot, code: 1, }) @@ -284,7 +280,6 @@ impl CharacterServerState { fn validate_checksum(&mut self) -> Vec { vec![SendCharacterPacket::ChecksumAck(ChecksumAck { - flag: 0, ack: 1, })] } @@ -398,7 +393,6 @@ impl ServerState for CharacterServerState { Box::new(vec![SendCharacterPacket::ParamDataChunk( ParamDataChunk { - flag: 0, chunk: chunk as u32, data: data, } @@ -432,7 +426,6 @@ impl ServerState for CharacterServerState { user.team_id.unwrap_or(1), client.security_data)), SendCharacterPacket::CharAck(CharAck { - flag: 0, slot: preview.slot, code: 0 }) @@ -482,7 +475,7 @@ mod test { }); server.clients.insert(ClientId(5), clientstate); - let send = server.handle(ClientId(5), &RecvCharacterPacket::RequestSettings(RequestSettings {flag: 0})) + let send = server.handle(ClientId(5), &RecvCharacterPacket::RequestSettings(RequestSettings{})) .unwrap() .collect::>(); assert!(send.len() == 1); @@ -498,8 +491,7 @@ mod test { struct TestData; impl EntityGateway for TestData {} let mut server = CharacterServerState::new(TestData {}); - let send = server.handle(ClientId(1), &RecvCharacterPacket::Checksum(Checksum {flag: 0, - checksum: 1234, + let send = server.handle(ClientId(1), &RecvCharacterPacket::Checksum(Checksum {checksum: 1234, padding: 0, })).unwrap().collect::>(); assert!(send.len() == 1); diff --git a/src/login/login.rs b/src/login/login.rs index 226e62d..b8d50f1 100644 --- a/src/login/login.rs +++ b/src/login/login.rs @@ -179,7 +179,6 @@ mod test { let send = server.handle(ClientId(1), &LOGIN_PACKET).unwrap().collect::>(); assert!(send == vec![ (ClientId(1), SendLoginPacket::LoginResponse(LoginResponse { - flag: 0, status: AccountStatus::Ok, tag: 65536, guildcard: 0, @@ -189,7 +188,6 @@ mod test { caps: 258 })), (ClientId(1), SendLoginPacket::RedirectClient(RedirectClient { - flag: 0, ip: 16777343, port: 12001, padding: 0, @@ -212,7 +210,6 @@ mod test { assert!(send == vec![ (ClientId(1), SendLoginPacket::LoginResponse(LoginResponse { - flag: 0, status: AccountStatus::InvalidUser, tag: 65536, guildcard: 0, @@ -250,7 +247,6 @@ mod test { assert!(send == vec![ (ClientId(1), SendLoginPacket::LoginResponse(LoginResponse { - flag: 0, status: AccountStatus::InvalidPassword, tag: 65536, guildcard: 0,