Browse Source

add default palette and symbol chats

pbs
Andy Newjack 5 years ago
committed by jake
parent
commit
4fae76928d
  1. 3
      src/entity/character.rs
  2. 11
      src/ship/character.rs
  3. 1
      src/ship/ship.rs

3
src/entity/character.rs

@ -2,6 +2,7 @@ use std::convert::{From, Into, TryFrom, TryInto};
use std::collections::HashMap; use std::collections::HashMap;
use libpso::packet::ship::{UpdateConfig, WriteInfoboard}; use libpso::packet::ship::{UpdateConfig, WriteInfoboard};
use libpso::character::character::{Character};
use crate::entity::item::tech::Technique; use crate::entity::item::tech::Technique;
use crate::entity::account::UserAccountId; use crate::entity::account::UserAccountId;
@ -189,7 +190,7 @@ pub struct CharacterConfig {
impl CharacterConfig { impl CharacterConfig {
fn new() -> CharacterConfig { fn new() -> CharacterConfig {
CharacterConfig { CharacterConfig {
raw_data: [0; 0xE8],
raw_data: Character::default().config,
} }
} }

11
src/ship/character.rs

@ -82,6 +82,7 @@ pub struct FullCharacterBytesBuilder<'a> {
inventory: Option<&'a ActiveInventory>, inventory: Option<&'a ActiveInventory>,
key_config: Option<&'a [u8; 0x16C]>, key_config: Option<&'a [u8; 0x16C]>,
joystick_config: Option<&'a [u8; 0x38]>, joystick_config: Option<&'a [u8; 0x38]>,
symbol_chat: Option<&'a [u8; 1248]>,
} }
@ -94,6 +95,7 @@ impl<'a> FullCharacterBytesBuilder<'a> {
inventory: None, inventory: None,
key_config: None, key_config: None,
joystick_config: None, joystick_config: None,
symbol_chat: None,
} }
} }
@ -139,6 +141,13 @@ impl<'a> FullCharacterBytesBuilder<'a> {
} }
} }
pub fn symbol_chat(self, symbol_chat: &'a [u8; 1248]) -> FullCharacterBytesBuilder<'a> {
FullCharacterBytesBuilder {
symbol_chat: Some(symbol_chat),
..self
}
}
pub fn build(self) -> character::FullCharacter { pub fn build(self) -> character::FullCharacter {
let character = self.character.unwrap(); let character = self.character.unwrap();
@ -147,6 +156,7 @@ impl<'a> FullCharacterBytesBuilder<'a> {
let inventory = self.inventory.unwrap(); let inventory = self.inventory.unwrap();
let key_config = self.key_config.unwrap(); let key_config = self.key_config.unwrap();
let joystick_config = self.joystick_config.unwrap(); let joystick_config = self.joystick_config.unwrap();
let symbol_chat = self.symbol_chat.unwrap();
character::FullCharacter { character::FullCharacter {
character: CharacterBytesBuilder::new() character: CharacterBytesBuilder::new()
@ -165,6 +175,7 @@ impl<'a> FullCharacterBytesBuilder<'a> {
..character::KeyTeamConfig::default() ..character::KeyTeamConfig::default()
}, },
info_board: character.info_board.as_bytes(), info_board: character.info_board.as_bytes(),
symbol_chats: *symbol_chat,
..character::FullCharacter::default() ..character::FullCharacter::default()
} }
} }

1
src/ship/ship.rs

@ -220,6 +220,7 @@ impl<EG: EntityGateway> ShipServerState<EG> {
.inventory(&client.inventory) .inventory(&client.inventory)
.key_config(&client.settings.settings.key_config) .key_config(&client.settings.settings.key_config)
.joystick_config(&client.settings.settings.joystick_config) .joystick_config(&client.settings.settings.joystick_config)
.symbol_chat(&client.settings.settings.symbol_chats)
.build(); .build();
Ok(vec![ Ok(vec![

Loading…
Cancel
Save