|
@ -177,7 +177,7 @@ impl ClientState { |
|
|
user: None,
|
|
|
user: None,
|
|
|
characters: None,
|
|
|
characters: None,
|
|
|
guildcard_data_buffer: 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(connected_client) = self.connected_clients.read().await.get(&user.id) {
|
|
|
if let Some(expires) = connected_client.expires {
|
|
|
if let Some(expires) = connected_client.expires {
|
|
|
if expires > chrono::Utc::now() {
|
|
|
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 {
|
|
|
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.guildcard = user.guildcard;
|
|
|
response.team_id = user.team_id.map_or(0, |ti| ti);
|
|
|
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)])
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(response)])
|
|
|
},
|
|
|
},
|
|
|
Err(err) => {
|
|
|
Err(err) => {
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(err, Session::new()))])
|
|
|
|
|
|
|
|
|
Ok(vec![SendCharacterPacket::LoginResponse(LoginResponse::by_status(err, Session::default()))])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|