diff --git a/Assets/Mirror/Runtime/Transport/Ignorance/Ignorance.cs b/Assets/Mirror/Runtime/Transport/Ignorance/Ignorance.cs index 28f0c1f..1aa50d6 100644 --- a/Assets/Mirror/Runtime/Transport/Ignorance/Ignorance.cs +++ b/Assets/Mirror/Runtime/Transport/Ignorance/Ignorance.cs @@ -4,11 +4,11 @@ // Copyright (c) 2019 - 2021 Matt Coburn (SoftwareGuy/Coburn64) // Ignorance is licensed under the MIT license. Refer // to the LICENSE file for more information. -using System; -using System.Collections.Generic; using ENet; using IgnoranceCore; using Mirror; +using System; +using System.Collections.Generic; using UnityEngine; namespace IgnoranceTransport @@ -76,7 +76,7 @@ public override bool Available() { // Ignorance is not available for Unity WebGL, the PS4 (no dev kit to confirm) or Switch (port exists but I have no access to said code). // Ignorance is available for most other operating systems. -#if (UNITY_WEBGL || UNITY_PS4 || UNITY_SWITCH) +#if UNITY_WEBGL || UNITY_PS4 || UNITY_SWITCH return false; #else return true; @@ -96,6 +96,8 @@ public override string ToString() public override void ClientConnect(string address) { + Debug.LogWarning("ClientConnect has been fired"); + ClientState = ConnectionState.Connecting; cachedConnectionAddress = address; @@ -126,10 +128,15 @@ public override void ClientConnect(Uri uri) public override void ClientDisconnect() { - ClientState = ConnectionState.Disconnecting; - + // 2022-01-17 Fix issue ticket #83 if (Client != null) { + // Ugh this feels like a ugly hack + // If we're host client for example, we don't need to run these routines. + if (!Client.IsAlive) return; + + ClientState = ConnectionState.Disconnecting; + // Fix for the Client commands RingBuffer not being initialized if we're in host mode. if (Client.Commands != null) Client.Commands.Enqueue(new IgnoranceCommandPacket { Type = IgnoranceCommandType.ClientWantsToStop }); diff --git a/Assets/Mirror/Runtime/Transport/Ignorance/IgnoranceDefinitions.cs b/Assets/Mirror/Runtime/Transport/Ignorance/IgnoranceDefinitions.cs index d5bb0fd..7e51e90 100644 --- a/Assets/Mirror/Runtime/Transport/Ignorance/IgnoranceDefinitions.cs +++ b/Assets/Mirror/Runtime/Transport/Ignorance/IgnoranceDefinitions.cs @@ -25,7 +25,7 @@ public enum IgnoranceChannelTypes public class IgnoranceInternals { - public const string Version = "1.4.0r0 (LTS)"; + public const string Version = "1.4.0r1 (LTS)"; public const string Scheme = "enet"; public const string BindAnyAddress = "::0"; }