Adding new serverstart option for startup change #3
@ -52,20 +52,22 @@ public class Subserver implements Runnable {
|
||||
}
|
||||
|
||||
public Subserver(Servertype type, String serverName, int port, Runnable shutdownCallback, String... command){
|
||||
this(type, serverName, port, new ProcessBuilder(command), shutdownCallback);
|
||||
}
|
||||
|
||||
public Subserver(Servertype type, String serverName, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
|
||||
this.started = false;
|
||||
this.serverName = serverName;
|
||||
this.type = type;
|
||||
this.shutdownCallback = shutdownCallback;
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder(command);
|
||||
InetSocketAddress address = new InetSocketAddress("127.0.0.1", port);
|
||||
|
||||
try{
|
||||
this.p = pb.start();
|
||||
this.p = processBuilder.start();
|
||||
|
||||
}catch(IOException e){
|
||||
throw new SecurityException("Server could not be started", e);
|
||||
}
|
||||
|
||||
InetSocketAddress address = new InetSocketAddress("127.0.0.1", port);
|
||||
this.server = ProxyServer.getInstance().constructServerInfo(
|
||||
serverName, address, "SteamWar.de - Subserver", false);
|
||||
this.writer = new PrintWriter(p.getOutputStream(), true);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
"p" als Name für eine Variable ist nicht gerade viel aussagend!