expect -> except

This commit is contained in:
StripedMonkey 2024-09-03 19:29:16 -04:00
parent dc093f4a21
commit 8b73cafaf0
2 changed files with 4 additions and 4 deletions

View File

@ -129,12 +129,12 @@ impl Server {
} }
/// Sends a Packet to all Players in all worlds /// Sends a Packet to all Players in all worlds
pub fn broadcast_packet_all<P>(&self, expect: &[Token], packet: &P) pub fn broadcast_packet_all<P>(&self, except: &[Token], packet: &P)
where where
P: ClientPacket, P: ClientPacket,
{ {
for world in &self.worlds { for world in &self.worlds {
world.blocking_lock().broadcast_packet(expect, packet) world.blocking_lock().broadcast_packet(except, packet)
} }
} }

View File

@ -39,14 +39,14 @@ impl World {
} }
/// Sends a Packet to all Players, Expect some players. Because we can't lock them twice /// Sends a Packet to all Players, Expect some players. Because we can't lock them twice
pub fn broadcast_packet<P>(&self, expect: &[Token], packet: &P) pub fn broadcast_packet<P>(&self, except: &[Token], packet: &P)
where where
P: ClientPacket, P: ClientPacket,
{ {
for (_, player) in self for (_, player) in self
.current_players .current_players
.iter() .iter()
.filter(|c| !expect.contains(c.0)) .filter(|c| !except.contains(c.0))
{ {
let mut player = player.lock().unwrap(); let mut player = player.lock().unwrap();
player.client.send_packet(packet); player.client.send_packet(packet);