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

Minecraft #641

Closed yaany closed 2 years ago

yaany commented 2 years ago

CS:GO, Minecraft servers is not working. No player count, or online status :(

Fix ? WEB: https://gamebot.lv/ MTA works, cs:go not, mc not

bumbummen99 commented 2 years ago

Your CSGO server is working on my end using dev-master, make sure you do use the correct port.

Minecraft indeed seems broken. It does seem to not have any streams (?) on the following line with value 0: https://github.com/Austinb/GameQ/blob/97aa7e0579da74c430c7faaae630029979207827/src/GameQ/Query/Native.php#L194

References: https://wiki.unrealadmin.org/UT3_query_protocol https://wiki.vg/Query https://github.com/xPaw/PHP-Minecraft-Query/blob/master/src/MinecraftQuery.php

Austinb commented 2 years ago

Just to bump this. If you look at the readme for the xPaw version, which this protocol is based off of, certain items need to be enabled for the query to work. This is also listed in the wiki at https://github.com/Austinb/GameQ/wiki/Supported-servers-list-v3

Minecraft (Gamespy v3) - Requires Minecraft 1.8+ Reference. Requires server settings: enable-query=true & query.port=25565

Is this enabled on the Minecraft server in question?

bumbummen99 commented 2 years ago

Just to bump this. If you look at the readme for the xPaw version, which this protocol is based off of, certain items need to be enabled for the query to work. This is also listed in the wiki at https://github.com/Austinb/GameQ/wiki/Supported-servers-list-v3

Minecraft (Gamespy v3) - Requires Minecraft 1.8+ Reference. Requires server settings: enable-query=true & query.port=25565

Is this enabled on the Minecraft server in question?

Tested it on mine, the public Nitrado and the Hypixel one - all broke. Hypixel should be properly configured since it does work with the xPaw package (https://skycraft.skyraptor.eu/).

Also checked the inital message against the xPaw version but it is the same so it should work

Erani0 commented 2 years ago

Minecraft java version works without problems Here are two examples: Minecraft Vanilla and Modded Minecraft

Screenshot_20220823-012130_Chrome.jpg Screenshot_20220823-011953_Chrome.jpg

CS:GO also works without problems.

bumbummen99 commented 2 years ago

Minecraft java version works without problems Here are two examples: Minecraft Vanilla and Modded Minecraft CS:GO also works without problems.

Wanna share the cfg for these servers? Also what version of GameQ are you on (composer show Austinb\GameQ)?

Erani0 commented 2 years ago

I use the normal version that you can download. I don't have a special version

Erani0 commented 2 years ago

@yaany To read the status of your Minecraft server you have to enable enable-query=true in your gameconfig otherwise it won't work you can also see this here https://mcsrvstat.us/server/mc.side.lv and before you ask the readout on the website does not work with GameQ

Here a Simple PHP script to test

<?php
require_once('GameQ/Autoloader.php');
//Please adjust path to Autoloader.php

$servers = [
    [
        'type'    => 'minecraft',
        'host'    => '141.95.59.103:25565',
    ],
    [
        'type'    => 'csgo',
        'host'    => '216.52.148.47:27015',
    ]

];

$GameQ = \GameQ\GameQ::factory();
$GameQ->addServers($servers);
$GameQ->setOption('timeout', 5);
$results = $GameQ->process();

$GQ = json_encode($results);

$arr = json_decode($GQ, true);

foreach($arr as $key=>$value){
    echo $key . "=><br>" . json_encode($value) . "<br><br>";
}
echo "<br>";

?>
bumbummen99 commented 2 years ago

$results = $GameQ->process();

Does not work for me with current v3 branch either locally or from GitHub Actions https://github.com/Austinb/GameQ/pull/649/checks

Can you please tell us what version is in the composer.json file inside the GameQ directory? Also please include the PHP Version, you can get it with the command php -v. Also how did you obtain GameQ? Did you download it using composer or just directly from github?

Erani0 commented 2 years ago

I downloaded it directly from github and my php version is 8.1.9 and @bumbummen99 please check your email i have write you

bumbummen99 commented 2 years ago

Also make sure query.port is set to the port you use in your config. Turns out tested servers had this set differenly, once adjusted it does work as intended.