From f9d352cb2527192db9ae28f83050ea81612dd1bb Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 2 Dec 2016 08:17:03 -0800 Subject: [PATCH] wifi: notify when game deleted --- .../XWords4/src/org/eehouse/android/xw4/GameUtils.java | 3 +++ .../XWords4/src/org/eehouse/android/xw4/WiDirService.java | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 18be96fcd..685d3bc3c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -1210,6 +1210,9 @@ public class GameUtils { } } break; + case COMMS_CONN_P2P: + WiDirService.gameDied( context, summary.gameID ); + break; } } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java index 3e5571d2c..5d7997a8f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java @@ -319,6 +319,14 @@ public class WiDirService extends XWService { } } + public static void gameDied( Context context, int gameID ) + { + Iterator iter = sSocketWrapMap.values().iterator(); + while ( iter.hasNext() ) { + sendNoGame( iter.next(), null, gameID ); + } + } + private static boolean initListeners( final Context context ) { boolean succeeded = false;