|
|
@ -75,13 +75,15 @@ pub async fn get_login_status(entity_gateway: &impl EntityGateway, pkt: &Login) |
|
|
|
|
|
|
|
|
|
|
|
pub struct LoginServerState<EG: EntityGateway> {
|
|
|
|
character_server_ip: net::Ipv4Addr,
|
|
|
|
entity_gateway: EG,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<EG: EntityGateway> LoginServerState<EG> {
|
|
|
|
pub fn new(entity_gateway: EG) -> LoginServerState<EG> {
|
|
|
|
pub fn new(entity_gateway: EG, character_server_ip: net::Ipv4Addr) -> LoginServerState<EG> {
|
|
|
|
LoginServerState {
|
|
|
|
entity_gateway: entity_gateway,
|
|
|
|
character_server_ip: character_server_ip.into(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
@ -89,8 +91,8 @@ impl<EG: EntityGateway> LoginServerState<EG> { |
|
|
|
match get_login_status(&self.entity_gateway, pkt).await {
|
|
|
|
Ok(_user) => {
|
|
|
|
let response = SendLoginPacket::LoginResponse(LoginResponse::by_status(AccountStatus::Ok, pkt.session));
|
|
|
|
let ip = net::Ipv4Addr::new(127,0,0,1);
|
|
|
|
let ip = u32::from_ne_bytes(ip.octets());
|
|
|
|
//let ip = net::Ipv4Addr::new(127,0,0,1);
|
|
|
|
let ip = u32::from_ne_bytes(self.character_server_ip.octets());
|
|
|
|
vec![response,
|
|
|
|
SendLoginPacket::RedirectClient(RedirectClient::new(ip, crate::login::character::CHARACTER_PORT))]
|
|
|
|
},
|
|
|
|