HACK: server must ping relay or it can't be contacted

This commit is contained in:
ehouse 2005-03-06 17:51:18 +00:00
parent 2e9dd5f3ea
commit 71870695cc

View file

@ -750,6 +750,19 @@ showPrevScore( ServerCtxt* server )
SETSTATE( server, server->vol.stateAfterShow ); SETSTATE( server, server->vol.stateAfterShow );
} /* showPrevScore */ } /* showPrevScore */
#if! defined XWFEATURE_STANDALONE_ONLY && defined BEYOND_IR
static void
connectRelay( ServerCtxt* server )
{
XWStreamCtxt* stream = util_makeStreamFromAddr( server->vol.util,
CHANNEL_NONE );
stream_putBytes( stream, &stream, 1 );
stream_close( stream );
}
#else
# define connectRelay(s)
#endif
XP_Bool XP_Bool
server_do( ServerCtxt* server ) server_do( ServerCtxt* server )
{ {
@ -763,6 +776,7 @@ server_do( ServerCtxt* server )
switch( server->nv.gameState ) { switch( server->nv.gameState ) {
case XWSTATE_BEGIN: case XWSTATE_BEGIN:
connectRelay( server );
if ( server->nv.pendingRegistrations == 0 ) { /* all players on device */ if ( server->nv.pendingRegistrations == 0 ) { /* all players on device */
assignTilesToAll( server ); assignTilesToAll( server );
SETSTATE( server, XWSTATE_INTURN ); SETSTATE( server, XWSTATE_INTURN );