Search Unity

NAT Traversal - Automatic port forwarding, punch-through, and more!

Discussion in 'Assets and Asset Store' started by thegreatzebadiah, Apr 5, 2016.

  1. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    That is almost exactly what it does.

    All three connections are actually started at the same time, so there is a chance the relay connection could finish before a hole has been punched. In this case the relay connection will be established first, but then as soon as the punch-through connection succeeds the relay connection will be dropped and seamlessly replaced.

    The idea is to use the first connection to succeed so that your players can get connected ASAP but to also never use the relay connection when there is a better connection possible.
     
    Last edited: May 23, 2016
  2. DshFox

    DshFox

    Joined:
    Oct 10, 2013
    Posts:
    15
    I want so much this plugin but can't afford this price :(
    I will be looking everyday for a disccount at asset store :)
    congratz for this awesome plugin
     
  3. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    I hope you can set up iOS support soon... Ping us if we can help somehow...
     
  4. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    Your custom manager specifies what port the facilitator will use, but what about port forwarding? Is it grabbing my Internal IP from Network.Player.IpAddress? How about External? Is the port selected by random or is it decided by 'Network Port' or 'Facilitator Port'?

    Is there a method I can call to find out whether or not Upnp was successful? Not every router supports it, so I'd like to notify players in my UI if their router is incompatible or if it simply failed.

    I also noticed that your manager wanted me to public override Update and Start, but I didn't find them used in your example class.

    EDIT: If I'm not mistaken, portforwarding is using the Facilitator Port indicated from the NatHelper class. But what about the IP's?
     
    Last edited: May 30, 2016
  5. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Yep

    By default the plugin uses icanhazip.com to fetch your external IP address, but you can configure it to use whatever service you want. Just set the externalIPSource on the NetworkManager component to whatever you want to use. The service needs to return only the dot separated IP string though just like icanhazip.com does.

    There are a couple of ports that get used. The NetworkPort is used for direct connections and is forwarded. The punchthrough uses random ports, and they are also forwarded. There should be no need to forward the actual Facilitator port since each client initiates the connection to the Facilitator. Forwarding should only be necessary for unrecognized incoming connections so since the clients initiate the connection to the Facilitator and not the other way around there should be no problem.

    I just checked and it looks like you could do this if you were using the NATHelper class directly to do the forwarding, but if you're just letting the NetworkManager handle it (which you almost definitely are) then I'm afraid there is no way at the moment. This is definitely something I can hook up in the next update. You can check isDoneFindingNATDevice and if that is true and natDevice == null then no compatible router was found, but that's really only part of the equation. I'm fairly positive that even if a natDevice is found, forwarding could still fail.
     
  6. voltage

    voltage

    Joined:
    Nov 11, 2011
    Posts:
    515
    YES. This is definitely a wanted feature. Thanks for being very helpful. I combed through the read me, but I never noticed your website providing a scripting reference. That is a god send. Especially this bit about the NatHelper:

    'Everything is done asynchronously so your game won't hang.'

    Definitely worth the full price.
     
    thegreatzebadiah likes this.
  7. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    245
    Hello, I haven't bought the plugin yet but it's something I'm definitely looking into.

    Just wanted to tell that we intend to combine Steam matchmaking (lobbies, invites, etc) with this, and try to avoid the Unity matchmaking service alltogether if possible.

    Today's the first day I've looked into unity networking (not my first time with network game development), and it looks like a complex task, so any tips would be welcome.
     
  8. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    I'm using steam lobbys for matchmaking and Forge networking for gameplay. Can I use this plugin to sort out my nat issues? or is it UNet only?
     
  9. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @WaaghMan That seems to be a common path that people are choosing. UNet for the API, Steam for the infrastructure.

    @bug5532
    I want to say that it would be possible to use the plugin with Forge but it's not something I've tried so I can't promise anything. Both the automatic port forwarding and punch through should really work with any networking system though.

    You just need to know the ports that you want to forward, and you need to be able to set the ports that Forge clients use to connect to the Host. Normally that would be handled for you, but all that code in the plugin is UNet specific, so you'd have to do a bit more work to tie things into Forge but it should be possible.

    Take a look at the NATHelper class. All of the port forwarding and punch through stuff is in there and it's not tied to UNet in any way.
     
    Last edited: Jun 7, 2016
  10. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    Sounds good to me, I think I'll be picking this up soon :)
     
  11. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    @thegreatzebadiah Just purchased and trying to set it up, I'm getting a null exception when I call NATHelper.init(). What would be the correct setup if I just want to use the NATHelper?
    Any chance we can get the source code? It's annoying not knowing what's going on...
     
    Last edited: Jun 8, 2016
  12. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    245
    Also getting an exception in NATHelper.init().

    Here's the code I'm currently using for hosting (right after having created the Steam lobby)

    Code (csharp):
    1.  
    2. GameObject go = new GameObject("NetworkManager");
    3. DontDestroyOnLoad(go);
    4.  
    5. // MilkNetworkManager inherits from NATTraversal.NetworkManager
    6. MilkNetworkManager nm = go.AddComponent<MilkNetworkManager>();
    7.  
    8. // Using the sample facilitator until further in development
    9. nm.facilitatorIP = "grabblesgame.com";
    10. nm.connectRelay = false;
    11. // No matchmaking (using Steam)
    12. nm.useUnityMatchmaking = false;
    13. nm.autoCreatePlayer = false;
    14.  
    15. yield return new WaitForSeconds(4);
    16.  
    17. NetworkClient nc = nm.StartHostAll(name, 4, true);
    18.  
    19. // Wait until we get our external ip
    20. yield return nm.getExternalIP();
    21.  
    22. Debug.Log("External IP:" + nm.externalIP);
    23.  
    24. // Save GUID and external/internal IP to Steam lobby so other users can connect
    25. string guid = NATTraversal.NATHelper.guid.ToString();
    26. sessionProperties.SetLobbyData("guid", guid);
    27.         Debug.Log("guid:" + guid);
    28.         sessionProperties.SetLobbyData("publicIP", nm.externalIP);
    29.         Debug.Log("publicIP:" + nm.externalIP);
    30.         sessionProperties.SetLobbyData("internalIP", nm.hostInternalIP);
    31.         Debug.Log("internalIP:" + nm.hostInternalIP);
    32.  
    33.  
     
  13. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    Ok, so I've managed to get it working, it seems adding in the example networkManager, even though it was not enabled fixed the null exception bug.
    Just having some troubles with it not Destroying now...
    I have:
    void OnApplicationQuit(){
    NATTraversal.NATHelper.Destroy();
    }
    but it doesn't seem to work... unity crashes when I stop play...
    Strangely it works fine in the test scene. Do you think it's somethinhg to do with forge using threading as well?

    EDIT:
    Ok, it seems to be if you call Destroy twice, could you please add a catch for that.
     
    Last edited: Jun 8, 2016
  14. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @bug5532 There is an update awaiting approval on the asset store that will fix the issues with destroying the NATHelper.

    @WaaghMan I believe the latest update also fixes the issue you are experiencing but if not please let me know after you've gotten the update.

    [Edit] I just checked and the update was just approved this afternoon so hopefully all the issues are already fixed but please let me know if that is not the case.

    Thanks everyone, and sorry for the confusing bugs.
     
    Last edited: Jun 8, 2016
  15. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @bug5532 and @WaaghMan I was totally wrong about the latest update fixing the null reference exception in NATHelper.init(). I screwed up when testing it because I only disabled the NetworkManager and didn't remove it entirely. It was this comment that helped me figure it out

    I'll have another fix up ASAP. I'm reworking the NATHelper to be totally independent of the NetworkManager (for real this time). I didn't originally intend for it to be used on its own but it seems like a popular request. If you need the fix immediately just message me an I'll get you the updated dll as soon as I've got it compiled.

    At least for now we're not releasing the source code. I know it's lame, and it's not how I would do things in a perfect world, but right now we're the only asset that provides punch-through and port forwarding and I'd rather not have a competitor buy the asset to get a peak at the code. Yeah, I'm a horrible capitalist, but I'm also a starving artist.
     
    Last edited: Jun 9, 2016
    alejobrainz likes this.
  16. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Hi! I know you don't have access to iPhone but I was wondering if there is any way we could help in making NAT Traversal a reality to iOS...

    Alejandro.
     
  17. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    does this asset mean we dont need to use unity matchmaking so we have unlimited CCU for no cost?
     
  18. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Damien Delmarle You do have that option yes. By default the asset still uses Unity's matchmaking to pass around host data just so that it works right out of the box but it can easily be replaced with something like steam lobbies or your own custom matchmaking system. You just need some way to get the host data to the clients.

    Even if you opt to keep using Unity's matchmaking you can disable relay connections and only the hosts will ever take up any CCU. If you're goal is cutting costs though it's not really about the CCU anyway. Once your game is live you are charged based on bandwidth over the relays, so it is perfectly possible to use Unity's matchmaking with relays disabled and never pay a dime.

    @brainz I'm messaging you right now
     
  19. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Version 1.32 released

    Mostly stability improvements, but the OnDoneConnectingToFacilitator method should be a useful new feature.

    Changes include:
    • Exposed several properties on NATHelper that were previously private for no real reason.
    • Removed broken isDoneConnectingToFacilitator property Added isConnectedToFacilitator and hasFailedToConnectToFacilitator properties
    • Mapped ports are now unmapped when the NetworkManager is destroyed
    • Added OnDoneConnectingToFacilitator event to NATHelper
    • Added OnDoneConnectingToFacilitator virtual method to NetworkManager
    • Fixed an error where the onDoneSearchingForNATDevice callback was not being called in all cases
    • Updated documentation
    The next update will be coming very soon and will fix the null reference exception when trying to use the NATHelper directly, as well as the crash on shutdown.

    Thanks everyone!
     
  20. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    Thanks for being speedy on the updates! That all sounds great :D
    As long as you continue active support not having the source code is ok. But if you ever feel you won't have time to fully support the asset please do release the source so we can self maintain it :)
     
  21. DizzyWascal

    DizzyWascal

    Joined:
    Jul 16, 2015
    Posts:
    21
    Great Asset!
    I'm just trying to setup a Server for the Facilitator, will we need just one server anywhere or one for each region?
     
  22. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    One server in each region would probably work best but you can get away with one anywhere. The facilitator doesn't do much in terms of bandwidth and it doesn't require a fast connection or low latency or anything like that. Worst case scenario it will take your players a little longer to connect if the Facilitator is far away but once they are connected it's all gravy.
     
  23. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    I'm getting the the ol' init error here too so I cant test it for myself, But my game can't use unity's servers due to the stupid bandwidth limit and always disconnects within about 5 min. If I turn off "connect relay" and "Use unity matchmaking" will that ensure it won't ever try to connect that way? I feel its more frustrating being kicked than not being able to join in the first place :p
     
  24. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Golesy Yep, you've got it exactly right. With both those options disabled your players will only ever connect directly. You won't be using Unity's infrastructure at all.

    P.S. I submitted the fix for the null reference bug two days ago. It should show up on the store within a week. If anyone would like access to the fix sooner just message me and I can get you the updated dll.
     
  25. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    Awesome! Thanks for the quick reply!
     
  26. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Hi again everyone. I just finished writing up a little FAQ that might help people out getting started with the plugin. I've tried to answer all of the most common questions I get asked but don't hesitate to let me know if I missed something.

    Here it is: http://grabblesgame.com/nat-traversal/faq

    You can tell by the complete lack of styling that I am not a web developer (anymore, thank god).

    As a side note while writing that up I realized that there's really no reason not to add steam lobby based matchmaking to the plugin as a built in alternate to UNet matchmaking. So expect that in the future :)
     
    moco2k likes this.
  27. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Version 1.33 released

    The main focus of this release was making it easier to use the NATHelper on its own so that punch-through and port forwarding isn't tied to UNET in any way. It should be possible to use the NATHelper to add punchthrough and forwarding to any peer-to-peer networking system now*
    *No promises

    Changes include:
    • Reworked the NATHelper so that it can be used on its own. NATHelper is now a separate component instead of a static class.
    • Updated NetworkManager to use new NATHelper component.
    • Added a success boolean to the OnHolePunchedClient callback so that there is some way to catch failed punch-through attempts.
    • Added singleton to NATHelper for easy access.
    • Added icon for new NATHelper component.
    • Automated the entire build process using some really sweet powershell scripting.
    • Fixed NullReferenceError being thrown in NATHelper.init
    • Updated documentation
    This update will unfortunately break any existing code that references the NATHelper or uses the OnHolePunchedClient callback. It should be quick and painless to fix though. If you have any references to "NATHelper" in your NetworkManager you can just change it to "natHelper" and you should be good. Outside of NetworkManager you can use NATHelper.singleton. To fix the OnHolePunched callback you just need to add a boolean "success" parameter so that it matches the method definition here: http://grabblesgame.com/nat-travers...anager.html#a33ed411a07e12a24c55c209dcf611d64

    As always if you run into any issues or have any trouble updating just let me know and I'll work with you to get the issues resolved as fast as possible.

    If you bought the asset and you have not yet rated / reviewed it on the asset store, please take a moment to do so. Every rating makes a huge difference to our visibility on the asset store, so if you are happy with the plugin leaving a positive rating is a quick and easy way to show your support. Also reviews are really great at helping other users make an informed decision, which is a benefit for the entire Unity community. Ok that's enough of a guilt trip. Enjoy the asset, and this lovely Monday afternoon :)

    Thanks everyone!
     
    Last edited: Jun 13, 2016
  28. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    Hey man!
    This may be more of an AWS question bu maybe you can help. So I went through and got an AWS EC2 server up and running, ran the facilitator and got the IP and Port Popup, But when I put that IP into the NAT helper I get the "Failed to connect to Facilitator at " warning? Could there have been a step I missed anywhere? the AWS tutorials arn't much help :p
     
  29. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Golesy

    I think the issue may be that the Facilitator is outputting the wrong IP address.

    Try something like:
    Code (CSharp):
    1. curl icanhazip.com
    to make sure you're getting the actual external IP of the Facilitator.
     
  30. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    Says its the same IP, I wouldnt have to do any custom port forwarding would I?
     
  31. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    You certainly shouldn't have to. Amazon EC2 is exactly what I've got it running on and I don't think I did anything at all for setup. I just started it up, moved the Facilitator to it, and ran it. Of course "just started it up" was actually some confusing Amazon stuff that I barely understood so maybe I did something in there that I'm not remembering. I'll try and start up a totally fresh instance later tonight and get back to you by tomorrow hopefully.
     
  32. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    Any updates on support for mobile?

    Unet is lagging bad for my users and it just doesn't work.
     
  33. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    Ok Cool, good luck :p If you want any specific info I'll gladly share it with you over PM!
     
  34. DizzyWascal

    DizzyWascal

    Joined:
    Jul 16, 2015
    Posts:
    21
    Thank you! That FAQ Sheet you made was very helpful!
     
  35. bug5532

    bug5532

    Joined:
    Aug 16, 2011
    Posts:
    307
    Could you rename your Player class in future updates, I already have a Player class... I keep having to go through and rename it PlayerNAT :)
     
  36. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Sure, no problem.
     
  37. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    HI thegreatzebadiah, the Asset is really amazing. But we are figuring one Problem:
    I host a lobby, and my collegue joins, then we destroy the game and create another one (I host) and the collegue tries to join we get an error that the port is already occuppied and we do not get the OnServerAddPlayer callback.

    Has anybody else figured out this problem?

    Thanks so far

    Greets Ben
     
  38. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @lochmann Are you experiencing the error when running the included Example scene with an unmodified ExampleNetworkManager? It kind of seems like you're missing the call to StopHost when disconnecting. How are you destroying the game? Using the disconnect button on the client? on the host? Just hitting play and stopping the scene?
     
  39. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    I'm getting that too, I'm calling stopHost and DropConnection when hosts disconnect and stopClient when clients disconnect. If both the host and the client close the game and re-open it its fine again. SEEMS to only happens if someone who was a client tries to become a host, or a host disconnects and re-hosts without restarting the game.
    I've been able to get it to happen in the example scene as well on my end, I'll try a completely clean project with only this plugin to see if it happens there too.
     
  40. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Thanks for the details @Golesy, I'm looking into it.
     
  41. jacktian1973

    jacktian1973

    Joined:
    Aug 8, 2015
    Posts:
    1
    Hello,I bought this plugin,and I read your files in http://grabblesgame.com/nat-traversal/docs/,but I wonder "If I have to fill like "Match host","Match port"etc.?",and I run the example,the error is just as blow:
    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Networking.Match.ListMatchResponse.ToString () (at C:/buildslave/unity/build/Runtime/Networking/Managed/UNETInterface.cs:609)
    UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0`1[UnityEngine.Networking.Match.ListMatchResponse].MoveNext () (at C:/buildslave/unity/build/Runtime/Networking/Managed/MatchMakingClient.cs:290)

    Can you help me ?Thank you!
    Jack
     
  42. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Yeah, they should be filled in already in the Example scene. They have to be set if you want to use Unity's matchmaking. The error your getting just means that the match list is empty, which would make sense if those fields aren't set.

    Match host should be "mm.unet.unity3d.com"
    Match port should be 443

    Alternatively you can uncheck "Use Unity Matchmaking" but then you'll have to implement your own matchmaking somehow. I'm not sure if you saw the FAQ but there's a bit more info there.
     
  43. pixel_maniacs

    pixel_maniacs

    Joined:
    Jun 25, 2015
    Posts:
    71
    @thegreatzebadiah we can repdroduce it this way:
    Client1: Host Game
    Client2: Join Game
    Client1: Disconnect
    Client2: Gets disconnected
    Client1: Host Game
    Try to Join with client2, doesn't work

    Thank you for having a look.

    Greets Ben
     
  44. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @lochmann, @Golesy I just finished working out a fix for this last night. I'm packaging it up now for the asset store adding a few last minute touches. It should be submitted by today, but as always if you need the update early just message me.
     
  45. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    Awesome!! Thanks!
     
  46. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    Trying this on Beta 5.4.0.b22 and get the following error:


    The class ResponseDelegate`1 could not be loaded, used in TypeRef ResolutionScope not yet handled (42) for .ResponseDelegate`1 in image C:\Projekt\HordeZ\HTCVive-HordeZ\Assets\Plugins\NAT Traversal for UNET\NATTraversalForUNET.dll at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 at Mono.CSharp.RootContext.PopulateTypes () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at Mono.CSharp.RootContext.PopulateTypes () [0x00000] in <filename unknown>:0 at Mono.CSharp.Class.Define () [0x00000] in <filename unknown>:0 at Mono.CSharp.ClassOrStruct.Define () [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 at Mono.CSharp.MemberCache..ctor (System.Type baseType, IMemberContainer container) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeManager.LookupMemberCache (System.Type t) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeHandle.GetMemberCache (System.Type t) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeHandle.GetTypeHandle (System.Type t) [0x00000] in <filename unknown>:0 at Mono.CSharp.TypeHandle..ctor (System.Type type) [0x00000] in <filename unknown>:0 at Mono.CSharp.MemberCache..ctor (IMemberContainer container) [0x00000] in <filename unknown>:0 at Mono.CSharp.MemberCache.AddMethods (System.Type type) [0x00000] in <filename unknown>:0 at Mono.CSharp.MemberCache.AddMethods (BindingFlags bf, System.Type type) [0x00000] in <filename unknown>:0 at System.Reflection.MethodBase.get_IsVirtual () [0x00000] in <filename unknown>:0 at System.Reflection.MonoMethod.get_Attributes () [0x00000] in <filename unknown>:0 at System.Reflection.MonoMethodInfo.GetAttributes (IntPtr handle) [0x00000] in <filename unknown>:0 at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)Unhandled Exception: Mono.CSharp.InternalErrorException: Assets/Lobby/Scripts/Lobby/LobbyManager.cs(18,18): UnityStandardAssets.Network.LobbyManager ---> System.TypeLoadException: Could not load type 'ResponseDelegate`1'.
     
  47. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    @Nikodemus I believe that error just means you've got the wrong version of the plugin for your editor version. If you re-import the plugin from the asset store it should update to the correct version. You can also check the top of the README file to see what version of the plugin you have and what version of the editor it is meant to run in.
     
  48. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    Version 1.4 released

    This one was all about bug fixes and stability. Thanks everyone that reported the issues with detailed steps to reproduce.

    Changes include:
    • Fixed issue with punchthrough clients not being notified on disconnect.
    • Fixed issue with not being able to join after hosting.
    • Renamed Player class and some others to avoid conflicts.
    • Updated documentation
    As always if you run into any issues or have any trouble updating just let me know and I'll work with you to get the issues resolved as fast as possible.

    If you bought the asset and you have not yet rated / reviewed it on the asset store, please take a moment to do so. Every rating makes a huge difference to our visibility on the asset store, so if you are happy with the plugin leaving a positive rating is a quick and easy way to show your support. Also reviews are really great at helping other users make an informed decision, which is a benefit for the entire Unity community. Ok that's enough of a guilt trip. Enjoy the asset, and this lovely Tuesday afternoon :)

    Thanks everyone!
     
  49. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    I am getting this issue basically everytime I try to connect using my own code. But I use your example code to create and connect:

    NullReferenceException: Before using the library you should call Init() and do not forget to call Shutdown() afterwards

    Also, the name of the match contains the name I created it with PLUS all the Connection data like internal ip, external ip, the works.

    The multiple player (creates multiple entities) bug is solved so that's nice and the example scene works a bit better. If I try to connect to a machine on my local network it tries to make a DNS checkup (which fails) but after 1-2 retries it finally connects.
     
  50. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    This is intentional and necessary. There is no other way to pass the connection data right now thanks to matchAttributes still not working (see this thread). It is simple to recover the actual match name though:
    Code (CSharp):
    1. string[] connectionInfo = matchName.Split(':');
    2. string actualMatchName = connectionInfo[0];
    As for the other issues, I'm not seeing them when running the Example scene. Can you maybe send me the project so I can take a look into it? The DNS issue is strange, there's no reason it should be doing a lookup when you're connecting to an IP.