Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
404 stars 137 forks source link

GameSpy3 protocol 'Function utf8_encode() is deprecated' #726

Open Angrygargamel opened 2 months ago

Angrygargamel commented 2 months ago

Hello there... when i want to query our Minecraft Server on PHP 8.3.11 it throws me an error (also appears on 8.2) 'Function utf8_encode() is deprecated' in line 255

ReaperIM commented 2 months ago

Getting information from Minecraft servers doesn't work for me at all. I'll use this https://github.com/xPaw/PHP-Minecraft-Query

Angrygargamel commented 2 months ago

@ReaperIM well you need to set enable-query=true query.port=25565 in your server.properties file (edit the port as you like)

never had any problem with minecraft and query so far...

the view.php does exactly the same only the view_serverping.php uses other methods...

ReaperIM commented 2 months ago

yep, if query port 25565... but query port can be custom 19132 for example.

Angrygargamel commented 2 months ago

thats what i meant with edit the port as you like... or better as it fits...

Krymonota commented 2 months ago

I've started to modernize GameQ and establish support for the latest PHP versions, which means I've also fixed this deprecation. Feel free to check out my fork: https://github.com/KrymoSoftware/GameQ. Version 4.0.0 is released and ready to use.

yep, if query port 25565... but query port can be custom 19132 for example.

You can always use a custom query port by providing a value to the query_port option:

$gameQ = new \GameQ\GameQ();
$gameQ->addServer([
    'type'    => 'minecraft',
    'host'    => '127.0.0.1:25565',
    'options' => [
        'query_port' => 27000,
    ],
]);

Nevertheless, port 19132 belongs to Minecraft: Bedrock Edition... So you'll probably want to use the type minecraftbe instead of minecraft (Java Edition).