pub fn send_packet_to_all_players<P: Packet + Clone + 'static>(
    net_comps: &ReadStorage<NetworkComponent>,
    entities: &Entities,
    packet: P,
    neq: Option<Entity>,
) {
    for (entity, net) in (entities, net_comps).join() {
        if let Some(e) = neq.as_ref() {
            if *e == entity {
                continue; // Exclude this entity
            }
        }

        send_packet_to_player(net, packet.clone());
    }
}
/// Sends a packet to all players on the server, excluding
/// `neq`, if it exists.
Sends a packet to all players on the server, excluding
`neq`, if it exists.
Sends a packet to all players on the server excluding ` neq ` if it exists .
pub fn send_packet_to_all_players<P: Packet + Clone + 'static>(
    net_comps: &ReadStorage<NetworkComponent>,
    entities: &Entities,
    packet: P,
    neq: Option<Entity>,
) {
    for (entity, net) in (entities, net_comps).join() {
        if let Some(e) = neq.as_ref() {
            if *e == entity {
                continue; // Exclude this entity
            }
        }
        send_packet_to_player(net, packet.clone());
    }
}
pub fn send_packet_to_all_players < P : Packet + Clone + ' static > ( net_comps : & ReadStorage < NetworkComponent > , entities : & Entities , packet : P , neq : Option < Entity > , ) { for ( entity , net ) in ( entities , net_comps ) . join ( ) { if let Some ( e ) = neq . as_ref ( ) { if * e == entity { continue ; // Exclude this entity } } send_packet_to_player ( net , packet . clone ( ) ) ; } }
Sends a packet to all players on the server, excluding
`neq`, if it exists.
Sends a packet to all players on the server excluding ` neq ` if it exists .
net_comps
&ReadStorage<NetworkComponent>
entities
&Entities
packet
P
neq
Option<Entity>
net_comps
&ReadStorage<NetworkComponent>
entities
&Entities
packet
P
neq
Option<Entity>