mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-13 01:07:30 +07:00
Server build fix / Debug hook
This commit is contained in:
@ -92,6 +92,8 @@ project(":desktop") {
|
||||
dependencies {
|
||||
compile project(":core")
|
||||
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-platform:$gdxVersion:natives-desktop"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||
|
@ -2,7 +2,3 @@ apply plugin: "java"
|
||||
sourceCompatibility = 1.8
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
|
||||
eclipse.project {
|
||||
name = appName + "-core"
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.game.EventType.GameLoadEvent;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
import io.anuke.ucore.core.Events;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.modules.ModuleCore;
|
||||
import io.anuke.ucore.util.Log;
|
||||
@ -32,6 +34,7 @@ public class Mindustry extends ModuleCore{
|
||||
@Override
|
||||
public void postInit(){
|
||||
Log.info("Time to load [total]: {0}", Timers.elapsed());
|
||||
Events.fire(new GameLoadEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,6 +6,10 @@ import io.anuke.ucore.function.Event;
|
||||
|
||||
public class EventType{
|
||||
|
||||
public static class GameLoadEvent implements Event{
|
||||
|
||||
}
|
||||
|
||||
public static class PlayEvent implements Event{
|
||||
|
||||
}
|
||||
|
@ -37,8 +37,12 @@ task run(dependsOn: classes, type: JavaExec) {
|
||||
jvmArgs "-XstartOnFirstThread"
|
||||
}
|
||||
ignoreExitValue = true
|
||||
if (project.hasProperty("appArgs")) {
|
||||
args Eval.me(appArgs)
|
||||
if (project.hasProperty("args")) {
|
||||
args Eval.me(project.getProperties()["args"])
|
||||
}
|
||||
|
||||
if(args.contains("debug")){
|
||||
main = "io.anuke.mindustry.DebugLauncher"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,10 +335,10 @@ public class ServerControl extends Module{
|
||||
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");
|
||||
debug = value;
|
||||
info("Debug mode is now {0}.", value ? "on" : "off");
|
||||
Settings.putBool("strict", value);
|
||||
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 -> {
|
||||
@ -903,7 +903,7 @@ public class ServerControl extends Module{
|
||||
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
|
||||
if(world.getSector().completedMissions >= world.getSector().missions.size){
|
||||
Log.info("Mission complete.");
|
||||
|
@ -10,6 +10,10 @@ if(System.properties["release"] == null || System.properties["release"].equals("
|
||||
include ':GDXGifRecorder'
|
||||
project(':GDXGifRecorder').projectDir = new File(settingsDir, '../GDXGifRecorder')
|
||||
}
|
||||
if (new File(settingsDir, '../debug').exists()) {
|
||||
include ':debug'
|
||||
project(':debug').projectDir = new File(settingsDir, '../debug')
|
||||
}
|
||||
}else{
|
||||
println("Not including local repositories.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user