xPaw Minecraft服务器查询

问题描述 投票:-1回答:1

有人可以帮我从xPaw的这个Minecraft查询中获取主机名。

这是回购:https://github.com/xPaw/PHP-Minecraft-Query

我相信我在GetInfo()之后添加了一些东西。

<?php
    require('MinecraftQuery.class.php');

    $Query = new MinecraftQuery( );

    try
    {
        $Query->Connect( 'localhost', 25565 );

       print_r( $Query->GetInfo( ));
    }
    catch( MinecraftQueryException $e )
    {
        echo $e->getMessage( );
    }
?>
php class minecraft
1个回答
0
投票

看看https://github.com/xPaw/PHP-Minecraft-Query/blob/master/MinecraftQuery.class.php#L105,你应该能够: -

$info = $Query->GetInfo();
echo $info['hostname'];
© www.soinside.com 2019 - 2024. All rights reserved.