Starting with Ignorance 1.4 Beta, the Ignorance Core is now a seperate class arrangement (see the files inside Core
) while the Transport (Ignorance.cs
) is the glue that sticks Ignorance to Mirror so Mirror knows how to talk to ENet Native. In short, the best analogy is if you put both Mirror and ENet together in a room out of the box, they'll just look at each other strangely. Ignorance and the Transport (using ENet-CSharp which are bindings for native ENet) has to sit between Mirror and ENet. It acts as the translator.
For example's sake, lets say Mirror and ENet are both different languages, similar to English and Spanish. When Mirror says Hello to ENet in English, Ignorance will on-the-fly translate into a language the native ENet library can understand in Spanish. ENet will then reply with it's greetings in Spanish. Ignorance translates this back into English for Mirror to understand. The key point is Mirror runs in Managed world, while ENet is Native world. We can't directly talk to Native from Managed, so we need to have a layer in between that does the translations for us. Ignorance is the layer that does this.
Due to this new design arrangement, this makes it possible to use Ignorance Core as a standalone system, however you will need to chop off or refactor the Core classes a little to remove dependencies on UnityEngine
. Also ensure that you have placed a native library blob (enet.dll
, libenet.so
, etc) with your application. Without it, Ignorance will throw an error saying a thread failed to initialize. Also check the "What devices are supported?" section in the README.md
file. 32Bit desktop platforms are not supported out of the box, you will need to re-compile ENet yourself in 32Bit mode.
The Ignorance Core is high performance and uses numerous ConcurrentQueues to help seperate events. Incoming events are placed in Incoming
, things to be sent out are processed from Outgoing
, Connection Events (Server got a new connection, client disconnected, etc) are also in their own queue. You can use the Transport implementation as hints as to how to implement very fast networking using queuing/de-queuing strategies in your non-Unity/non-Mirror projects.
If you have issues with the Ignorance Core then please by all means investigate, open a issue ticket and if you can resolve it, open a PR and get your fix in. 😃