public static void formatKarkaString(EventData lowLevelEventData) { List<EventStatus> status = new ArrayList<EventStatus>(); for (ServerID servId : ServerID.values()) { formatKarkaString(lowLevelEventData, status, servId); } eventStatus = status; }
public static void formatKarkaString( EventData lowLevelEventData, List<EventStatus> statusList, ServerID servId) { String outStatus = ""; String color = ""; DateTime time = null; int fontWeight = 400; String queenId1 = servId.getUid() + "-" + QUEEN1.uid(); String queenId2 = servId.getUid() + "-" + QUEEN2.uid(); String queenId3 = servId.getUid() + "-" + QUEEN3.uid(); String queenId4 = servId.getUid() + "-" + QUEEN4.uid(); String set1DefId = servId.getUid() + "-" + SET1_DEF.uid(); String set1FailId = servId.getUid() + "-" + SET1_FAIL.uid(); String set2DefId = servId.getUid() + "-" + SET2_DEF.uid(); String set2FailId = servId.getUid() + "-" + SET2_FAIL.uid(); String set3DefId = servId.getUid() + "-" + SET3_DEF.uid(); String set3FailId = servId.getUid() + "-" + SET3_FAIL.uid(); String set4DefId = servId.getUid() + "-" + SET4_DEF.uid(); String set4FailId = servId.getUid() + "-" + SET4_FAIL.uid(); String queenStatus1 = lowLevelEventData.getEventStatus(queenId1); String queenStatus2 = lowLevelEventData.getEventStatus(queenId2); String queenStatus3 = lowLevelEventData.getEventStatus(queenId3); String queenStatus4 = lowLevelEventData.getEventStatus(queenId4); String set1DefStatus = lowLevelEventData.getEventStatus(set1DefId); String set1FailStatus = lowLevelEventData.getEventStatus(set1FailId); String set2DefStatus = lowLevelEventData.getEventStatus(set2DefId); String set2FailStatus = lowLevelEventData.getEventStatus(set2FailId); String set3DefStatus = lowLevelEventData.getEventStatus(set3DefId); String set3FailStatus = lowLevelEventData.getEventStatus(set3FailId); String set4DefStatus = lowLevelEventData.getEventStatus(set4DefId); String set4FailStatus = lowLevelEventData.getEventStatus(set4FailId); boolean playSound = false; int settlementCount = 0; if ((queenStatus1 != null) && (queenStatus1.equals("Active")) || (queenStatus2 != null) && (queenStatus2.equals("Active")) || (queenStatus3 != null) && (queenStatus3.equals("Active")) || (queenStatus4 != null) && (queenStatus4.equals("Active"))) { time = lowLevelEventData.getEventTime(queenId1); playSound = true; outStatus = "Active"; color = EventStateColor.ACTIVE.color(); fontWeight = 900; } else { if (set1FailStatus != null && set1DefStatus != null) if (set1FailStatus.equals("Success") || set1DefStatus.equals("Success") || set1DefStatus.equals("Active") || set1DefStatus.equals("Warmup") || set1DefStatus.equals("Preparation")) { settlementCount++; } if (set2FailStatus != null && set2DefStatus != null) if (set2FailStatus.equals("Success") || set2DefStatus.equals("Success") || set2DefStatus.equals("Active") || set2DefStatus.equals("Warmup") || set2DefStatus.equals("Preparation")) { settlementCount++; } if (set3FailStatus != null && set3DefStatus != null) if (set3FailStatus.equals("Success") || set3DefStatus.equals("Success") || set3DefStatus.equals("Active") || set3DefStatus.equals("Warmup") || set3DefStatus.equals("Preparation")) { settlementCount++; } if (set4FailStatus != null && set4DefStatus != null) if (set4FailStatus.equals("Success") || set4DefStatus.equals("Success") || set4DefStatus.equals("Active") || set4DefStatus.equals("Warmup") || set4DefStatus.equals("Preparation")) { settlementCount++; } time = lowLevelEventData.getEventTime(queenId1); outStatus = "Not up: " + settlementCount + "/4"; color = EventStateColor.FAIL.color(); } String soundKey = servId.getUid() + "-karka"; boolean playSoundList = playSound; if (PlaySoundStatus.playSoundStatus.containsKey(soundKey) && PlaySoundStatus.playSoundStatus.get(soundKey)) { playSound = false; } PlaySoundStatus.playSoundStatus.put(soundKey, playSoundList); EventStringFormatter.generateEventString( statusList, servId, outStatus, color, fontWeight, time, "Karka Queen", Waypoint.KARKA.toString(), playSound); }