IvanCraft623 / RankSystem

An amazing Rank and Permissions Manager. The best ranks manager for PocketMine-MP.
Apache License 2.0
40 stars 16 forks source link

PurePerms migration doesn't work for user.json files #49

Closed HimbeersaftLP closed 12 months ago

HimbeersaftLP commented 1 year ago

PurePerms mistakenly saved the config as YML with a .json extension: https://github.com/poggit-orphanage/PurePerms/blob/16e796ca96eb58dd3aa0a6edea0be2ca14688478/src/_64FF00/PurePerms/DataProviders/JsonProvider.php#L86

But the migrator goes by the file extension by using DETECT: https://github.com/IvanCraft623/RankSystem/blob/2ffa5f865daad7e4aa5874242bece7f87dc31103/src/IvanCraft623/RankSystem/migrator/PurePerms.php#L90

Which will of course cause a JSON syntax error exception:

[18:57:59.734] [Server thread/CRITICAL]: pocketmine\utils\ConfigLoadException: "Failed to parse config D:\Himbeer\PMMP\plugin_data\PurePerms\players\himbeersaftlp.json: Syntax error" (EXCEPTION) in "pmsrc/src/utils/ConfigLoadException" at line 29

This is what the himbeersaftlp.json file contains:

---
userName: HimbeersaftLP
group: Owner
permissions: []
worlds: []
time: -1
expTime: -1
...

Also I'd prefer it if the data wasn't migrated without asking first.

IvanCraft623 commented 12 months ago

PurePerms mistakenly saved the config as YML with a .json extension

@Vecnavium Did that mess in PurePerms :(

Also I'd prefer it if the data wasn't migrated without asking first.

You can set auto-migrator to false in config.yml