@@ -61,7 +61,6 @@ public void actionPerformed(ActionEvent e) {
6161 // if we do not have that invasion stored, create a new invasion object
6262 // and add it to the list
6363 if (!invasionTracker .invasions .containsKey (district )) {
64- logger .info ("New invasion: " + district );
6564 JSONObject temp = invasionsJSON .getJSONObject (key );
6665 String cogType = temp .getString ("Type" );
6766 int cogsDefeated = temp .getInt ("CurrentProgress" );
@@ -74,6 +73,15 @@ public void actionPerformed(ActionEvent e) {
7473 .atZone (ZoneId .systemDefault ());
7574 invasionTracker .invasions .put (district , newInvasion );
7675 invasionTracker .showNotification (newInvasion , true );
76+ logger .info (
77+ "Tracking new invasion for "
78+ + district
79+ + ". Cogs: "
80+ + cogsDefeated
81+ + "/"
82+ + cogsTotal
83+ + ". ETA: "
84+ + newInvasion .endTime );
7785 } else {
7886 if (!invasionTracker .invasions .containsKey (district )) {
7987 return ; // JUST IN CASE
@@ -82,10 +90,18 @@ public void actionPerformed(ActionEvent e) {
8290 // we want to update the total cogs defeated and the end time
8391 Invasion tempInv = invasionTracker .invasions .get (district );
8492 JSONObject temp = invasionsJSON .getJSONObject (key );
85- logger .info ("Updating invasion: " + district );
8693 // ignore mega invasion cog count
8794 if (!temp .getBoolean ("MegaInvasion" )) {
8895 int cogsDefeated = temp .getInt ("CurrentProgress" );
96+ logger .info (
97+ "Updating invasion details for "
98+ + district
99+ + ". Cogs: "
100+ + tempInv .getCogsDefeated ()
101+ + " -> "
102+ + cogsDefeated
103+ + ". ETA: "
104+ + tempInv .endTime );
89105 tempInv .updateCogsDefeated (cogsDefeated );
90106 tempInv .endTime =
91107 Instant .parse (temp .getString ("EstimatedCompletion" ))
@@ -99,13 +115,15 @@ public void actionPerformed(ActionEvent e) {
99115 Iterator <Map .Entry <String , Invasion >> it = invasionTracker .invasions .entrySet ().iterator ();
100116 while (it .hasNext ()) {
101117 Map .Entry <String , Invasion > pair = it .next ();
102- // this is the district
118+ String cogType = pair .getValue ().getCogType ();
119+ String district = pair .getKey ();
103120 // <district>/<cog name>
104- String key = pair . getKey () + "/" + pair . getValue (). getCogType () ;
121+ String key = district + "/" + cogType ;
105122 if (!invasionsJSON .has (key )) {
106123 invasionTracker .showNotification (pair .getValue (), false );
124+ String savedDuration = (System .nanoTime () - pair .getValue ().getCacheStartTime ())/ 1000000000 + " seconds." ;
107125 it .remove ();
108- logger .info ("Remove invasion: " + key );
126+ logger .info ("Removing saved invasion for " + district + ". Tracked for " + savedDuration );
109127 }
110128 }
111129 invasionTracker .runs ++;
0 commit comments