mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
add comms_stop() to jni and use it
This commit is contained in:
parent
132a495c4f
commit
de7c29dcc7
3 changed files with 19 additions and 2 deletions
|
@ -995,8 +995,21 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1start
|
||||||
( JNIEnv* env, jclass C, jint gamePtr )
|
( JNIEnv* env, jclass C, jint gamePtr )
|
||||||
{
|
{
|
||||||
XWJNI_START();
|
XWJNI_START();
|
||||||
if ( !!state->game.comms ) {
|
CommsCtxt* comms = state->game.comms;
|
||||||
comms_start( state->game.comms );
|
if ( !!comms ) {
|
||||||
|
comms_start( comms );
|
||||||
|
}
|
||||||
|
XWJNI_END();
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1stop
|
||||||
|
( JNIEnv* env, jclass C, jint gamePtr )
|
||||||
|
{
|
||||||
|
XWJNI_START();
|
||||||
|
CommsCtxt* comms = state->game.comms;
|
||||||
|
if ( !!comms ) {
|
||||||
|
comms_stop( comms );
|
||||||
}
|
}
|
||||||
XWJNI_END();
|
XWJNI_END();
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,6 +286,9 @@ public class JNIThread extends Thread {
|
||||||
// state. In some cases it'll otherwise drop the move.
|
// state. In some cases it'll otherwise drop the move.
|
||||||
XwJNI.server_do( m_jniGamePtr );
|
XwJNI.server_do( m_jniGamePtr );
|
||||||
|
|
||||||
|
// And let it tell the relay (if any) it's leaving
|
||||||
|
XwJNI.comms_stop( m_jniGamePtr );
|
||||||
|
|
||||||
XwJNI.game_getGi( m_jniGamePtr, m_gi );
|
XwJNI.game_getGi( m_jniGamePtr, m_gi );
|
||||||
if ( null != m_newDict ) {
|
if ( null != m_newDict ) {
|
||||||
m_gi.dictName = m_newDict;
|
m_gi.dictName = m_newDict;
|
||||||
|
|
|
@ -234,6 +234,7 @@ public class XwJNI {
|
||||||
|
|
||||||
// Comms
|
// Comms
|
||||||
public static native void comms_start( int gamePtr );
|
public static native void comms_start( int gamePtr );
|
||||||
|
public static native void comms_stop( int gamePtr );
|
||||||
public static native void comms_resetSame( int gamePtr );
|
public static native void comms_resetSame( int gamePtr );
|
||||||
public static native void comms_getAddr( int gamePtr, CommsAddrRec addr );
|
public static native void comms_getAddr( int gamePtr, CommsAddrRec addr );
|
||||||
public static native CommsAddrRec[] comms_getAddrs( int gamePtr );
|
public static native CommsAddrRec[] comms_getAddrs( int gamePtr );
|
||||||
|
|
Loading…
Reference in a new issue