mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Clean up
This commit is contained in:
parent
62f9bc5059
commit
3a52599e49
@ -845,7 +845,6 @@ impl Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn edit_character(&mut self, alias: String, id: CharacterId, body: comp::Body) {
|
pub fn edit_character(&mut self, alias: String, id: CharacterId, body: comp::Body) {
|
||||||
println!("Edit character");
|
|
||||||
self.character_list.loading = true;
|
self.character_list.loading = true;
|
||||||
self.send_msg(ClientGeneral::EditCharacter { alias, id, body });
|
self.send_msg(ClientGeneral::EditCharacter { alias, id, body });
|
||||||
}
|
}
|
||||||
|
@ -82,10 +82,6 @@ pub fn edit_character(
|
|||||||
body: Body,
|
body: Body,
|
||||||
character_updater: &mut WriteExpect<'_, CharacterUpdater>,
|
character_updater: &mut WriteExpect<'_, CharacterUpdater>,
|
||||||
) -> Result<(), CreationError> {
|
) -> 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(_)) {
|
if !matches!(body, Body::Humanoid(_)) {
|
||||||
return Err(CreationError::InvalidBody);
|
return Err(CreationError::InvalidBody);
|
||||||
}
|
}
|
||||||
|
@ -516,6 +516,7 @@ pub fn edit_character(
|
|||||||
(body, char.body)
|
(body, char.body)
|
||||||
{
|
{
|
||||||
if new.species != old.species || new.body_type != old.body_type {
|
if new.species != old.species || new.body_type != old.body_type {
|
||||||
|
warn!("Should never happen due to client validation");
|
||||||
return Err(PersistenceError::CharacterDataError);
|
return Err(PersistenceError::CharacterDataError);
|
||||||
} else {
|
} else {
|
||||||
char.body = body;
|
char.body = body;
|
||||||
|
@ -152,7 +152,7 @@ impl CharacterUpdater {
|
|||||||
error!(?e, "Could not send character edit response");
|
error!(?e, "Could not send character edit response");
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
"Processed character create for player {}",
|
"Processed character edit for player {}",
|
||||||
player_uuid
|
player_uuid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ impl Sys {
|
|||||||
debug!(
|
debug!(
|
||||||
?error,
|
?error,
|
||||||
?body,
|
?body,
|
||||||
"Denied creating character because of invalid input."
|
"Denied editing character because of invalid input."
|
||||||
);
|
);
|
||||||
client.send(ServerGeneral::CharacterActionError(error.to_string()))?;
|
client.send(ServerGeneral::CharacterActionError(error.to_string()))?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user