From 0e4e0e84296ad9dd4e992a03ca40588a6f6bcb84 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Wed, 12 Jan 2022 22:17:44 +0900 Subject: - Fix value "false" getting removed in data collection - Collect "killed boss" / "died at boss" / "died before boss" --- src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java | 4 ++++ src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java index be0f7837..bd04d7a9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java @@ -172,6 +172,8 @@ public class DungeonContext { @Getter private boolean ended = false; + @Getter + private boolean defeated = false; public void onChat(ClientChatReceivedEvent event) { IChatComponent component = event.message; String formatted = component.getFormattedText(); @@ -197,6 +199,8 @@ public class DungeonContext { } else if (formatted.contains("§6> §e§lEXTRA STATS §6<")) { createEvent(new DungeonNodataEvent("DUNGEON_END")); ended = true; + } else if (formatted.contains("§r§c☠ §r§eDefeated ")) { + defeated = true; } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java index bb727971..ac8bfb1e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java @@ -404,7 +404,8 @@ public class MapProcessor { JSONObject payload = new JSONObject().put("timeSB", FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed()) .put("timeR", FeatureRegistry.DUNGEON_REALTIME.getTimeElapsed()) .put("timeScore", time) - .put("completed", context.getBossRoomEnterSeconds() != -1) + .put("completionStage", context.getBossRoomEnterSeconds() == -1 ? 0 : + context.isDefeated() ? 2 : 1) .put("percentage", DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getPercentage() / 100.0) .put("floor", DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName()); DungeonsGuide.sendDebugChat(new ChatComponentText(payload.toString())); -- cgit