diff --git a/Unity-Technologies-networking/Runtime/LocalConnections.cs b/Unity-Technologies-networking/Runtime/LocalConnections.cs index 08efd05e5..c4f3efb8b 100644 --- a/Unity-Technologies-networking/Runtime/LocalConnections.cs +++ b/Unity-Technologies-networking/Runtime/LocalConnections.cs @@ -5,8 +5,7 @@ namespace UnityEngine.Networking { // a server's connection TO a LocalClient. - // sending messages on this connection causes the client's - // handler function to be invoked directly + // sending messages on this connection causes the client's handler function to be invoked directly class ULocalConnectionToClient : NetworkConnection { LocalClient m_LocalClient; @@ -19,14 +18,6 @@ public ULocalConnectionToClient(LocalClient localClient) m_LocalClient = localClient; } - public override bool SendByChannel(short msgType, MessageBase msg, int channelId) - { - m_LocalClient.InvokeHandlerOnClient(msgType, msg, channelId); - return true; - } - public override bool Send(short msgType, MessageBase msg) { return SendByChannel(msgType, msg, Channels.DefaultReliable); } - public override bool SendUnreliable(short msgType, MessageBase msg) { return SendByChannel(msgType, msg, Channels.DefaultUnreliable); } - protected override bool SendBytes(byte[] bytes, int channelId) { m_LocalClient.InvokeBytesOnClient(bytes, channelId); @@ -35,9 +26,7 @@ protected override bool SendBytes(byte[] bytes, int channelId) } // a localClient's connection TO a server. - // send messages on this connection causes the server's - // handler function to be invoked directly. - + // send messages on this connection causes the server's handler function to be invoked directly. internal class ULocalConnectionToServer : NetworkConnection { public ULocalConnectionToServer() @@ -45,13 +34,6 @@ public ULocalConnectionToServer() address = "localServer"; } - public override bool SendByChannel(short msgType, MessageBase msg, int channelId) - { - return NetworkServer.InvokeHandlerOnServer(this, msgType, msg, channelId); - } - public override bool Send(short msgType, MessageBase msg) { return SendByChannel(msgType, msg, Channels.DefaultReliable); } - public override bool SendUnreliable(short msgType, MessageBase msg) { return SendByChannel(msgType, msg, Channels.DefaultUnreliable); } - protected override bool SendBytes(byte[] bytes, int channelId) { if (bytes.Length == 0) diff --git a/Unity-Technologies-networking/Runtime/NetworkServer.cs b/Unity-Technologies-networking/Runtime/NetworkServer.cs index fd74ae47c..1251788cf 100644 --- a/Unity-Technologies-networking/Runtime/NetworkServer.cs +++ b/Unity-Technologies-networking/Runtime/NetworkServer.cs @@ -1393,26 +1393,6 @@ static internal bool InvokeBytes(ULocalConnectionToServer conn, byte[] buffer, i return false; } - // invoked for local clients - static internal bool InvokeHandlerOnServer(ULocalConnectionToServer conn, short msgType, MessageBase msg, int channelId) - { - if (handlers.ContainsKey(msgType) && s_LocalConnection != null) - { - // write the message to a local buffer - NetworkWriter writer = new NetworkWriter(); - msg.Serialize(writer); - - // pass a reader (attached to local buffer) to handler - NetworkReader reader = new NetworkReader(writer.ToArray()); - - // this must be invoked with the connection to the client, not the client's connection to the server - s_LocalConnection.InvokeHandler(msgType, reader, channelId); - return true; - } - if (LogFilter.logError) { Debug.LogError("Local invoke: Failed to find local connection to invoke handler on [connectionId=" + conn.connectionId + "] for MsgId:" + msgType); } - return false; - } - static public GameObject FindLocalObject(NetworkInstanceId netId) { return s_NetworkScene.FindLocalObject(netId);