mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: NetworkDiscovery BroadcastAddress exposed for iOS support (#3255)
* exposing BroadCasting Address iOS build prevents broadcasting to 0.0.0.0, so we needed to expose it to change it for our built * Update NetworkDiscoveryBase.cs Co-authored-by: mischa <16416509+vis2k@users.noreply.github.com>
This commit is contained in:
parent
33e0bea844
commit
fb95c411ef
@ -40,6 +40,10 @@ public abstract class NetworkDiscoveryBase<Request, Response> : MonoBehaviour
|
|||||||
[Range(1, 60)]
|
[Range(1, 60)]
|
||||||
float ActiveDiscoveryInterval = 3;
|
float ActiveDiscoveryInterval = 3;
|
||||||
|
|
||||||
|
// broadcast address needs to be configurable on iOS:
|
||||||
|
// https://github.com/vis2k/Mirror/pull/3255
|
||||||
|
public string BroadcastAddress = "";
|
||||||
|
|
||||||
protected UdpClient serverUdpClient;
|
protected UdpClient serverUdpClient;
|
||||||
protected UdpClient clientUdpClient;
|
protected UdpClient clientUdpClient;
|
||||||
|
|
||||||
@ -369,6 +373,18 @@ public void BroadcastDiscoveryRequest()
|
|||||||
|
|
||||||
IPEndPoint endPoint = new IPEndPoint(IPAddress.Broadcast, serverBroadcastListenPort);
|
IPEndPoint endPoint = new IPEndPoint(IPAddress.Broadcast, serverBroadcastListenPort);
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(BroadcastAddress))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
endPoint = new IPEndPoint(IPAddress.Parse(BroadcastAddress), serverBroadcastListenPort);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.LogException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
|
using (NetworkWriterPooled writer = NetworkWriterPool.Get())
|
||||||
{
|
{
|
||||||
writer.WriteLong(secretHandshake);
|
writer.WriteLong(secretHandshake);
|
||||||
|
Loading…
Reference in New Issue
Block a user