diff --git a/Tools/PHP/GetOnlinePlayers.php b/Tools/PHP/GetOnlinePlayers.php new file mode 100644 index 00000000..092ced35 --- /dev/null +++ b/Tools/PHP/GetOnlinePlayers.php @@ -0,0 +1,31 @@ +pconnect(127.0.0.1, 6379, 2.5, "Server1"); +$redis->auth("yourlongasspasswordhere"); + +$data = $redis->get('PLAYERS:' . $instance); +$onlineUIDs = json_decode($data); + +// loop though online player UID's +foreach ($onlineUIDs as $key => $UID) { + + // get player name + $dataRaw = $redis->get('PlayerData:' . $UID); + $data = json_decode($dataRaw); + + // print player name + echo '

'. $data[0].'

'; +} + +?>