Server build fix / Debug hook

This commit is contained in:
Anuken
2018-09-10 19:33:12 -04:00
parent 4af0fbf553
commit d9eb4c1296
7 changed files with 24 additions and 11 deletions

View File

@ -92,6 +92,8 @@ project(":desktop") {
dependencies { dependencies {
compile project(":core") compile project(":core")
compile project(":kryonet") compile project(":kryonet")
if(new File(projectDir.parent, '../debug').exists()) compile project(":debug")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion" compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"

View File

@ -2,7 +2,3 @@ apply plugin: "java"
sourceCompatibility = 1.8 sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.java.srcDirs = ["src/"] sourceSets.main.java.srcDirs = ["src/"]
eclipse.project {
name = appName + "-core"
}

View File

@ -1,7 +1,9 @@
package io.anuke.mindustry; package io.anuke.mindustry;
import io.anuke.mindustry.core.*; import io.anuke.mindustry.core.*;
import io.anuke.mindustry.game.EventType.GameLoadEvent;
import io.anuke.mindustry.io.BundleLoader; import io.anuke.mindustry.io.BundleLoader;
import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
import io.anuke.ucore.modules.ModuleCore; import io.anuke.ucore.modules.ModuleCore;
import io.anuke.ucore.util.Log; import io.anuke.ucore.util.Log;
@ -32,6 +34,7 @@ public class Mindustry extends ModuleCore{
@Override @Override
public void postInit(){ public void postInit(){
Log.info("Time to load [total]: {0}", Timers.elapsed()); Log.info("Time to load [total]: {0}", Timers.elapsed());
Events.fire(new GameLoadEvent());
} }
@Override @Override

View File

@ -6,6 +6,10 @@ import io.anuke.ucore.function.Event;
public class EventType{ public class EventType{
public static class GameLoadEvent implements Event{
}
public static class PlayEvent implements Event{ public static class PlayEvent implements Event{
} }

View File

@ -37,8 +37,12 @@ task run(dependsOn: classes, type: JavaExec) {
jvmArgs "-XstartOnFirstThread" jvmArgs "-XstartOnFirstThread"
} }
ignoreExitValue = true ignoreExitValue = true
if (project.hasProperty("appArgs")) { if (project.hasProperty("args")) {
args Eval.me(appArgs) args Eval.me(project.getProperties()["args"])
}
if(args.contains("debug")){
main = "io.anuke.mindustry.DebugLauncher"
} }
} }

View File

@ -335,10 +335,10 @@ public class ServerControl extends Module{
info("Crash reporting is now {0}.", value ? "on" : "off"); info("Crash reporting is now {0}.", value ? "on" : "off");
}); });
handler.register("debug", "<on/off>", "Disables or enables debug mode", arg -> { handler.register("strict", "<on/off>", "Disables or enables strict mode", arg -> {
boolean value = arg[0].equalsIgnoreCase("on"); boolean value = arg[0].equalsIgnoreCase("on");
debug = value; Settings.putBool("strict", value);
info("Debug mode is now {0}.", value ? "on" : "off"); info("Debug mode is now {0}.", Settings.getBool("strict", true) ? "on" : "off");
}); });
handler.register("allow-custom-clients", "[on/off]", "Allow or disallow custom clients.", arg -> { handler.register("allow-custom-clients", "[on/off]", "Allow or disallow custom clients.", arg -> {
@ -903,7 +903,7 @@ public class ServerControl extends Module{
checkPvPGameOver(); checkPvPGameOver();
} }
if(state.is(State.playing) && world.getSector() != null && !inExtraRound && !debug){ if(state.is(State.playing) && world.getSector() != null && !inExtraRound){
//all assigned missions are complete //all assigned missions are complete
if(world.getSector().completedMissions >= world.getSector().missions.size){ if(world.getSector().completedMissions >= world.getSector().missions.size){
Log.info("Mission complete."); Log.info("Mission complete.");

View File

@ -10,6 +10,10 @@ if(System.properties["release"] == null || System.properties["release"].equals("
include ':GDXGifRecorder' include ':GDXGifRecorder'
project(':GDXGifRecorder').projectDir = new File(settingsDir, '../GDXGifRecorder') project(':GDXGifRecorder').projectDir = new File(settingsDir, '../GDXGifRecorder')
} }
if (new File(settingsDir, '../debug').exists()) {
include ':debug'
project(':debug').projectDir = new File(settingsDir, '../debug')
}
}else{ }else{
println("Not including local repositories.") println("Not including local repositories.")
} }