From da3f6db9e44a8f46f29efdc441c4a92b47f015ef Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 11 Nov 2017 08:10:48 -0800 Subject: [PATCH] fix failure to notify relay of half-game deletion Wasn't detecting as a relay game something registered on relay but not yet joined by another device, a common case! --- .../main/java/org/eehouse/android/xw4/GameUtils.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java index dba4c57de..92c476792 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameUtils.java @@ -1196,7 +1196,7 @@ public class GameUtils { for ( CommsConnType typ : conTypes ) { switch ( typ ) { case COMMS_CONN_RELAY: - tellRelayDied( context, summary, informNow ); + // see below break; case COMMS_CONN_BT: BTService.gameDied( context, addr.bt_btAddr, gameID ); @@ -1210,6 +1210,14 @@ public class GameUtils { } } } + + // comms doesn't have a relay address for us until the game's + // in play (all devices registered, at least.) To enable + // deleting on relay half-games that we created but nobody + // joined, special-case this one. + if ( summary.inRelayGame() ) { + tellRelayDied( context, summary, informNow ); + } gamePtr.release(); }