fix : 에코 클라이언트 수신 버그 수정

This commit is contained in:
qornwh1
2026-03-04 16:02:22 +09:00
parent 343ea43a03
commit 18fd8a0737

View File

@@ -4,6 +4,7 @@ using System.Text;
using ClientTester.Packet;
using LiteNetLib;
using LiteNetLib.Utils;
using ProtoBuf;
using Serilog;
namespace ClientTester.EchoDummyService;
@@ -76,10 +77,14 @@ public class EchoDummyClients
{
short code = reader.GetShort();
short bodyLength = reader.GetShort();
string? msg = reader.GetString();
byte[] payloadBytes = new byte[bodyLength];
reader.GetBytes(payloadBytes, bodyLength);
EchoPacket echoPacket = PacketSerializer.DeserializePayload<EchoPacket>(payloadBytes);
string msg = echoPacket.Str;
long sentTick;
if (msg != null && msg.StartsWith("Echo seq:") &&
if (msg.StartsWith("Echo seq:") &&
int.TryParse(msg.Substring("Echo seq:".Length), out int seq) &&
pendingPings.TryRemove(seq, out sentTick))
{