Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Bug5532 on May 10, 2014, 08:15:05 AM

Title: v1.9.0 error
Post by: Bug5532 on May 10, 2014, 08:15:05 AM
Hi, I'm getting this error when I try to run the example scene.
IP address cannot be determined!
UnityEngine.Debug:LogError(Object, Object)
TNManager:Awake() (at Assets/TNet/Client/TNManager.cs:790)

and then:
[TNet] Udp.Start: The requested address is not valid in this context
UnityEngine.Debug:LogError(Object)
TNet.UdpProtocol:Start(Int32) (at Assets/TNet/Common/TNUdpProtocol.cs:117)
TNUdpLobbyClient:OnEnable() (at Assets/TNet/Client/TNUdpLobbyClient.cs:67)

What should I do to fix this? It was working before I updated.
Title: Re: v1.9.0 error
Post by: ArenMook on May 10, 2014, 10:33:16 AM
What's your target platform? Any way I can reproduce this on my end? You can change the way IP was determined back to how it was by going to line 105 of TNTools.cs (it's a try/catch block). Get rid of the entire "try" block and comment out the "catch exception" line, leaving only the DNS part that follows.
Title: Re: v1.9.0 error
Post by: Bug5532 on May 10, 2014, 05:46:43 PM
I just set up a completely blank project to test it out. So brand new project, imported the tnet unity package and opened the scene example menu. Hit play and got the error message. Target was PC, Mac & Linus Standalone as it was a new project.
This is on a macbook pro in the editor, I dont know if that has anything to do with it.
I'll try reverting it now.
Title: Re: v1.9.0 error
Post by: ArenMook on May 10, 2014, 11:26:14 PM
That's interesting... the only way that point can be reached if the list of local IPs could not be determined. The list of IPs is retrieved in TNTools.cs, Tools.localAddresses. It's done by querying the hardware, getting the list of network interfaces, then iterating through them to find valid IPs. I need to know which part of that is failing on your machine, because I am running Windows 8.1 here and everything works as expected. It even has a fallback there where if it's not possible to determine the IPs using this method it reverts to the old way of doing it -- via DNS.
Title: Re: v1.9.0 error
Post by: nah0y on May 11, 2014, 10:49:14 AM
It seems I have the same issue.
I've logged some information, and the issue seems to come from TNTools.cs in the get of networkInterfaces.

I'm on an iMac, and NetworkInterface[] list = NetworkInterface.GetAllNetworkInterfaces(); give me a list of 9 items.
After that, for each item you test if they support IPv4 and if OperationalStatus == OperationalStatus.Up, here is the result for the 9 items :
(name - support IPv4 - operationalStatus)
lo0 - True - Unknown
gif0 - False - Unknown
stf0 - False - Unknown
en0 - False - Unknown
fw0 - False - Unknown
en1 - True - Unknown
en4 - False - Unknown
en5 - False - Unknown
p2p0 - False - Unknown

I'm on Skype if you need any more information.
Title: Re: v1.9.0 error
Post by: ArenMook on May 11, 2014, 01:57:40 PM
nah0y and I spent 2 hours on Skype to get to the bottom of the issues. Seems everything should work now in 1.9.0b.
Title: Re: v1.9.0 error
Post by: Bug5532 on May 13, 2014, 09:50:32 AM
Thanks a lot to both of you for finding a fix. Sorry I couldn't have been more help. I will give 1.9.0b a go now :D
Title: Re: v1.9.0 error
Post by: nah0y on May 27, 2014, 10:28:42 AM
Reading Unity 4.5 release notes, there is :
- Mac OS X Standalone: Fix GetAllNetworkInterfaces.


So maybe this will fix the issues we had...