mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove account on logout.
This commit is contained in:
parent
3995f099b0
commit
b29e543089
@ -42,6 +42,8 @@ impl AuthProvider {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn logout(&mut self, username: &str) { self.accounts.retain(|_, v| v != username); }
|
||||
|
||||
pub fn query(&mut self, username_or_token: String) -> Result<(), RegisterError> {
|
||||
// Based on whether auth server is provided or not we expect an username or
|
||||
// token
|
||||
|
@ -293,6 +293,7 @@ impl<'a> System<'a> for Sys {
|
||||
None,
|
||||
ServerMsg::broadcast(format!("{} went offline.", &player.alias)),
|
||||
));
|
||||
accounts.logout(&player.alias);
|
||||
}
|
||||
server_emitter.emit(ServerEvent::ClientDisconnect(entity));
|
||||
client.postbox.send_message(ServerMsg::Disconnect);
|
||||
|
Loading…
Reference in New Issue
Block a user