-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8859f71
commit 617ed55
Showing
4 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ documentation. | |
:maxdepth: 3 | ||
|
||
install | ||
usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Basic Usage | ||
=========== | ||
|
||
Here's a quick example of how you can use the OpenGSQ library to query a server using the VCMP protocol: | ||
|
||
.. code-block:: php | ||
<?php | ||
// Include the Composer autoloader | ||
require_once '../vendor/autoload.php'; | ||
// Import the Vcmp class from the OpenGSQ\Protocols namespace | ||
use OpenGSQ\Protocols\Vcmp; | ||
// Create a new Vcmp object with the specified host and port | ||
$vcmp = new Vcmp('123.123.123.123', 8114); | ||
// Get the status of the server | ||
$status = $vcmp->getStatus(); | ||
// Output the status information | ||
var_dump($status); | ||
// Get the players on the server | ||
$players = $vcmp->getPlayers(); | ||
// Output the player information | ||
var_dump($players); | ||
In this example, we first include the Composer autoloader and import the `Vcmp` class. We then create a new `Vcmp` object, specifying the host and port of the server we want to query. Finally, we call the `getStatus` and `getPlayers` methods to retrieve and output information about the server and its players. |