diff --git a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UtilityCommands.java b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UtilityCommands.java index ffd3b534..edc6214a 100644 --- a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UtilityCommands.java +++ b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UtilityCommands.java @@ -76,12 +76,13 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.security.GeneralSecurityException; +import java.text.DateFormat; import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -2250,6 +2251,7 @@ public static String vmHistory(@Me IMessageIO io, Set nations, @Switch CompletableFuture msgFuture = io.send("Mounting nation snapshots..."); DataDumpParser parser = Locutus.imp().getDataDumper(true); + List validDays = parser.getDays(true, false); long today = TimeUtil.getDay(); long finalMinDay = minDay; @@ -2284,6 +2286,7 @@ public void accept(Long day) { }); Map> changesByNation = new LinkedHashMap<>(); + for (DBNation nation : nations) { long dayStart = TimeUtil.getDay(nation.getDate()); long lastStatus = -1; // -1 indicates no previous status @@ -2306,8 +2309,9 @@ public void accept(Long day) { case 2 -> "VM"; default -> "UNKNOWN"; }; + long timeMs = TimeUtil.getTimeFromDay(day); changesByNation.computeIfAbsent(nation.getNation_id(), k -> new ArrayList<>()) - .add(new String[]{new Date(TimeUtil.getTimeFromDay(day)).toString(), statusString}); + .add(new String[]{TimeUtil.DD_MM_YYYY.format(new Date(timeMs)), statusString}); } lastStatus = currentStatus; } diff --git a/src/main/java/link/locutus/discord/db/GuildHandler.java b/src/main/java/link/locutus/discord/db/GuildHandler.java index e4e7ec74..844f1a5b 100644 --- a/src/main/java/link/locutus/discord/db/GuildHandler.java +++ b/src/main/java/link/locutus/discord/db/GuildHandler.java @@ -1857,22 +1857,20 @@ public Boolean apply(IMessageBuilder msg) { tips.add("Deposit your excess money in the bank or it will be stolen: " + bankUrl + " (only $" + MathMan.format(unraidable) + " is unraidable)"); } if (faRole != null) { - tips.add("Please ping @\u200B" + faRole.getName() + " to get help negotiating peace"); + String enemyStr = "(Or mark as enemy " + CM.coalition.create.cmd.create(attacker.getAlliance_id() + "", "enemies") + ")"; + tips.add("Please ping @\u200B" + faRole.getName() + " to get help negotiating peace. " + (attacker.getAlliance_id() == 0 ? "" : enemyStr)); } if (milcomRole != null) { tips.add("Please ping @\u200B" + milcomRole.getName() + " to get military advice"); } } - Map defCities = defender.getCityMap(false, false); - if (attacker.getSoldiers() > defender.getSoldiers()) { - for (JavaCity value : defCities.values()) { - if (value.getBuilding(Buildings.BARRACKS) != 5) { - tips.add("Buy max barracks and soldiers (you may need to sell off some mines)"); - break; - } - } + if (defender.getMMRBuildingArr()[0] <= 4) { + tips.add("Buy max barracks and soldiers (you may need to sell off some mines)"); + } else if (defender.getSoldierPct() < 0.8) { + tips.add("Buy more soldiers to help defend yourself"); } if (attacker.getShips() > 0 && defender.getShips() == 0 && defender.getAvg_infra() >= 1450 && defender.getAircraft() > attacker.getAircraft()) { + Map defCities = defender.getCityMap(false, false); boolean hasDock = false; for (JavaCity value : defCities.values()) { if (value.getBuilding(Buildings.DRYDOCK) != 0) {