expect -> except
This commit is contained in:
parent
dc093f4a21
commit
8b73cafaf0
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user