Download the PHP package t0xicvybez/gamequery without Composer

On this page you can find all versions of the php package t0xicvybez/gamequery. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gamequery

GameQuery

Packagist Version npm version

query.arkenbot.app — docs, the full game list, and a live demo you can point at your own server.

A dependency-free game server query library — read player counts, map, hostname, ping, and rules from one or many servers at once. It ships as two parallel ports that stay in lockstep: a PHP library (t0xicvybez/gamequery) and a Node/TypeScript library (@t0xicvybez/gamequery), with the same protocols, the same API, and the same results.

Built by @t0xicVybez and used in production by ArkenBot.

Installation

PHP (Composer):

PHP (standalone, e.g. a shared webhost with no Composer): drop in the src/ folder and autoload.php, then require __DIR__ . '/autoload.php';.

Node / TypeScript:

Ships both ESM and CommonJS, so import and require() both work. See node/ for the TypeScript API and CLI details.

Quick start

PHP:

Just one server, or don't know the protocol? Skip the ceremony:

Node / TypeScript:

Result API

Addresses accept IPv6 in bracket form ([::1]:27015). Every parser is fuzzed against malformed input, so a hostile or broken server reply can't crash it.

Results come back in add order, one per server. data holds whatever the protocol parsed — see each protocol class's parse() for its exact fields.

Supported protocols

23 protocol families / 33 registered keys, identical across both ports. Parenthesised keys are aliases or variants (e.g. source-players adds the player list, -info variants skip it).

Key Family / games Transport
source (source-players, source-full) Source / A2S — CS2, TF2, Rust, ARK, GMod, SCUM, most Steamworks games UDP
minecraft (minecraft-ping) Minecraft: Java Edition SLP (-ping adds 0x01 ping latency) TCP
minecraft-legacy Minecraft: Java Edition (≤1.6 legacy ping) TCP
minecraft-query Minecraft: Java enable-query (full player list) UDP
bedrock (minecraft-bedrock) Minecraft: Bedrock Edition (RakNet) UDP
fivem (fivem-info) FiveM / CFX (GTA V multiplayer) TCP/HTTP
palworld (palworld-info) Palworld REST API TCP/HTTP
quakeworld (quake1) QuakeWorld / Quake 1 UDP
quake2 id Tech 2 / Quake 2 UDP
quake3 id Tech 3 — Quake 3, CoD 1/2/4, OpenArena, Xonotic, ET UDP
gamespy1 GameSpy 1 — Unreal, early UT, Tribes 2, older titles UDP
gamespy2 GameSpy 2 — Battlefield 1942/Vietnam, Halo, UT2004 UDP
gamespy3 GameSpy 3 — Battlefield 2, Crysis, UT3, later titles UDP
unreal2 (unreal2-info) Unreal Engine 2 — UT2003/2004, Killing Floor UDP
doom3 id Tech 4 — Doom 3, Quake 4, ET: Quake Wars, Prey UDP
ase All-Seeing Eye — Multi Theft Auto (MTA:SA) UDP
mumble Mumble / Murmur voice servers UDP
teamspeak3 TeamSpeak 3 / TeaSpeak (ServerQuery) TCP
frostbite Battlefield 3/4, Bad Company 2, Medal of Honor TCP
assettocorsa Assetto Corsa (HTTP /INFO) TCP/HTTP
terraria Terraria via TShock REST TCP/HTTP
samp (openmp, samp-info) SA-MP / open.mp (GTA: San Andreas) UDP
satisfactory Satisfactory Lightweight Query (name/state/build) UDP

A few protocols need extra input: Palworld and Terraria take an admin password / token, TeamSpeak 3 takes the voice port, and Assetto Corsa is queried on its HTTP port. Pass these through the per-server options bag — each protocol class's docblock lists the keys it reads.

Command-line interface

Both ports ship a gamequery CLI that emits JSON on stdout — handy for calling from any language, or from a shell:

The --batch form takes a JSON array and queries every entry concurrently. When a password is involved, keep it off the process table: pass it via the GAMEQUERY_PASSWORD env var or --password-stdin rather than a --password flag (which is visible to anything that can run ps). The CLI always exits 0 (check the online field) unless there's a usage error.

Architecture

The core idea: every game query protocol, however different its byte layout, is a linear conversation — send a packet, look at the reply, decide whether to send another. A protocol is just three methods (initialStep, nextStep, parse) describing that conversation; it never touches a socket. The transport layer owns every socket, timer, and retry and knows nothing about A2S or Minecraft specifically. That split is what keeps the concurrency engine small and makes adding a game a matter of writing one focused class.

Adding a protocol

  1. Create the protocol class in both ports (src/Protocol/YourGame.php and node/src/protocol/YourGame.ts), extending AbstractProtocol.
  2. Implement transport(), initialStep(), nextStep(), and parse(). See Source for a challenge/response example or Minecraft for a single-shot one.
  3. Register it in both ProtocolRegistry files, or at runtime:

  4. Add a crafted-packet test to both smoke suites.

No changes to the transport layer are ever needed for a new protocol. The PHP and Node ports must move together — see CONTRIBUTING.md.

Address resolution: protocols whose request embeds the server's own numeric IP (SA-MP/open.mp) override requiresAddressResolution() to return true; the transport then resolves the host to an IPv4 address before initialStep() and exposes it via Server::address(). Protocols that don't opt in pay no cost.

Known limitations

Kept deliberately honest — these are the edges worth knowing about:

Testing

Generate the API reference with cd node && npm run docs (typedoc) and composer docs (phpDocumentor — needs the phpDocumentor phar on your PATH).

The unit suites are dependency-free assertions against hand-built, known-good protocol byte sequences — buffer round-tripping, A2S parsing (including the 2020 A2S_INFO challenge and the "Ship" info variant), challenge hand-offs, Minecraft JSON framing, Palworld auth, and a crafted-packet case for every protocol. No network needed; both suites must stay all-green, and every protocol change lands in both ports with matching tests.

The integration.php / integration.test.ts scripts are separate, network-dependent diagnostics: they query real public servers and print a table, never failing the process on an offline server. Point them at your own servers to smoke-test a protocol end to end.

License

@t0xicVybez

GameQuery is free software and stays that way. You can use it, modify it and contribute to it freely; if you distribute a modified version — including running one as a network service — you have to make your source available under the same licence. That's what keeps this project open rather than something somebody repackages and sells closed.

Every published release is AGPL. The pre-0.5.4 releases, which were MIT, have been withdrawn from npm, Packagist and GitHub, so the AGPL is the only licence GameQuery is distributed under.


All versions of gamequery with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package t0xicvybez/gamequery contains the following files

Loading the files please wait ...