|
@ -534,7 +534,7 @@ impl<EG: EntityGateway> ServerState for CharacterServerState<EG> { |
|
|
|
|
|
|
|
|
fn new_character_from_preview(character: &mut Character, preview: &CharacterPreview) {
|
|
|
fn new_character_from_preview(character: &mut Character, preview: &CharacterPreview) {
|
|
|
character.slot = preview.slot;
|
|
|
character.slot = preview.slot;
|
|
|
character.name = String::from_utf16_lossy(&preview.character.name);
|
|
|
|
|
|
|
|
|
character.name = String::from_utf16_lossy(&preview.character.name).trim_matches(char::from(0)).into();
|
|
|
character.section_id = preview.character.section_id.into();
|
|
|
character.section_id = preview.character.section_id.into();
|
|
|
character.char_class = preview.character.ch_class.into();
|
|
|
character.char_class = preview.character.ch_class.into();
|
|
|
character.appearance.costume = preview.character.costume;
|
|
|
character.appearance.costume = preview.character.costume;
|
|
@ -726,7 +726,7 @@ mod test { |
|
|
assert!(send.len() == 2);
|
|
|
assert!(send.len() == 2);
|
|
|
|
|
|
|
|
|
let chars = TestData.get_characters_by_user(&fake_user.user.unwrap());
|
|
|
let chars = TestData.get_characters_by_user(&fake_user.user.unwrap());
|
|
|
assert!(chars[1].unwrap().character.name == [9, 69, 116, 101, 115, 116, 32, 110, 97, 109, 101, 0, 0, 0, 0, 0]);
|
|
|
|
|
|
|
|
|
assert!(chars[1].as_ref().unwrap().name == "\tEtest name");
|
|
|
assert!(chars[0].is_none());
|
|
|
assert!(chars[0].is_none());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|