fix: Fixes edge cases with the network packet loop (#1959)
This commit is contained in:
parent
e0fcde885c
commit
2a7aa1905b
2 changed files with 10 additions and 6 deletions
|
|
@ -591,7 +591,7 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
|
|||
|
||||
if (newSeed == 0)
|
||||
{
|
||||
HandleError(0, 0);
|
||||
Disconnect(string.Empty);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -602,16 +602,16 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
|
|||
_parserState = ParserState.AwaitingNextPacket;
|
||||
_protocolState = ProtocolState.GameServer_AwaitingGameServerLogin;
|
||||
}
|
||||
else
|
||||
else // Don't allow partial packets on initial connection, just disconnect them.
|
||||
{
|
||||
_parserState = ParserState.AwaitingPartialPacket;
|
||||
Disconnect(string.Empty);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ProtocolState.LoginServer_AwaitingLogin:
|
||||
{
|
||||
if (packetId != 0xCF && packetId != 0x80)
|
||||
if (packetId != 0x80)
|
||||
{
|
||||
LogInfo("Possible encrypted client detected, disconnecting...");
|
||||
HandleError(packetId, packetLength);
|
||||
|
|
@ -659,7 +659,12 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
|
|||
|
||||
case ProtocolState.GameServer_AwaitingGameServerLogin:
|
||||
{
|
||||
if (packetId != 0x91 && packetId != 0x80)
|
||||
if (packetId == 0x80)
|
||||
{
|
||||
goto case ProtocolState.LoginServer_AwaitingLogin;
|
||||
}
|
||||
|
||||
if (packetId != 0x91)
|
||||
{
|
||||
HandleError(packetId, packetLength);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue