expect -> except

This commit is contained in:
StripedMonkey committed 2024-09-04 21:52:42 -04:00
1 parent dc093f4a21
commit 8b73cafaf0
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -129,12 +129,12 @@ impl Server {
}
/// 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
P: ClientPacket,
{
for world in &self.worlds {
world.blocking_lock().broadcast_packet(expect, packet)
world.blocking_lock().broadcast_packet(except, packet)
}
}
+2 -2
View File
@@ -39,14 +39,14 @@ impl World {
}
/// 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
P: ClientPacket,
{
for (_, player) in self
.current_players
.iter()
.filter(|c| !expect.contains(c.0))
.filter(|c| !except.contains(c.0))
{
let mut player = player.lock().unwrap();
player.client.send_packet(packet);