|
@ -63,11 +63,7 @@ pub async fn get_login_status(entity_gateway: &impl EntityGateway, pkt: &Login) |
|
|
let username = array_to_utf8(pkt.username).map_err(|_err| AccountStatus::Error)?;
|
|
|
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 password = array_to_utf8(pkt.password).map_err(|_err| AccountStatus::Error)?;
|
|
|
let user = entity_gateway.get_user_by_name(username).await.map_err(|_| AccountStatus::InvalidUser)?;
|
|
|
let user = entity_gateway.get_user_by_name(username).await.map_err(|_| AccountStatus::InvalidUser)?;
|
|
|
/*if user.is_currently_online() {
|
|
|
|
|
|
return Err(AccountStatus::AlreadyOnline)
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
log::info!("user: {}, activated {}", user.username, user.activated);
|
|
|
|
|
|
if !user.activated {
|
|
|
if !user.activated {
|
|
|
return Err(AccountStatus::PayUp)
|
|
|
return Err(AccountStatus::PayUp)
|
|
|
}
|
|
|
}
|
|
@ -233,7 +229,7 @@ mod test { |
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
async fn save_user(&mut self, user: &UserAccountEntity) -> Result<(), GatewayError> {
|
|
|
|
|
|
|
|
|
async fn save_user(&mut self, _user: &UserAccountEntity) -> Result<(), GatewayError> {
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|