Skip to content

Commit

Permalink
Fix A2S GetInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jun 4, 2021
1 parent eeb99f6 commit fc0e662
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OpenGSQ/OpenGSQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyTitle>OpenGSQ</AssemblyTitle>
<VersionPrefix>1.0.0</VersionPrefix>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>OpenGSQ, BattlefieldDuck</Authors>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>OpenGSQ</AssemblyName>
Expand Down
11 changes: 7 additions & 4 deletions OpenGSQ/Protocols/A2S.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,18 @@ private byte[] ConnectAndSendChallenge(UdpClient udpClient, Request request)
udpClient.Client.SendTimeout = _timeout;
udpClient.Client.ReceiveTimeout = _timeout;

// Set up request data
// Set up request base
var requestBase = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, (byte)request };
var requestData = requestBase;

if (request == Request.A2S_INFO)
{
requestData = requestData.Concat(Encoding.Default.GetBytes("Source Engine Query\0")).ToArray();
requestBase = requestBase.Concat(Encoding.Default.GetBytes("Source Engine Query\0")).ToArray();
}
else

// Set up request data
var requestData = requestBase;

if (request != Request.A2S_INFO)
{
requestData = requestData.Concat(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF }).ToArray();
}
Expand Down

0 comments on commit fc0e662

Please sign in to comment.