Skip to content

Commit faa825d

Browse files
committed
修复一个kcp内网连接的bug
1 parent b0a9c3d commit faa825d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Unity/Assets/Scripts/Core/Network/KService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ private void Recv()
276276
{
277277
realAddress = this.cache.ToStr(9, messageLength - 9);
278278
}
279+
else
280+
{
281+
realAddress = this.ipEndPoint.ToString();
282+
}
279283

280284
remoteConn = BitConverter.ToUInt32(this.cache, 1);
281285
localConn = BitConverter.ToUInt32(this.cache, 5);
@@ -298,7 +302,7 @@ private void Recv()
298302

299303
kChannel.RealAddress = realAddress;
300304

301-
IPEndPoint realEndPoint = kChannel.RealAddress == null? kChannel.RemoteAddress : NetworkHelper.ToIPEndPoint(kChannel.RealAddress);
305+
IPEndPoint realEndPoint = NetworkHelper.ToIPEndPoint(kChannel.RealAddress);
302306
this.AcceptCallback(kChannel.Id, realEndPoint);
303307
}
304308
if (kChannel.RemoteConn != remoteConn)

0 commit comments

Comments
 (0)