Configuration lost when calling AddOrUpdateMapping after restartFixed
When another plugin tries to add a mapping via AddOrUpdateMapping from within the other plugins OnServerInitialized hook, the configuration resets to defaults. to mitigate this, it would be great to offer a hook that exposes serverInitialized to check against or queue the mappings until the config is loaded.
How about at least 

bool AddOrUpdateMapping(string key, string ruleset) {
     if (!serverInitialized) return false;​
Checking - may be other places where this also makes sense.  Curious which plugin you mean.
a private (or to say not yet public) one that adds dynamic mappings and restores them after restart. at the moment i'm circumventing it with a delay. here's my hotfix:

		bool AddOrUpdateMapping(string key, string ruleset) {
			if (!serverInitialized) {
				Puts("Not Initialized, deferring AddOrUpdateMapping "+key+" -> "+ruleset);
				timer.In(10f, () => {
					AddOrUpdateMapping(key, ruleset);
				});
				return true;
			}
			// ...​


as far as i understand its a race condition, where AddOrUpdateMapping (and RemoveMapping) are causing a save of the configuration before it's actually loaded and therefore overwriting it with the default config.



please also have a look at https://umod.org/community/true-pve/12831-members-are-overwritten-with-exclusions — it's an annoying error and easy to fix.
Added to 1.0.2.  Thank you for your detailed requests.
Locked automatically