implement plugins section
This commit is contained in:
@@ -58,7 +58,9 @@ public class ApiServerManager : Manager
|
||||
.WithController<ServerController>()
|
||||
.WithController<SettingsController>()
|
||||
.WithController<WorldsController>()
|
||||
.WithController<ChatController>())
|
||||
.WithController<ChatController>()
|
||||
.WithController<PluginsController>()
|
||||
.WithController<PluginDownloadsController>())
|
||||
.WithModule(new LogsModule("/api/live/logs", true))
|
||||
.WithModule(chatModule)
|
||||
.WithBearerToken("/api", new SymmetricSecurityKey(Convert.FromBase64String(_config.SecurityKey)), new BasicAuthorizationServerProvider());
|
||||
|
@@ -70,8 +70,11 @@ public class SettingManager : Manager
|
||||
|
||||
var persistentType = persistentInstance.GetType();
|
||||
var getter = persistentType.GetProperty("Data")!;
|
||||
|
||||
var settingType = persistentType.GenericTypeArguments[0];
|
||||
|
||||
RegisterSetting(plugin.Name, getter.GetValue(persistentInstance), persistentType.GenericTypeArguments[0]);
|
||||
RegisterSetting(plugin.Name, getter.GetValue(persistentInstance), settingType);
|
||||
PluginSettings.Add(plugin.Id, settingType.FullName!);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +95,7 @@ public class SettingManager : Manager
|
||||
}
|
||||
|
||||
public IDictionary<string, Setting> Settings { get; } = new ConcurrentDictionary<string, Setting>();
|
||||
public IDictionary<Guid, string> PluginSettings { get; } = new ConcurrentDictionary<Guid, string>();
|
||||
}
|
||||
|
||||
public record Setting(string Name, Type Type, JsonSchema Schema, object Value);
|
Reference in New Issue
Block a user