Skip to content

Commit c07e253

Browse files
committed
V1.0.6 initial commit
1 parent 557844e commit c07e253

18 files changed

Lines changed: 324 additions & 213 deletions

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog for SteamQueryNet v1.0.6
2+
3+
### 1. Enhancements
4+
5+
* ServerInfo model now reduces the `ServerInfo.Bots` from the `ServerInfo.Players` property. So that `ServerInfo.Players` reflects real player count only. This was an issue because some server flag their bots as real players.
6+
7+
* Added a new constructor to `ServerQuery` to allow users to be able to bind their own local IPEndpoint.
8+
9+
* Added a new constructor to `ServerQuery` to allow users to be able to provide hostnames and ports in one single string like
10+
11+
```
12+
string myHostAndPort = "127.0.0.1:27015";
13+
// or
14+
string myHostAndPort = "localhost:27015";
15+
```
16+
17+
* Added a CHANGELOG. LUL :)
18+
19+
### 2. Bug fixes
20+
21+
* Fixed a bug where player information was not gathered correctly by the `ServerQuery.GetPlayers()` function.
22+
23+
* Fixed a bug where player count was not gathered by the `ServerQuery.GetServerInfo()` function.
24+
25+
### 3. Soft-deprecations (no warnings emitted)
26+
27+
* Removed `sealed` modifiers from all `SteamQueryNet.Models` namespace.
28+
29+
### 4. Hard-deprecations
30+
31+
* `ServerQuery` constructor parameter `int port` now changed to `ushort` to remove all integer range checks since the UDP port is already literally an `ushort`.
32+
33+
* Removed port range tests.

SteamQueryNet/SteamQueryNet.Tests/ServerQueryTests.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
using System;
2-
using System.Net;
2+
33
using Xunit;
44

55
namespace SteamQueryNet.Tests
66
{
77
public class ServerQueryTests
88
{
9-
private const string IP_ADDRESS = "209.222.101.220";
9+
private const string IP_ADDRESS = "54.37.111.216";
1010
private const int PORT = 27015;
1111

1212
[Theory]
1313
[InlineData(IP_ADDRESS)]
1414
public void ShouldInitializeWithProperHost(string host)
1515
{
1616
var squery = new ServerQuery(host, PORT);
17-
var t = squery.GetServerInfo();
18-
}
19-
20-
[Theory]
21-
[InlineData(IPEndPoint.MaxPort + 1)]
22-
[InlineData(IPEndPoint.MinPort - 1)]
23-
public void ShouldNotInitializeWithAPortOutOfRange(int port)
24-
{
25-
Assert.Throws<ArgumentException>(() =>
26-
{
27-
var squery = new ServerQuery(IP_ADDRESS, port);
28-
});
17+
var t = squery.GetPlayers();
2918
}
3019

3120
[Theory]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace SteamQueryNet.Attributes
4+
{
5+
[AttributeUsage(AttributeTargets.Property)]
6+
internal sealed class EDFAttribute : Attribute
7+
{
8+
internal EDFAttribute(byte condition) { }
9+
}
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System;
2+
3+
namespace SteamQueryNet.Attributes
4+
{
5+
[AttributeUsage(AttributeTargets.Property)]
6+
internal sealed class NotParsableAttribute : Attribute { }
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System;
2+
3+
namespace SteamQueryNet.Attributes
4+
{
5+
[AttributeUsage(AttributeTargets.Property)]
6+
internal sealed class ParseCustomAttribute : Attribute { }
7+
}

SteamQueryNet/SteamQueryNet/Models/PacketHeaders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace SteamQueryNet.Models
22
{
3-
public sealed class RequestHeaders
3+
internal sealed class RequestHeaders
44
{
55
public const byte A2S_INFO = 0x54;
66

SteamQueryNet/SteamQueryNet/Models/Player.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using SteamQueryNet.Models.TheShip;
2-
using SteamQueryNet.Utils;
2+
using SteamQueryNet.Attributes;
33
using System;
44

55
namespace SteamQueryNet.Models
66
{
7-
public sealed class Player
7+
public class Player
88
{
99
/// <summary>
1010
/// Index of player chunk starting from 0.

SteamQueryNet/SteamQueryNet/Models/Rule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace SteamQueryNet.Models
22
{
3-
public sealed class Rule
3+
public class Rule
44
{
55
/// <summary>
66
/// Name of the rule.

SteamQueryNet/SteamQueryNet/Models/ServerInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using SteamQueryNet.Enums;
22
using SteamQueryNet.Models.TheShip;
3-
using SteamQueryNet.Utils;
3+
using SteamQueryNet.Attributes;
44

55
namespace SteamQueryNet.Models
66
{
7-
public sealed class ServerInfo
7+
public class ServerInfo
88
{
99
/// <summary>
1010
/// Protocol version used by the server.

SteamQueryNet/SteamQueryNet/Models/TheShip/ShipGameInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace SteamQueryNet.Models.TheShip
55
/// <summary>
66
/// These fields only exist in a response if the server is running The Ship.
77
/// </summary>
8-
public sealed class ShipGameInfo
8+
public class ShipGameInfo
99
{
1010
/// <summary>
1111
/// Indicates the game mode.

0 commit comments

Comments
 (0)