|
|
@ -532,7 +532,7 @@ mod test { |
|
|
|
id: 3,
|
|
|
|
username: "hi3".to_string(),
|
|
|
|
password: bcrypt::hash("qwer", 5).unwrap(),
|
|
|
|
guildcard: Some(3u32),
|
|
|
|
guildcard: Some(3),
|
|
|
|
team_id: None,
|
|
|
|
banned: false,
|
|
|
|
muted_until: SystemTime::now(),
|
|
|
@ -543,6 +543,7 @@ mod test { |
|
|
|
let mut server = CharacterServerState::new(TestData.clone());
|
|
|
|
server.clients.insert(ClientId(1), fake_user.clone());
|
|
|
|
let mut send = server.handle(ClientId(1), &RecvCharacterPacket::SetFlag(SetFlag {flags: 1})).unwrap().collect::<Vec<_>>();
|
|
|
|
assert!(TestData.get_user_by_id(3).unwrap().flags == 1);
|
|
|
|
send = server.handle(ClientId(1), &RecvCharacterPacket::CharacterPreview(CharacterPreview {slot: 1, character: character::SelectScreenCharacter {
|
|
|
|
exp: 0,
|
|
|
|
level: 0,
|
|
|
@ -572,7 +573,7 @@ mod test { |
|
|
|
} })).unwrap().collect::<Vec<_>>();
|
|
|
|
assert!(send.len() == 2);
|
|
|
|
|
|
|
|
let chars = TestData.get_characters_by_user(&fake_user.user.clone().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[0].is_none());
|
|
|
|
}
|
|
|
|