feat : 스트레스 테스트 기능 추가 / 패킷 처리량 제한 / 프로젝트 상황 리드미 추가
This commit is contained in:
@@ -184,6 +184,22 @@ public abstract class ServerBase : INetEventListener
|
||||
return;
|
||||
}
|
||||
|
||||
// 패킷 레이트 리미팅 체크
|
||||
if (session.CheckRateLimit())
|
||||
{
|
||||
// 3회 연속 초과 시 강제 연결 해제
|
||||
if (session.RateLimitViolations >= 3)
|
||||
{
|
||||
Log.Warning("[Server] 레이트 리밋 초과 강제 해제 HashKey={Key} PeerId={Id}", session.HashKey, peer.Id);
|
||||
peer.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Warning("[Server] 레이트 리밋 초과 ({Count}회) HashKey={Key} PeerId={Id}", session.RateLimitViolations, session.HashKey,
|
||||
peer.Id);
|
||||
return; // 패킷 드롭
|
||||
}
|
||||
|
||||
HandlePacket(peer, session.HashKey, type, payload);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user