diff --git a/Ragon.Common/Sources/RagonTarget.cs b/Ragon.Common/Sources/RagonTarget.cs index ced8277..f20bfa2 100644 --- a/Ragon.Common/Sources/RagonTarget.cs +++ b/Ragon.Common/Sources/RagonTarget.cs @@ -4,6 +4,7 @@ namespace Ragon.Common { Owner, ExceptOwner, + ExceptInvoker, All, } } \ No newline at end of file diff --git a/Ragon/Sources/Entity/Entity.cs b/Ragon/Sources/Entity/Entity.cs index dfaf777..b3412fd 100644 --- a/Ragon/Sources/Entity/Entity.cs +++ b/Ragon/Sources/Entity/Entity.cs @@ -81,7 +81,7 @@ public class Entity serializer.WriteData(ref payload); var sendData = serializer.ToArray(); - Send(targetMode, sendData); + RouteEvent(peerId, targetMode, sendData); } public void ReadState(uint peerId, RagonSerializer serializer) @@ -208,7 +208,7 @@ public class Entity _room.BroadcastToReady(sendData, DeliveryType.Reliable); } - void Send(RagonTarget targetMode, byte[] sendData) + void RouteEvent(ushort peerId, RagonTarget targetMode, byte[] sendData) { switch (targetMode) { @@ -222,6 +222,11 @@ public class Entity _room.BroadcastToReady(sendData, new [] { OwnerId }, DeliveryType.Reliable); break; } + case RagonTarget.ExceptInvoker: + { + _room.BroadcastToReady(sendData, new[] {peerId}, DeliveryType.Reliable); + break; + } case RagonTarget.All: { _room.BroadcastToReady(sendData, DeliveryType.Reliable);