joker-119 / CustomRoles

4 stars 4 forks source link

Cannot change the global configuration file #8

Open lonelyicer opened 3 years ago

lonelyicer commented 3 years ago

unknown unknown (1)

Cannot change the global configuration file, restarting the server will reset it Just a small change will cause it to be reset

joker-119 commented 3 years ago

Confirmed to be occurring. I believe it's related to having the CustomAbility configs in the role configs, something isn't parsing correctly.

KrisPrs commented 3 years ago

@joker-119 fix when... I can't use all your custom roles and the same amount of mine own due to this annoying bug

4310V343k commented 2 years ago

The first and easier problem is that you, for some reason, omitted the .WithNamingConvention(UnderscoredNamingConvention.Instance) while building the deserializer. The second and harder problem is that CustomRole class has List<CustomAbility> CustomAbilities property. While deserializing YamlDotNet tries to instantiate abstract CustomAbilities instead of derived classes and fails because, well, CustomAbility is abstract

While searching for some info, i found this page that can help implementing the fix