Added update trigger / Server moddability tweaks

This commit is contained in:
Anuken
2019-12-28 21:34:20 -05:00
parent b01d56aae8
commit 8c941c7165
8 changed files with 26 additions and 19 deletions
+6 -2
View File
@@ -11,6 +11,7 @@ import mindustry.core.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.net.Administration.*;
import mindustry.net.Packets.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
@@ -126,13 +127,16 @@ public class BeControl{
len -> Core.app.post(() -> Log.info("&ly| Size: {0} MB.", Strings.fixed((float)len / 1024 / 1024, 2))),
progress -> {},
() -> false,
() -> {
() -> Core.app.post(() -> {
netServer.kickAll(KickReason.serverRestarting);
Threads.sleep(32);
Log.info("&lcVersion downloaded, exiting. Note that if you are not using a auto-restart script, the server will not restart automatically.");
//replace old file with new
dest.copyTo(source);
dest.delete();
System.exit(2); //this will cause a restart if using the script
},
}),
Throwable::printStackTrace);
}catch(Exception e){
e.printStackTrace();