디버깅용 로그 제거
This commit is contained in:
@@ -25,7 +25,6 @@ namespace Northbound
|
||||
if (enableOnStart)
|
||||
{
|
||||
_networkManager = NetworkManager.Singleton;
|
||||
Debug.Log("[SimpleMonitor] Simple Network Monitor started");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,21 +46,39 @@ namespace Northbound
|
||||
{
|
||||
if (_networkManager == null)
|
||||
{
|
||||
Debug.LogWarning("[SimpleMonitor] NetworkManager not found");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isServer = _networkManager.IsServer;
|
||||
bool isClient = _networkManager.IsClient;
|
||||
bool isHost = _networkManager.IsHost;
|
||||
|
||||
|
||||
if (isServer && !isClient && _eventsLogged < 3)
|
||||
{
|
||||
_serverStartCount++;
|
||||
_lastServerStartTime = Time.time;
|
||||
Debug.Log("[SimpleMonitor] Server started (Count: " + _serverStartCount + ")");
|
||||
_eventsLogged++;
|
||||
}
|
||||
|
||||
if (!isServer && !isClient && _lastServerStartTime > 0f && _eventsLogged < 50)
|
||||
{
|
||||
float uptime = Time.time - _lastServerStartTime;
|
||||
_serverStopCount++;
|
||||
_eventsLogged++;
|
||||
|
||||
if (_serverStopCount >=3)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (isServer && _serverStartCount > 0)
|
||||
{
|
||||
if (_eventsLogged % 10 ==0)
|
||||
{
|
||||
float uptime = Time.time - _lastServerStartTime;
|
||||
_eventsLogged++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isServer && !isClient && _lastServerStartTime > 0f && _eventsLogged < 50)
|
||||
{
|
||||
@@ -96,20 +113,11 @@ namespace Northbound
|
||||
_serverStartCount = 0;
|
||||
_lastServerStartTime = 0f;
|
||||
_eventsLogged = 0;
|
||||
Debug.Log("[SimpleMonitor] Counters reset");
|
||||
}
|
||||
|
||||
|
||||
[ContextMenu("Show Stats")]
|
||||
public void ShowStats()
|
||||
{
|
||||
Debug.Log("=== SIMPLE MONITOR STATS ===");
|
||||
Debug.Log("Server Stops: " + _serverStopCount);
|
||||
Debug.Log("Server Starts: " + _serverStartCount);
|
||||
Debug.Log("NetworkManager:");
|
||||
Debug.Log(" IsServer: " + (_networkManager != null ? _networkManager.IsServer.ToString() : "null"));
|
||||
Debug.Log(" IsClient: " + (_networkManager != null ? _networkManager.IsClient.ToString() : "null"));
|
||||
Debug.Log(" IsHost: " + (_networkManager != null ? _networkManager.IsHost.ToString() : "null"));
|
||||
Debug.Log("============================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user