diff --git a/README.md b/README.md index 6b43f84..76144ec 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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:
'; + { + foreach($response['player_list'] as $player) + { + echo $player . '
'; + } + } } ``` If the server is offline MinecraftServerStatus::query returns false else it returns an array which contains the server informations. @@ -67,6 +80,10 @@ The following table contains the available variables the response can contain. T Number of the slots of the server +
'player_list'
+Collection of connected players. It contains player´s nick and uuid. + +
'description'
The message of the day of the server diff --git a/composer.json b/composer.json index 98458fc..6aed43b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "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" : [ @@ -7,10 +7,10 @@ "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" : { diff --git a/src/MinecraftServerStatus.php b/src/MinecraftServerStatus.php index 185f6d9..1f0edec 100644 --- a/src/MinecraftServerStatus.php +++ b/src/MinecraftServerStatus.php @@ -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,