mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-15 15:20:57 -08:00
ServerControl was broken, yet again (#10661)
This commit is contained in:
parent
666c68edb1
commit
39834f21db
1 changed files with 15 additions and 15 deletions
|
|
@ -248,6 +248,21 @@ public class ServerControl implements ApplicationListener{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(state.isGame()){ //run this only if the server's actually hosting
|
||||
if(Config.autoPause.bool()){
|
||||
if(Groups.player.isEmpty()){
|
||||
autoPaused = true;
|
||||
state.set(State.paused);
|
||||
}else if(autoPaused){
|
||||
autoPaused = false;
|
||||
state.set(State.playing);
|
||||
}
|
||||
}else if(autoPaused && Vars.state.isPaused()){ //unpause when the config is disabled
|
||||
state.set(State.playing);
|
||||
autoPaused = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Events.run(Trigger.socketConfigChanged, () -> {
|
||||
|
|
@ -259,21 +274,6 @@ public class ServerControl implements ApplicationListener{
|
|||
autoPaused = false;
|
||||
});
|
||||
|
||||
Events.run(Trigger.update, () -> {
|
||||
if(Config.autoPause.bool()){
|
||||
if(Groups.player.isEmpty()){
|
||||
autoPaused = true;
|
||||
state.set(State.paused);
|
||||
}else if(autoPaused){
|
||||
autoPaused = false;
|
||||
state.set(State.playing);
|
||||
}
|
||||
}else if(autoPaused && Vars.state.isPaused()){ //unpause when the config is disabled
|
||||
state.set(State.playing);
|
||||
autoPaused = false;
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(PlayEvent.class, e -> {
|
||||
try{
|
||||
JsonValue value = JsonIO.json.fromJson(null, Core.settings.getString("globalrules"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue