call server_do() up to five times to allow some extra work to get

done.  Required if a host is also a robot.
This commit is contained in:
Andy2 2011-08-17 19:48:55 -07:00
parent b9be2b45f4
commit 08789c4097

View file

@ -1017,10 +1017,16 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage
(void)server_do( server, NULL );
/* } */
(void)server_receiveMessage( server, stream );
/* in case MORE work's pending */
/* for ( notDone = XP_TRUE; notDone; ) { */
(void)server_do( server, NULL );
/* } */
/* 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()). */
int ii;
XP_Bool notDone;
for ( ii = 0, notDone = XP_TRUE; notDone && ii < 5; ++ii ) {
(void)server_do( server, &notDone );
}
}
stream_destroy( stream );