From 210332ec939954585d95a00f6bb5b5004de87a9e Mon Sep 17 00:00:00 2001 From: eehouse Date: Wed, 24 Feb 2010 04:30:13 +0000 Subject: [PATCH] implement and call comms_resendAll --- xwords4/android/XWords4/jni/xwjni.c | 10 ++++++++++ .../src/org/eehouse/android/xw4/BoardActivity.java | 5 ++++- .../src/org/eehouse/android/xw4/jni/JNIThread.java | 6 ++++++ .../XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index e35d09705..a19c9f2af 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -900,3 +900,13 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1hasComms XWJNI_END(); return result; } + +JNIEXPORT void JNICALL +Java_org_eehouse_android_xw4_jni_XwJNI_comms_1resendAll +( JNIEnv* env, jclass C, jint gamePtr ) +{ + XWJNI_START(); + XP_ASSERT( !!state->game.comms ); + (void)comms_resendAll( state->game.comms ); + XWJNI_END(); +} diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 8ece94b28..14db36aad 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -344,9 +344,12 @@ public class BoardActivity extends Activity implements UtilCtxt { case R.id.board_menu_game_info: case R.id.board_menu_game_final: - case R.id.board_menu_game_resend: Utils.notImpl(this); break; + + case R.id.board_menu_game_resend: + m_jniThread.handle( JNIThread.JNICmd.CMD_RESEND ); + break; case R.id.board_menu_file_prefs: m_cp = null; // mark so we'll reset it later startActivity( new Intent( this, PrefsActivity.class ) ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java index c3d24403e..ab10fada2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java @@ -39,6 +39,7 @@ public class JNIThread extends Thread { CMD_VALUES, CMD_COUNTS_VALUES, CMD_REMAINING, + CMD_RESEND, CMD_HISTORY, CMD_POST_OVER, }; @@ -289,6 +290,11 @@ public class JNIThread extends Thread { XwJNI.board_formatRemainingTiles( m_jniGamePtr ) ); break; + + case CMD_RESEND: + XwJNI.comms_resendAll( m_jniGamePtr ); + break; + case CMD_HISTORY: boolean gameOver = XwJNI.server_getGameIsOver( m_jniGamePtr ); sendForDialog( ((Integer)args[0]).intValue(), diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java index b2021275a..f68bc9363 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java @@ -128,6 +128,7 @@ public class XwJNI { public static native void comms_start( int gamePtr ); public static native void comms_getAddr( int gamePtr, CommsAddrRec addr ); public static native void comms_setAddr( int gamePtr, CommsAddrRec addr ); + public static native void comms_resendAll( int gamePtr ); // Dicts public static native boolean dict_tilesAreSame( int dictPtr1, int dictPtr2 );