mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
use the new built-in game_receiveMessage
I'd forgotten it...
This commit is contained in:
parent
16dc1b15bd
commit
ed57a744b6
1 changed files with 1 additions and 27 deletions
|
@ -1673,8 +1673,6 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage
|
||||||
{
|
{
|
||||||
jboolean result;
|
jboolean result;
|
||||||
XWJNI_START_GLOBALS();
|
XWJNI_START_GLOBALS();
|
||||||
XP_ASSERT( state->game.comms );
|
|
||||||
XP_ASSERT( state->game.server );
|
|
||||||
|
|
||||||
XWStreamCtxt* stream = streamFromJStream( MPPARM(mpool) env, globals->vtMgr,
|
XWStreamCtxt* stream = streamFromJStream( MPPARM(mpool) env, globals->vtMgr,
|
||||||
jstream );
|
jstream );
|
||||||
|
@ -1686,31 +1684,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage
|
||||||
addrp = &addr;
|
addrp = &addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pthread_mutex_lock( &state->msgMutex ); */
|
result = game_receiveMessage( &state->game, stream, addrp );
|
||||||
|
|
||||||
ServerCtxt* server = state->game.server;
|
|
||||||
CommsMsgState commsState;
|
|
||||||
result = comms_checkIncomingStream( state->game.comms, stream, addrp,
|
|
||||||
&commsState );
|
|
||||||
if ( result ) {
|
|
||||||
(void)server_do( server );
|
|
||||||
|
|
||||||
result = server_receiveMessage( server, stream );
|
|
||||||
}
|
|
||||||
comms_msgProcessed( state->game.comms, &commsState, !result );
|
|
||||||
|
|
||||||
/* pthread_mutex_unlock( &state->msgMutex ); */
|
|
||||||
|
|
||||||
if ( result ) {
|
|
||||||
/* in case MORE work's pending. Multiple calls are required in at
|
|
||||||
least one case, where I'm a host handling client registration *AND*
|
|
||||||
I'm a robot. Only one server_do and I'll never make that first
|
|
||||||
robot move. That's because comms can't detect a duplicate initial
|
|
||||||
packet (in validateInitialMessage()). */
|
|
||||||
for ( int ii = 0; ii < 5; ++ii ) {
|
|
||||||
(void)server_do( server );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stream_destroy( stream );
|
stream_destroy( stream );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue