diff --git a/Assets/Scripts/Net/Instances/Server.cs b/Assets/Scripts/Net/Instances/Server.cs index 6a0b004..9614c22 100644 --- a/Assets/Scripts/Net/Instances/Server.cs +++ b/Assets/Scripts/Net/Instances/Server.cs @@ -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); } }