From d143c47aa1302dcb8b68c8e39b184eb4ca78f756 Mon Sep 17 00:00:00 2001 From: eehouse Date: Sat, 1 May 2010 02:49:08 +0000 Subject: [PATCH] fill new GameSummary fields --- xwords4/android/XWords4/jni/xwjni.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index a85d9e7a3..0332c7ed2 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -935,6 +935,20 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize setInt( env, jsummary, "nMoves", nMoves ); setBool( env, jsummary, "gameOver", server_getGameIsOver( state->game.server ) ); + + if ( !!state->game.comms ) { + CommsAddrRec addr; + comms_getAddr( state->game.comms, &addr ); + intToJenumField( env, jsummary, addr.conType, "conType", + "org/eehouse/android/xw4/jni/" + "CommsAddrRec$CommsConnType" ); + if ( COMMS_CONN_RELAY == addr.conType ) { + setString( env, jsummary, "roomName", addr.u.ip_relay.invite ); + } else if ( COMMS_CONN_SMS == addr.conType ) { + setString( env, jsummary, "smsPhone", addr.u.sms.phone ); + } + } + XWJNI_END(); LOG_RETURN_VOID(); }