GithubHelp home page GithubHelp logo

15406511 / php-source-query Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xpaw/php-source-query

0.0 0.0 0.0 232 KB

๐Ÿ˜ PHP library to query servers that implement Source Engine Query protocol

License: GNU Lesser General Public License v2.1

Shell 0.56% PHP 99.44%

php-source-query's Introduction

PHP Source Query

Build Status Test Coverage Packagist Downloads Packagist Version

This class was created to query game server which use the Source query protocol, this includes all source games, and all the games that implement Steamworks.

The class also allows you to query servers using RCON although this only works for half-life 1 and source engine games.

Minecraft also uses Source RCON protocol, and this means you can use this class to send commands to your minecraft server while having engine set to Source engine.

โš ๏ธ Please do not create issues when you are unable to retrieve information from a server, unless you can prove that there is a bug within the library.

Requirements

Protocol Specifications

Supported Games

AppID Game Query RCON Notes
~ All HL1/HL2 games and mods โœ… โœ…
10 Counter-Strike 1.6 โœ… โœ…
730 Counter-Strike: Global Offensive โœ… โœ…
440 Team Fortress 2 โœ… โœ…
550 Left 4 Dead 2 โœ… โœ…
1002 Rag Doll Kung Fu โœ… โœ…
2400 The Ship โœ… โœ…
4000 Garry's Mod โœ… โœ…
17710 Nuclear Dawn โœ… โœ…
70000 Dino D-Day โœ… โœ…
107410 Arma 3 โœ… โŒ Add +1 to the server port
115300 Call of Duty: Modern Warfare 3 โœ… โœ…
211820 Starbound โœ… โœ… Call SetUseOldGetChallengeMethod method after connecting
244850 Space Engineers โœ… โŒ Add +1 to the server port
252490 Rust โœ… โœ…
282440 Quake Live โœ… โŒ Quake Live uses the ZMQ messaging queue protocol for rcon control.
346110 ARK: Survival Evolved โœ… โœ…
Minecraft โŒ โœ…

Open a pull request if you know another game which supports Source Query and/or RCON protocols.

How to tell if the game supports Source Query Protocol?

Add your server to your favourites in Steam server browser, and if Steam can display information about your server, then the protocol is supported.

Functions

Connect( $Ip, $Port, $Timeout, $Engine ) Opens connection to a server
Disconnect( ) Closes all open connections
Ping( ) Ping the server to see if it exists
Warning: Source engine may not answer to this
GetInfo( ) Returns server info in an array
GetPlayers( ) Returns players on the server in an array
GetRules( ) Returns public rules (cvars) in an array
SetRconPassword( $Password ) Sets rcon password for later use with Rcon()
Rcon( $Command ) Execute rcon command on the server

Also refer to examples folder to work things out.

License

PHP Source Query
Copyright (C) 2012-2015 Pavel Djundik

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

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.