making changes to lighting. This is a backup just in case
This commit is contained in:
@@ -158,6 +158,7 @@ namespace FishNet.Discovery
|
||||
/// </summary>
|
||||
public void StartAdvertisingServer()
|
||||
{
|
||||
//Debug.Log("NetworkDiscovery is advertizing on port " + port);
|
||||
if (!InstanceFinder.IsServer)
|
||||
{
|
||||
if (NetworkManager.StaticCanLog(LoggingType.Warning)) Debug.LogWarning("Unable to start advertising server. Server is inactive.", this);
|
||||
@@ -184,7 +185,7 @@ namespace FishNet.Discovery
|
||||
EnableBroadcast = true,
|
||||
MulticastLoopback = false,
|
||||
};
|
||||
|
||||
//Debug.Log("UDP = " + _serverUdpClient.ToString());
|
||||
Task.Run(AdvertiseServerAsync);
|
||||
|
||||
if (NetworkManager.StaticCanLog(LoggingType.Common)) Debug.Log("Started advertising server.", this);
|
||||
@@ -208,11 +209,13 @@ namespace FishNet.Discovery
|
||||
{
|
||||
while (_serverUdpClient != null)
|
||||
{
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(discoveryInterval));
|
||||
|
||||
|
||||
UdpReceiveResult result = await _serverUdpClient.ReceiveAsync();
|
||||
|
||||
Debug.Log("Awaiting for server");
|
||||
string receivedSecret = Encoding.UTF8.GetString(result.Buffer);
|
||||
Debug.Log(receivedSecret);
|
||||
|
||||
if (receivedSecret == secret)
|
||||
{
|
||||
@@ -221,6 +224,7 @@ namespace FishNet.Discovery
|
||||
await _serverUdpClient.SendAsync(okBytes, okBytes.Length, result.RemoteEndPoint);
|
||||
}
|
||||
}
|
||||
Debug.Log("_serverUdpClient == null");
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -238,6 +242,7 @@ namespace FishNet.Discovery
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
// Debug.Log("NetworkDiscovery is searching on port " + port);
|
||||
|
||||
if (InstanceFinder.IsClient)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user