Hi Nivex,
I've been chasing the error where when using TruePVE schedules and DynamicPVP together that the scheduler stops working. I mean it's been a LOOOOOOOOONG time we've been looking for this. You fixed the NREs by ignoring the null outputs in ClockUpdate but that didn't fix the underlying issue. I had some time tonight and dug in finally.
It turns out that this is related to a "fix" RFC put in before you took this over. To quote from the changelog "Added first pass fix for AddOrUpdateMapping() clearing all but the default ruleset. Probably more work to be done." He added LoadConfiguration() to the top of AddOrUpdateMapping and this resets data.schedule.parsedEntries. specifically this line of code from LoadConfiguration resets the list:
data = Config.ReadObject<TruePVEData>() ?? null;Data is being overwritten like the plugin just loaded. Schedule.Init() only ever gets called when a new TruePVEData object is created. This only happens when the plugin loads. So calling LoadConfiguration will reset anything that is initialized in data when the plugin loads.
I can reproduce this error independantly of DynamicPVP by simply calling AddOrUpdateMapping from anywhere. After I do so the scheduler stops working and parsedEntries is empty.
I'm surprised more people haven't had issues with other plugins that call this API. I guess not many are using the scheduler. I dont see what value LoadConfiguration adds in that procedure so I've commeted it out in my version and so far no ill effects.
You might also consider getting rid of the parser and just have the parsedEntities broken into nice little JSON nuggets. Not as pretty as a one liner but easier to code.
I hope this helps you fix this very very VERY old issue. Sorry it took me so long man...
Cheers,
-Fire