mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 07:07:03 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b795d97d0e
@ -142,6 +142,7 @@ public class ServerControl implements ApplicationListener{
|
||||
Events.on(GameOverEvent.class, event -> {
|
||||
if(inExtraRound) return;
|
||||
info("Game over!");
|
||||
displayStatus();
|
||||
|
||||
if(Core.settings.getBool("shuffle")){
|
||||
if(maps.all().size > 0){
|
||||
@ -299,29 +300,7 @@ public class ServerControl implements ApplicationListener{
|
||||
});
|
||||
|
||||
handler.register("status", "Display server status.", arg -> {
|
||||
if(state.is(State.menu)){
|
||||
info("Status: &rserver closed");
|
||||
}else{
|
||||
info("Status:");
|
||||
info(" &lyPlaying on map &fi{0}&fb &lb/&ly Wave {1}", Strings.capitalize(world.getMap().name()), state.wave);
|
||||
|
||||
if(state.rules.waves){
|
||||
info("&ly {0} enemies.", unitGroups[Team.crux.ordinal()].size());
|
||||
}else{
|
||||
info("&ly {0} seconds until next wave.", (int)(state.wavetime / 60));
|
||||
}
|
||||
|
||||
info(" &ly{0} FPS, {1} MB used.", (int)(60f / Time.delta()), Core.app.getJavaHeap() / 1024 / 1024);
|
||||
|
||||
if(playerGroup.size() > 0){
|
||||
info(" &lyPlayers: {0}", playerGroup.size());
|
||||
for(Player p : playerGroup.all()){
|
||||
info(" &y{0} / {1}", p.name, p.uuid);
|
||||
}
|
||||
}else{
|
||||
info(" &lyNo players connected.");
|
||||
}
|
||||
}
|
||||
displayStatus();
|
||||
});
|
||||
|
||||
handler.register("mods", "Display all loaded mods.", arg -> {
|
||||
@ -765,6 +744,32 @@ public class ServerControl implements ApplicationListener{
|
||||
mods.each(p -> p.registerClientCommands(netServer.clientCommands));
|
||||
}
|
||||
|
||||
private void displayStatus() {
|
||||
if(state.is(State.menu)){
|
||||
info("Status: &rserver closed");
|
||||
}else{
|
||||
info("Status:");
|
||||
info(" &lyPlaying on map &fi{0}&fb &lb/&ly Wave {1}", Strings.capitalize(world.getMap().name()), state.wave);
|
||||
|
||||
if(state.rules.waves){
|
||||
info("&ly {0} enemies.", unitGroups[Team.crux.ordinal()].size());
|
||||
}else{
|
||||
info("&ly {0} seconds until next wave.", (int)(state.wavetime / 60));
|
||||
}
|
||||
|
||||
info(" &ly{0} FPS, {1} MB used.", (int)(60f / Time.delta()), Core.app.getJavaHeap() / 1024 / 1024);
|
||||
|
||||
if(playerGroup.size() > 0){
|
||||
info(" &lyPlayers: {0}", playerGroup.size());
|
||||
for(Player p : playerGroup.all()){
|
||||
info(" &y{0} / {1}", p.name, p.uuid);
|
||||
}
|
||||
}else{
|
||||
info(" &lyNo players connected.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readCommands(){
|
||||
|
||||
Scanner scan = new Scanner(System.in);
|
||||
|
Loading…
Reference in New Issue
Block a user