implement and call comms_resendAll

This commit is contained in:
eehouse 2010-02-24 04:30:13 +00:00
parent 2d22ef1f6a
commit 210332ec93
4 changed files with 21 additions and 1 deletions

View file

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

View file

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

View file

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

View file

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