네트워크 동기화 문제 해결

몬스터와 크립에 네트워크 관련 컴포넌트가 없는 문제 수정
포탈/캠프와 몬스터/크립 간의 계층 구조 해제
 - 네트워크 오브젝트끼리 계층 구조로 둘 수 없음
This commit is contained in:
2026-02-04 18:16:59 +09:00
parent ea80402fc1
commit 4bd46b2a0a
25 changed files with 1241 additions and 174 deletions

View File

@@ -0,0 +1,67 @@
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("================================");
}
private void Start()
{
Invoke(nameof(LogNetworkConfig), 1f);
}
}
}