Ejemplo n.º 1
0
    if (empty($_GET["tlx"])) {
        $text_loc_x = 540;
    } else {
        $text = htmlspecialchars($_GET["tlx"]);
    }
    if (empty($_GET["tly"])) {
        $text_loc_y = 240;
    } else {
        $text = htmlspecialchars($_GET["tly"]);
    }
    if (empty($_GET["port"])) {
        $port = 25565;
    } else {
        $port = htmlspecialchars($_GET["port"]);
    }
    img::paintImage($ip, $text, $port, $text_loc_x, $text_loc_y);
}
class img
{
    function paintImage($ip, $text, $port, $text_loc_x, $text_loc_y)
    {
        $query = self::QueryMinecraft($ip, $port);
        if ($query === FALSE) {
            self::error();
            return FALSE;
        }
        $motd = $query["HostName"];
        $online = '在线人数:' . $query["Players"];
        $max = $query["MaxPlayers"];
        $ver = $query["Version"];
        $im = imagecreatefrompng('background.png');