mirror of
https://github.com/SKCraft/Launcher.git
synced 2025-01-07 19:29:03 +01:00
Added server argument to configuration
This commit is contained in:
parent
2c9ccb4338
commit
21e67328c7
@ -35,6 +35,9 @@ public class Configuration {
|
||||
private String proxyUsername;
|
||||
private String proxyPassword;
|
||||
private String gameKey;
|
||||
private boolean serverEnabled = false;
|
||||
private String serverHost;
|
||||
private int serverPort = 25565;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
@ -136,6 +136,7 @@ public class Runner implements Callable<Process>, ProgressObservable {
|
||||
addLibraries();
|
||||
addJarArgs();
|
||||
addProxyArgs();
|
||||
addServerArgs();
|
||||
addWindowArgs();
|
||||
addPlatformArgs();
|
||||
addLegacyArgs();
|
||||
@ -305,6 +306,25 @@ public class Runner implements Callable<Process>, ProgressObservable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add server arguments.
|
||||
*/
|
||||
private void addServerArgs() {
|
||||
List<String> args = builder.getArgs();
|
||||
|
||||
if (config.isServerEnabled()) {
|
||||
String host = config.getServerHost();
|
||||
int port = config.getServerPort();
|
||||
|
||||
if (!Strings.isNullOrEmpty(host) && port > 0 && port < 65535) {
|
||||
args.add("--server");
|
||||
args.add(host);
|
||||
args.add("--port");
|
||||
args.add(String.valueOf(port));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add window arguments.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user