From 628d804be6239dba6f2269322b15d822d28cdd97 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 3 Dec 2019 22:51:21 -0800 Subject: [PATCH] send ship name to client --- src/ship/ship.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ship/ship.rs b/src/ship/ship.rs index 900e266..5ce01b4 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -101,6 +101,7 @@ pub struct ShipServerState { clients: HashMap, client_location: ClientLocation, level_table: CharacterLevelTable, + name: String, } impl ShipServerState { @@ -110,6 +111,7 @@ impl ShipServerState { clients: HashMap::new(), client_location: ClientLocation::new(), level_table: CharacterLevelTable::new(), + name: "Sona-Nyl".into(), } } @@ -128,7 +130,7 @@ impl ShipServerState { .ok_or(ShipError::ClientNotFound(id))?; self.clients.insert(id, ClientState::new(user, settings, character, pkt.session)); - vec![SendShipPacket::LoginResponse(response), SendShipPacket::ShipBlockList(ShipBlockList::new(3))] + vec![SendShipPacket::LoginResponse(response), SendShipPacket::ShipBlockList(ShipBlockList::new(&self.name, 3))] }, Err(err) => { vec![SendShipPacket::LoginResponse(LoginResponse::by_status(err, Session::new()))]