feat : 더미 플레이어 구현 / 더미클라 서비스 에코용, 더미 플레이어용 분기

This commit is contained in:
qornwh1
2026-03-04 08:55:27 +09:00
parent d2ba2ccb48
commit 9930348d5e
10 changed files with 678 additions and 287 deletions

View File

@@ -16,10 +16,13 @@ namespace ClientTester.Packet
ushort size = (ushort)payload.Length;
byte[] result = new byte[4 + payload.Length];
// 2바이트 패킷 타입 헤더
result[0] = (byte)(type & 0xFF);
result[1] = (byte)(type >> 8);
// 2바이트 패킷 길이 헤더
result[2] = (byte)(size & 0xFF);
result[3] = (byte)(size >> 8);
// protobuf 페이로드
Buffer.BlockCopy(payload, 0, result, 4, payload.Length);
return result;
}
@@ -36,10 +39,12 @@ namespace ClientTester.Packet
ushort type = (ushort)(data[0] | (data[1] << 8));
ushort size = (ushort)(data[2] | (data[3] << 8));
// 헤더에 명시된 size와 실제 데이터 길이 검증
int actualPayloadLen = data.Length - 4;
if (size > actualPayloadLen)
{
Log.Warning("[PacketSerializer] 페이로드 크기 불일치 HeaderSize={Size} ActualSize={Actual}", size, actualPayloadLen);
Log.Warning("[PacketSerializer] 페이로드 크기 불일치 HeaderSize={Size} ActualSize={Actual}", size,
actualPayloadLen);
return (0, 0, null)!;
}