From e6a20a5ef051246b0a09f35a88d6a79fb0d0292b Mon Sep 17 00:00:00 2001 From: vis2k Date: Sat, 28 Sep 2019 16:13:07 +0200 Subject: [PATCH] just Send --- Assets/Mirror/Runtime/LocalConnections.cs | 4 ++-- Assets/Mirror/Runtime/NetworkConnection.cs | 6 +++--- Assets/Mirror/Runtime/NetworkServer.cs | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Assets/Mirror/Runtime/LocalConnections.cs b/Assets/Mirror/Runtime/LocalConnections.cs index 33962d4d2..a92c134a6 100644 --- a/Assets/Mirror/Runtime/LocalConnections.cs +++ b/Assets/Mirror/Runtime/LocalConnections.cs @@ -13,7 +13,7 @@ public ULocalConnectionToClient() : base ("localClient") connectionId = 0; } - internal override bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable) + internal override bool Send(byte[] bytes, int channelId = Channels.DefaultReliable) { NetworkClient.localClientPacketQueue.Enqueue(bytes); return true; @@ -30,7 +30,7 @@ public ULocalConnectionToServer() : base("localServer") connectionId = 0; } - internal override bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable) + internal override bool Send(byte[] bytes, int channelId = Channels.DefaultReliable) { if (bytes.Length == 0) { diff --git a/Assets/Mirror/Runtime/NetworkConnection.cs b/Assets/Mirror/Runtime/NetworkConnection.cs index cb14c3769..abe9190a6 100644 --- a/Assets/Mirror/Runtime/NetworkConnection.cs +++ b/Assets/Mirror/Runtime/NetworkConnection.cs @@ -225,7 +225,7 @@ public virtual bool Send(int msgType, MessageBase msg, int channelId = Channels. { // pack message and send byte[] message = MessagePacker.PackMessage(msgType, msg); - return SendBytes(message, channelId); + return Send(message, channelId); } /// @@ -240,12 +240,12 @@ public virtual bool Send(T msg, int channelId = Channels.DefaultReliable) whe // pack message and send byte[] message = MessagePacker.Pack(msg); NetworkDiagnostics.OnSend(msg, channelId, message.Length, 1); - return SendBytes(message, channelId); + return Send(message, channelId); } // internal because no one except Mirror should send bytes directly to // the client. they would be detected as a message. send messages instead. - internal virtual bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable) + internal virtual bool Send(byte[] bytes, int channelId = Channels.DefaultReliable) { if (logNetworkMessages) Debug.Log("ConnectionSend con:" + connectionId + " bytes:" + BitConverter.ToString(bytes)); diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 4833f4358..1b4b7325b 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -228,7 +228,7 @@ static bool SendToObservers(NetworkIdentity identity, short msgType, MessageBase bool result = true; foreach (KeyValuePair kvp in identity.observers) { - result &= kvp.Value.SendBytes(bytes); + result &= kvp.Value.Send(bytes); } return result; } @@ -249,7 +249,7 @@ static bool SendToObservers(NetworkIdentity identity, T msg) where T: IMessag bool result = true; foreach (KeyValuePair kvp in identity.observers) { - result &= kvp.Value.SendBytes(bytes); + result &= kvp.Value.Send(bytes); } NetworkDiagnostics.OnSend(msg, Channels.DefaultReliable, bytes.Length, identity.observers.Count); return result; @@ -272,7 +272,7 @@ public static bool SendToAll(int msgType, MessageBase msg, int channelId = Chann bool result = true; foreach (KeyValuePair kvp in connections) { - result &= kvp.Value.SendBytes(bytes, channelId); + result &= kvp.Value.Send(bytes, channelId); } return result; } @@ -295,7 +295,7 @@ public static bool SendToAll(T msg, int channelId = Channels.DefaultReliable) bool result = true; foreach (KeyValuePair kvp in connections) { - result &= kvp.Value.SendBytes(bytes, channelId); + result &= kvp.Value.Send(bytes, channelId); } NetworkDiagnostics.OnSend(msg, channelId, bytes.Length, connections.Count); @@ -322,7 +322,7 @@ public static bool SendToReady(NetworkIdentity identity, short msgType, MessageB { if (kvp.Value.isReady) { - result &= kvp.Value.SendBytes(bytes, channelId); + result &= kvp.Value.Send(bytes, channelId); } } return result; @@ -357,7 +357,7 @@ public static bool SendToReady(NetworkIdentity identity, T msg, bool includeS if ((!isSelf || includeSelf) && kvp.Value.isReady) { - result &= kvp.Value.SendBytes(bytes, channelId); + result &= kvp.Value.Send(bytes, channelId); count++; } }