Browse Source

add char level table structs to ships

pbs
jake 5 years ago
parent
commit
4b2c7d299e
  1. 6
      src/login/character.rs
  2. 3
      src/ship/ship.rs

6
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<EG: EntityGateway> {
param_data: Vec<u8>,
clients: HashMap<ClientId, ClientState>,
ships: Vec<Ship>,
level_table: CharacterLevelTable,
}
impl<EG: EntityGateway> CharacterServerState<EG> {
@ -190,6 +193,7 @@ impl<EG: EntityGateway> CharacterServerState<EG> {
param_data: param_data,
clients: HashMap::new(),
ships: ships,
level_table: CharacterLevelTable::new(),
}
}
@ -218,7 +222,7 @@ impl<EG: EntityGateway> CharacterServerState<EG> {
item: i as u32,
flags: 0,
name: utf8_to_utf16_array!(s.name, 0x11)
}
}
}).collect()))
])
}

3
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<EG: EntityGateway> {
entity_gateway: EG,
clients: HashMap<ClientId, ClientState>,
client_location: ClientLocation,
level_table: CharacterLevelTable,
}
impl<EG: EntityGateway> ShipServerState<EG> {
@ -107,6 +109,7 @@ impl<EG: EntityGateway> ShipServerState<EG> {
entity_gateway: entity_gateway,
clients: HashMap::new(),
client_location: ClientLocation::new(),
level_table: CharacterLevelTable::new(),
}
}

Loading…
Cancel
Save