Skip to content

Commit

Permalink
Merge pull request #1 from startersclan/docs/simplify-readme-examples
Browse files Browse the repository at this point in the history
Docs: Simplify readme examples
  • Loading branch information
leojonathanoh authored Apr 9, 2021
2 parents 15c6d82 + 31f0d35 commit c2902fb
Showing 1 changed file with 26 additions and 40 deletions.
66 changes: 26 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Powershell implementation of [SourceQuery](https://developer.valvesoftware.com/w

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

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

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.

## SourceQuery Examples
## Usage

### Source Engine
### SourceQuery

```powershell
# Source Engine
Import-Module SourceQuery
# A2S_INFO query
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'info' # Returns a hashtable of server metadata
# A2S_PLAYER query
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'players' # Returns a hashtable of players
# A2S_RULES query
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'rules' # Returns a hashtable of server cvars
# A2A_PING query
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'ping' # Returns a hashtable of whether the ping was successful
```

### Goldsource Engine

```powershell
# A2S_INFO query. Returns a hashtable of server metadata
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'info'
# A2S_PLAYER query. Returns a hashtable of players
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'players' #
# A2S_RULES query, Returns a hashtable of server cvars
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'rules'
# A2A_PING query. Returns a hashtable of whether the ping was successful
SourceQuery -Address $ip -Port $port -Engine 'Source' -Type 'ping'
# GoldSource Engine
Import-Module SourceQuery
# A2S_INFO query
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'info' # Returns a hashtable of server metadata
# A2S_PLAYER query
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'players' # Returns a hashtable of players
# A2S_RULES query
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'rules' # Returns a hashtable of server cvars
# A2A_PING query
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'ping' # Returns a hashtable of whether the ping was successful
# A2S_INFO query - Returns a hashtable of server metadata
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'info'
# A2S_PLAYER query. Returns a hashtable of players
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'players'
# A2S_RULES query, Returns a hashtable of server cvars
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'rules'
# A2A_PING query. Returns a hashtable of whether the ping was successful
SourceQuery -Address $ip -Port $port -Engine 'GoldSource' -Type 'ping'
```

## Rcon Examples

### Source Engine
### Rcon

```powershell
# Source Engine
Import-Module SourceRcon
SourceRcon -Address $ip -Port $port -Password $rcon_password -Command 'status'
```
### Goldsource Engine

```powershell
# GoldSource Engine
Import-Module GoldsourceRcon
GoldsourceRcon -Address $ip -Port $port -Password $rcon_password -Command 'status'
```

## Debugging
### Debugging

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

0 comments on commit c2902fb

Please sign in to comment.