export server_listWordsPlayed via jni.

This commit is contained in:
Andy2 2011-09-18 19:06:23 -07:00
parent 43e8bd7879
commit dced47e202
2 changed files with 19 additions and 0 deletions

View file

@ -1241,6 +1241,23 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1endGame
XWJNI_END();
}
JNIEXPORT jstring JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_server_1listWordsPlayed
( JNIEnv* env, jclass C, jint gamePtr, jint nMoves )
{
jstring result;
XWJNI_START_GLOBALS();
XP_ASSERT( !!state->game.server );
XWStreamCtxt* stream = and_empty_stream( MPPARM(mpool) globals );
server_listWordsPlayed( state->game.server, stream, nMoves );
result = streamToJString( MPPARM(mpool) env, stream );
(*env)->DeleteLocalRef( env, result );
stream_destroy( stream );
XWJNI_END();
return result;
}
JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_server_1sendChat
( JNIEnv* env, jclass C, jint gamePtr, jstring jmsg )

View file

@ -214,6 +214,8 @@ public class XwJNI {
public static native void server_initClientConnection( int gamePtr );
public static native void server_endGame( int gamePtr );
public static native void server_sendChat( int gamePtr, String msg );
public static native String server_listWordsPlayed( int gamePtr,
int nMoves );
// hybrid to save work
public static native boolean board_server_prefsChanged( int gamePtr,