@@ -206,6 +206,16 @@ private static void runGame(String gamePk) {
206
206
while (!currentState .gameState ().equals ("Final" )) {
207
207
GameState recentState = GameState .fromPk (gamePk );
208
208
209
+ if (recentState .isCancelled ()) {
210
+ endGame (gamePk , recentState , "\n Unfortunately, this game was cancelled." );
211
+ return ;
212
+ }
213
+
214
+ if (recentState .isSuspended ()) {
215
+ endGame (gamePk , recentState , "\n Unfortunately, this game has been suspended. It will resume at a later time." );
216
+ return ;
217
+ }
218
+
209
219
if (recentState .failed ()) {
210
220
int retryIn = fails + 3 ;
211
221
retryIn = Math .min (20 , retryIn );
@@ -321,7 +331,7 @@ private static void runGame(String gamePk) {
321
331
JSONObject advisory = newAdvisories .get (i );
322
332
JSONObject details = advisory .getJSONObject ("details" );
323
333
324
- logger .debug ("New advisory: " + advisory );
334
+ logger .debug ("New advisory: {}" , advisory );
325
335
326
336
String event = details .getString ("event" );
327
337
String description = details .getString ("description" );
@@ -379,16 +389,6 @@ private static void runGame(String gamePk) {
379
389
}
380
390
}
381
391
382
- if (currentState .isCancelled ()) {
383
- endGame (gamePk , currentState , "\n Unfortunately, this game was cancelled." );
384
- return ;
385
- }
386
-
387
- if (currentState .isSuspended ()) {
388
- endGame (gamePk , currentState , "\n Unfortunately, this game has been suspended. It will resume at a later time." );
389
- return ;
390
- }
391
-
392
392
// Build a scorecard embed
393
393
EmbedBuilder scorecardEmbed = new EmbedBuilder ();
394
394
scorecardEmbed .setTitle ("Scorecard" );
0 commit comments