fix : 코드 분석 후 버그 및 결함 16건 수정
- ARepository 전체 메서드 IDbConnection using 추가 (커넥션 풀 누수) - GameServer NotImplementedException → 로그 출력으로 변경 - ServerBase Auth/Echo payload 길이 검증 주석 해제 - PacketSerializer MemoryStream using 추가 (양쪽 솔루션) - PacketSerializer size 파라미터 제거, 자동 계산 + size 검증 구현 - ServerBase NetDataWriter cachedWriter 재사용 (GC 압력 감소) - ServerBase isListening volatile 추가 - ServerBase Deserialize 실패 시 null payload 체크 - ServerBase Serilog 구조적 로깅 템플릿 구문 수정 - TestHandler 전체 메서드 try-catch 추가 - TestRepository IDbConnectionFactory 인터페이스로 변경 - DummyClients BodyLength 계산 불일치 수정 - DummyClients pendingPings 메모리 누수 방지 - EchoClientTester async void 이벤트 → 동기 Cancel()로 변경 - ANALYSIS.md 코드 분석 및 문제점 보고서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,37 +12,79 @@ public class TestHandler
|
||||
|
||||
public async Task<string> GetTestAsync(int id)
|
||||
{
|
||||
Test? result = await _testService.GetTestAsync(id);
|
||||
return result is null
|
||||
? HandlerHelper.Error("Test not found")
|
||||
: HandlerHelper.Success(result);
|
||||
try
|
||||
{
|
||||
Test? result = await _testService.GetTestAsync(id);
|
||||
return result is null
|
||||
? HandlerHelper.Error("Test not found")
|
||||
: HandlerHelper.Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetTestByUuidAsync(string uuid)
|
||||
{
|
||||
Test? result = await _testService.GetTestByUuidAsync(uuid);
|
||||
return result is null
|
||||
? HandlerHelper.Error("Test not found")
|
||||
: HandlerHelper.Success(result);
|
||||
try
|
||||
{
|
||||
Test? result = await _testService.GetTestByUuidAsync(uuid);
|
||||
return result is null
|
||||
? HandlerHelper.Error("Test not found")
|
||||
: HandlerHelper.Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetAllTestsAsync()
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.GetAllTestsAsync());
|
||||
try
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.GetAllTestsAsync());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> CreateTestAsync(int testA, string testB, double testC)
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.CreateTestAsync(testA, testB, testC));
|
||||
try
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.CreateTestAsync(testA, testB, testC));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> UpdateTestAsync(int id, int? testA, string? testB, double? testC)
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.UpdateTestAsync(id, testA, testB, testC));
|
||||
try
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.UpdateTestAsync(id, testA, testB, testC));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> DeleteTestAsync(int id)
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.DeleteTestAsync(id));
|
||||
try
|
||||
{
|
||||
return HandlerHelper.Success(await _testService.DeleteTestAsync(id));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return HandlerHelper.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace MMOserver.RDB.Repositories;
|
||||
// 실제 호출할 쿼리들
|
||||
public class TestRepository : ARepository<Test>
|
||||
{
|
||||
public TestRepository(DbConnectionFactory factory) : base(factory)
|
||||
public TestRepository(IDbConnectionFactory factory) : base(factory)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user