|
|
@ -484,7 +484,7 @@ impl<EG: EntityGateway + Clone> CharacterServerState<EG> { |
|
|
|
async fn set_flag(&mut self, id: ClientId, setflag: &SetFlag) -> Result<std::option::IntoIter<SendCharacterPacket>, anyhow::Error> {
|
|
|
|
let mut client = self.clients.write().await;
|
|
|
|
let client = client.get_mut(&id).ok_or_else(|| CharacterError::ClientNotFound(id))?;
|
|
|
|
let mut user = client.user.as_mut().unwrap();
|
|
|
|
let user = client.user.as_mut().unwrap();
|
|
|
|
user.flags = setflag.flags;
|
|
|
|
self.entity_gateway.save_user(user).await.unwrap();
|
|
|
|
Ok(None.into_iter())
|
|
|
@ -515,7 +515,7 @@ impl<EG: EntityGateway + Clone> CharacterServerState<EG> { |
|
|
|
async fn character_preview(&mut self, id: ClientId, preview: &CharacterPreview) -> Result<Vec<SendCharacterPacket>, anyhow::Error> {
|
|
|
|
let mut client = self.clients.write().await;
|
|
|
|
let client = client.get_mut(&id).ok_or_else(|| CharacterError::ClientNotFound(id))?;
|
|
|
|
let mut user = client.user.as_mut().unwrap();
|
|
|
|
let user = client.user.as_mut().unwrap();
|
|
|
|
if user.flags == USERFLAG_NEWCHAR {
|
|
|
|
new_character(&mut self.entity_gateway, user, preview).await?
|
|
|
|
}
|
|
|
|