From 31f0d35e3db72999b504aa27c2368baedb8b39ee Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Fri, 9 Apr 2021 00:51:31 +0000 Subject: [PATCH] Docs: Simplify readme examples --- README.md | 66 ++++++++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index b1e6276..7b19a6f 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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.