feat : 코드 주석 정리

This commit is contained in:
qornwh1
2026-03-30 12:47:36 +09:00
parent 849105f8ff
commit 2ebd0120ab
2 changed files with 11 additions and 17 deletions

View File

@@ -176,11 +176,15 @@ public abstract class ServerBase : INetEventListener
_ = HandleAuth(peer, payload).ContinueWith(t => _ = HandleAuth(peer, payload).ContinueWith(t =>
{ {
if (t.IsFaulted) if (t.IsFaulted)
{
Log.Error(t.Exception, "[Server] HandleAuth 예외 PeerId={Id}", peer.Id); Log.Error(t.Exception, "[Server] HandleAuth 예외 PeerId={Id}", peer.Id);
}
}, TaskContinuationOptions.OnlyOnFaulted); }, TaskContinuationOptions.OnlyOnFaulted);
return; return;
} }
else if (type == (ushort)PacketType.DUMMY_ACC_TOKEN)
// Auth 이외 패킷 처리
if (type == (ushort)PacketType.DUMMY_ACC_TOKEN)
{ {
HandleAuthDummy(peer, payload); HandleAuthDummy(peer, payload);
return; return;
@@ -205,9 +209,9 @@ public abstract class ServerBase : INetEventListener
return; return;
} }
Log.Warning("[Server] 레이트 리밋 초과 ({Count}회) HashKey={Key} PeerId={Id}", session.RateLimitViolations, session.HashKey, // 패킷 드롭
peer.Id); Log.Warning("[Server] 레이트 리밋 초과 ({Count}회) HashKey={Key} PeerId={Id}", session.RateLimitViolations, session.HashKey, peer.Id);
return; // 패킷 드롭 return;
} }
HandlePacket(peer, session.HashKey, type, payload); HandlePacket(peer, session.HashKey, type, payload);
@@ -237,23 +241,19 @@ public abstract class ServerBase : INetEventListener
if (PingLogRtt) if (PingLogRtt)
{ {
// rtt 시간 출력 // rtt 시간 출력
// Log.Debug("[Server] latency : {Latency} ", latency);
} }
} }
// Echo 서버 테스트 // Echo 서버 테스트
protected abstract void HandleEcho(NetPeer peer, byte[] payload); protected abstract void HandleEcho(NetPeer peer, byte[] payload);
// ─── Auth 처리 (더미) ──────────────────────────────────────────────── // Auth 처리 (더미)
protected abstract void HandleAuthDummy(NetPeer peer, byte[] payload); protected abstract void HandleAuthDummy(NetPeer peer, byte[] payload);
// ─── Auth 처리 ──────────────────────────────────────────────── // Auth 처리
protected abstract Task HandleAuth(NetPeer peer, byte[] payload); protected abstract Task HandleAuth(NetPeer peer, byte[] payload);
// ─── 전송 헬퍼 ───────────────────────────────────────────────────────
// peer에게 전송 // peer에게 전송
protected void SendTo(NetPeer peer, byte[] data, DeliveryMethod method = DeliveryMethod.ReliableOrdered) protected void SendTo(NetPeer peer, byte[] data, DeliveryMethod method = DeliveryMethod.ReliableOrdered)
{ {
@@ -278,8 +278,6 @@ public abstract class ServerBase : INetEventListener
netManager.SendToAll(cachedWriter, 0, method, exclude); netManager.SendToAll(cachedWriter, 0, method, exclude);
} }
// ─── 서브클래스 구현 ─────────────────────────────────────────────────
// 인증(Auth) 완료 후 호출 // 인증(Auth) 완료 후 호출
protected abstract void OnSessionConnected(NetPeer peer, int hashKey); protected abstract void OnSessionConnected(NetPeer peer, int hashKey);

View File

@@ -36,8 +36,6 @@ public static class CrashDumpHandler
Log.Information("[CrashDump] 핸들러 등록 완료 (CrashDir={Dir})", Path.GetFullPath(CRASH_DIR)); Log.Information("[CrashDump] 핸들러 등록 완료 (CrashDir={Dir})", Path.GetFullPath(CRASH_DIR));
} }
// ─── 핸들러 ──────────────────────────────────────────────────────────
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {
Exception? ex = e.ExceptionObject as Exception; Exception? ex = e.ExceptionObject as Exception;
@@ -52,8 +50,6 @@ public static class CrashDumpHandler
WriteCrash(tag, e.Exception); WriteCrash(tag, e.Exception);
} }
// ─── 핵심 처리 ───────────────────────────────────────────────────────
private static void WriteCrash(string tag, Exception? ex) private static void WriteCrash(string tag, Exception? ex)
{ {
try try