add seed and fetch it in jni

This commit is contained in:
Andy2 2010-11-08 17:23:16 -08:00
parent 22f7a42c1d
commit 82876bda06
2 changed files with 5 additions and 2 deletions

View file

@ -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 );
}

View file

@ -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()