Skip to content

Commit

Permalink
v1.4.6.1
Browse files Browse the repository at this point in the history
oops
  • Loading branch information
SoftwareGuy committed Jun 14, 2021
1 parent 656babb commit 59ffa9e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions Assets/Mirror/Runtime/Transport/Ignorance/Ignorance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ public override bool ServerActive()
return Server != null && Server.IsAlive;
}

#if !MIRROR_37_0_OR_NEWER
// Workaround for legacy Mirror versions.
public override bool ServerDisconnect(int connectionId) => ServerDisconnectLegacy(connectionId);
#else
public override void ServerDisconnect(int connectionId)
{
if (Server == null)
Expand All @@ -201,6 +205,7 @@ public override void ServerDisconnect(int connectionId)
// Pass the packet onto the thread for dispatch.
Server.Commands.Enqueue(kickPacket);
}
#endif

public override string ServerGetClientAddress(int connectionId)
{
Expand Down Expand Up @@ -711,6 +716,30 @@ private enum ConnectionState { Connecting, Connected, Disconnecting, Disconnecte

private float statusUpdateTimer = 0f;
#endregion

#region Legacy Overrides
#if !MIRROR_37_0_OR_NEWER
public bool ServerDisconnectLegacy(int connectionId)
{
if (Server == null)
{
Debug.LogError("Cannot enqueue kick packet; our Server object is null. Something has gone wrong.");
// Return here because otherwise we will get a NRE when trying to enqueue the kick packet.
return false;
}

IgnoranceCommandPacket kickPacket = new IgnoranceCommandPacket
{
Type = IgnoranceCommandType.ServerKickPeer,
PeerId = (uint)connectionId - 1 // ENet's native peer ID will be ConnID - 1
};

// Pass the packet onto the thread for dispatch.
Server.Commands.Enqueue(kickPacket);
return true;
}
#endif
#endregion
#endif

}
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ PlayerSettings:
webGLThreadsSupport: 0
webGLWasmStreaming: 0
scriptingDefineSymbols:
1: MIRROR;MIRROR_1726_OR_NEWER;MIRROR_3_0_OR_NEWER;MIRROR_3_12_OR_NEWER;MIRROR_4_0_OR_NEWER;MIRROR_5_0_OR_NEWER;MIRROR_6_0_OR_NEWER;MIRROR_7_0_OR_NEWER;MIRROR_8_0_OR_NEWER;MIRROR_9_0_OR_NEWER;MIRROR_10_0_OR_NEWER;MIRROR_11_0_OR_NEWER;MIRROR_12_0_OR_NEWER;MIRROR_13_0_OR_NEWER;MIRROR_14_0_OR_NEWER;MIRROR_15_0_OR_NEWER;MIRROR_16_0_OR_NEWER;MIRROR_17_0_OR_NEWER;MIRROR_18_0_OR_NEWER;MIRROR_24_0_OR_NEWER;MIRROR_26_0_OR_NEWER;MIRROR_27_0_OR_NEWER;MIRROR_28_0_OR_NEWER;MIRROR_29_0_OR_NEWER;MIRROR_30_0_OR_NEWER;MIRROR_30_5_2_OR_NEWER;MIRROR_32_1_2_OR_NEWER;MIRROR_32_1_4_OR_NEWER;MIRROR_35_0_OR_NEWER;MIRROR_35_1_OR_NEWER;IGNORANCE_MIRROR_POLLING;IGNORANCE;IGNORANCE_1;IGNORANCE_1_4
1: MIRROR;MIRROR_1726_OR_NEWER;MIRROR_3_0_OR_NEWER;MIRROR_3_12_OR_NEWER;MIRROR_4_0_OR_NEWER;MIRROR_5_0_OR_NEWER;MIRROR_6_0_OR_NEWER;MIRROR_7_0_OR_NEWER;MIRROR_8_0_OR_NEWER;MIRROR_9_0_OR_NEWER;MIRROR_10_0_OR_NEWER;MIRROR_11_0_OR_NEWER;MIRROR_12_0_OR_NEWER;MIRROR_13_0_OR_NEWER;MIRROR_14_0_OR_NEWER;MIRROR_15_0_OR_NEWER;MIRROR_16_0_OR_NEWER;MIRROR_17_0_OR_NEWER;MIRROR_18_0_OR_NEWER;MIRROR_24_0_OR_NEWER;MIRROR_26_0_OR_NEWER;MIRROR_27_0_OR_NEWER;MIRROR_28_0_OR_NEWER;MIRROR_29_0_OR_NEWER;MIRROR_30_0_OR_NEWER;MIRROR_30_5_2_OR_NEWER;MIRROR_32_1_2_OR_NEWER;MIRROR_32_1_4_OR_NEWER;MIRROR_35_0_OR_NEWER;MIRROR_35_1_OR_NEWER;IGNORANCE_MIRROR_POLLING;MIRROR_37_0_OR_NEWER;MIRROR_38_0_OR_NEWER;MIRROR_39_0_OR_NEWER;MIRROR_40_0_OR_NEWER;IGNORANCE;IGNORANCE_1;IGNORANCE_1_4
7:
14: MIRROR_3_12_OR_NEWER;MIRROR_4_0_OR_NEWER;MIRROR;MIRROR_1726_OR_NEWER;MIRROR_3_0_OR_NEWER;IGNORANCE;IGNORANCE_1;IGNORANCE_1_3
platformArchitecture: {}
Expand Down

0 comments on commit 59ffa9e

Please sign in to comment.