server
Clone or download
Modified Files
--- '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<NormalAction> normalPlugins;
+ private List<NormalAction> normalPlugins = null;
HashMap<String, Integer> normalPluginsHashmap;
public void registerPlugins() throws SevereException, MinorException
@@ -126,6 +126,7 @@ public class NormalActionPlugins
}
ArrayList<NormalAction> errorModules = new ArrayList<>();
+ ArrayList<String> errorModuleError = new ArrayList<>();
ArrayList<Action> 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<errorModules.size(); i++)
{
- normalPlugins.remove(e);
- errors.append("\n * ").append(e);
+ normalPlugins.remove(errorModules.get(i));
+ errors.append("\n * ").append(errorModules.get(i).getModuleName()).append("\n(")
+ .append(errorModuleError.get(i)).append(")");
}
throw new MinorException("Plugins", errors.toString());
--- 'a/src/main/java/com/StreamPi/Server/Client/Client.java'
+++ b/src/main/java/com/StreamPi/Server/Client/Client.java
@@ -20,7 +20,7 @@ public class Client {
private final Platform platform;
private ClientConnection connectionHandler;
private final Version version;
- private final Version commAPIVersion;
+ private final Version commStandardVersion;
private final Version themeAPIVersion;
private final ReleaseStatus releaseStatus;
@@ -35,11 +35,11 @@ public class Client {
private int totalNoOfProfiles;
- public Client(Version version, ReleaseStatus releaseStatus, Version commAPIVersion, Version themeAPIVersion, String nickName, Platform platform, SocketAddress remoteSocketAddress)
+ public Client(Version version, ReleaseStatus releaseStatus, Version commStandardVersion, Version themeAPIVersion, String nickName, Platform platform, SocketAddress remoteSocketAddress)
{
this.version = version;
this.releaseStatus = releaseStatus;
- this.commAPIVersion = commAPIVersion;
+ this.commStandardVersion = commStandardVersion;
this.themeAPIVersion = themeAPIVersion;
this.nickName = nickName;
this.remoteSocketAddress = remoteSocketAddress;
@@ -162,9 +162,9 @@ public class Client {
return version;
}
- public Version getCommAPIVersion()
+ public Version getCommStandardVersion()
{
- return commAPIVersion;
+ return commStandardVersion;
}
public Version getThemeAPIVersion()
@@ -191,21 +191,7 @@ public class Client {
{
startupDisplayWidth = width;
}
-
- public void debugPrint()
- {
- System.out.println("Client Info : "+
- "\nNickname : "+nickName+
- "\nRemote address : "+remoteSocketAddress+
- "\nPlatform : "+platform.getUIName()+
- "\nVersion : "+version.getText()+
- "\nComm API Version : "+commAPIVersion.getText()+
- "\nTheme API Version : "+themeAPIVersion.getText()+
- "\nDisplay Width : "+startupDisplayWidth+
- "\nDisplay Height : "+startupDisplayHeight+
- "\nDefault Profile ID : "+defaultProfileID);
- }
-
+
private int getMaxRows(int eachActionSize)
{
return (int) (startupDisplayHeight / eachActionSize);
--- 'a/src/main/java/com/StreamPi/Server/Connection/ClientConnection.java'
+++ b/src/main/java/com/StreamPi/Server/Connection/ClientConnection.java
@@ -221,10 +221,10 @@ public class ClientConnection extends Th
throw new MinorException(e.getShortMessage()+" (Client '"+socket.getRemoteSocketAddress()+"' )");
}
- if(!commsStandard.isEqual(ServerInfo.getInstance().getCommAPIVersion()))
+ if(!commsStandard.isEqual(ServerInfo.getInstance().getCommStandardVersion()))
{
String errTxt = "Server and Client Communication standards do not match. Make sure you are on the latest version of server and client.\n" +
- "Server Comms. Standard : "+ServerInfo.getInstance().getCommAPIVersion().getText()+
+ "Server Comms. Standard : "+ServerInfo.getInstance().getCommStandardVersion().getText()+
"\nClient Comms. Standard : "+commsStandard.getText();
disconnect(errTxt);
@@ -237,9 +237,7 @@ public class ClientConnection extends Th
client.setStartupDisplayHeight(Double.parseDouble(arr[7]));
client.setDefaultProfileID(arr[9]);
client.setDefaultThemeFullName(arr[10]);
-
- client.debugPrint();
-
+
//call get profiles command.
serverListener.clearTemp();
}
--- 'a/src/main/java/com/StreamPi/Server/Controller/Controller.java'
+++ b/src/main/java/com/StreamPi/Server/Controller/Controller.java
@@ -162,35 +162,42 @@ public class Controller extends Base imp
{
try
{
-
-
-
getSettingsPane().getGeneralSettings().loadDataFromConfig();
- Platform.runLater(()->{
- 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> 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<NormalAction> actions = NormalActionPlugins.getInstance().getPlugins();
+ System.out.println("asdasdasdasd"+actions.size());
+
Platform.runLater(()-> pluginsSettingsVBox.getChildren().clear());
if(actions.size() == 0)