Skip to content

Commit

Permalink
Improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ooonush committed Nov 7, 2023
1 parent 9342f2b commit 35f3894
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using FishNet.Managing.Logging;
using FishNet.Utility.Performance;
using Networking = Unity.Networking;
using System;
Expand Down Expand Up @@ -867,8 +866,8 @@ private void IterateIncoming()

if (m_ProtocolType == ProtocolType.RelayUnityTransport && m_Driver.GetRelayConnectionStatus() == RelayConnectionStatus.AllocationInvalid)
{
Debug.LogError("Transport failure! Relay allocation needs to be recreated, and NetworkManager restarted. " +
"Use NetworkManager.OnTransportFailure to be notified of such events programmatically.");
Debug.LogError("Transport failure! Relay allocation needs to be recreated, and NetworkManager restarted. ");
// + "Use NetworkManager.OnTransportFailure to be notified of such events programmatically.");

// TODO
// InvokeOnTransportEvent(TransportFailure);
Expand Down Expand Up @@ -968,9 +967,6 @@ private void DisconnectLocalClient()
m_ReliableReceiveQueues.Remove(m_ServerClientId);
ClearSendQueuesForClientId(m_ServerClientId);

// If we successfully disconnect we dispatch a local disconnect message
// this how uNET and other transports worked and so this is just keeping with the old behavior
// should be also noted on the client this will call shutdown on the NetworkManager and the Transport
SetClientConnectionState(LocalConnectionState.Stopped);
}
}
Expand Down Expand Up @@ -1335,7 +1331,7 @@ public void CreateDriver(FishyUnityTransport transport, out NetworkDriver driver
if (m_RelayServerData.IsSecure == 0)
{
// log an error because we have mismatched configuration
NetworkManager.LogError("Mismatched security configuration, between Relay and local NetworkManager settings");
NetworkManager.LogError("Mismatched security configuration, between Relay and local UnityTransport settings");
}

// No need to to anything else if using Relay because UTP will handle the
Expand Down Expand Up @@ -1644,8 +1640,7 @@ public override void SetMaximumClients(int value)
{
if (m_ServerState == LocalConnectionState.Starting || m_ServerState == LocalConnectionState.Started)
{
if (NetworkManager.CanLog(LoggingType.Warning))
Debug.LogWarning($"Cannot set maximum clients when server is running.");
NetworkManager.LogWarning("Cannot set maximum clients when server is running.");
}
else
{
Expand Down

0 comments on commit 35f3894

Please sign in to comment.