This commit is contained in:
Dr. Dystopia 2021-12-15 21:55:53 +01:00
parent 62f9bc5059
commit 3a52599e49
5 changed files with 3 additions and 7 deletions

View File

@ -845,7 +845,6 @@ impl Client {
}
pub fn edit_character(&mut self, alias: String, id: CharacterId, body: comp::Body) {
println!("Edit character");
self.character_list.loading = true;
self.send_msg(ClientGeneral::EditCharacter { alias, id, body });
}

View File

@ -82,10 +82,6 @@ pub fn edit_character(
body: Body,
character_updater: &mut WriteExpect<'_, CharacterUpdater>,
) -> Result<(), CreationError> {
// quick fix whitelist validation for now; eventually replace the
// `Option<String>` with an index into a server-provided list of starter
// items, and replace `comp::body::Body` with `comp::body::humanoid::Body`
// throughout the messages involved
if !matches!(body, Body::Humanoid(_)) {
return Err(CreationError::InvalidBody);
}

View File

@ -516,6 +516,7 @@ pub fn edit_character(
(body, char.body)
{
if new.species != old.species || new.body_type != old.body_type {
warn!("Should never happen due to client validation");
return Err(PersistenceError::CharacterDataError);
} else {
char.body = body;

View File

@ -152,7 +152,7 @@ impl CharacterUpdater {
error!(?e, "Could not send character edit response");
} else {
debug!(
"Processed character create for player {}",
"Processed character edit for player {}",
player_uuid
);
}

View File

@ -161,7 +161,7 @@ impl Sys {
debug!(
?error,
?body,
"Denied creating character because of invalid input."
"Denied editing character because of invalid input."
);
client.send(ServerGeneral::CharacterActionError(error.to_string()))?;
}