Skip to content

Commit

Permalink
Tightens the network loop
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Sep 20, 2024
1 parent 328fbff commit 09ec0a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Projects/Server/Network/NetState/NetState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public void HandleReceive(bool throttled = false)

if (newSeed == 0)
{
HandleError(0, 0);
Disconnect(string.Empty);
return;
}

Expand All @@ -602,16 +602,16 @@ public void HandleReceive(bool throttled = false)
_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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public static unsafe void Configure()
IncomingPackets.Register(0x91, &GameLogin, 65, outgameOnly: true);
IncomingPackets.Register(0xA0, &PlayServer, 3, outgameOnly: true);
IncomingPackets.Register(0xBD, &ClientVersion);
IncomingPackets.Register(0xCF, &AccountLogin, outgameOnly: true);
IncomingPackets.Register(0xE1, &ClientType);
IncomingPackets.Register(0xEF, &LoginServerSeed, 21, outgameOnly: true);
IncomingPackets.Register(0xF8, &CreateCharacter, 106, outgameOnly: true);
Expand Down

0 comments on commit 09ec0a1

Please sign in to comment.