I’m trying to use Network.player.ipAddress to get the external IP of the HoloLens. In the editor, this works fine. But, if I try to make a HoloLens build, I get this error:
Assets\Scripts\Networking\NetworkingGUI.cs(44,59): error CS0103: The name ‘Network’ does not exist in the current context
It looks like the Network class is not in the actual native SDK? If not…what are we supposed to use instead?
@Unity_Wesley thanks a lot! I think that will work. I don’t think I could find a way to get the external IP using NetworkManager, it would always just report “localhost”. Any particular reason why the Network class doesn’t have a UWP version of it when compiling for HoloLens, or is that eventually on the agenda?
So far it’s the only class I’ve found unsupported on UWP, but I’m sure there are more.
@Tautvydas-Zilys ah thanks! Will the functionality be merged into a different class? Network.isCilent and the ability to get access to Network.player for the IP are very handy.
IIRC the implementation in the old system relied on the facilitator (for NAT punchthrough) or connection tester reporting the external IP so this class could display it. We could add something similar to the new system, relying on a connection like this to report the IP (we’re adding NAT support right now and will have a facilitator for that). I’ll add this to our todo list.
I’ve done a simple discovery server/client using UNET. However, it seems to be missing NetworkPlayer when trying to compile to Hololens. Is this true?
I don’t get how to know what works and what not. Previously I did a UDP server/client which also didn’t work even though I using the preprocessor macro (and it worked fine on Windows 10, not just Hololens).