diff --git a/Unity-Technologies-networking/Editor/NetworkAnimatorEditor.cs b/Unity-Technologies-networking/Editor/NetworkAnimatorEditor.cs index 62605cb97..1ba87ed22 100644 --- a/Unity-Technologies-networking/Editor/NetworkAnimatorEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkAnimatorEditor.cs @@ -1,10 +1,10 @@ #if ENABLE_UNET using System; +using UnityEditor; using UnityEditor.Animations; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkAnimator), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkBehaviourInspector.cs b/Unity-Technologies-networking/Editor/NetworkBehaviourInspector.cs index e9eb09e79..e42a8c5b1 100644 --- a/Unity-Technologies-networking/Editor/NetworkBehaviourInspector.cs +++ b/Unity-Technologies-networking/Editor/NetworkBehaviourInspector.cs @@ -3,10 +3,10 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkBehaviour), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkIdentityEditor.cs b/Unity-Technologies-networking/Editor/NetworkIdentityEditor.cs index 053e4ac5a..1f9b64b5c 100644 --- a/Unity-Technologies-networking/Editor/NetworkIdentityEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkIdentityEditor.cs @@ -1,9 +1,9 @@ #if ENABLE_UNET using System; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkIdentity), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkInformationPreview.cs b/Unity-Technologies-networking/Editor/NetworkInformationPreview.cs index 2d4752751..014b1ac31 100644 --- a/Unity-Technologies-networking/Editor/NetworkInformationPreview.cs +++ b/Unity-Technologies-networking/Editor/NetworkInformationPreview.cs @@ -1,11 +1,11 @@ #if ENABLE_UNET using System; using System.Collections.Generic; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; using UnityObject = UnityEngine.Object; -namespace UnityEditor.Networking +namespace Mirror { [CustomPreview(typeof(GameObject))] class NetworkInformationPreview : ObjectPreview diff --git a/Unity-Technologies-networking/Editor/NetworkManagerEditor.cs b/Unity-Technologies-networking/Editor/NetworkManagerEditor.cs index d71ffe436..da404a67f 100644 --- a/Unity-Technologies-networking/Editor/NetworkManagerEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkManagerEditor.cs @@ -2,12 +2,12 @@ using System; using System.IO; using System.Reflection; +using UnityEditor; using UnityEditorInternal; using UnityEngine; -using UnityEngine.Networking; using UnityObject = UnityEngine.Object; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkManager), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkManagerHUDEditor.cs b/Unity-Technologies-networking/Editor/NetworkManagerHUDEditor.cs index e4b6c2a06..be8c1a370 100644 --- a/Unity-Technologies-networking/Editor/NetworkManagerHUDEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkManagerHUDEditor.cs @@ -1,11 +1,11 @@ #if ENABLE_UNET using System; using System.Collections.Generic; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; using UnityObject = UnityEngine.Object; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkManagerHUD), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkManagerPreview.cs b/Unity-Technologies-networking/Editor/NetworkManagerPreview.cs index 9bb825df9..9eb691f2b 100644 --- a/Unity-Technologies-networking/Editor/NetworkManagerPreview.cs +++ b/Unity-Technologies-networking/Editor/NetworkManagerPreview.cs @@ -1,11 +1,11 @@ #if ENABLE_UNET using System; using System.Collections.Generic; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; using UnityObject = UnityEngine.Object; -namespace UnityEditor.Networking +namespace Mirror { [CustomPreview(typeof(NetworkManager))] class NetworkManagerPreview : ObjectPreview diff --git a/Unity-Technologies-networking/Editor/NetworkScenePostProcess.cs b/Unity-Technologies-networking/Editor/NetworkScenePostProcess.cs index 4ca8ee8f1..364048d76 100644 --- a/Unity-Technologies-networking/Editor/NetworkScenePostProcess.cs +++ b/Unity-Technologies-networking/Editor/NetworkScenePostProcess.cs @@ -2,11 +2,11 @@ using System.Text; using System.Collections.Generic; using System.Linq; +using UnityEditor; using UnityEditor.Callbacks; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { public class NetworkScenePostProcess : MonoBehaviour { diff --git a/Unity-Technologies-networking/Editor/NetworkTransformChildEditor.cs b/Unity-Technologies-networking/Editor/NetworkTransformChildEditor.cs index 8d7ff4e60..e66ae3c0b 100644 --- a/Unity-Technologies-networking/Editor/NetworkTransformChildEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkTransformChildEditor.cs @@ -2,10 +2,8 @@ using UnityEditor; using UnityEngine; using System.Collections; -using UnityEngine.Networking; - -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkTransformChild), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkTransformEditor.cs b/Unity-Technologies-networking/Editor/NetworkTransformEditor.cs index 8a0bd12ce..a3e1bbcd8 100644 --- a/Unity-Technologies-networking/Editor/NetworkTransformEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkTransformEditor.cs @@ -1,9 +1,9 @@ #if ENABLE_UNET using System; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkTransform), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Editor/NetworkTransformPreview.cs b/Unity-Technologies-networking/Editor/NetworkTransformPreview.cs index f5f58698b..42bd31cea 100644 --- a/Unity-Technologies-networking/Editor/NetworkTransformPreview.cs +++ b/Unity-Technologies-networking/Editor/NetworkTransformPreview.cs @@ -1,10 +1,10 @@ #if ENABLE_UNET using System; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; using UnityObject = UnityEngine.Object; -namespace UnityEditor.Networking +namespace Mirror { [CustomPreview(typeof(GameObject))] class NetworkTransformPreview : ObjectPreview diff --git a/Unity-Technologies-networking/Editor/NetworkTransformVisualizerEditor.cs b/Unity-Technologies-networking/Editor/NetworkTransformVisualizerEditor.cs index 3752d4aec..409b65aa0 100644 --- a/Unity-Technologies-networking/Editor/NetworkTransformVisualizerEditor.cs +++ b/Unity-Technologies-networking/Editor/NetworkTransformVisualizerEditor.cs @@ -2,10 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using UnityEditor; using UnityEngine; -using UnityEngine.Networking; -namespace UnityEditor +namespace Mirror { [CustomEditor(typeof(NetworkTransformVisualizer), true)] [CanEditMultipleObjects] diff --git a/Unity-Technologies-networking/Runtime/ClientScene.cs b/Unity-Technologies-networking/Runtime/ClientScene.cs index 7fcd5c147..a6fa6baee 100644 --- a/Unity-Technologies-networking/Runtime/ClientScene.cs +++ b/Unity-Technologies-networking/Runtime/ClientScene.cs @@ -1,9 +1,8 @@ #if ENABLE_UNET -using System; using System.Collections.Generic; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { public class ClientScene { diff --git a/Unity-Technologies-networking/Runtime/CustomAttributes.cs b/Unity-Technologies-networking/Runtime/CustomAttributes.cs index ba299cdf7..b0dd83cd0 100644 --- a/Unity-Technologies-networking/Runtime/CustomAttributes.cs +++ b/Unity-Technologies-networking/Runtime/CustomAttributes.cs @@ -1,8 +1,9 @@ using System; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { [AttributeUsage(AttributeTargets.Class)] public class NetworkSettingsAttribute : Attribute diff --git a/Unity-Technologies-networking/Runtime/DotNetCompatibility.cs b/Unity-Technologies-networking/Runtime/DotNetCompatibility.cs index a4bc887da..91836d615 100644 --- a/Unity-Technologies-networking/Runtime/DotNetCompatibility.cs +++ b/Unity-Technologies-networking/Runtime/DotNetCompatibility.cs @@ -2,8 +2,9 @@ using System.Collections.Generic; using System.Reflection; using System.Net.Sockets; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { internal static class DotNetCompatibility { diff --git a/Unity-Technologies-networking/Runtime/LocalClient.cs b/Unity-Technologies-networking/Runtime/LocalClient.cs index 4feb4af7c..38d0c9fec 100644 --- a/Unity-Technologies-networking/Runtime/LocalClient.cs +++ b/Unity-Technologies-networking/Runtime/LocalClient.cs @@ -1,8 +1,9 @@ #if ENABLE_UNET using System; using System.Collections.Generic; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { sealed class LocalClient : NetworkClient { diff --git a/Unity-Technologies-networking/Runtime/LocalConnections.cs b/Unity-Technologies-networking/Runtime/LocalConnections.cs index abd214a92..e73056d44 100644 --- a/Unity-Technologies-networking/Runtime/LocalConnections.cs +++ b/Unity-Technologies-networking/Runtime/LocalConnections.cs @@ -1,8 +1,9 @@ using System; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { // a server's connection TO a LocalClient. // sending messages on this connection causes the client's handler function to be invoked directly diff --git a/Unity-Technologies-networking/Runtime/LogFilter.cs b/Unity-Technologies-networking/Runtime/LogFilter.cs index b92630ef0..430d9cc11 100644 --- a/Unity-Technologies-networking/Runtime/LogFilter.cs +++ b/Unity-Technologies-networking/Runtime/LogFilter.cs @@ -1,7 +1,8 @@ using System; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { public class LogFilter { diff --git a/Unity-Technologies-networking/Runtime/Messages.cs b/Unity-Technologies-networking/Runtime/Messages.cs index b009283ef..4d18f3d8f 100644 --- a/Unity-Technologies-networking/Runtime/Messages.cs +++ b/Unity-Technologies-networking/Runtime/Messages.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { // This can't be an interface because users don't need to implement the // serialization functions, we'll code generate it for them when they omit it. @@ -15,12 +16,9 @@ public virtual void Deserialize(NetworkReader reader) {} // Serialize the contents of this message into the writer public virtual void Serialize(NetworkWriter writer) {} } -} - -namespace UnityEngine.Networking.NetworkSystem -{ + // ---------- General Typed Messages ------------------- - + public class StringMessage : MessageBase { public string value; diff --git a/Unity-Technologies-networking/Runtime/NetworkAnimator.cs b/Unity-Technologies-networking/Runtime/NetworkAnimator.cs index 347023780..395d5c076 100644 --- a/Unity-Technologies-networking/Runtime/NetworkAnimator.cs +++ b/Unity-Technologies-networking/Runtime/NetworkAnimator.cs @@ -1,9 +1,8 @@ #if ENABLE_UNET using System; using UnityEngine; -using UnityEngine.Networking.NetworkSystem; -namespace UnityEngine.Networking +namespace Mirror { [DisallowMultipleComponent] [AddComponentMenu("Network/NetworkAnimator")] diff --git a/Unity-Technologies-networking/Runtime/NetworkBehaviour.cs b/Unity-Technologies-networking/Runtime/NetworkBehaviour.cs index fe780afae..42c3cb3f2 100644 --- a/Unity-Technologies-networking/Runtime/NetworkBehaviour.cs +++ b/Unity-Technologies-networking/Runtime/NetworkBehaviour.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [RequireComponent(typeof(NetworkIdentity))] [AddComponentMenu("")] diff --git a/Unity-Technologies-networking/Runtime/NetworkClient.cs b/Unity-Technologies-networking/Runtime/NetworkClient.cs index bdfcf7fad..5ddbfcc94 100644 --- a/Unity-Technologies-networking/Runtime/NetworkClient.cs +++ b/Unity-Technologies-networking/Runtime/NetworkClient.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Net; using System.Net.Sockets; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { public class NetworkClient { @@ -213,6 +213,7 @@ void GenerateConnectError(byte error) GenerateError(error); } + /* TODO use or remove void GenerateDataError(byte error) { NetworkError dataError = (NetworkError)error; @@ -226,6 +227,7 @@ void GenerateDisconnectError(byte error) if (LogFilter.logError) { Debug.LogError("UNet Client Disconnect Error: " + disconnectError); } GenerateError(error); } + */ void GenerateError(byte error) { diff --git a/Unity-Technologies-networking/Runtime/NetworkConnection.cs b/Unity-Technologies-networking/Runtime/NetworkConnection.cs index e6cd6c8ef..833e68197 100644 --- a/Unity-Technologies-networking/Runtime/NetworkConnection.cs +++ b/Unity-Technologies-networking/Runtime/NetworkConnection.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.Text; using System.Linq; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { /* * wire protocol is a list of : size | msgType | payload @@ -20,8 +21,6 @@ public class NetworkConnection : IDisposable HashSet m_ClientOwnedObjects; - private NetworkError error; - public int hostId = -1; public int connectionId = -1; public bool isReady; @@ -32,8 +31,6 @@ public class NetworkConnection : IDisposable public bool logNetworkMessages = false; public bool isConnected { get { return hostId != -1; }} - public NetworkError lastError { get { return error; } internal set { error = value; } } - public virtual void Initialize(string networkAddress, int networkHostId, int networkConnectionId) { address = networkAddress; diff --git a/Unity-Technologies-networking/Runtime/NetworkHash128.cs b/Unity-Technologies-networking/Runtime/NetworkHash128.cs index bcc76ddf9..7ff90d7b7 100644 --- a/Unity-Technologies-networking/Runtime/NetworkHash128.cs +++ b/Unity-Technologies-networking/Runtime/NetworkHash128.cs @@ -1,7 +1,8 @@ #if ENABLE_UNET using System; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { // vis2k: NetworkHash128 explanation // -> AssetDatabase.AssetPathToGUID returns a 32 length hex string diff --git a/Unity-Technologies-networking/Runtime/NetworkIdentity.cs b/Unity-Technologies-networking/Runtime/NetworkIdentity.cs index 31bc53178..aa4a8daf9 100644 --- a/Unity-Technologies-networking/Runtime/NetworkIdentity.cs +++ b/Unity-Technologies-networking/Runtime/NetworkIdentity.cs @@ -3,13 +3,13 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif -namespace UnityEngine.Networking +namespace Mirror { [ExecuteInEditMode] [DisallowMultipleComponent] diff --git a/Unity-Technologies-networking/Runtime/NetworkInstanceId.cs b/Unity-Technologies-networking/Runtime/NetworkInstanceId.cs index 8b23774b0..340c1a6a3 100644 --- a/Unity-Technologies-networking/Runtime/NetworkInstanceId.cs +++ b/Unity-Technologies-networking/Runtime/NetworkInstanceId.cs @@ -1,7 +1,8 @@ #if ENABLE_UNET using System; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [Serializable] public struct NetworkInstanceId diff --git a/Unity-Technologies-networking/Runtime/NetworkManager.cs b/Unity-Technologies-networking/Runtime/NetworkManager.cs index 44183a16a..f99523c4d 100644 --- a/Unity-Technologies-networking/Runtime/NetworkManager.cs +++ b/Unity-Technologies-networking/Runtime/NetworkManager.cs @@ -1,13 +1,11 @@ #if ENABLE_UNET -using System; using System.Collections.Generic; using System.Net; using System.Linq; -using UnityEngine.Networking.NetworkSystem; -using UnityEngine.Networking.Types; +using UnityEngine; using UnityEngine.SceneManagement; -namespace UnityEngine.Networking +namespace Mirror { public enum PlayerSpawnMethod { @@ -25,10 +23,6 @@ public class NetworkManager : MonoBehaviour [SerializeField] string m_NetworkAddress = "localhost"; [SerializeField] bool m_DontDestroyOnLoad = true; [SerializeField] bool m_RunInBackground = true; - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - [SerializeField] bool m_ScriptCRCCheck = true; - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - [SerializeField] float m_MaxDelay = 0.01f; [SerializeField] LogFilter.FilterLevel m_LogLevel = LogFilter.FilterLevel.Info; [SerializeField] GameObject m_PlayerPrefab; [SerializeField] bool m_AutoCreatePlayer = true; @@ -41,13 +35,6 @@ public class NetworkManager : MonoBehaviour [SerializeField] bool m_UseWebSockets; - #pragma warning disable 0169 - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - [SerializeField] int m_MaxBufferedPackets; - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - [SerializeField] bool m_AllowFragmentation; - #pragma warning restore 0169 - bool m_ClientLoadedScene; // properties @@ -57,11 +44,6 @@ public class NetworkManager : MonoBehaviour public string networkAddress { get { return m_NetworkAddress; } set { m_NetworkAddress = value; } } public bool dontDestroyOnLoad { get { return m_DontDestroyOnLoad; } set { m_DontDestroyOnLoad = value; } } public bool runInBackground { get { return m_RunInBackground; } set { m_RunInBackground = value; } } - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - public bool scriptCRCCheck { get { return m_ScriptCRCCheck; } set { m_ScriptCRCCheck = value; }} - - [Obsolete("Not used anymore, kept to preserve original HLAPI serialization")] - public float maxDelay { get { return m_MaxDelay; } set { m_MaxDelay = value; } } public LogFilter.FilterLevel logLevel { get { return m_LogLevel; } set { m_LogLevel = value; LogFilter.currentLogLevel = value; } } public GameObject playerPrefab { get { return m_PlayerPrefab; } set { m_PlayerPrefab = value; } } public bool autoCreatePlayer { get { return m_AutoCreatePlayer; } set { m_AutoCreatePlayer = value; } } @@ -721,16 +703,8 @@ public virtual void OnServerDisconnect(NetworkConnection conn) { NetworkServer.DestroyPlayersForConnection(conn); - // note: timeouts happen all the time, no need to throw an error there. - if (conn.lastError == NetworkError.Ok || conn.lastError == NetworkError.Timeout) - { - if (LogFilter.logDebug) { Debug.Log("OnServerDisconnect: client disconnected:" + conn); } - } - else - { - // a client disconnected, let's show a message - if (LogFilter.logError) { Debug.LogError("OnServerDisconnect: Client disconnected with error: " + conn.lastError); } - } + // a client disconnected, let's show a message + if (LogFilter.logError) { Debug.LogError("OnServerDisconnect: Client disconnected."); } } public virtual void OnServerReady(NetworkConnection conn) @@ -846,10 +820,6 @@ public virtual void OnClientConnect(NetworkConnection conn) public virtual void OnClientDisconnect(NetworkConnection conn) { StopClient(); - if (conn.lastError != NetworkError.Ok) - { - if (LogFilter.logError) { Debug.LogError("ClientDisconnected due to error: " + conn.lastError); } - } } public virtual void OnClientError(NetworkConnection conn, int errorCode) diff --git a/Unity-Technologies-networking/Runtime/NetworkManagerHUD.cs b/Unity-Technologies-networking/Runtime/NetworkManagerHUD.cs index ec1f66b7b..39a907edb 100644 --- a/Unity-Technologies-networking/Runtime/NetworkManagerHUD.cs +++ b/Unity-Technologies-networking/Runtime/NetworkManagerHUD.cs @@ -2,10 +2,11 @@ // confusion if someone accidentally presses one. using System; using System.ComponentModel; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { [AddComponentMenu("Network/NetworkManagerHUD")] [RequireComponent(typeof(NetworkManager))] diff --git a/Unity-Technologies-networking/Runtime/NetworkProximityChecker.cs b/Unity-Technologies-networking/Runtime/NetworkProximityChecker.cs index 8448e96ec..353bd9178 100644 --- a/Unity-Technologies-networking/Runtime/NetworkProximityChecker.cs +++ b/Unity-Technologies-networking/Runtime/NetworkProximityChecker.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [AddComponentMenu("Network/NetworkProximityChecker")] [RequireComponent(typeof(NetworkIdentity))] diff --git a/Unity-Technologies-networking/Runtime/NetworkReader.cs b/Unity-Technologies-networking/Runtime/NetworkReader.cs index a34acae91..be43b608e 100644 --- a/Unity-Technologies-networking/Runtime/NetworkReader.cs +++ b/Unity-Technologies-networking/Runtime/NetworkReader.cs @@ -1,8 +1,9 @@ #if ENABLE_UNET using System; using System.IO; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { public class NetworkReader { diff --git a/Unity-Technologies-networking/Runtime/NetworkScene.cs b/Unity-Technologies-networking/Runtime/NetworkScene.cs index a5f5d6f1e..d4f7970fa 100644 --- a/Unity-Technologies-networking/Runtime/NetworkScene.cs +++ b/Unity-Technologies-networking/Runtime/NetworkScene.cs @@ -1,8 +1,8 @@ #if ENABLE_UNET -using System; using System.Collections.Generic; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { // This is an internal class to allow the client and server to share scene-related functionality. // This code (mostly) used to be in ClientScene. diff --git a/Unity-Technologies-networking/Runtime/NetworkSceneId.cs b/Unity-Technologies-networking/Runtime/NetworkSceneId.cs index 5ddc1d3a2..402cd737a 100644 --- a/Unity-Technologies-networking/Runtime/NetworkSceneId.cs +++ b/Unity-Technologies-networking/Runtime/NetworkSceneId.cs @@ -1,7 +1,8 @@ #if ENABLE_UNET using System; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [Serializable] public struct NetworkSceneId diff --git a/Unity-Technologies-networking/Runtime/NetworkServer.cs b/Unity-Technologies-networking/Runtime/NetworkServer.cs index a1f497ff1..093f296aa 100644 --- a/Unity-Technologies-networking/Runtime/NetworkServer.cs +++ b/Unity-Technologies-networking/Runtime/NetworkServer.cs @@ -3,10 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using UnityEngine.Networking.NetworkSystem; -using UnityEngine.Networking.Types; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { public sealed class NetworkServer { @@ -407,7 +406,6 @@ static void HandleConnect(int connectionId, byte error) NetworkConnection conn = (NetworkConnection)Activator.CreateInstance(s_NetworkConnectionClass); conn.SetHandlers(s_MessageHandlers); conn.Initialize(address, s_ServerHostId, connectionId); - conn.lastError = (NetworkError)0; // add connection at correct index while (s_Connections.Count <= connectionId) @@ -434,17 +432,6 @@ static void HandleDisconnect(int connectionId, byte error) { return; } - conn.lastError = (NetworkError)error; - - if (error != 0) - { - if ((NetworkError)error != NetworkError.Timeout) - { - s_Connections[connectionId] = null; - if (LogFilter.logError) { Debug.LogError("Server client disconnect error, connectionId: " + connectionId + " error: " + (NetworkError)error); } - return; - } - } conn.Disconnect(); s_Connections[connectionId] = null; @@ -484,13 +471,6 @@ static void HandleData(int connectionId, byte[] data, byte error) if (LogFilter.logError) { Debug.LogError("HandleData Unknown connectionId:" + connectionId); } return; } - conn.lastError = (NetworkError)error; - - if (error != 0) - { - GenerateDataError(conn, error); - return; - } OnData(conn, data); } @@ -506,6 +486,7 @@ static void GenerateConnectError(byte error) GenerateError(null, error); } + /* TODO use or remove static void GenerateDataError(NetworkConnection conn, byte error) { NetworkError dataError = (NetworkError)error; @@ -519,6 +500,7 @@ static void GenerateDisconnectError(NetworkConnection conn, byte error) if (LogFilter.logError) { Debug.LogError("UNet Server Disconnect Error: " + disconnectError + " conn:[" + conn + "]:" + conn.connectionId); } GenerateError(conn, error); } + */ static void GenerateError(NetworkConnection conn, byte error) { @@ -1175,7 +1157,7 @@ static void DestroyObject(NetworkIdentity uv, bool destroyServerObject) // when unspawning, dont destroy the server's object if (destroyServerObject) { - Object.Destroy(uv.gameObject); + UnityEngine.Object.Destroy(uv.gameObject); } uv.MarkForReset(); } diff --git a/Unity-Technologies-networking/Runtime/NetworkStartPosition.cs b/Unity-Technologies-networking/Runtime/NetworkStartPosition.cs index 98af0591a..c61b4d7f9 100644 --- a/Unity-Technologies-networking/Runtime/NetworkStartPosition.cs +++ b/Unity-Technologies-networking/Runtime/NetworkStartPosition.cs @@ -2,7 +2,7 @@ using System; using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [DisallowMultipleComponent] [AddComponentMenu("Network/NetworkStartPosition")] diff --git a/Unity-Technologies-networking/Runtime/NetworkTranformChild.cs b/Unity-Technologies-networking/Runtime/NetworkTranformChild.cs index de7e1ded3..ff40f50e8 100644 --- a/Unity-Technologies-networking/Runtime/NetworkTranformChild.cs +++ b/Unity-Technologies-networking/Runtime/NetworkTranformChild.cs @@ -1,9 +1,9 @@ #if ENABLE_UNET using System; using UnityEngine; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [AddComponentMenu("Network/NetworkTransformChild")] public class NetworkTransformChild : NetworkBehaviour diff --git a/Unity-Technologies-networking/Runtime/NetworkTransform.cs b/Unity-Technologies-networking/Runtime/NetworkTransform.cs index d8ab355ae..1a0273b1c 100644 --- a/Unity-Technologies-networking/Runtime/NetworkTransform.cs +++ b/Unity-Technologies-networking/Runtime/NetworkTransform.cs @@ -1,9 +1,8 @@ #if ENABLE_UNET using System; using UnityEngine; -using UnityEngine.Networking.NetworkSystem; -namespace UnityEngine.Networking +namespace Mirror { [DisallowMultipleComponent] [AddComponentMenu("Network/NetworkTransform")] diff --git a/Unity-Technologies-networking/Runtime/NetworkTransformVisualizer.cs b/Unity-Technologies-networking/Runtime/NetworkTransformVisualizer.cs index a197a6518..f5274b309 100644 --- a/Unity-Technologies-networking/Runtime/NetworkTransformVisualizer.cs +++ b/Unity-Technologies-networking/Runtime/NetworkTransformVisualizer.cs @@ -3,7 +3,7 @@ using System.ComponentModel; using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { [DisallowMultipleComponent] [AddComponentMenu("Network/NetworkTransformVisualizer")] diff --git a/Unity-Technologies-networking/Runtime/NetworkWriter.cs b/Unity-Technologies-networking/Runtime/NetworkWriter.cs index 8cccc3015..ec955e48d 100644 --- a/Unity-Technologies-networking/Runtime/NetworkWriter.cs +++ b/Unity-Technologies-networking/Runtime/NetworkWriter.cs @@ -1,8 +1,9 @@ #if ENABLE_UNET using System; using System.IO; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { // Binary stream Writer. Supports simple types, buffers, arrays, structs, and nested types public class NetworkWriter diff --git a/Unity-Technologies-networking/Runtime/PlayerController.cs b/Unity-Technologies-networking/Runtime/PlayerController.cs index dfe91cd39..9d9733c47 100644 --- a/Unity-Technologies-networking/Runtime/PlayerController.cs +++ b/Unity-Technologies-networking/Runtime/PlayerController.cs @@ -1,7 +1,8 @@ using System; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { // This class represents the player entity in a network game, there can be multiple players per client // when there are multiple people playing on one machine diff --git a/Unity-Technologies-networking/Runtime/SyncList.cs b/Unity-Technologies-networking/Runtime/SyncList.cs index a8fde613a..82547b9f3 100644 --- a/Unity-Technologies-networking/Runtime/SyncList.cs +++ b/Unity-Technologies-networking/Runtime/SyncList.cs @@ -3,9 +3,9 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using UnityEngine.Networking.NetworkSystem; +using UnityEngine; -namespace UnityEngine.Networking +namespace Mirror { public sealed class SyncListString : SyncList { diff --git a/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs b/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs index 483099d31..4a33f42bf 100644 --- a/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs +++ b/Unity-Technologies-networking/Runtime/Transport/LLAPITransport.cs @@ -1,8 +1,10 @@ // wraps UNET's LLAPI for use as HLAPI TransportLayer using System; +using UnityEngine; +using UnityEngine.Networking; using UnityEngine.Networking.Types; -namespace UnityEngine.Networking +namespace Mirror { public class LLAPITransport : TransportLayer { diff --git a/Unity-Technologies-networking/Runtime/Transport/TelepathyTransport.cs b/Unity-Technologies-networking/Runtime/Transport/TelepathyTransport.cs index 8920e816c..632c3f51d 100644 --- a/Unity-Technologies-networking/Runtime/Transport/TelepathyTransport.cs +++ b/Unity-Technologies-networking/Runtime/Transport/TelepathyTransport.cs @@ -1,5 +1,6 @@ // wraps Telepathy for use as HLAPI TransportLayer -namespace UnityEngine.Networking +using UnityEngine; +namespace Mirror { public class TelepathyTransport : TransportLayer { diff --git a/Unity-Technologies-networking/Runtime/Transport/TelepathyWebsocketsMultiplexTransport.cs b/Unity-Technologies-networking/Runtime/Transport/TelepathyWebsocketsMultiplexTransport.cs index 50454f2b4..6e75e396a 100644 --- a/Unity-Technologies-networking/Runtime/Transport/TelepathyWebsocketsMultiplexTransport.cs +++ b/Unity-Technologies-networking/Runtime/Transport/TelepathyWebsocketsMultiplexTransport.cs @@ -1,7 +1,8 @@ // multiplex transport that uses either: // * Telepathy for standalone (windows/mac/linux/mobile/etc.) // * UNET's LLAPI for websockets -namespace UnityEngine.Networking +using UnityEngine; +namespace Mirror { public class TelepathyWebsocketsMultiplexTransport : TransportLayer { diff --git a/Unity-Technologies-networking/Runtime/Transport/Transport.cs b/Unity-Technologies-networking/Runtime/Transport/Transport.cs index 9c737fc26..a221dff1f 100644 --- a/Unity-Technologies-networking/Runtime/Transport/Transport.cs +++ b/Unity-Technologies-networking/Runtime/Transport/Transport.cs @@ -1,7 +1,7 @@ // transport layer backend // - set to telepathy by default // - can be changed by assigning Transport.layer to whatever you want -namespace UnityEngine.Networking +namespace Mirror { // Transport class used by HLAPI /////////////////////////////////////////// public static class Transport diff --git a/Unity-Technologies-networking/Runtime/UNetwork.cs b/Unity-Technologies-networking/Runtime/UNetwork.cs index a5090b423..50b18c220 100644 --- a/Unity-Technologies-networking/Runtime/UNetwork.cs +++ b/Unity-Technologies-networking/Runtime/UNetwork.cs @@ -1,8 +1,9 @@ using System; +using UnityEngine; #if ENABLE_UNET -namespace UnityEngine.Networking +namespace Mirror { // Handles network messages on client and server public delegate void NetworkMessageDelegate(NetworkMessage netMsg); diff --git a/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkHash128Test.cs b/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkHash128Test.cs index 8c3228684..099a1ea10 100644 --- a/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkHash128Test.cs +++ b/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkHash128Test.cs @@ -2,7 +2,7 @@ using System; using UnityEngine; -namespace UnityEngine.Networking.Tests +namespace Mirror.Tests { [TestFixture] public class NetworkHash128Test diff --git a/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkWriterTest.cs b/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkWriterTest.cs index 8b251df2e..36acc27f5 100644 --- a/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkWriterTest.cs +++ b/Unity-Technologies-networking/UnityEngine.Networking.Tests/NetworkWriterTest.cs @@ -2,7 +2,7 @@ using System; using UnityEngine; -namespace UnityEngine.Networking.Tests +namespace Mirror.Tests { [TestFixture] public class NetworkWriterTest diff --git a/Unity-Technologies-networking/Weaver/AssemblyInfo.cs b/Unity-Technologies-networking/Weaver/AssemblyInfo.cs index 15a550557..ef084db17 100644 --- a/Unity-Technologies-networking/Weaver/AssemblyInfo.cs +++ b/Unity-Technologies-networking/Weaver/AssemblyInfo.cs @@ -5,12 +5,12 @@ // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. -[assembly: AssemblyTitle("Unity.UNetWeaver")] -[assembly: AssemblyDescription("UNET assembly post processor for code generation.")] +[assembly: AssemblyTitle("Mirror.Weaver")] +[assembly: AssemblyDescription("Mirror assembly post processor for code generation.")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Unity Technologies")] -[assembly: AssemblyProduct("Unity.UNetWeaver")] -[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyCompany("vis2k")] +[assembly: AssemblyProduct("Mirror")] +[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: InternalsVisibleTo("Assembly-CSharp-Editor-testable")] diff --git a/Unity-Technologies-networking/Weaver/Helpers.cs b/Unity-Technologies-networking/Weaver/Helpers.cs index 1f69daf0c..7a10bf564 100644 --- a/Unity-Technologies-networking/Weaver/Helpers.cs +++ b/Unity-Technologies-networking/Weaver/Helpers.cs @@ -9,7 +9,7 @@ using Mono.Cecil.Mdb; using Mono.Cecil.Pdb; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { class Helpers { diff --git a/Unity-Technologies-networking/Weaver/MessageClassProcessor.cs b/Unity-Technologies-networking/Weaver/MessageClassProcessor.cs index 38184c237..53fda2c35 100644 --- a/Unity-Technologies-networking/Weaver/MessageClassProcessor.cs +++ b/Unity-Technologies-networking/Weaver/MessageClassProcessor.cs @@ -2,7 +2,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { class MessageClassProcessor { diff --git a/Unity-Technologies-networking/Weaver/MonoBehaviourProcessor.cs b/Unity-Technologies-networking/Weaver/MonoBehaviourProcessor.cs index 76fe5ac7b..45ffee05b 100644 --- a/Unity-Technologies-networking/Weaver/MonoBehaviourProcessor.cs +++ b/Unity-Technologies-networking/Weaver/MonoBehaviourProcessor.cs @@ -2,7 +2,7 @@ using System.Linq; using Mono.Cecil; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { class MonoBehaviourProcessor { diff --git a/Unity-Technologies-networking/Weaver/Program.cs b/Unity-Technologies-networking/Weaver/Program.cs index 0291ba21a..5955bf03f 100644 --- a/Unity-Technologies-networking/Weaver/Program.cs +++ b/Unity-Technologies-networking/Weaver/Program.cs @@ -3,7 +3,7 @@ using System.IO; using Mono.Cecil; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { public static class Log { diff --git a/Unity-Technologies-networking/Weaver/SyncListStructProcessor.cs b/Unity-Technologies-networking/Weaver/SyncListStructProcessor.cs index 591b227e2..1f0f5cecb 100644 --- a/Unity-Technologies-networking/Weaver/SyncListStructProcessor.cs +++ b/Unity-Technologies-networking/Weaver/SyncListStructProcessor.cs @@ -2,7 +2,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { class SyncListStructProcessor { diff --git a/Unity-Technologies-networking/Weaver/UNetBehaviourProcessor.cs b/Unity-Technologies-networking/Weaver/UNetBehaviourProcessor.cs index 0252ec505..4773c55cb 100644 --- a/Unity-Technologies-networking/Weaver/UNetBehaviourProcessor.cs +++ b/Unity-Technologies-networking/Weaver/UNetBehaviourProcessor.cs @@ -4,7 +4,7 @@ using Mono.Cecil; using Mono.Cecil.Cil; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { class NetworkBehaviourProcessor { diff --git a/Unity-Technologies-networking/Weaver/UNetWeaver.cs b/Unity-Technologies-networking/Weaver/UNetWeaver.cs index 24923eb53..68ca1b7d8 100644 --- a/Unity-Technologies-networking/Weaver/UNetWeaver.cs +++ b/Unity-Technologies-networking/Weaver/UNetWeaver.cs @@ -8,7 +8,7 @@ using Mono.Cecil.Pdb; using Mono.Cecil.Mdb; -namespace Unity.UNetWeaver +namespace Mirror.Weaver { public enum OutSymbolsFormat {