From 82876bda0696241fc458cf10f2504738e21b489a Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 8 Nov 2010 17:23:16 -0800 Subject: [PATCH] add seed and fetch it in jni --- xwords4/android/XWords4/jni/xwjni.c | 6 ++++-- .../src/org/eehouse/android/xw4/jni/GameSummary.java | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 9d5729b54..9a0275d26 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -998,18 +998,20 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize if ( !!state->game.comms ) { CommsAddrRec addr; - comms_getAddr( state->game.comms, &addr ); + CommsCtxt* comms = state->game.comms; + comms_getAddr( comms, &addr ); intToJenumField( env, jsummary, addr.conType, "conType", "org/eehouse/android/xw4/jni/" "CommsAddrRec$CommsConnType" ); if ( COMMS_CONN_RELAY == addr.conType ) { XP_UCHAR buf[128]; XP_U16 len = VSIZE(buf); - if ( comms_getRelayID( state->game.comms, buf, &len ) ) { + if ( comms_getRelayID( comms, buf, &len ) ) { buf[len] = '\0'; setString( env, jsummary, "relayID", buf ); } setString( env, jsummary, "roomName", addr.u.ip_relay.invite ); + setInt( env, jsummary, "seed", comms_getChannelSeed( comms ) ); } else if ( COMMS_CONN_SMS == addr.conType ) { setString( env, jsummary, "smsPhone", addr.u.sms.phone ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java index 2160aad97..a729dbd06 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java @@ -34,6 +34,7 @@ public class GameSummary { // relay-related fields public String roomName; public String relayID; + public int seed; public boolean msgsPending; public boolean inNetworkGame()