Open dotV3 opened 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.
This is non-trivial to implement under the current playerdata storage system, since it would require data migration for existing servers.
Relates to #4077.
Can't data migration be done through a plugin easily?
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.
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.
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.