Add headless option
This commit is contained in:
parent
8ec6388477
commit
ebb2cb8769
15
.vscode/launch.json
vendored
15
.vscode/launch.json
vendored
@ -10,19 +10,20 @@
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Launch TerrainGen",
|
||||
"request": "launch",
|
||||
"mainClass": "electrosphere.game.server.terrain.generation.TerrainGen",
|
||||
"projectName": "Renderer"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Launch Main",
|
||||
"request": "launch",
|
||||
"mainClass": "electrosphere.main.Main",
|
||||
"projectName": "Renderer"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Launch Main (Headless)",
|
||||
"request": "launch",
|
||||
"mainClass": "electrosphere.main.Main",
|
||||
"projectName": "Renderer",
|
||||
"args" : "--headless"
|
||||
}
|
||||
]
|
||||
}
|
||||
44
.vscode/tasks.json
vendored
44
.vscode/tasks.json
vendored
@ -1,44 +0,0 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build",
|
||||
"type": "shell",
|
||||
"command": "mvn process-classes",
|
||||
"windows": {
|
||||
"command": "mvn process-classes"
|
||||
},
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared",
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Clean and Build",
|
||||
"type": "shell",
|
||||
"command": "mvn clean package",
|
||||
"windows": {
|
||||
"command": "mvn clean package"
|
||||
},
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared",
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Run",
|
||||
"type": "shell",
|
||||
"command": "mvn process-classes exec:exec",
|
||||
"windows": {
|
||||
"command": "mvn process-classes exec:exec"
|
||||
},
|
||||
"group": "test",
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared",
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
20
src/main/java/electrosphere/engine/cli/CLIParser.java
Normal file
20
src/main/java/electrosphere/engine/cli/CLIParser.java
Normal file
@ -0,0 +1,20 @@
|
||||
package electrosphere.engine.cli;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import electrosphere.main.Globals;
|
||||
|
||||
public class CLIParser {
|
||||
|
||||
public static void parseCLIArgs(String args[]){
|
||||
List<String> argList = Arrays.asList(args);
|
||||
for(String arg : argList){
|
||||
if(arg.equals("--headless")){
|
||||
Globals.RUN_CLIENT = false;
|
||||
Globals.RUN_SERVER = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,6 +17,7 @@ import electrosphere.entity.types.item.ItemUtils;
|
||||
import electrosphere.entity.types.attach.AttachUtils;
|
||||
import electrosphere.entity.types.camera.CameraEntityUtils;
|
||||
import electrosphere.engine.LoadingThread;
|
||||
import electrosphere.engine.cli.CLIParser;
|
||||
import electrosphere.game.client.ClientFunctions;
|
||||
import electrosphere.game.client.targeting.crosshair.Crosshair;
|
||||
import electrosphere.game.config.UserSettings;
|
||||
@ -118,6 +119,9 @@ public class Main {
|
||||
//
|
||||
//
|
||||
|
||||
//parse command line arguments
|
||||
CLIParser.parseCLIArgs(args);
|
||||
|
||||
//initialize logging interfaces
|
||||
LoggerInterface.initLoggers();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user