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 library binaries (aka server.dll)

Discussion in 'Multiplayer Networking' started by aabramychev, Apr 14, 2018.

  1. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    Ok, we decided to open access to everybody who interesting in "sever.dll" project. It is standalone library whihc allow you writing c# program communication with unity clients via unet. For example you can try to do lobby server, or chat server. and so on.

    Binaries has been released for Windows, Linux and Mac. All of them are 64 bit (do not forget this when you will use them). All of them should work with .Net core. Code base, last version of unet (we did some work on performance recently) should be compatible with any 2017.x and 2018.x clients.

    The library is provided as a preview/beta still, and we’ll provide best effort support for it. It’s under the UCL license included in the zip file.

    I will try to add c++ interface in the few next weeks.

    http://files.unity3d.com/multiplayer/unet-server-1.0.0.9_b8a58aa1e70d.zip
     
    Last edited by a moderator: May 4, 2018
    _FLX, jpthek9, korchoon and 5 others like this.
  2. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    2,316
    Was that only for UNET-Server or for LLAPI in general? And is this in 2017.4 LTS?
     
  3. Fijit

    Fijit

    Joined:
    Sep 1, 2011
    Posts:
    6
    Thanks for the lib,

    Trying to run SharpPart project for testing and apparently there is no entry point for SetReceiveCallbackFunc in UNETServerDLL.dll.

    The exception is on line 33 of SharpTransportProvider.cs which eventually leads to line 31 of GlobalProfileInternal.cs

    Code (CSharp):
    1. GlobalProfileInternal.SetSendCallbackFunc(this.m_PGlobalProfile, config.SendCallback);
    I compiled all libs as x64 and copied the UNETServerDLL.dll file from the /lib folder as per instructions so I must have missed something :)

    Screenshot of exception attached in case it helps

    upload_2018-4-14_12-51-47.png
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @Fijit ups, looks like i forget fix examples and docs: Callbacks name did change. Use these please
    Code (CSharp):
    1.  public NetworkEventAvailableCallback NetworkEventAvailable  //old ConnectionReadable
    2.         {
    3.             get { return m_NetworkEventAvailable; }
    4.             set { m_NetworkEventAvailable = value;  }
    5.         }
    6.  
    7.         public ConnectionReadyForSendCallback ConnectionReadyForSend //old SetSendCallbackFunc
    8.         {
    9.             get { return m_ConnectionReadyForSend; }
    10.             set { m_ConnectionReadyForSend = value; }
    11.         }
    Or is it something else?

    @vis2k it is LLAPI in general only, actually it is full llapi part of unity.
    And is this in 2017.4 LTS - so far no, it will work with 2017.4 but has not migrated yet. When will it backported to 2017.4 - probably in month. We still working on performance improving. API and protocol itself have not changed. But i changed couple algorithms inside, removed stl containers and so on.
     
    Fijit and vis2k like this.
  5. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @Fijit and you will need to change UNETServerAssembly.dll in SharpPart\SharpProject\Assemblies folder to the new one from lib folder. and I attached correct file with fixes

    Sorry about :(
     

    Attached Files:

    Fijit likes this.
  6. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    273
    I see people still have some confusion about what is this library, what is LLAPI, and how they are related to each other.

    UNet itself is a low-level transport and this server library, as well as LLAPI is an interlayer. So yea, they are doing the same job under the hood, but one made for standalone servers and one integrated with Unity for player hosted games primarily.
     
    Last edited: Apr 18, 2018
  7. Fijit

    Fijit

    Joined:
    Sep 1, 2011
    Posts:
    6
    @aabramychev I've applied your fixes and now it works fine, thank you :)
     
    aabramychev likes this.
  8. Driiade

    Driiade

    Joined:
    Nov 21, 2017
    Posts:
    35
    Very good news for everyone using Unet and wanting to communicate with application outside of unity.
     
  9. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    When can we expect the C++ interface?
     
  10. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @TwoTen :( only time, I need 3 days to finish implementation and 2 days for testing and deploying, but I do not have this time... If you really need this, could you please kick my ass every week by mail with reminder that I promised?

    PS. As u can see the last time i was here couple of weeks ago :( No time et al.
     
    TheBrizleOne likes this.
  11. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    Hello! I have a few suggestions:

    1. Please add an overload to the GetConnectionInfo merthod where NetworkID and NodeId is not requires as those classes are in the UnityEngine library.
    2. We REALLY need a Offset on the Send method. Right now we are tinkering by moving every byte forwards or backwards before sending the buffer and recalculating the size when we want to for example ignore certain parts of the buffer for sending.
    3. MaxConnections should not be a part of the CRC. We have written a UNET Relay so that users don't have to use Unity's relay as it costs quite a bit and we want self hosting. But we require users to set the MaxConnections very high. On the relay, we want the maxConnections to be very high as it will host many sessions. But we don't want the games to require that large of a maxConnections count. (I think it might be a bug that a CRC is thrown when the MaxConnections are different)
     
    Last edited: May 28, 2018
  12. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @TwoTen
    1. Will do
    2. Will add (but the length will still define the massage length, means
    offset = 5;
    Send(buff, offset, 10) --> means 10 bytes from byte no 5. ok?
    3. MaxConnections, hmm do not understand you, MaxConnection is not part of CRC...
     
  13. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    Might be a bug? We are getting CRCDisconnect when changing the MaxConnections.


    Thanks for the implementations anyways!
     
  14. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @TwoTen ok will check today. BTW, c++ iface almost ready (just need to add example) if the changes whihc you pointed out is urgent, I can add them and publish new binaries on this week. Or on the next week with example
     
  15. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    The changes are not "urgent", we worked around it. But they will decrease performance of our application. And since it's a relay. Every bit of performance is important. Just take your time, and thanks a ton for the CPP interface.
     
    aabramychev likes this.
  16. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    Please do ignore my MaxConnections "bug report". It was a fault at our end. No need to investigate that!
     
    aabramychev likes this.
  17. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    TwoTen likes this.
  18. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
  19. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @TwoTen Hmm, I do not see this function in browser, but I can use it, check please the path to assembly, if you will fail again ping me i will check zip itself:
    newsend.png
     
  20. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    602
    So one small library and it only contains networking code? Sounds cool.

    There's no way to get PhysX included as well or as some optional module right?
    So we could check collisions against level geometry.
     
  21. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    Not through Unity, but you could try through other means.
     
  22. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    I think something is wrong with the Zip, i'm not seeing the overloads after updating all references :(
     
  23. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    TwoTen likes this.
  24. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    974
    aabramychev likes this.
  25. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    16
    Hi @aabramychev, I'm trying to make a C# server using these libs but I'm having an issue when using addwebsockethost. It should be working since it's based on ServerDllDemo-netcore but I have this error : "web socket server has not been supported for this platform". I only replaced AddHost by AddWebsocketHost.

    It seems to be working if I do the same but with NetworkTransport inside Unity so I assume that the library is missing something ? Maybe something to say that we are a standalone build ? (maybe some define ?)

    I'm on a Mac now but I will try on Windows when I have a few minutes.

    Do you have any idea about this issue ?
    Thanks!
     
  26. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    521
    @dzamani - it is expected, I didn't include web socket library to server dll, as ("by design") I expected that this library will used only for udp connections. For web socket support it is easier to set real web server for handling web.socket traffic from clients. If you will decide to do this, ping me again i will explain protocol (it is very easy)
     
    dzamani likes this.
  27. dzamani

    dzamani

    Joined:
    Feb 25, 2014
    Posts:
    16
    @aabramychev - Thanks, I've started a conversion with you so to not flood here.