From 56278f5a842434b84822e252d4c74cc50439134d Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 19 Jul 2018 11:31:26 +0200 Subject: [PATCH] Removed ConnectionArray class because it wasn't used anywhere. --- .../UnityEngine.Networking-Editor.csproj | 1 - .../Runtime/ConnectionArray.cs | 117 ------------------ .../Runtime/UnityEngine.Networking.csproj | 1 - 3 files changed, 119 deletions(-) delete mode 100644 Unity-Technologies-networking/Runtime/ConnectionArray.cs diff --git a/Unity-Technologies-networking/Runtime-Editor/UnityEngine.Networking-Editor.csproj b/Unity-Technologies-networking/Runtime-Editor/UnityEngine.Networking-Editor.csproj index 6e673d4c1..5cd9ff424 100644 --- a/Unity-Technologies-networking/Runtime-Editor/UnityEngine.Networking-Editor.csproj +++ b/Unity-Technologies-networking/Runtime-Editor/UnityEngine.Networking-Editor.csproj @@ -41,7 +41,6 @@ - diff --git a/Unity-Technologies-networking/Runtime/ConnectionArray.cs b/Unity-Technologies-networking/Runtime/ConnectionArray.cs deleted file mode 100644 index 4c530c131..000000000 --- a/Unity-Technologies-networking/Runtime/ConnectionArray.cs +++ /dev/null @@ -1,117 +0,0 @@ -#if ENABLE_UNET -using System; -using System.Collections.Generic; -using System.Linq; - -namespace UnityEngine.Networking -{ - // This has a list of real connections - // The local or "fake" connections are kept separate because sometimes you - // only want to iterate through those, and not all connections. - class ConnectionArray - { - List m_LocalConnections; - List m_Connections; - - internal List localConnections { get { return m_LocalConnections; }} - internal List connections { get { return m_Connections; }} - - public int Count { get { return m_Connections.Count; } } - - public int LocalIndex { get { return -m_LocalConnections.Count; } } - - public ConnectionArray() - { - m_Connections = new List(); - m_LocalConnections = new List(); - } - - public int Add(int connId, NetworkConnection conn) - { - if (connId < 0) - { - if (LogFilter.logWarn) {Debug.LogWarning("ConnectionArray Add bad id " + connId); } - return -1; - } - - if (connId < m_Connections.Count && m_Connections[connId] != null) - { - if (LogFilter.logWarn) { Debug.LogWarning("ConnectionArray Add dupe at " + connId); } - return -1; - } - - while (connId > (m_Connections.Count - 1)) - { - m_Connections.Add(null); - } - - m_Connections[connId] = conn; - return connId; - } - - // call this if you know the connnection exists - public NetworkConnection Get(int connId) - { - if (connId < 0) - { - return m_LocalConnections[Mathf.Abs(connId) - 1]; - } - - if (connId >= connections.Count) - { - if (LogFilter.logWarn) { Debug.LogWarning("ConnectionArray Get invalid index " + connId); } - return null; - } - - return m_Connections[connId]; - } - - // call this if the connection may not exist (in disconnect handler) - public NetworkConnection GetUnsafe(int connId) - { - return (0 <= connId && connId < connections.Count) ? m_Connections[connId] : null; - } - - public void Remove(int connId) - { - if (connId < 0) - { - m_LocalConnections[Mathf.Abs(connId) - 1] = null; - return; - } - - if (connId >= m_Connections.Count) - { - if (LogFilter.logWarn) { Debug.LogWarning("ConnectionArray Remove invalid index " + connId); } - return; - } - m_Connections[connId] = null; - } - - public int AddLocal(NetworkConnection conn) - { - m_LocalConnections.Add(conn); - int index = -m_LocalConnections.Count; - conn.connectionId = index; - return index; - } - - public bool ContainsPlayer(GameObject player, out NetworkConnection conn) - { - conn = null; - if (player == null) - return false; - - for (int i = LocalIndex; i < m_Connections.Count; i++) - { - conn = Get(i); - if (conn != null && conn.playerControllers.Any(pc => pc.IsValid && pc.gameObject == player)) - { - return true; - } - } - return false; - } - } -} -#endif //ENABLE_UNET diff --git a/Unity-Technologies-networking/Runtime/UnityEngine.Networking.csproj b/Unity-Technologies-networking/Runtime/UnityEngine.Networking.csproj index b0b848075..481b49a7c 100644 --- a/Unity-Technologies-networking/Runtime/UnityEngine.Networking.csproj +++ b/Unity-Technologies-networking/Runtime/UnityEngine.Networking.csproj @@ -40,7 +40,6 @@ -