Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This is just a fork!
I am not the author of this code, I am just keeping it updated for my personal use. Please have a look at the original author.

# Minecraft Server Status Query [Discontinued]

[![Latest Stable Version](https://poser.pugx.org/funnyitselmo/minecraftserverstatus/v/stable)](https://packagist.org/packages/funnyitselmo/minecraftserverstatus) [![Total Downloads](https://poser.pugx.org/funnyitselmo/minecraftserverstatus/downloads)](https://packagist.org/packages/funnyitselmo/minecraftserverstatus) [![Latest Unstable Version](https://poser.pugx.org/funnyitselmo/minecraftserverstatus/v/unstable)](https://packagist.org/packages/funnyitselmo/minecraftserverstatus) [![License](https://poser.pugx.org/funnyitselmo/minecraftserverstatus/license)](https://packagist.org/packages/funnyitselmo/minecraftserverstatus)
Expand All @@ -8,7 +11,7 @@ Minecraft Server Status Query, written in PHP, with online players, motd, favico

### Installation
```
composer require funnyitselmo/minecraftserverstatus
composer require ok236449/minecraftserverstatus
```
### Tutorial
```Java
Expand All @@ -26,6 +29,16 @@ if (! $response) {
currently are " . $response['players'] . " players online
of a maximum of " . $response['max_players'] . ". The motd of the server is '" . $response['description'] . "'.
The server has a ping of " . $response['ping'] . " milliseconds.";


if($response['player_list'])
echo 'Connected players:<br>';
{
foreach($response['player_list'] as $player)
{
echo $player . '<br>';
}
}
}
```
If the server is offline MinecraftServerStatus::query returns false else it returns an array which contains the server informations.
Expand Down Expand Up @@ -67,6 +80,10 @@ The following table contains the available variables the response can contain. T
<td>Number of the slots of the server</td>
</tr>
<tr>
<td><pre>'player_list'</pre></td>
<td>Collection of connected players. It contains player´s nick and uuid.</td>
</tr>
<tr>
<td><pre>'description'</pre></td>
<td>The message of the day of the server </td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name" : "funnyitselmo/minecraftserverstatus",
"name" : "ok236449/minecraftserverstatus",
"type" : "library",
"description" : "Minecraft Server Status Query, written in PHP, with online players, motd, favicon and more server related informations without plugins and enable-query.",
"keywords" : [
"minecraft",
"server",
"status"
],
"license" : "BSD",
"license" : "proprietary",
"repositories" : [{
"type" : "vcs",
"url" : "https://github.com/FunnyItsElmo/PHP-Minecraft-Server-Status-Query.git"
"url" : "https://github.com/ok236449/PHP-Minecraft-Server-Status-Query.git"
}
],
"autoload" : {
Expand Down
1 change: 1 addition & 0 deletions src/MinecraftServerStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static function query ($host = '127.0.0.1', $port = 25565) {
'protocol' => isset($data->version->protocol) ? $data->version->protocol : false,
'players' => isset($data->players->online) ? $data->players->online : false,
'max_players' => isset($data->players->max) ? $data->players->max : false,
'player_list' => isset($data->players->sample) ? $data->players->sample : false,
'description' => $description,
'description_raw' => $descriptionRaw,
'favicon' => isset($data->favicon) ? $data->favicon : false,
Expand Down