BeardedManStudios / ForgeNetworkingRemastered

See various forks, also please join the Forge Community fork of Forge Alloy! -> https://github.com/ForgeAlloyCommunity/ForgeAlloy
https://twitter.com/FarrisFaulds
Apache License 2.0
1.49k stars 306 forks source link

UDP LAN Discovery fails on OSX #265

Closed TheSeanLavery closed 4 years ago

TheSeanLavery commented 5 years ago

EDIT: It works in Unity 2018. Seems to be related to the mono version of Unity 2017

Version Number and Operating System(s):

Current Master and DEV. OSX

Edit: Unity version is 2017 LTS API compatibility is Mono 2.0 Subset

Expected behavior:

Tick "Get Local Network Connections" in MultiplayerMenu.unity Build and host server. Run game in unity editor. See IP address of discovered host printed into console

Actual behavior:

No IP address is printed

Steps to reproduce:

New unity project with forge, tick "Get Local Network Connections"

[Optional] Discord Username:

AttackingHobo

phalasz commented 5 years ago

Interesting as I don't have that issue. I am working on upgrading the multiplayer menu to automatically list local games and potentially master server games in a list.

Are you running both the client and host on OS X? Are you running them both on the same machine?

Unity version? OS X version?

TheSeanLavery commented 5 years ago

Here is a fix with platform dependent compilation. Don't know if these changes will break under specific conditions. So someone might want to take a look at this, and see if this is good enough, or if there is a better solution.

https://hastebin.com/kitogigata.cs Lines changed are 1116 to 1127

phalasz commented 5 years ago

Note: @AttackingHobo confirmed on discord that Unity 2018 does not have the same issue.

It seems to be a problem with the version of mono shipped with earlier versions of Unity.

phalasz commented 5 years ago

Issue introduced by PR #227

SixWays commented 5 years ago

LAN discovery also seems to fail on Android, on Unity 2018. I've not been able to test with the commit prior to PR #227 being merged to see if it was working before that.

XeviaN360 commented 5 years ago

LAN discovery also seems to fail on Android, on Unity 2018. I've not been able to test with the commit prior to PR #227 being merged to see if it was working before that.

I tested it on some android devices, with Unity 2019.2.10f1. The build is failing on some devices (Oculus Quest) and is working on others (Galaxy Note 8 for example). Problem is the NetworkInterface.GetAllNetworkInterfaces() throw an exception: "Unable to find libc".

phalasz commented 5 years ago

For Android issues please see PR #304

phalasz commented 4 years ago

2017 LTS is soon end of life.