Skip to content

Commit fe98040

Browse files
committed
Update readme
1 parent f33c75a commit fe98040

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
11
# SteamQueryNet
2-
Steam Server Query API written in netstandard2.0
2+
3+
SteamQueryNet is a C# wrapper for [Steam Server Queries](https://developer.valvesoftware.com/wiki/Server_queries) UDP protocol. It is;
4+
5+
* Light
6+
* Dependency free
7+
* Written in .net standard 2.0 so that it works with both .NET framework 4.6+ and core.
8+
9+
# How to install ?
10+
11+
Check out [SteamQueryNet](https://www.nuget.org/packages/SteamQueryNet/) on nuget.
12+
13+
# How to use ?
14+
15+
SteamQueryNet comes with a single object that gives you access to all API's of the [Steam protocol](https://developer.valvesoftware.com/wiki/Server_queries) which are;
16+
17+
* Server information (server name, capacity etc).
18+
* Concurrent players.
19+
* Server rules (friendlyfire, roundttime etc). **Warning: currently does not work due to a protocol issue on server source server.**
20+
21+
## Creating an instance
22+
To make us of the API's listed above, an instance of `ServerQuery` should be created.
23+
24+
```csharp
25+
string serverIp = "127.0.0.1";
26+
int serverPort = 27015;
27+
IServerQuery serverQuery = new ServerQuery(serverIp, serverPort);
28+
```
29+
30+
once its created functions below returns informations desired,
31+
32+
[ServerInfo](https://github.com/cyilcode/SteamQueryNet/blob/master/SteamQueryNet/SteamQueryNet/Models/ServerInfo.cs)
33+
```csharp
34+
ServerInfo serverInfo = serverQuery.GetServerInfo();
35+
```
36+
37+
[Players](https://github.com/cyilcode/SteamQueryNet/blob/master/SteamQueryNet/SteamQueryNet/Models/Player.cs)
38+
```csharp
39+
// Concurrent Players
40+
List<Player> players = serverQuery.GetPlayers();
41+
```
42+
43+
[Rules](https://github.com/cyilcode/SteamQueryNet/blob/master/SteamQueryNet/SteamQueryNet/Models/Rule.cs)
44+
```csharp
45+
// Rules
46+
List<Rules> rules = serverQuery.GetRules();
47+
```
48+
49+
and thats it.
50+
51+
# Todos
52+
* Write MOAR TESTS !
53+
* Enable CI

0 commit comments

Comments
 (0)