Skip to content

Commit c2902fb

Browse files
Merge pull request #1 from startersclan/docs/simplify-readme-examples
Docs: Simplify readme examples
2 parents 15c6d82 + 31f0d35 commit c2902fb

1 file changed

Lines changed: 26 additions & 40 deletions

File tree

README.md

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Powershell implementation of [SourceQuery](https://developer.valvesoftware.com/w
1010

1111
Engine | Games
1212
:---------------:|:---------------:
13-
`Source` (`srcds`) | `left4dead2`, `csgo`
13+
`Source` (`srcds`) | `left4dead2`, `csgo`, `hl2mp`
1414
`Goldsource` (`hlds`) | `cstrike`, `czero`, `valve`. Should work for all `hlds` games.
1515

1616
The libraries will probably work on a lot more games than those in the list.
@@ -19,60 +19,46 @@ The libraries will probably work on a lot more games than those in the list.
1919

2020
The libraries are *stateless* - that is, `SourceQuery`, `SourceRcon`, and `GoldsourceRcon` are pure functions, storing no authentication or challenge states. This is to be expected for Source Queries, but not for Rcon. A possible future area of improvement would be to make `SourceRcon` and `GoldsourceRcon` construct and return a stateful Rcon object, that would improve client performance especially when multiple rcon commands need to be executed in sequence.
2121

22-
## SourceQuery Examples
22+
## Usage
2323

24-
### Source Engine
24+
### SourceQuery
2525

2626
```powershell
27+
# Source Engine
2728
Import-Module SourceQuery
28-
29-
# A2S_INFO query
30-
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'info' # Returns a hashtable of server metadata
31-
32-
# A2S_PLAYER query
33-
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'players' # Returns a hashtable of players
34-
35-
# A2S_RULES query
36-
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'rules' # Returns a hashtable of server cvars
37-
38-
# A2A_PING query
39-
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'ping' # Returns a hashtable of whether the ping was successful
40-
```
41-
42-
### Goldsource Engine
43-
44-
```powershell
29+
# A2S_INFO query. Returns a hashtable of server metadata
30+
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'info'
31+
# A2S_PLAYER query. Returns a hashtable of players
32+
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'players' #
33+
# A2S_RULES query, Returns a hashtable of server cvars
34+
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'rules'
35+
# A2A_PING query. Returns a hashtable of whether the ping was successful
36+
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'ping'
37+
38+
# GoldSource Engine
4539
Import-Module SourceQuery
46-
47-
# A2S_INFO query
48-
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'info' # Returns a hashtable of server metadata
49-
50-
# A2S_PLAYER query
51-
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'players' # Returns a hashtable of players
52-
53-
# A2S_RULES query
54-
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'rules' # Returns a hashtable of server cvars
55-
56-
# A2A_PING query
57-
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'ping' # Returns a hashtable of whether the ping was successful
40+
# A2S_INFO query - Returns a hashtable of server metadata
41+
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'info'
42+
# A2S_PLAYER query. Returns a hashtable of players
43+
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'players'
44+
# A2S_RULES query, Returns a hashtable of server cvars
45+
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'rules'
46+
# A2A_PING query. Returns a hashtable of whether the ping was successful
47+
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'ping'
5848
```
5949

60-
## Rcon Examples
61-
62-
### Source Engine
50+
### Rcon
6351

6452
```powershell
53+
# Source Engine
6554
Import-Module SourceRcon
6655
SourceRcon -Address $ip -Port $port -Password $rcon_password -Command 'status'
67-
```
6856
69-
### Goldsource Engine
70-
71-
```powershell
57+
# GoldSource Engine
7258
Import-Module GoldsourceRcon
7359
GoldsourceRcon -Address $ip -Port $port -Password $rcon_password -Command 'status'
7460
```
7561

76-
## Debugging
62+
### Debugging
7763

7864
Use the `-Verbose` switch to turn on verbose output.

0 commit comments

Comments
 (0)