Example #1
0
        private CachedValue <List <string> > _enabledPlugins; // TODO: _enabledPlugins currently store full name including version, but it shouldn't include version since that would disable the plugin if the plugin was updated.

        public PluginManager(GuildHandler parent)
        {
            _parentHandler  = parent;
            _enabledPlugins = new CachedValue <List <string> >(new IdentityKeyJsonRepository("plugindata"), _parentHandler.GuildId, "EnabledPlugins", () => PluginLoader.GetPlugins().Where(x => PluginLoader.IsStandard(x)).Select(y => Plugin.GetFullName(y)).ToList());
            _enabledPlugins.Cache();

            MakeSuperSureCriticalPluginsAreEnabled();
            PurgeDuplicateEnabledPlugins();
        }
Example #2
0
 public PluginManager(GuildHandler parent)
 {
     _parentHandler  = parent;
     _enabledPlugins = new CachedValue <List <string> >(new DoubleKeyJsonRepository("plugindata"), _parentHandler.GuildId, "EnabledPlugins", () => PluginLoader.GetPlugins().Where(x => PluginLoader.IsDefault(x)).Select(y => Plugin.GetFullName(y)).ToList());
     _enabledPlugins.Cache();
 }