From: rnayabed Date: Sun, 17 Jan 2021 13:28:27 +0530 Subject: work --- work --- --- 'a/src/main/java/com/StreamPi/Server/Action/NormalActionPlugins.java' +++ b/src/main/java/com/StreamPi/Server/Action/NormalActionPlugins.java @@ -105,7 +105,7 @@ public class NormalActionPlugins return null; } - private List normalPlugins; + private List normalPlugins = null; HashMap normalPluginsHashmap; public void registerPlugins() throws SevereException, MinorException @@ -126,6 +126,7 @@ public class NormalActionPlugins } ArrayList errorModules = new ArrayList<>(); + ArrayList errorModuleError = new ArrayList<>(); ArrayList pluginsConfigs = new ArrayList<>(); @@ -327,6 +328,7 @@ public class NormalActionPlugins } catch (Exception e) { e.printStackTrace(); errorModules.add(eachPlugin); + errorModuleError.add(e.getMessage()); } } @@ -341,10 +343,11 @@ public class NormalActionPlugins if(errorModules.size() > 0) { StringBuilder errors = new StringBuilder("The following action modules could not be loaded:"); - for(NormalAction e : errorModules) + for(int i = 0; i{ - getDashboardPane().getPluginsPane().clearData(); - getDashboardPane().getPluginsPane().loadOtherActions(); - }); - - NormalActionPlugins.setPluginsLocation(getConfig().getPluginsPath()); - NormalActionPlugins.getInstance().init(); - Platform.runLater(()->getDashboardPane().getPluginsPane().loadData()); - - getSettingsPane().getPluginsSettings().loadPlugins(); - - + //themes getSettingsPane().getThemesSettings().setThemes(getThemes()); getSettingsPane().getThemesSettings().setCurrentThemeFullName(getCurrentTheme().getFullName()); getSettingsPane().getThemesSettings().loadThemes(); + //clients getSettingsPane().getClientsSettings().loadData(); + try + { + + //Plugins + Platform.runLater(()->{ + getDashboardPane().getPluginsPane().clearData(); + getDashboardPane().getPluginsPane().loadOtherActions(); + }); + + NormalActionPlugins.setPluginsLocation(getConfig().getPluginsPath()); + NormalActionPlugins.getInstance().init(); + + Platform.runLater(()->getDashboardPane().getPluginsPane().loadData()); + + getSettingsPane().getPluginsSettings().loadPlugins(); + } + catch (MinorException e) + { + getSettingsPane().getPluginsSettings().showPluginInitError(); + handleMinorException(e); + } + + //Server mainServer.setPort(getConfig().getPort()); mainServer.start(); - } - catch (MinorException e) - { - handleMinorException(e); + } catch (SevereException e) { --- 'a/src/main/java/com/StreamPi/Server/Info/ServerInfo.java' +++ b/src/main/java/com/StreamPi/Server/Info/ServerInfo.java @@ -22,7 +22,7 @@ public class ServerInfo { private Version minThemeSupportVersion; private Version minPluginSupportVersion; - private Version commAPIVersion; + private Version commStandardVersion; private static ServerInfo instance = null; @@ -30,15 +30,10 @@ public class ServerInfo { private boolean startMinimised = false; private ServerInfo(){ - - try { - version = new Version("1.0.0"); - minThemeSupportVersion = new Version("1.0.0"); - minPluginSupportVersion = new Version("1.0.0"); - commAPIVersion = new Version("1.0.0"); - } catch (MinorException e) { - e.printStackTrace(); - } + version = new Version(1,0,0); + minThemeSupportVersion = new Version(1,0,0); + minPluginSupportVersion = new Version(1,0,0); + commStandardVersion = new Version(1,0,0); releaseStatus = ReleaseStatus.EA; prePath = "data/"; @@ -116,8 +111,8 @@ public class ServerInfo { return minPluginSupportVersion; } - public Version getCommAPIVersion() + public Version getCommStandardVersion() { - return commAPIVersion; + return commStandardVersion; } } --- 'a/src/main/java/com/StreamPi/Server/Window/Dashboard/DashboardBase.java' +++ b/src/main/java/com/StreamPi/Server/Window/Dashboard/DashboardBase.java @@ -102,9 +102,6 @@ public class DashboardBase extends HBox { getActionDetailsPane().setClient(clientConnection.getClient()); getActionGridPane().setClient(clientConnection.getClient()); - - logger.info("Current selected client details:"); - clientConnection.getClient().debugPrint(); } } --- 'a/src/main/java/com/StreamPi/Server/Window/Settings/About.java' +++ b/src/main/java/com/StreamPi/Server/Window/Settings/About.java @@ -94,7 +94,7 @@ public class About extends VBox{ ServerInfo serverInfo = ServerInfo.getInstance(); Label versionText = new Label(serverInfo.getVersion().getText() + " - "+ serverInfo.getPlatformType().getUIName() + " - "+ serverInfo.getReleaseStatus().getUIName()); - Label commAPILabel = new Label("CommAPI "+serverInfo.getCommAPIVersion().getText()); + Label commStandardLabel = new Label("CommStandard "+serverInfo.getCommStandardVersion().getText()); Label minThemeAPILabel = new Label("Min ThemeAPI "+serverInfo.getMinThemeSupportVersion().getText()); Label minActionAPILabel = new Label("Min ActionAPI "+serverInfo.getMinPluginSupportVersion().getText()); @@ -103,7 +103,7 @@ public class About extends VBox{ setSpacing(3); - getChildren().addAll(appIconImageView, licenseLabel, licenseTextArea, links, donateButton, gap, versionText, commAPILabel, minThemeAPILabel, minActionAPILabel, currentActionAPILabel); + getChildren().addAll(appIconImageView, licenseLabel, licenseTextArea, links, donateButton, gap, versionText, commStandardLabel, minThemeAPILabel, minActionAPILabel, currentActionAPILabel); } public void openWebpage(String url) { --- 'a/src/main/java/com/StreamPi/Server/Window/Settings/PluginsSettings.java' +++ b/src/main/java/com/StreamPi/Server/Window/Settings/PluginsSettings.java @@ -161,12 +161,23 @@ public class PluginsSettings extends VBo private ArrayList pluginProperties; + + public void showPluginInitError() + { + Platform.runLater(()->{ + pluginsSettingsVBox.getChildren().add(new Label("Plugin init error. Resolve issues and restart.")); + saveButton.setVisible(false); + }); + } + public void loadPlugins() throws MinorException { pluginProperties.clear(); List actions = NormalActionPlugins.getInstance().getPlugins(); + System.out.println("asdasdasdasd"+actions.size()); + Platform.runLater(()-> pluginsSettingsVBox.getChildren().clear()); if(actions.size() == 0)