diff --git a/README.md b/README.md index e6e4093..e7a1721 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,10 @@ * get the latest nightly `rustup install nightly` * grab elseware and [libpso](https://github.com/jakeprobst/libpso) * have elseware and libpso in the same directory -* `cargo install diesel-cli` -* `diesel database setup` -* `cargo run --bin patch` or `cargo run --bin login` * `cargo test` to run tests + +# to actually run it +* `cargo install diesel_cli` +* `diesel database setup` +* [some sort of step that seeds the db with fake data to be useful] +* `cargo run --bin patch` and `cargo run --bin login` diff --git a/src/login/character.rs b/src/login/character.rs index e564d45..db23753 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -30,6 +30,7 @@ pub enum CharacterError { pub enum RecvCharacterPacket { Login(Login), RequestSettings(RequestSettings), + CharSelect(CharSelect) } impl RecvServerPacket for RecvCharacterPacket { @@ -37,6 +38,7 @@ impl RecvServerPacket for RecvCharacterPacket { match data[2] { 0x93 => Ok(RecvCharacterPacket::Login(Login::from_bytes(data)?)), 0xE0 => Ok(RecvCharacterPacket::RequestSettings(RequestSettings::from_bytes(data)?)), + 0xE3 => Ok(RecvCharacterPacket::CharSelect(CharSelect::from_bytes(data)?)), _ => Err(PacketParseError::WrongPacketForServerType) } } @@ -102,6 +104,10 @@ impl CharacterServerState { vec![pkt] } + + fn char_select(&mut self) -> Vec { + Vec::new() + } } impl ServerState for CharacterServerState { @@ -130,15 +136,14 @@ impl ServerState for CharacterServerState { }, RecvCharacterPacket::RequestSettings(_req) => { Box::new(self.get_settings().into_iter()) + }, + RecvCharacterPacket::CharSelect(sel) => { + Box::new(self.char_select().into_iter()) } } } } - - - - pub fn new_client(socket: mio::tcp::TcpStream, shared_state: SharedLoginState) { let state = CharacterServerState::new(shared_state); let client = Client::new(socket, Box::new(state)); @@ -153,10 +158,6 @@ mod test { use libpso::character::settings; use std::time::SystemTime; - #[test] - fn test_login() { - } - #[test] fn test_option_send() { struct TestData { @@ -192,5 +193,4 @@ mod test { assert!(bytes[2] == 0xE2); assert!(bytes.len() == 0xAFC); } - }