fix : 에코 클라이언트 수신 버그 수정
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user