Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Commit

Permalink
Fixing invalid packet id, not matter if it's really invalid or not (#5)
Browse files Browse the repository at this point in the history
After i initially cloned the project and tested the examples, i noticed it will always tell me that i've got packet with invalid id.

I am not sure, but i think one lined if clause does not work with multiline condition put betwenn the () brackets. Probably a issue with inconsistent line endings when loading up the project in some cases.

I've removed the one-liner and the issue was gone.
  • Loading branch information
WaGi-Coding authored Jan 22, 2021
1 parent 60c427d commit 03873c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions RCONServerLib/RemoteConClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,14 @@ internal void ParsePacket(byte[] rawPacket)
return;
}

if (_requestedCommands.ContainsKey(packet.Id) &&
packet.Type == RemoteConPacket.PacketType.ResponseValue)
if (_requestedCommands.ContainsKey(packet.Id) && packet.Type == RemoteConPacket.PacketType.ResponseValue)
{
_requestedCommands[packet.Id](packet.Payload);
}
else
{
Log("Got packet with invalid id " + packet.Id);
}
}
catch (Exception e)
{
Expand Down

0 comments on commit 03873c6

Please sign in to comment.