Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-07-05 09:17:34 -04:00
5 changed files with 48 additions and 35 deletions

View File

@@ -126,3 +126,4 @@ Skat
WilloIzCitron WilloIzCitron
SAMBUYYA SAMBUYYA
genNAowl genNAowl
TranquillyUnpleasant

View File

@@ -1,12 +0,0 @@
#convert from stereo to mono
cd assets/sounds/
for i in *.ogg; do
echo $i
ffmpeg -i "$i" -ac 1 "OUT_$i"
done
find . -type f ! -name "OUT_*" -delete
for file in OUT_*; do mv "$file" "${file#OUT_}"; done;
cd ../../

View File

@@ -163,9 +163,9 @@ public class ServerControl implements ApplicationListener{
Events.on(GameOverEvent.class, event -> { Events.on(GameOverEvent.class, event -> {
if(inExtraRound) return; if(inExtraRound) return;
if(state.rules.waves){ if(state.rules.waves){
info("Game over! Reached wave @ with @ players online on map @.", state.wave, Groups.player.size(), Strings.capitalize(state.map.name())); info("Game over! Reached wave @ with @ players online on map @.", state.wave, Groups.player.size(), Strings.capitalize(Strings.stripColors(state.map.name())));
}else{ }else{
info("Game over! Team @ is victorious with @ players online on map @.", event.winner.name, Groups.player.size(), Strings.capitalize(state.map.name())); info("Game over! Team @ is victorious with @ players online on map @.", event.winner.name, Groups.player.size(), Strings.capitalize(Strings.stripColors(state.map.name())));
} }
//set next map to be played //set next map to be played
@@ -174,14 +174,14 @@ public class ServerControl implements ApplicationListener{
if(map != null){ if(map != null){
Call.infoMessage((state.rules.pvp Call.infoMessage((state.rules.pvp
? "[accent]The " + event.winner.name + " team is victorious![]\n" : "[scarlet]Game over![]\n") ? "[accent]The " + event.winner.name + " team is victorious![]\n" : "[scarlet]Game over![]\n")
+ "\nNext selected map:[accent] " + map.name() + "[]" + "\nNext selected map:[accent] " + Strings.stripColors(map.name()) + "[]"
+ (map.tags.containsKey("author") && !map.tags.get("author").trim().isEmpty() ? " by[accent] " + map.author() + "[white]" : "") + "." + + (map.tags.containsKey("author") && !map.tags.get("author").trim().isEmpty() ? " by[accent] " + map.author() + "[white]" : "") + "." +
"\nNew game begins in " + roundExtraTime + " seconds."); "\nNew game begins in " + roundExtraTime + " seconds.");
state.gameOver = true; state.gameOver = true;
Call.updateGameOver(event.winner); Call.updateGameOver(event.winner);
info("Selected next map to be @.", map.name()); info("Selected next map to be @.", Strings.stripColors(map.name()));
play(true, () -> world.loadMap(map, map.applyRules(lastMode))); play(true, () -> world.loadMap(map, map.applyRules(lastMode)));
}else{ }else{
@@ -259,10 +259,20 @@ public class ServerControl implements ApplicationListener{
} }
protected void registerCommands(){ protected void registerCommands(){
handler.register("help", "Displays this command list.", arg -> { handler.register("help", "[command]", "Display the command list, or get help for a specific command.", arg -> {
info("Commands:"); if(arg.length > 0){
for(Command command : handler.getCommandList()){ Command command = handler.getCommandList().find(c -> c.text.equalsIgnoreCase(arg[0]));
info(" &b&lb " + command.text + (command.paramText.isEmpty() ? "" : " &lc&fi") + command.paramText + "&fr - &lw" + command.description); if(command == null){
err("Command " + arg[0] + " not found!");
}else{
info(command.text + ":");
info(" &b&lb " + command.text + (command.paramText.isEmpty() ? "" : " &lc&fi") + command.paramText + "&fr - &lw" + command.description);
}
}else{
info("Commands:");
for(Command command : handler.getCommandList()){
info(" &b&lb " + command.text + (command.paramText.isEmpty() ? "" : " &lc&fi") + command.paramText + "&fr - &lw" + command.description);
}
} }
}); });
@@ -306,7 +316,7 @@ public class ServerControl implements ApplicationListener{
Map result; Map result;
if(arg.length > 0){ if(arg.length > 0){
result = maps.all().find(map -> map.name().equalsIgnoreCase(arg[0].replace('_', ' ')) || map.name().equalsIgnoreCase(arg[0])); result = maps.all().find(map -> Strings.stripColors(map.name().replace('_', ' ')).equalsIgnoreCase(Strings.stripColors(arg[0]).replace('_', ' ')));
if(result == null){ if(result == null){
err("No map with name '@' found.", arg[0]); err("No map with name '@' found.", arg[0]);
@@ -335,14 +345,28 @@ public class ServerControl implements ApplicationListener{
} }
}); });
handler.register("maps", "Display all available maps.", arg -> { handler.register("maps", "[all/custom/default]", "Display available maps. Displays only custom maps by default.", arg -> {
boolean custom = arg.length == 0 || arg[0].equals("custom") || arg[0].equals("all");
boolean def = arg.length > 0 && (arg[0].equals("default") || arg[0].equals("all"));
if(!maps.all().isEmpty()){ if(!maps.all().isEmpty()){
info("Maps:"); Seq<Map> all = new Seq<>();
for(Map map : maps.all()){
if(map.custom){ if(custom) all.addAll(maps.customMaps());
info(" @ (@): &fiCustom / @x@", map.name().replace(' ', '_'), map.file.name(), map.width, map.height); if(def) all.addAll(maps.defaultMaps());
}else{
info(" @: &fiDefault / @x@", map.name().replace(' ', '_'), map.width, map.height); if(all.isEmpty()){
info("No custom maps loaded. &fiTo display built-in maps, use the \"@\" argument.", "all");
}else{
info("Maps:");
for(Map map : all){
String mapName = Strings.stripColors(map.name()).replace(' ', '_');
if(map.custom){
info(" @ (@): &fiCustom / @x@", mapName, map.file.name(), map.width, map.height);
}else{
info(" @: &fiDefault / @x@", mapName, map.width, map.height);
}
} }
} }
}else{ }else{
@@ -366,7 +390,7 @@ public class ServerControl implements ApplicationListener{
info("Status: &rserver closed"); info("Status: &rserver closed");
}else{ }else{
info("Status:"); info("Status:");
info(" Playing on map &fi@ / Wave @", Strings.capitalize(state.map.name()), state.wave); info(" Playing on map &fi@ / Wave @", Strings.capitalize(Strings.stripColors(state.map.name())), state.wave);
if(state.rules.waves){ if(state.rules.waves){
info(" @ enemies.", state.enemies); info(" @ enemies.", state.enemies);
@@ -650,10 +674,10 @@ public class ServerControl implements ApplicationListener{
}); });
handler.register("nextmap", "<mapname...>", "Set the next map to be played after a game-over. Overrides shuffling.", arg -> { handler.register("nextmap", "<mapname...>", "Set the next map to be played after a game-over. Overrides shuffling.", arg -> {
Map res = maps.all().find(map -> map.name().equalsIgnoreCase(arg[0].replace('_', ' ')) || map.name().equalsIgnoreCase(arg[0])); Map res = maps.all().find(map -> Strings.stripColors(map.name().replace('_', ' ')).equalsIgnoreCase(Strings.stripColors(arg[0]).replace('_', ' ')));
if(res != null){ if(res != null){
nextMapOverride = res; nextMapOverride = res;
info("Next map set to '@'.", res.name()); info("Next map set to '@'.", Strings.stripColors(res.name()));
}else{ }else{
err("No map '@' found.", arg[0]); err("No map '@' found.", arg[0]);
} }

View File

@@ -27,10 +27,6 @@
"name": "BE6.RUN", "name": "BE6.RUN",
"address": ["be6.run", "mindustrycn.top"] "address": ["be6.run", "mindustrycn.top"]
}, },
{
"name": "io",
"address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000", "mindustry.io.community:4000"]
},
{ {
"name": "ECAN", "name": "ECAN",
"address": ["mindustry.ecansol.com:6597", "mindustry.ecansol.com:6499", "mindustry.ecansol.com:6599"] "address": ["mindustry.ecansol.com:6597", "mindustry.ecansol.com:6499", "mindustry.ecansol.com:6599"]

View File

@@ -41,5 +41,9 @@
{ {
"name": "Obvilion Network", "name": "Obvilion Network",
"address": "obvilionnetwork.ru:7004" "address": "obvilionnetwork.ru:7004"
},
{
"name": "io",
"address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000"]
} }
] ]