I don't even know if this is allowed here, but I need to know how you ping a PocketMine server from a web server using PHP? Not querying it, just want to gets its status, like "online" or "offline". Please don't send me your querying classes, I only need to know a fast and simple method. Thanks again If it's not okay to post here, please delete this Thread
you would still need the query tools to query the server, if it returns smth then it's not offline OR UNTESTED fopen(serverip:\port) and see if there's any respond
you might just have to query it for respond, but what cause you to try to evade using query libraries?
You could use MCPE banners which uses the MCPE protocol to query the server, so it will work regardless of whether query is enabled PHP: if(array_key_exists ("connected", json_decode(file_get_contents("https://b.mcpe.me/" . $serverAdress . "/json"), true))){ // server is online}else{// server is offline} Or you could use mcapi which is bigger and has more server power, but will only work if query is enabled PHP: if(json_decode(file_get_contents("https://mcapi.ca/query/" . $serverAdress . "/mcpe"), true)["status"] === true){ // server is online}else{// server is offline}
Oh, $serverAddress can be a string like "example.com:19132" for both services. If you don't specify the port, it uses 19132.
Querying the server might be inefficient since the server may be laggy. I recommend having a CGI somewhere else and connecting to the CGI directly to retrieve a cached status (cached for several seconds) for better performance. Hormones does something like this -- it regularly updates the timestamp in a row in the hormones_tissues table that represents the current server, so if the timestamp is checked from another client to be less than 5 seconds before current timestamp, the server is considered online.