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

Added missing fields to server name for ping responses #1114

Merged
merged 1 commit into from
Jul 4, 2017
Merged

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Jun 19, 2017

Introduction

This data is used to send back responses when a client pings the server, to show the server in the server list. However, there were 3 fields missing that vanilla MCPE sends that PocketMine-MP was not:

  • world seed - Specified as -1, since with multiple worlds, which seed do you pick?
  • host name - In vanilla this would be the name of the player hosting the multiplayer game.
  • gamemode - Server global gamemode.

This pull request will also provide a quick way to identify a PocketMine-MP server based on its ping response.

There are some unconfirmed bugs with this such as servers appearing in the wrong place in the server list if the list contains servers which do not include these extra fields. Please test and review.

Changes

API changes

  • Added API method Server::getGamemodeName(int $gamemode)

Behavioural changes

  • Server ping response now includes previously missing fields.

@dktapps dktapps added Category: Protocol Related to (changes in) the Minecraft network protocol PR: Contribution labels Jun 19, 2017
@robske110
Copy link
Contributor

You could send the seed of the dedault level, but -1 is probably the best choice. And i think the gamemode function should be in Player because it is player-specific and also using Player constants. I sometimes am confused by the misc functions that have just been thrown into Server.

@jojoe77777
Copy link
Contributor

@robske110 the client shouldn't be able to see any world seeds, otherwise they can use tools to find certain generated structures

@robske110
Copy link
Contributor

Actually, you're right. The seed will be generated completely different if given to mcpe anyways.

@dktapps dktapps merged commit 409fc28 into master Jul 4, 2017
@dktapps dktapps deleted the pong branch July 4, 2017 10:17
@dktapps dktapps added Type: Enhancement Contributes features or other improvements to PocketMine-MP and removed Type: Contribution labels Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Protocol Related to (changes in) the Minecraft network protocol Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants