Cuberite Forum
Players Online in web site. - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Off Topic (https://forum.cuberite.org/forum-9.html)
+--- Forum: Off Topic Discussion (https://forum.cuberite.org/forum-10.html)
+--- Thread: Players Online in web site. (/thread-2427.html)



Players Online in web site. - Boo - 04-18-2016

How to put players online to my site monitoring from web admin?  "Players online: 12"


RE: Players Online in web site. - NiLSPACE - 04-19-2016

I'm not sure what you want. The "Players online: (number)" shows how many players are on the server at the moment.


RE: Players Online in web site. - bearbin - 04-19-2016

I think boo wants to have the number show up on the main website not the webadmin?


RE: Players Online in web site. - Schwertspize - 04-19-2016

I made that some time ago for a website, although for spigot, but it's just an implementation of the minecraft ping protocol. I used this library (ping "version") https://github.com/xPaw/PHP-Minecraft-Query. You can aquire the online players with $Query->Query()["players"]["online"] (i saved the result of $Query->Query() in the variable $result, then closed the connection. After that checked if ($result) which checks if the host is online (otherwise result would he empty I think) and then accessed$result["players"]["online"]

I wish you good luck!


RE: Players Online in web site. - worktycho - 04-25-2016

That library should work with cuberite, as we also support the ping protocol.


RE: Players Online in web site. - webterminator77 - 11-02-2016

Thanks for sharin' guys.