|
|
@ -72,6 +72,10 @@ impl EntityGateway for InMemoryGatewayTransaction { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn save_user_settings(&mut self, settings: &UserSettingsEntity) -> Result<(), GatewayError> {
|
|
|
|
self.original_gateway.save_user_settings(settings).await
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn save_character(&mut self, char: &CharacterEntity) -> Result<(), GatewayError> {
|
|
|
|
copy_if_needed(&mut *self.working_gateway.characters.lock().await,
|
|
|
|
&*self.original_gateway.characters.lock().await,
|
|
|
@ -418,6 +422,12 @@ impl EntityGateway for InMemoryGateway { |
|
|
|
.ok_or(GatewayError::Error)
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn save_user_settings(&mut self, settings: &UserSettingsEntity) -> Result<(), GatewayError> {
|
|
|
|
let mut user_settings = self.user_settings.lock().await;
|
|
|
|
user_settings.insert(settings.id, settings.clone());
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn get_characters_by_user(&mut self, user: &UserAccountEntity) -> Result<[Option<CharacterEntity>; 4], GatewayError> {
|
|
|
|
let characters = self.characters.lock().await;
|
|
|
|
const NONE: Option<CharacterEntity> = None;
|
|
|
|