send mqtt game-gone when game deleted

Receiver only does anything if the game's open. This could change....
This commit is contained in:
Eric House 2020-11-21 08:43:24 -08:00
parent 8bc956491b
commit 210b0bcbcb
2 changed files with 9 additions and 3 deletions

View file

@ -1310,7 +1310,7 @@ public class GameUtils {
WiDirService.gameDied( addr.p2p_addr, gameID );
break;
case COMMS_CONN_MQTT:
MQTTUtils.gameDied( addr.mqtt_devID, gameID );
MQTTUtils.gameDied( context, addr.mqtt_devID, gameID );
break;
}
}

View file

@ -473,9 +473,15 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba
}
}
public static void gameDied( String devID, int gameID )
public static void gameDied( Context context, String devID, int gameID )
{
Log.e( TAG, "gameDied() not handled" );
if ( BuildConfig.DO_MQTT_GAME_GONE ) {
String[] topic = { devID };
byte[] packet = XwJNI.dvc_makeMQTTNoSuchGame( gameID, topic );
addToSendQueue( context, topic[0], packet );
} else {
Log.e( TAG, "gameDied() not handled" ); // fix me
}
}
@Override