Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[Standalone UNET Relay] MLAPI.Relay

Discussion in 'Multiplayer Networking' started by TwoTen, Jun 13, 2018.

  1. TwoTen


    May 25, 2016


    I have created a UNET standalone relay that I want to share with you. As of now it's in alpha and you are free to test it while we are finishing up some stuff before release. This is not an open source project as I want to try creating a commercial product.

    1. You can use it without any licence. CCU is limited to 20 connections.
    2. 1 month licence. This is for people who want to try the relay without limits. This is useful to for example stress test before purchasing. ~1 EUR
    3. Permanent licence, no limits. Infinite licence for ~30 EUR

    As of right now you cannot purchase a licence, free only. (If you need a temporary licence in the mean time for any reason. PM me)

    Issues & Support
    Bugs should be reported on the GitHub Issue Tracker. Questions can be asked on this thread or in the MLAPI Discord server.

    The relay is tested on the HLAPI and the MLAPI but works on all UNET projects. The Relay requires .NET Core to be installed on the target machine.

    Using the relay is really straight forward. First, download the RelayTransport class.
    Then replace NetworkTransport with RelayTransport everywhere where these methods are used:
    • Connect
    • ConnectEndPoint
    • ConnectWithSimulator
    • AddHost
    • AddHostWithSimulator
    • AddWebsocketHost
    • Disconnect
    • Send
    • QueueMessageForSending
    • SendQueuedMessages
    • Receive
    • ReceiveFromHost
    Example: NetworkTransport.Connect(signatureGoesHere) => RelayTransport.Connect(sameSignature);

    Even if you do this, you can still use connect without relay by setting the RelayTransport.Enabled to false. Setting the RelayTransport.Enabled to false will make the relay transport act exactly like the NetworkTransport with no changes.
    And that's it!

    I really hope you find this useful. More documentation about configuration etc and the RelayTransport class can be found on GitHub. Note that the RelayTransport class is open source and is licenced as "public domain". For the exact licence. See the licence file. This licence is for the RelayTransport only and does not cover the Relay itself, any documentation or external libraries.

    Last edited: Jun 14, 2018 at 6:02 PM