OnReceivedError callback for clients

This commit is contained in:
JohnCorby 2023-06-09 19:20:01 -07:00
parent 646b6256c3
commit 81ea1e0ce7
2 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,8 @@ namespace Mirror.FizzySteam
private event Action<byte[], int> OnReceivedData;
private event Action OnConnected;
private event Action OnDisconnected;
// CHANGED
private event Action<TransportError, string> OnReceivedError;
private TimeSpan ConnectionTimeout;
@ -34,6 +36,8 @@ namespace Mirror.FizzySteam
c.OnConnected += () => transport.OnClientConnected.Invoke();
c.OnDisconnected += () => transport.OnClientDisconnected.Invoke();
c.OnReceivedData += (data, channel) => transport.OnClientDataReceived.Invoke(new ArraySegment<byte>(data), channel);
// CHANGED
c.OnReceivedError += (error, reason) => transport.OnClientError.Invoke(error, reason);
try

View File

@ -18,6 +18,8 @@ namespace Mirror.FizzySteam
private event Action<byte[], int> OnReceivedData;
private event Action OnConnected;
private event Action OnDisconnected;
// CHANGED
private event Action<TransportError, string> OnReceivedError;
private Steamworks.Callback<SteamNetConnectionStatusChangedCallback_t> c_onConnectionChange = null;
private CancellationTokenSource cancelToken;
@ -39,6 +41,8 @@ namespace Mirror.FizzySteam
c.OnConnected += () => transport.OnClientConnected.Invoke();
c.OnDisconnected += () => transport.OnClientDisconnected.Invoke();
c.OnReceivedData += (data, ch) => transport.OnClientDataReceived.Invoke(new ArraySegment<byte>(data), ch);
// CHANGED
c.OnReceivedError += (error, reason) => transport.OnClientError.Invoke(error, reason);
try
{