Cuberite Forum
How to get player's name at the ping screen - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: How to get player's name at the ping screen (/thread-3195.html)

Pages: 1 2


RE: How to get player's name at the ping screen - MGlolenstine - 08-23-2018

(08-23-2018, 07:16 PM)bearbin Wrote: Yes, it is not possible. The player is only added to the client handle once it has logged in, and I don't believe the username is even sent in ping packets. Can you link to an example of another server that implements this feature?

I believe that Mineplex and Hypickel had it some time ago... Maybe protocols changed or something. But it used to say "Welcome <player name>"


RE: How to get player's name at the ping screen - bearbin - 08-23-2018

OK, I have looked into it a little bit more. I'm pretty sure that there isn't a good way to do it, and the servers that have your name in the description just use a hack like PersonalMOTD which just correlates the IP Address of the user with their username after the first login, and then remembers the username mapping for next time.

Luckily you can do the same thing in Cuberite, as ClientHandle exposes a GetIPString method you can use to get the IP address.


RE: How to get player's name at the ping screen - MGlolenstine - 08-25-2018

(08-23-2018, 07:40 PM)bearbin Wrote: OK, I have looked into it a little bit more. I'm pretty sure that there isn't a good way to do it, and the servers that have your name in the description just use a hack like PersonalMOTD which just correlates the IP Address of the user with their username after the first login, and then remembers the username mapping for next time.

Luckily you can do the same thing in Cuberite, as ClientHandle exposes a GetIPString method you can use to get the IP address.

oooh, that seems like a good idea, thank you for suggesting it!