Deprecations
Certain features of Unity Networking (UNet) were removed from Mirror or modified for various reasons. This page will identify all changed and removed features, properties, and methods, the reason for change or removal, and possible alternatives.
Match Namespace & Host Migration
As part of the Unity Services, this entire namespace was removed. It didn't work well to begin with, and was incredibly complex to be part of the core networking package. We expect this, along with other back-end services, will be provided through standalone apps that have integration to Mirror.
Network Server Simple
This was too complex and impractical to maintain for what little it did, and was removed. There are much easier ways to make a basic listen server, with or without one of our transports.
Couch Co-Op
The core networking was greatly simplified by removing this low-hanging fruit. It was buggy, and too convoluted to be worth fixing. For those that need something like this, consider defining a non-visible player prefab as a message conduit that spawns actual player prefabs with client authority. All inputs would route through the conduit prefab to control the player objects.
Message Types
The MsgType enumeration was removed. All message types are generated dynamically. Use Send instead.
Network Transform
Network Transform was fully replaced so that it only syncs position, rotation and scale, has control options for those and whether to interpolate them, and uses Snapshot Interpolation. It also has a bunch of virtual methods and there's a Script Template for making your own derived version. Rigidbody support was removed in favor of a separate Network Rigidbody component.
Network Animator
Network Animator was also simplified, as it batches all Animator parameters into a single update message.
SyncVar Hook Parameters
SyncVar property values are now updated before the hook is called, and hooks now require two parameters of the same type as the property: oldValue and newValue
SyncListSTRUCT
Use SyncList instead.
SyncList Classes
SyncListStringwas replaced bySyncList<string>.SyncListFloatwas replaced bySyncList<float>.SyncListIntwas replaced bySyncList<int>.SyncListUIntwas replaced bySyncList<uint>.SyncListBoolwas replaced bySyncList<bool>.
See documentation for more details.
SyncList Operations
OP_REMOVEwas replaced byOP_REMOVEATOP_DIRTYwas replaced byOP_SET
See documentation for more details.
SyncDictionary Operations
OP_DIRTYwas replaced byOP_SET
See documentation for more details.
SyncObject
This is now a class instead of an interface.
Flush- UseClearChangesinstead.
Quality of Service Flags
In classic UNet, QoS Flags were used to determine how packets got to the remote end. For example, if you needed a packet to be prioritized in the queue, you would specify a high priority flag which the Unity LLAPI would then receive and deal with appropriately. Unfortunately, this caused a lot of extra work for the transport layer and some of the QoS flags did not work as intended due to buggy code that relied on too much magic.
In Mirror, QoS flags were replaced with a "Channels" system. While the default transport, Telepathy, does not use channels at all because it's TCP-based, other transports, such as Ignorance and LiteNetLib, do support them.
The currently defined channels are:
Channels.Reliable = 0Channels.Unreliable = 1
Changes by Class
NetworkManager
NetworkConnectionwas replaced byNetworkConnectionToClientin many places.networkPortRemoved as part of separating Transports to components. Not all transports use ports, but those that do have a field for it. See Transports for more info.IsHeadless()Use compiler symbolUNITY_SERVERinstead.ConfigureServerFrameRatewas renamed toConfigureHeadlessFrameRate.clientUse NetworkClient directly, it will be made static soon. For example, useNetworkClient.Send(message)instead ofNetworkManager.client.Send(message).IsClientConnected()Use static propertyNetworkClient.isConnectedinstead.onlineSceneandofflineSceneThese store full paths now, so use SceneManager.GetActiveScene().path instead.OnStartClient(NetworkClient client)Override OnStartClient() instead since allNetworkClientmethods are static now.OnClientChangeScene(string newSceneName)OverrideOnClientChangeScene(string newSceneName, SceneOperation sceneOperation, bool customHandling)instead.OnClientChangeScene(string newSceneName, SceneOperation sceneOperation)OverrideOnClientChangeScene(string newSceneName, SceneOperation sceneOperation, bool customHandling)instead.OnServerAddPlayer(NetworkConnection conn, AddPlayerMessage extraMessage)OverrideOnServerAddPlayer(NetworkConnection conn)instead. See Custom Player Spawn Guide for details.OnServerRemovePlayer(NetworkConnection conn, NetworkIdentity player)UseNetworkServer.RemovePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false)instead.OnServerError(NetworkConnection conn, int errorCode)Replaced with
OnServerError(NetworkConnection conn, Exception exception).OnClientError(NetworkConnection conn, int errorCode)Replaced with
OnClientError(Exception exception).disconnectInactiveConnectionsanddisconnectInactiveTimeoutwere removed.OnClient* virtual methods no longer take a
NetworkConnectionparameter. Remove the parameter from your overrides and useNetworkClient.connectionin your code instead.serverTickRaterenamed tosendRate.serverTickIntervalmoved toNetworkServer.
NetworkManagerHUD
showGUIwas removed.Disable the component instead.
NetworkRoomManager
NetworkConnectionwas replaced byNetworkConnectionToClientin many places.OnRoomServerCreateGamePlayer(NetworkConnection conn)UseOnRoomServerCreateGamePlayer(NetworkConnection conn, GameObject roomPlayer)instead.OnRoomServerSceneLoadedForPlayer(GameObject roomPlayer, GameObject gamePlayer)UseOnRoomServerSceneLoadedForPlayer(NetworkConnection conn, GameObject roomPlayer, GameObject gamePlayer)instead.Client virtual methods no longer take a
NetworkConnectionparameter.Use
NetworkClient.connectionwithin your overrides.
NetworkIdentity
clientAuthorityOwnerUse connectionToClient insteadGetSceneIdenityUseGetSceneIdentityinstead (typo in original name)RemoveClientAuthority(NetworkConnection conn)NetworkConnection parameter is no longer needed and nothing is returnedspawneddictionaryThis has been split up to
NetworkServer.spawnedandNetworkClient.spawneddictionaries.Local Player Authority checkbox This checkbox is no longer needed, and we simplified how Authority works in Mirror.
NetworkBehaviour
NetworkConnectionwas replaced byNetworkConnectionToClientin many places.sendIntervalattribute UseNetworkBehaviour.syncIntervalfield instead. Can be modified in the Inspector too.List m_SyncObjectsUseList syncObjectsinstead.OnSetLocalVisibility(bool visible)OverrideOnSetHostVisibility(bool visible)instead.OnRebuildObservers,OnCheckObserver, andOnSetHostVisibilitywere moved to a separate class calledNetworkVisibilityNetworkBehaviour.OnNetworkDestroywas renamed toNetworkBehaviour.OnStopClient.getSyncVarHookGuardrenamed toGetSyncVarHookGuard.setSyncVarHookGuard- renamed toSetSyncVarHookGuard.SetDirtyBit- UseSetSyncVarDirtyBitinstead.[Command]attribute parameterignoreAuthorityreplaced withrequiresAuthority.[ClientRpc]attribute parameterincludeOwnerreplace withexcludeOwner.hasAuthorityrenamed toisOwned.
NetworkConnection
hostIdRemoved because it's not needed ever since we removed LLAPI as default. It's always 0 for regular connections and -1 for local connections. Useconnection.GetType() == typeof(NetworkConnection)to check if it's a regular or local connection.isConnectedRemoved because it's pointless. ANetworkConnectionis always connected.InvokeHandlerNoData(int msgType)UseInvokeHandlerinstead.playerControllerrenamed toidentitysince that's what it is: theNetworkIdentityfor the connection.RegisterHandler(short msgType, NetworkMessageDelegate handler)UseNetworkServer.RegisterHandler()orNetworkClient.RegisterHandler()instead.UnregisterHandler(short msgType)UseNetworkServer.UnregisterHandler()orNetworkClient.UnregisterHandler()instead.Send(int msgType, MessageBase msg, int channelId = Channels.Reliable)UseSend(msg, channelId)instead.clientOwnedObjectsrenamed toowned.
NetworkServer
NetworkConnectionwas replaced byNetworkConnectionToClientin many places.FindLocalObject(uint netId)UseNetworkServer.spawned[netId].gameObjectinstead.RegisterHandler(int msgType, NetworkMessageDelegate handler)UseRegisterHandler(T msg)instead.RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)UseRegisterHandler(T msg)instead.RegisterHandler(Action handler, bool requireAuthentication = true)Use
RegisterHandler(Action<NetworkConnection, T), requireAuthentication = true)instead.UnregisterHandler(int msgType)UseUnregisterHandler(T msg)instead.UnregisterHandler(MsgType msgType)UseUnregisterHandler(T msg)instead.SendToAll(int msgType, MessageBase msg, int channelId = Channels.Reliable)UseSendToAll(T msg, int channelId = Channels.Reliable)instead.SendToClient(int connectionId, int msgType, MessageBase msg)UseNetworkConnection.Send(T msg, int channelId = Channels.Reliable)instead.SendToClient(int connectionId, T msg)UseNetworkConnection.Send(T msg, int channelId = Channels.Reliable)instead.SendToClientOfPlayer(NetworkIdentity identity, int msgType, MessageBase msg)Useidentity.connectionToClient.Send<T>(T message, int channelId = Channels.Reliable)instead.SendToReady(NetworkIdentity identity, short msgType, MessageBase msg, int channelId = Channels.Reliable)Useidentity.connectionToClient.Send()instead.SendToReady(NetworkIdentity identity, T message, bool includeOwner = true, int channelId = Channels.Reliable)Renamed to
SendToReadyObservers.SpawnWithClientAuthority(GameObject obj, GameObject player)UseSpawn(GameObject obj, GameObject player)instead.SpawnWithClientAuthority(GameObject obj, NetworkConnection ownerConnection)UseSpawn(GameObject obj, NetworkConnection ownerConnection)instead.SpawnWithClientAuthority(GameObject obj, Guid assetId, NetworkConnection ownerConnection)UseSpawn(GameObject obj, Guid assetId, NetworkConnection ownerConnection)instead.disconnectInactiveConnectionsanddisconnectInactiveTimeoutwere removed.NoConnectionswas renamed toNoExternalConnections.DisconnectAllExternalConnections/DisconnectAllConnectionsUse
DisconnectAllinstead.OnErrorrenamed toOnTransportErrorfor clarity.
NetworkClient
NetworkClient singletonUseNetworkClientdirectly. Singleton isn't needed anymore as all functions are static now. Example:NetworkClient.Send(message)instead ofNetworkClient.singleton.Send(message).allClientsUseNetworkClientdirectly instead. There is always exactly one client.GetRTT()UseNetworkTime.rttinstead.readyConnectionUse
connectioninstead.isLocalClientUse
isHostClientinstead.DisconnectLocalServer()Use
NetworkClient.Disconnect()instead.RegisterHandler(int msgType, NetworkMessageDelegate handler)UseRegisterHandler(T msg)instead.RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)UseRegisterHandler(T msg)instead.RegisterHandler(Action<NetworkConnection, T> handler, bool requireAuthentication = true)Use
RegisterHandler(Action<T> handler, bool requireAuthentication = true)instead.UnregisterHandler(int msgType)UseUnregisterHandler(T msg)instead.UnregisterHandler(MsgType msgType)UseUnregisterHandler(T msg)instead.Ready(NetworkConnection conn)Use
Ready()without theNetworkConnectionparameter instead.Send(short msgType, MessageBase msg)UseSend(T msg, int channelId = Channels.Reliable)with no message id insteadShutdownAll()UseShutdown()instead. There is only one client.OnErrorrenamed toOnTransportErrorfor clarity.
ClientScene
Merged into
NetworkClient.
Network Scene Checker
Replaced by Scene Interest Management.
Network Proximity Checker
Replaced by Spatial Hash / Distance Interest Management.
Network Match Checker
Replaced by Network Match and requires Match Interest Management.
Network Owner Checker
Replaced by Network Team and requires Team Interest Management.
Network Authenticator
NetworkConnectionwas replaced byNetworkConnectionToClientin many places.OnClientAuthenticateno longer takes aNetworkConnectionparameter. UseNetworkClient.connectionas needed.OnClientAuthenticatedevent no longer takes aNetworkConnectionparameter. UseNetworkClient.connectionas needed.NetworkConnectionis no longer used in client message handlers.Use
NetworkClient.connectionwithin your handlers instead.ClientAcceptandClientRejectno longer needs aNetworkConnectionparameter.
NetworkTime
NetworkTime.timeVarwas renamed totimeVariance.NetworkTime.timeSdwas renamed totimeStandardDeviation.NetworkTime.rttVarwas renamed torttVariance.NetworkTime.rttSdwas renamed torttStandardDeviation.
Transport
activeTransportrenamed toactive.
Messages
Basic messages of simple types were all removed as unnecessary bloat. You can create your own message classes instead.
StringMessageByteMessageBytesMessageIntegerMessageDoubleMessageEmptyMessage
NetworkMessage requires structs in all cases - classes no longer supported
NetworkReader
Read(byte[] buffer, int offset, int count)UseReadBytesinstead.ReadPackedInt32(int value)UseReadInt32(int value)instead.ReadPackedUInt32(uint value)UseReadUInt32(uint value)instead.ReadPackedUInt64(ulong value)UseReadUInt64(ulong value)instead.ReadBooleanrenamed toReadBool.ReadInt16renamed toReadShort.ReadInt32renamed toReadInt.Readint64renamed toReadLong.ReadSinglerenamed toReadFloat.
NetworkWriter
Write(bool value)UseWriteBoolinstead.Write(byte value)UseWriteByteinstead.Write(sbyte value)UseWriteSByteinstead.Write(short value)UseWriteShortinstead.Write(ushort value)UseWriteUShortinstead.Write(int value)UseWriteIntinstead.Write(uint value)UseWriteUIntinstead.Write(long value)UseWriteLonginstead.Write(ulong value)UseWriteULonginstead.Write(float value)UseWriteFloatinstead.Write(double value)UseWriteDoubleinstead.Write(decimal value)UseWriteDecimalinstead.Write(string value)UseWriteStringinstead.Write(char value)UseWriteCharinstead.Write(Vector2 value)UseWriteVector2instead.Write(Vector2Int value)UseWriteVector2Intinstead.Write(Vector3 value)UseWriteVector3instead.Write(Vector3Int value)UseWriteVector3Intinstead.Write(Vector4 value)UseWriteVector4instead.Write(Color value)UseWriteColorinstead.Write(Color32 value)UseWriteColor32instead.Write(Guid value)UseWriteGuidinstead.Write(Transform value)UseWriteTransforminstead.Write(Quaternion value)UseWriteQuaternioninstead.Write(Rect value)UseWriteRectinstead.Write(Plane value)UseWritePlaneinstead.Write(Ray value)UseWriteRayinstead.Write(Matrix4x4 value)UseWriteMatrix4x4instead.Write(NetworkIdentity value)UseWriteNetworkIdentityinstead.Write(GameObject value)UseWriteGameObjectinstead.Write(byte[] buffer, int offset, int count)UseWriteBytesinstead.WritePackedInt32(int value)UseWriteInt32(int value)insteadWritePackedUInt32(uint value)UseWriteUInt32(uint value)insteadWritePackedUInt64(ulong value)UseWriteUInt64(ulong value)instead
RemoteCallHelper
Renamed to
RemoteProcedureCalls.CmdDelegaterenamed toRemoteCallDelegate.MirrorInvokeTyperenamed toRemoteCallType.
Transport
GetConnectionInfo(int connectionId, out string address)UseServerGetClientAddress(int connectionId)instead.GetMaxBatchSizerenamed toGetMaxPacketSize.ClientSend(int channelId, ArraySegment segment)Use
ClientSend(segment, channelId)instead.ServerSend(int connectionId, int channelId, ArraySegment segment)Use
ServerSend(connectionId, segment, channelId)instead.
Telepathy Transport
MaxMessageSizeUseMaxMessageSizeFromClientorMaxMessageSizeFromServerinstead.
Fallback Transport
This has been removed.
Utils
Versionenum removed.DefaultReliablerenamed toReliable.DefaultUnreliablerenamed toUnreliable.
Last updated