File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
launcher/src/main/java/com/skcraft/launcher Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ public class Configuration {
35
35
private String proxyUsername ;
36
36
private String proxyPassword ;
37
37
private String gameKey ;
38
+ private boolean serverEnabled = false ;
39
+ private String serverHost ;
40
+ private int serverPort = 25565 ;
38
41
39
42
@ Override
40
43
public boolean equals (Object o ) {
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ public Process call() throws Exception {
136
136
addLibraries ();
137
137
addJarArgs ();
138
138
addProxyArgs ();
139
+ addServerArgs ();
139
140
addWindowArgs ();
140
141
addPlatformArgs ();
141
142
addLegacyArgs ();
@@ -305,6 +306,25 @@ private void addProxyArgs() {
305
306
}
306
307
}
307
308
309
+ /**
310
+ * Add server arguments.
311
+ */
312
+ private void addServerArgs () {
313
+ List <String > args = builder .getArgs ();
314
+
315
+ if (config .isServerEnabled ()) {
316
+ String host = config .getServerHost ();
317
+ int port = config .getServerPort ();
318
+
319
+ if (!Strings .isNullOrEmpty (host ) && port > 0 && port < 65535 ) {
320
+ args .add ("--server" );
321
+ args .add (host );
322
+ args .add ("--port" );
323
+ args .add (String .valueOf (port ));
324
+ }
325
+ }
326
+ }
327
+
308
328
/**
309
329
* Add window arguments.
310
330
*/
You can’t perform that action at this time.
0 commit comments