mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 00:05:34 +00:00
Merge branch 'Lucky4Luuk:master' into welcome/leave-notification
This commit is contained in:
commit
7eaa382f6c
@ -377,14 +377,9 @@ impl Server {
|
||||
"Accepting {} incoming clients...",
|
||||
clients_incoming_lock.len()
|
||||
);
|
||||
for i in 0..clients_incoming_lock.len() {
|
||||
let (name, role, is_guest, beammp_id) = {
|
||||
let client = clients_incoming_lock[i]
|
||||
.info
|
||||
.as_ref()
|
||||
.unwrap();
|
||||
(client.username.clone(), client.roles.clone(), client.guest, client.uid.clone())
|
||||
};
|
||||
for client in clients_incoming_lock.drain(..) {
|
||||
let userdata = client.get_userdata();
|
||||
let (name, role, is_guest, beammp_id) = (userdata.username.clone(), userdata.roles.clone(), userdata.guest, userdata.uid.clone());
|
||||
info!("Welcome {name}!");
|
||||
joined_names.push(name.clone());
|
||||
let mut vrx = Vec::new();
|
||||
@ -400,7 +395,7 @@ impl Server {
|
||||
// debug!("res: {:?}", res);
|
||||
vrx.push(rx);
|
||||
}
|
||||
self.clients_queue.push((clients_incoming_lock.swap_remove(i), vrx, Vec::new()));
|
||||
self.clients_queue.push((client, vrx, Vec::new()));
|
||||
}
|
||||
trace!("Accepted incoming clients!");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user