pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.28k stars 1.56k forks source link

XUID rather than Username #5287

Open dotV3 opened 2 years ago

dotV3 commented 2 years ago

Change the player data to be set using the XUID rather than the username

It's how it should be set in the first place because if a player changes their Microsoft username then they'll lose all their data (loot/xp/etc) while if it's set to XUID then they'll keep their data and stuff even if they change their Microsoft username.

xerenahmed commented 2 years ago

if this is going to happen, it should be with the setting chosen by the user.

For example, in pocketmine.yml

player:
  save-strategy: "username" | "xuid" | "both"

if you select both, it will use XUID if it exists, if it's not use the username. (Always will save the data to both on player quit.). This old data (with usernames) will be protected and XUID will work in future.

dktapps commented 2 years ago

This is non-trivial to implement under the current playerdata storage system, since it would require data migration for existing servers.

Relates to #4077.

dotV3 commented 2 years ago

Can't data migration be done through a plugin easily?

dktapps commented 2 years ago

A core data change needs to be accommodated by the core itself. There are 10 years' worth of PocketMine-MP servers which use the current system.

dotV3 commented 2 years ago

as said in https://github.com/pmmp/PocketMine-MP/issues/5287#issuecomment-1247660724 , Default can be set to "username" so the XUID is optional but possible so that it prevents data loss. Data migration would still be required in case of switching to XUID rather than USERNAME but they wouldn't be forced to use it and as I said it'd be optional to switch to using XUID.