fix: Fixes CUO connecting with new TCP Peek Filtering (#2137)
This commit is contained in:
parent
49fd5f210d
commit
ad361001c5
1 changed files with 5 additions and 3 deletions
|
|
@ -169,13 +169,15 @@ public static class TcpServer
|
||||||
var bytesRead = await socket.ReceiveAsync(firstBytes, SocketFlags.Peek, cts.Token);
|
var bytesRead = await socket.ReceiveAsync(firstBytes, SocketFlags.Peek, cts.Token);
|
||||||
|
|
||||||
var isValid =
|
var isValid =
|
||||||
// Older clients only send the 4 byte seed first
|
// Older clients only send the 4 byte seed first then 0x80
|
||||||
(UOClient.MinRequired == null || UOClient.MinRequired < ClientVersion.Version6050) && bytesRead == 4 ||
|
(UOClient.MinRequired == null || UOClient.MinRequired < ClientVersion.Version6050) && (
|
||||||
|
bytesRead == 4 || bytesRead >= 66 && firstBytes[4] == 0x80) ||
|
||||||
|
// Newer clients
|
||||||
(UOClient.MaxRequired == null || UOClient.MaxRequired >= ClientVersion.Version6050) && (
|
(UOClient.MaxRequired == null || UOClient.MaxRequired >= ClientVersion.Version6050) && (
|
||||||
// Account Login - 0xEF + 0x80 (83 bytes)
|
// Account Login - 0xEF + 0x80 (83 bytes)
|
||||||
bytesRead >= 83 && firstBytes[0] == 0xEF && firstBytes[21] == 0x80 ||
|
bytesRead >= 83 && firstBytes[0] == 0xEF && firstBytes[21] == 0x80 ||
|
||||||
// Game Login - 4 bytes + 0x91 (69 bytes)
|
// Game Login - 4 bytes + 0x91 (69 bytes)
|
||||||
firstBytes[4] == 0x91 && bytesRead >= 69
|
bytesRead >= 69 && firstBytes[4] == 0x91
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Validate client version is v4 -> v7 for 0xEF packet
|
// TODO: Validate client version is v4 -> v7 for 0xEF packet
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue