Skip to content

Commit

Permalink
fix: add ignorance support with defines for test
Browse files Browse the repository at this point in the history
  • Loading branch information
uweeby committed Feb 1, 2021
1 parent cbb00b3 commit 35634d5
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using Mirror.KCP;
using UnityEngine;
using Cysharp.Threading.Tasks;
#if IGNORANCE
using Mirror.ENet;
#endif

namespace Mirror.HeadlessBenchmark
{
Expand Down Expand Up @@ -199,6 +202,22 @@ void ParseForTransport()
this.transport = newTransport;
}

#if IGNORANCE
if (string.IsNullOrEmpty(transport) || transport.Equals("ignorance"))
{
IgnoranceNG newTransport = networkManager.gameObject.AddComponent<IgnoranceNG>();

//Try to apply port if exists and needed by transport.
if (!string.IsNullOrEmpty(port))
{
newTransport.Config.CommunicationPort = ushort.Parse(port);
}
networkManager.server.Transport = newTransport;
networkManager.client.Transport = newTransport;

this.transport = newTransport;
}
#endif
}

string GetArgValue(string name)
Expand Down

0 comments on commit 35634d5

Please sign in to comment.