|
|
@ -19,7 +19,7 @@ use networking::cipherkeys::{ELSEWHERE_PRIVATE_KEY, ELSEWHERE_PARRAY}; |
|
|
|
use networking::serverstate::{SendServerPacket, RecvServerPacket, ServerState, OnConnect, ClientId};
|
|
|
|
use networking::interserver::{ServerId, InterserverActor, LoginMessage, ShipMessage, Ship};
|
|
|
|
use stats::leveltable::LEVEL_TABLE;
|
|
|
|
use libpso::{utf8_to_array, utf8_to_utf16_array};
|
|
|
|
use libpso::util::{utf8_to_array, utf8_to_utf16_array};
|
|
|
|
|
|
|
|
use entity::gateway::{EntityGateway, GatewayError};
|
|
|
|
use entity::account::{UserAccountId, UserAccountEntity, NewUserSettingsEntity, USERFLAG_NEWCHAR, USERFLAG_DRESSINGROOM};
|
|
|
@ -150,7 +150,7 @@ fn generate_param_data(path: &str) -> (ParamDataHeader, Vec<u8>) { |
|
|
|
size: len as u32,
|
|
|
|
checksum: crc.sum32(),
|
|
|
|
offset: buffer.len() as u32,
|
|
|
|
filename: utf8_to_array!(param.file_name().unwrap().to_str().unwrap(), 0x40),
|
|
|
|
filename: utf8_to_array(param.file_name().unwrap().to_str().unwrap()),
|
|
|
|
});
|
|
|
|
|
|
|
|
buffer.append(&mut filebuf);
|
|
|
@ -177,7 +177,7 @@ impl ClientState { |
|
|
|
user: None,
|
|
|
|
characters: None,
|
|
|
|
guildcard_data_buffer: None,
|
|
|
|
session: Session::new(),
|
|
|
|
session: Session::default(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -342,15 +342,15 @@ impl<EG: EntityGateway + Clone> CharacterServerState<EG> { |
|
|
|
if let Some(connected_client) = self.connected_clients.read().await.get(&user.id) {
|
|
|
|
if let Some(expires) = connected_client.expires {
|
|
|
|
if expires > chrono::Utc::now() {
|
|
|
|
return Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(AccountStatus::AlreadyOnline, Session::new()))]);
|
|
|
|
return Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(AccountStatus::AlreadyOnline, Session::default()))]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(AccountStatus::AlreadyOnline, Session::new()))]);
|
|
|
|
return Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(AccountStatus::AlreadyOnline, Session::default()))]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let mut response = LoginResponse::by_status(AccountStatus::Ok, Session::new());
|
|
|
|
let mut response = LoginResponse::by_status(AccountStatus::Ok, Session::default());
|
|
|
|
response.guildcard = user.guildcard;
|
|
|
|
response.team_id = user.team_id.map_or(0, |ti| ti);
|
|
|
|
|
|
|
@ -367,7 +367,7 @@ impl<EG: EntityGateway + Clone> CharacterServerState<EG> { |
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(response)])
|
|
|
|
},
|
|
|
|
Err(err) => {
|
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(err, Session::new()))])
|
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(err, Session::default()))])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,7 +379,7 @@ impl<EG: EntityGateway + Clone> CharacterServerState<EG> { |
|
|
|
menu: SHIP_MENU_ID,
|
|
|
|
item: i.0 as u32,
|
|
|
|
flags: 0,
|
|
|
|
name: utf8_to_utf16_array!(s.name, 0x11)
|
|
|
|
name: utf8_to_utf16_array(&s.name)
|
|
|
|
}
|
|
|
|
}).collect()))
|
|
|
|
])
|
|
|
@ -824,7 +824,7 @@ impl<'a> SelectScreenCharacterBuilder<'a> { |
|
|
|
hair_b: character.appearance.hair_b,
|
|
|
|
prop_x: character.appearance.prop_x,
|
|
|
|
prop_y: character.appearance.prop_y,
|
|
|
|
name: utf8_to_utf16_array!(character.name, 16),
|
|
|
|
name: utf8_to_utf16_array(&character.name),
|
|
|
|
play_time: character.playtime,
|
|
|
|
..character::SelectScreenCharacter::default()
|
|
|
|
}
|
|
|
|