Skip to content

Commit

Permalink
Update A2S.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jan 3, 2021
1 parent 93487e9 commit 15704c0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion WindowsGSM/GameServer/Query/A2S.cs
Expand Up @@ -100,7 +100,24 @@ public void SetAddressPort(string address, int port, int timeout = 5)
keys["SpectatorPort"] = br.ReadInt16().ToString();
keys["SpectatorName"] = ReadString(br);
}
if ((edf & 0x20) == 1) { keys["Keywords"] = ReadString(br); }
if ((edf & 0x20) == 1)
{
keys["Keywords"] = ReadString(br);
if (keys["Game"] == "Mordhau")
{
var tags = keys["Keywords"].Split(',');
foreach (var tag in tags)
{
if (tag[0] == 'B' && tag[1] == ':' && int.TryParse(tag.Replace("B:", string.Empty), out int players))
{
keys["Players"] = players.ToString();
break;
}
}
}
}
if ((edf & 0x01) == 1) { keys["GameID"] = br.ReadUInt64().ToString(); }
}
else if (header == GOLDSOURCE_RESPONSE)
Expand Down

0 comments on commit 15704c0

Please sign in to comment.