From 4b2c7d299e9a2644b16359dbcd879b8570475349 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 3 Dec 2019 21:45:16 -0800 Subject: [PATCH] add char level table structs to ships --- src/login/character.rs | 6 +++++- src/ship/ship.rs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/login/character.rs b/src/login/character.rs index 59b2603..e53b7d4 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -10,6 +10,7 @@ use libpso::crypto::bb::PSOBBCipher; use crate::common::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY}; use crate::common::serverstate::{SendServerPacket, RecvServerPacket, ServerState, OnConnect, ClientId}; +use crate::common::leveltable::CharacterLevelTable; use libpso::{utf8_to_array, utf8_to_utf16_array}; use crate::entity::gateway::EntityGateway; @@ -150,6 +151,7 @@ impl ClientState { } } + struct Ship { flags: u32, name: String, @@ -174,6 +176,7 @@ pub struct CharacterServerState { param_data: Vec, clients: HashMap, ships: Vec, + level_table: CharacterLevelTable, } impl CharacterServerState { @@ -190,6 +193,7 @@ impl CharacterServerState { param_data: param_data, clients: HashMap::new(), ships: ships, + level_table: CharacterLevelTable::new(), } } @@ -218,7 +222,7 @@ impl CharacterServerState { item: i as u32, flags: 0, name: utf8_to_utf16_array!(s.name, 0x11) - } + } }).collect())) ]) } diff --git a/src/ship/ship.rs b/src/ship/ship.rs index ada5bc3..802aff1 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -12,6 +12,7 @@ use libpso::utf8_to_utf16_array; use crate::common::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY}; use crate::common::serverstate::{SendServerPacket, RecvServerPacket, ServerState, OnConnect, ClientId}; +use crate::common::leveltable::CharacterLevelTable; use crate::entity::gateway::EntityGateway; use crate::entity::account::{UserAccount, UserSettings, USERFLAG_NEWCHAR, USERFLAG_DRESSINGROOM}; @@ -99,6 +100,7 @@ pub struct ShipServerState { entity_gateway: EG, clients: HashMap, client_location: ClientLocation, + level_table: CharacterLevelTable, } impl ShipServerState { @@ -107,6 +109,7 @@ impl ShipServerState { entity_gateway: entity_gateway, clients: HashMap::new(), client_location: ClientLocation::new(), + level_table: CharacterLevelTable::new(), } }