mirror of
https://github.com/SKCraft/Launcher.git
synced 2025-01-08 19:38:58 +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 proxyUsername;
|
||||||
private String proxyPassword;
|
private String proxyPassword;
|
||||||
private String gameKey;
|
private String gameKey;
|
||||||
|
private boolean serverEnabled = false;
|
||||||
|
private String serverHost;
|
||||||
|
private int serverPort = 25565;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
@ -136,6 +136,7 @@ public class Runner implements Callable<Process>, ProgressObservable {
|
|||||||
addLibraries();
|
addLibraries();
|
||||||
addJarArgs();
|
addJarArgs();
|
||||||
addProxyArgs();
|
addProxyArgs();
|
||||||
|
addServerArgs();
|
||||||
addWindowArgs();
|
addWindowArgs();
|
||||||
addPlatformArgs();
|
addPlatformArgs();
|
||||||
addLegacyArgs();
|
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.
|
* Add window arguments.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user