refactor(Minecraft.World): Implement LCEMP changes.
This commit is contained in:
@@ -432,6 +432,27 @@ void DirectoryLevelStorage::save(shared_ptr<Player> player)
|
||||
CompoundTag *DirectoryLevelStorage::load(shared_ptr<Player> player)
|
||||
{
|
||||
CompoundTag *tag = loadPlayerDataTag( player->getXuid() );
|
||||
#ifdef _WINDOWS64
|
||||
if (tag == NULL)
|
||||
{
|
||||
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
|
||||
for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++)
|
||||
{
|
||||
PlayerUID oldXuid = WIN64_XUID_BASE + i;
|
||||
tag = loadPlayerDataTag(oldXuid);
|
||||
if (tag != NULL)
|
||||
{
|
||||
ConsoleSavePath oldFile = ConsoleSavePath(playerDir.getName() + _toString(oldXuid) + L".dat");
|
||||
if (m_saveFile->doesFileExist(oldFile))
|
||||
{
|
||||
m_saveFile->deleteFile(m_saveFile->createFile(oldFile));
|
||||
}
|
||||
app.DebugPrintf("Migrated player data from old XUID %llu to new XUID %llu\n", oldXuid, player->getXuid());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (tag != NULL)
|
||||
{
|
||||
player->load(tag);
|
||||
|
||||
Reference in New Issue
Block a user