Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Angrygargamel opened this issue Sep 15, 2024 · 7 comments · Fixed by #729
Closed

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

Angrygargamel opened this issue Sep 15, 2024 · 7 comments · Fixed by #729

Comments

@Angrygargamel
Copy link

Angrygargamel commented Sep 15, 2024

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
Copy link

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

@Angrygargamel
Copy link
Author

Angrygargamel commented Sep 17, 2024

@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
Copy link

ReaperIM commented Sep 17, 2024

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

@Angrygargamel
Copy link
Author

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

@Krymonota
Copy link
Contributor

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).

@bumbummen99
Copy link
Collaborator

bumbummen99 commented Nov 28, 2024

You are getting a deprecation warning, not an error. The mentioned function has been deprecated with PHP 8.2 and will be removed with PHP 9.0. However, this does not affect the functionality of the package.

@bumbummen99
Copy link
Collaborator

This is fixed in #729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants