63 lines
2.7 KiB
C#
63 lines
2.7 KiB
C#
using UnityEngine;
|
|
using Unity.Netcode;
|
|
|
|
namespace Northbound
|
|
{
|
|
/// <summary>
|
|
/// NetworkConfig의 모든 설정을 로그로 출력하여 서버/클라이언트 차이점을 확인
|
|
/// </summary>
|
|
public class NetworkConfigDebugger : MonoBehaviour
|
|
{
|
|
[ContextMenu("Log NetworkConfig Details")]
|
|
public void LogNetworkConfig()
|
|
{
|
|
if (NetworkManager.Singleton == null)
|
|
{
|
|
Debug.LogError("[NetworkConfigDebugger] NetworkManager not found!");
|
|
return;
|
|
}
|
|
|
|
Debug.Log("=== NETWORK CONFIG DEBUGGER ===");
|
|
|
|
var config = NetworkManager.Singleton.NetworkConfig;
|
|
var transport = NetworkManager.Singleton.GetComponent<Unity.Netcode.Transports.UTP.UnityTransport>();
|
|
|
|
Debug.Log("<color=cyan>Basic Config:</color>");
|
|
Debug.Log($" ProtocolVersion: {config.ProtocolVersion}");
|
|
Debug.Log($" TickRate: {config.TickRate}");
|
|
Debug.Log($" ClientConnectionBufferTimeout: {config.ClientConnectionBufferTimeout}");
|
|
Debug.Log($" EnsureNetworkVariableLengthSafety: {config.EnsureNetworkVariableLengthSafety}");
|
|
|
|
Debug.Log("<color=cyan>Connection Settings:</color>");
|
|
Debug.Log($" ConnectionApproval: {config.ConnectionApproval}");
|
|
Debug.Log($" EnableSceneManagement: {config.EnableSceneManagement}");
|
|
Debug.Log($" EnableNetworkLogs: {config.EnableNetworkLogs}");
|
|
|
|
Debug.Log("<color=cyan>Spawn Settings:</color>");
|
|
Debug.Log($" ForceSamePrefabs: {config.ForceSamePrefabs}");
|
|
Debug.Log($" RecycleNetworkIds: {config.RecycleNetworkIds}");
|
|
Debug.Log($" PlayerPrefab: {config.PlayerPrefab?.name ?? "NULL"}");
|
|
|
|
Debug.Log("<color=cyan>NetworkPrefabs ({config.Prefabs.Prefabs.Count}):</color>");
|
|
foreach (var prefab in config.Prefabs.Prefabs)
|
|
{
|
|
Debug.Log($" - {prefab.Prefab.name} (Hash: {prefab.Prefab.GetHashCode()})");
|
|
}
|
|
|
|
Debug.Log("<color=cyan>Transport:</color>");
|
|
if (transport != null)
|
|
{
|
|
Debug.Log($" Address: {transport.ConnectionData.Address}");
|
|
Debug.Log($" Port: {transport.ConnectionData.Port}");
|
|
Debug.Log($" ServerData: {transport.ConnectionData.ServerListenAddress}:{transport.ConnectionData.Port}");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError(" Transport not found!");
|
|
}
|
|
|
|
Debug.Log("================================");
|
|
}
|
|
}
|
|
}
|