mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Revert "breaking!(NetworkManager): Removed obsolete OnServerError / OnClientError"
This reverts commit d45bd661ef
.
This commit is contained in:
parent
d45bd661ef
commit
a74f8f9ea2
@ -1306,8 +1306,16 @@ public virtual void OnServerAddPlayer(NetworkConnectionToClient conn)
|
||||
NetworkServer.AddPlayerForConnection(conn, player);
|
||||
}
|
||||
|
||||
// Deprecated 2022-05-12
|
||||
[Obsolete("OnServerError(conn, Exception) was changed to OnServerError(conn, TransportError, string)")]
|
||||
public virtual void OnServerError(NetworkConnectionToClient conn, Exception exception) {}
|
||||
/// <summary>Called on server when transport raises an exception. NetworkConnection may be null.</summary>
|
||||
public virtual void OnServerError(NetworkConnectionToClient conn, TransportError error, string reason) {}
|
||||
public virtual void OnServerError(NetworkConnectionToClient conn, TransportError error, string reason)
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
OnServerError(conn, new Exception(reason));
|
||||
#pragma warning restore CS0618
|
||||
}
|
||||
|
||||
/// <summary>Called from ServerChangeScene immediately before SceneManager.LoadSceneAsync is executed</summary>
|
||||
public virtual void OnServerChangeScene(string newSceneName) {}
|
||||
@ -1336,8 +1344,16 @@ public virtual void OnClientConnect()
|
||||
/// <summary>Called on clients when disconnected from a server.</summary>
|
||||
public virtual void OnClientDisconnect() {}
|
||||
|
||||
// Deprecated 2022-05-12
|
||||
[Obsolete("OnClientError(Exception) was changed to OnClientError(TransportError, string)")]
|
||||
public virtual void OnClientError(Exception exception) {}
|
||||
/// <summary>Called on client when transport raises an exception.</summary>
|
||||
public virtual void OnClientError(TransportError error, string reason) {}
|
||||
public virtual void OnClientError(TransportError error, string reason)
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
OnClientError(new Exception(reason));
|
||||
#pragma warning restore CS0618
|
||||
}
|
||||
|
||||
/// <summary>Called on clients when a servers tells the client it is no longer ready, e.g. when switching scenes.</summary>
|
||||
public virtual void OnClientNotReady() {}
|
||||
|
Loading…
Reference in New Issue
Block a user