diff --git a/Unity-Technologies-networking/Runtime/NetworkServer.cs b/Unity-Technologies-networking/Runtime/NetworkServer.cs index 4122233d6..6805dfd3a 100644 --- a/Unity-Technologies-networking/Runtime/NetworkServer.cs +++ b/Unity-Technologies-networking/Runtime/NetworkServer.cs @@ -283,7 +283,9 @@ static bool SendToObservers(GameObject contextObj, short msgType, MessageBase ms return false; } - static public void SendWriterToReady(GameObject contextObj, NetworkWriter writer, int channelId) + // End users should not send random bytes + // because the other side might interpret them as messages + static internal void SendWriterToReady(GameObject contextObj, NetworkWriter writer, int channelId) { if (writer.Position > UInt16.MaxValue) { @@ -293,7 +295,9 @@ static public void SendWriterToReady(GameObject contextObj, NetworkWriter writer SendBytesToReady(contextObj, writer.ToArray(), writer.Position, channelId); } - static public void SendBytesToReady(GameObject contextObj, byte[] buffer, int numBytes, int channelId) + // End users should not send random bytes + // because the other side might interpret them as messages + static internal void SendBytesToReady(GameObject contextObj, byte[] buffer, int numBytes, int channelId) { if (contextObj == null) { @@ -344,25 +348,6 @@ static public void SendBytesToReady(GameObject contextObj, byte[] buffer, int nu } } - public static void SendBytesToPlayer(GameObject player, byte[] buffer, int numBytes, int channelId) - { - for (int i = 0; i < connections.Count; i++) - { - var conn = connections[i]; - if (conn != null) - { - for (int j = 0; j < conn.playerControllers.Count; j++) - { - if (conn.playerControllers[j].IsValid && conn.playerControllers[j].gameObject == player) - { - conn.SendBytes(buffer, numBytes, channelId); - break; - } - } - } - } - } - static public bool SendByChannelToAll(short msgType, MessageBase msg, int channelId) { if (LogFilter.logDev) { Debug.Log("Server.SendByChannelToAll id:" + msgType); }