|
|
@ -56,7 +56,7 @@ impl SendServerPacket for SendLoginPacket { |
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get_login_status(entity_gateway: &dyn EntityGateway, pkt: &Login) -> Result<UserAccount, AccountStatus> {
|
|
|
|
pub fn get_login_status(entity_gateway: &impl EntityGateway, pkt: &Login) -> Result<UserAccount, AccountStatus> {
|
|
|
|
let username = array_to_utf8(pkt.username).map_err(|_err| AccountStatus::Error)?;
|
|
|
|
let password = array_to_utf8(pkt.password).map_err(|_err| AccountStatus::Error)?;
|
|
|
|
let user = entity_gateway.get_user_by_name(username).ok_or(AccountStatus::InvalidUser)?;
|
|
|
|