2020-02-12 00:15:39 +00:00
# LiteNetLib4Mirror Transport
2019-03-11 17:39:48 +00:00
2020-05-12 17:00:10 +00:00
**LiteNetLib based transport for Mirror.**
2020-05-12 14:37:51 +00:00
2020-05-12 17:00:10 +00:00
## Usage
1. Download the unity package from [Releases ](https://github.com/MrGadget1024/LiteNetLib4Mirror/releases ) and import it to your project (it does not contain Mirror)
2. Put LiteNetLib4MirrorTransport component on gameobject with NetworkManager and assign it there
3. (Optional) Make your NetworkManager derrive from LiteNetLib4MirrorNetworkManager and use optional overloads from it
2020-05-12 14:37:51 +00:00
2020-05-12 17:00:10 +00:00
## Features
- UDP
- Built-in Network Discovery and UPnP
- Fully managed code
- Small CPU and RAM usage
- Small packet size overhead ( 1 byte for unreliable, 3 bytes for reliable packets )
- Different send mechanics
- Reliable with order
- Reliable without order
- Ordered but unreliable with duplication prevention
- Simple UDP packets without order and reliability
- Automatic small packets merging
- Automatic fragmentation of reliable packets
- Automatic MTU detection
- NTP time requests
- Packet loss and latency simulation
- IPv6 support (dual mode)
- Connection statisitcs (need DEBUG or STATS_ENABLED flag)
- Multicasting (for discovering hosts in local network)
2020-05-12 14:37:51 +00:00
2020-05-12 17:00:10 +00:00
## IL2CPP Warning!
2020-05-12 14:37:51 +00:00
With IL2CPP, IPv6 is only supported on Unity 2018.3.6f1 and later because of this:
2020-05-12 17:00:10 +00:00
![Unity ChangeLog ](unity2018.3.6f1il2cpp.png )
Also, socket Reuse Address option isn't available in IL2CPP.
2020-05-12 14:37:51 +00:00
2020-05-12 17:00:10 +00:00
## Credits
RevenantX - for [LiteNetLib ](https://github.com/RevenantX/LiteNetLib/releases )
2020-05-12 14:37:51 +00:00
vis2k & Paul - for [Mirror ](https://assetstore.unity.com/packages/tools/network/mirror-129321 )
Coburn - for [Ignorance ](https://github.com/SoftwareGuy/Ignorance ) which i've used as an example
Dankrushen - for helping me find one small mistake which i couldn't find for two days
Lucas Ontivero - for [Open.Nat ](https://github.com/lontivero/Open.NAT/releases ), used for UPnP
2020-05-12 17:00:10 +00:00
shiena - for NetworkDiscoveryHUD
2020-05-12 14:37:51 +00:00
2019-03-13 17:18:46 +00:00
![The LiteNetLib4Mirror Transport component in the Inspector window ](LiteNetLibTransport.PNG )