diff --git a/proto/src/main/proto/soulfire/config.proto b/proto/src/main/proto/soulfire/config.proto index 1fa18103..a161ef2b 100644 --- a/proto/src/main/proto/soulfire/config.proto +++ b/proto/src/main/proto/soulfire/config.proto @@ -104,12 +104,6 @@ message SettingEntry { } message SettingsPage { - enum Type { - SERVER = 0; - INSTANCE = 1; - } - - Type type = 1; optional string owning_plugin = 2; // The name of the page for these settings string page_name = 3; @@ -141,7 +135,8 @@ message ClientDataResponse { string email = 8; repeated GlobalPermissionState server_permissions = 2; repeated ServerPlugin plugins = 3; - repeated SettingsPage settings = 5; + repeated SettingsPage server_settings = 9; + repeated SettingsPage instance_settings = 10; } service ConfigService { diff --git a/server/src/main/java/com/soulfiremc/server/SoulFireServer.java b/server/src/main/java/com/soulfiremc/server/SoulFireServer.java index ee7e25a3..bbd247a9 100644 --- a/server/src/main/java/com/soulfiremc/server/SoulFireServer.java +++ b/server/src/main/java/com/soulfiremc/server/SoulFireServer.java @@ -20,7 +20,6 @@ import ch.jalu.injector.Injector; import ch.jalu.injector.InjectorBuilder; import com.soulfiremc.builddata.BuildData; -import com.soulfiremc.grpc.generated.SettingsPage; import com.soulfiremc.server.api.SoulFireAPI; import com.soulfiremc.server.api.event.attack.InstanceInitEvent; import com.soulfiremc.server.api.event.lifecycle.InstanceSettingsRegistryInitEvent; @@ -192,14 +191,14 @@ public SoulFireServer( new ServerSettingsRegistryInitEvent( this, serverSettingsRegistry = - new ServerSettingsRegistry(SettingsPage.Type.SERVER) + new ServerSettingsRegistry() .addClass(ServerSettings.class, "Server Settings", "server") .addClass(DevSettings.class, "Dev Settings", "bug"))); SoulFireAPI.postEvent( new InstanceSettingsRegistryInitEvent( this, instanceSettingsRegistry = - new ServerSettingsRegistry(SettingsPage.Type.INSTANCE) + new ServerSettingsRegistry() // Needs Via loaded to have all protocol versions .addClass(BotSettings.class, "Bot Settings", "bot") .addClass(AccountSettings.class, "Account Settings", "users") diff --git a/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java b/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java index 48d9b4c1..4a5321d6 100644 --- a/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java +++ b/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java @@ -74,8 +74,8 @@ public void getClientData( }) .addAllServerPermissions(getGlobalPermissions()) .addAllPlugins(getPlugins()) - .addAllSettings(soulFireServer.serverSettingsRegistry().exportSettingsMeta()) - .addAllSettings(soulFireServer.instanceSettingsRegistry().exportSettingsMeta()) + .addAllServerSettings(soulFireServer.serverSettingsRegistry().exportSettingsMeta()) + .addAllInstanceSettings(soulFireServer.instanceSettingsRegistry().exportSettingsMeta()) .build()); responseObserver.onCompleted(); } catch (Throwable t) { diff --git a/server/src/main/java/com/soulfiremc/server/settings/lib/ServerSettingsRegistry.java b/server/src/main/java/com/soulfiremc/server/settings/lib/ServerSettingsRegistry.java index 27bb8568..fc5a2c56 100644 --- a/server/src/main/java/com/soulfiremc/server/settings/lib/ServerSettingsRegistry.java +++ b/server/src/main/java/com/soulfiremc/server/settings/lib/ServerSettingsRegistry.java @@ -34,7 +34,6 @@ @RequiredArgsConstructor public class ServerSettingsRegistry { - private final SettingsPage.Type type; private final Map namespaceMap = new LinkedHashMap<>(); private static IntSetting createIntSetting(IntProperty property) { @@ -241,7 +240,6 @@ yield fillProperties(comboProperty) } var settingsPageBuilder = SettingsPage.newBuilder() - .setType(type) .setPageName(namespaceRegistry.pageName) .setNamespace(namespaceEntry.getKey()) .addAllEntries(entries)