GithubHelp home page GithubHelp logo

startersclan / pssourcequery Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 90 KB

Powershell implementation of Query and Rcon for Source and Goldsource games.

License: MIT License

PowerShell 100.00%
srcds hlds rcon sourcequery steam source powershell library pwsh valve

pssourcequery's Introduction

PSSourceQuery

github-actions github-release powershell-gallery-release

Powershell implementation of Query and Rcon for Source and Goldsource games.

Install

Open powershell or pwsh and type:

Install-Module -Name PSSourceQuery -Repository PSGallery -Scope CurrentUser -Verbose

If prompted to trust the repository, hit Y and enter.

Usage

-Address may be a DNS or IP address.

-Verbose turns on verbose output for debugging.

Query

Import-Module PSSourceQuery

# Source Engine
# A2S_INFO query. Returns a hashtable of server metadata
SourceQuery -Address $address -Port $port -Engine 'Source' -Type 'info'
# A2S_PLAYER query. Returns a hashtable of players
SourceQuery -Address $address -Port $port -Engine 'Source' -Type 'players'
# A2S_RULES query, Returns a hashtable of server cvars
SourceQuery -Address $address -Port $port -Engine 'Source' -Type 'rules'
# A2A_PING query (deprecated). Returns a hashtable of whether the ping was successful
SourceQuery -Address $address -Port $port -Engine 'Source' -Type 'ping'

# Goldsource Engine
# A2S_INFO query - Returns a hashtable of server metadata
SourceQuery -Address $address -Port $port -Engine 'Goldsource' -Type 'info'
# A2S_PLAYER query. Returns a hashtable of players
SourceQuery -Address $address -Port $port -Engine 'Goldsource' -Type 'players'
# A2S_RULES query, Returns a hashtable of server cvars
SourceQuery -Address $address -Port $port -Engine 'Goldsource' -Type 'rules'
# A2A_PING query (deprecated). Returns a hashtable of whether the ping was successful
SourceQuery -Address $address -Port $port -Engine 'Goldsource' -Type 'ping'

Rcon

Import-Module PSSourceQuery

# Source Engine
SourceRcon -Address $address -Port $port -Password $rcon_password -Command 'status'

# Goldsource Engine
GoldsourceRcon -Address $address -Port $port -Password $rcon_password -Command 'status'

FAQ

Q: Prerequisites?

Q: Verified games?

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

The functions will probably work on a lot more games than those in the list.

Q: ping query not working for some games?

A2A_PING is no longer supported on Counter Strike: Source and Team Fortress 2 servers, and is considered a deprecated feature. See official documentation here for more information.

Notes

The functions 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.

pssourcequery's People

Contributors

leojonathanoh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

leojonathanoh

pssourcequery's Issues

CS2 Support for Query

Hi there!

I have been using the SourceQuery to many things the last like year and a half, to many things. It seems like there is some issues with it on CS2 (Source2) even tho the rcon and those things seems kinda the same. Is it something you want to look into making support for CS2/Source 2?

Basically it seems like the info type is making a lot of gibberish:
image

The players one seem to work slightly better:
image

Environment:
Debian Linux
PowerShell Core 7.3.9

Thanks,
Nikolaj

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.