diff --git a/NebulaAPI/GameState/INetworkProvider.cs b/NebulaAPI/GameState/INetworkProvider.cs index 0d7d450e8..d7f06825e 100644 --- a/NebulaAPI/GameState/INetworkProvider.cs +++ b/NebulaAPI/GameState/INetworkProvider.cs @@ -26,7 +26,7 @@ public interface INetworkProvider : IDisposable /// /// /// - public void SendIfCondition(T packet, Predicate condition) where T : class, new(); + public void SendToMatching(T packet, Predicate condition) where T : class, new(); /// /// Broadcast packet to all Players within current star system diff --git a/NebulaNetwork/PacketProcessors/Routers/PlanetBroadcastProcessor.cs b/NebulaNetwork/PacketProcessors/Routers/PlanetBroadcastProcessor.cs index cb61d7401..2c6a6ab9a 100644 --- a/NebulaNetwork/PacketProcessors/Routers/PlanetBroadcastProcessor.cs +++ b/NebulaNetwork/PacketProcessors/Routers/PlanetBroadcastProcessor.cs @@ -26,7 +26,7 @@ protected override void ProcessPacket(PlanetBroadcastPacket packet, NebulaConnec { //Forward packet to other users if we're the host if (IsHost) - Multiplayer.Session.Server.SendIfCondition(packet, p => + Multiplayer.Session.Server.SendToMatching(packet, p => p.Data.LocalPlanetId == packet.PlanetId && p.Connection.Equals(conn) ); diff --git a/NebulaNetwork/PacketProcessors/Routers/StarBroadcastProcessor.cs b/NebulaNetwork/PacketProcessors/Routers/StarBroadcastProcessor.cs index 3df665daa..6d6c10305 100644 --- a/NebulaNetwork/PacketProcessors/Routers/StarBroadcastProcessor.cs +++ b/NebulaNetwork/PacketProcessors/Routers/StarBroadcastProcessor.cs @@ -26,7 +26,7 @@ protected override void ProcessPacket(StarBroadcastPacket packet, NebulaConnecti { //Forward packet to other users if we're the host if (IsHost) - Multiplayer.Session.Server.SendIfCondition(packet, p => + Multiplayer.Session.Server.SendToMatching(packet, p => p.Data.LocalStarId == packet.StarId && p.Connection.Equals(conn) ); diff --git a/NebulaNetwork/Server.cs b/NebulaNetwork/Server.cs index 99e2a3b4f..3233240e2 100644 --- a/NebulaNetwork/Server.cs +++ b/NebulaNetwork/Server.cs @@ -375,7 +375,7 @@ public void Dispose() /// /// /// - public void SendIfCondition(T packet, Predicate condition) + public void SendToMatching(T packet, Predicate condition) where T : class, new() { var players = Players @@ -386,7 +386,7 @@ public void SendIfCondition(T packet, Predicate condition) public void SendPacketToStar(T packet, int starId) where T : class, new() { - SendIfCondition(packet, p => p.Data.LocalStarId == starId); + SendToMatching(packet, p => p.Data.LocalStarId == starId); } public void SendPacketToLocalStar(T packet) where T : class, new() @@ -397,7 +397,7 @@ public void SendIfCondition(T packet, Predicate condition) public void SendPacketToPlanet(T packet, int planetId) where T : class, new() { - SendIfCondition(packet, p => p.Data.LocalPlanetId == planetId); + SendToMatching(packet, p => p.Data.LocalPlanetId == planetId); } public void SendPacketToLocalPlanet(T packet) where T : class, new() @@ -409,12 +409,12 @@ public void SendIfCondition(T packet, Predicate condition) public void SendPacketExclude(T packet, INebulaConnection exclude) where T : class, new() { - SendIfCondition(packet, p => !p.Connection.Equals(exclude)); + SendToMatching(packet, p => !p.Connection.Equals(exclude)); } public void SendPacketToStarExclude(T packet, int starId, INebulaConnection exclude) where T : class, new() { - SendIfCondition(packet, p => p.Data.LocalStarId == starId && !p.Connection.Equals(exclude)); + SendToMatching(packet, p => p.Data.LocalStarId == starId && !p.Connection.Equals(exclude)); } public void Update()