Add except field for Send(un)reliable to all
This commit is contained in:
parent
8a4b5f858c
commit
f313f8aaf4
@ -67,7 +67,7 @@ namespace NeonTea.Quakeball.Net.Instances {
|
||||
spawn = new SpawnPckt();
|
||||
spawn.PlayerId = conn.uid;
|
||||
spawn.Location = obj.transform.position;
|
||||
SendReliableToAll(spawn);
|
||||
SendReliableToAll(spawn, except: spawn.PlayerId);
|
||||
}
|
||||
} else if (packet is PlayerUpdatePckt) {
|
||||
PlayerUpdatePckt updatePckt = (PlayerUpdatePckt)packet;
|
||||
@ -78,14 +78,20 @@ namespace NeonTea.Quakeball.Net.Instances {
|
||||
}
|
||||
}
|
||||
|
||||
public void SendReliableToAll(Packet packet) {
|
||||
public void SendReliableToAll(Packet packet, ulong except = ulong.MaxValue) {
|
||||
foreach (NetPlayer p in Players.Values) {
|
||||
if (p.Id == ulong.MaxValue || p.Id == except) {
|
||||
continue;
|
||||
}
|
||||
Peer.SendReliable(p.Id, packet);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendUnreliableToAll(Packet packet) {
|
||||
public void SendUnreliableToAll(Packet packet, ulong except = ulong.MaxValue) {
|
||||
foreach (NetPlayer p in Players.Values) {
|
||||
if (p.Id == ulong.MaxValue || p.Id == except) {
|
||||
continue;
|
||||
}
|
||||
Peer.SendUnreliable(p.Id, packet);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user