mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
kcp2k V1.37 [2023-07-31]
- fix: #47 KcpServer.Stop now clears connections so they aren't carried over to the next session - fix: KcpPeer doesn't log 'received unreliable message while not authenticated' anymore.
This commit is contained in:
parent
a9cbcf696e
commit
e92e91dcfd
@ -1,3 +1,7 @@
|
||||
V1.37 [2023-07-31]
|
||||
- fix: #47 KcpServer.Stop now clears connections so they aren't carried over to the next session
|
||||
- fix: KcpPeer doesn't log 'received unreliable message while not authenticated' anymore.
|
||||
|
||||
V1.36 [2023-06-08]
|
||||
- fix: #49 KcpPeer.RawInput message size check now considers cookie as well
|
||||
- kcp.cs cleanups
|
||||
|
@ -6,6 +6,10 @@ namespace kcp2k
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
// ArraySegment as HexString for convenience
|
||||
public static string ToHexString(this ArraySegment<byte> segment) =>
|
||||
BitConverter.ToString(segment.Array, segment.Offset, segment.Count);
|
||||
|
||||
// non-blocking UDP send.
|
||||
// allows for reuse when overwriting KcpServer/Client (i.e. for relays).
|
||||
// => wrapped with Poll to avoid WouldBlock allocating new SocketException.
|
||||
|
@ -586,10 +586,17 @@ void OnRawInputUnreliable(ArraySegment<byte> message)
|
||||
}
|
||||
else
|
||||
{
|
||||
// invalid unreliable messages may be random internet noise.
|
||||
// show a warning, but don't disconnect.
|
||||
// otherwise attackers could disconnect someone with random noise.
|
||||
Log.Warning($"KcpPeer: received unreliable message while not authenticated.");
|
||||
// it's common to receive unreliable messages before being
|
||||
// authenticated, for example:
|
||||
// - random internet noise
|
||||
// - game server may send an unreliable message after authenticating,
|
||||
// and the unreliable message arrives on the client before the
|
||||
// 'auth_ok' message. this can be avoided by sending a final
|
||||
// 'ready' message after being authenticated, but this would
|
||||
// add another 'round trip time' of latency to the handshake.
|
||||
//
|
||||
// it's best to simply ignore invalid unreliable messages here.
|
||||
// Log.Info($"KcpPeer: received unreliable message while not authenticated.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user