Jump to content

Recommended Posts

Posted

Hi, I'm trying to make a mod for transporting players to other servers and I need to send the player's player.dat file to the destination server.  I already have a way of doing this (a sort of webserver running in the mod) and a way to download the data to the world/playerdata directory.  The problem is that I need to get the UUID of the player on the receiving side, and want to know if there's any way to get it on an offline server.  I can use MojangApi for online servers,  but so far skimming through the DedicatedServer code I havent found anything useful for resolving offline UUIDs.  How does minecraft resolve them on servers with online mode off and how can I implement this (i.e. will the same player have a different UUID on two different offline servers?)

 

Thanks!

"Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why."

                           -- Unknown

Posted

Thanks! I eventually found this in NetHandlerLoginServer:

 

protected GameProfile func_152506_a(GameProfile p_152506_1_)

    {

        UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + p_152506_1_.getName()).getBytes(Charsets.UTF_8));

        return new GameProfile(uuid, p_152506_1_.getName());

    }

"Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why."

                           -- Unknown

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.