fix error message to not specify host or guest

This commit is contained in:
Andy2 2010-09-10 01:24:42 -07:00
parent f7c5ff619d
commit 34a94f23a0

View file

@ -62,7 +62,7 @@
/* static guint gtkSetupClientSocket( GtkAppGlobals* globals, int sock ); */ /* static guint gtkSetupClientSocket( GtkAppGlobals* globals, int sock ); */
#ifndef XWFEATURE_STANDALONE_ONLY #ifndef XWFEATURE_STANDALONE_ONLY
static void sendOnClose( XWStreamCtxt* stream, void* closure ); static void sendOnCloseGTK( XWStreamCtxt* stream, void* closure );
#endif #endif
static void setCtrlsForTray( GtkAppGlobals* globals ); static void setCtrlsForTray( GtkAppGlobals* globals );
static void new_game( GtkWidget* widget, GtkAppGlobals* globals ); static void new_game( GtkWidget* widget, GtkAppGlobals* globals );
@ -311,7 +311,7 @@ relay_status_gtk( void* closure, CommsRelayState state )
} }
static void static void
relay_connd_gtk( void* closure, XP_Bool allHere, XP_U16 nMissing ) relay_connd_gtk( void* XP_UNUSED(closure), XP_Bool allHere, XP_U16 nMissing )
{ {
XP_Bool skip = XP_FALSE; XP_Bool skip = XP_FALSE;
char buf[256]; char buf[256];
@ -319,14 +319,9 @@ relay_connd_gtk( void* closure, XP_Bool allHere, XP_U16 nMissing )
if ( allHere ) { if ( allHere ) {
snprintf( buf, sizeof(buf), "All expected players have joined. Play!" ); snprintf( buf, sizeof(buf), "All expected players have joined. Play!" );
} else { } else {
GtkAppGlobals* globals = (GtkAppGlobals*)closure; if ( nMissing > 0 ) {
DeviceRole role = globals->cGlobals.params->serverRole; snprintf( buf, sizeof(buf), "Connected to relay; waiting "
if ( role == SERVER_ISSERVER ) {
snprintf( buf, sizeof(buf), "Connected to relay as host; waiting "
"for %d player[s].", nMissing ); "for %d player[s].", nMissing );
} else if ( nMissing > 0 ) {
snprintf( buf, sizeof(buf), "Connected to relay as guest. Still "
"waiting for %d player[s].", nMissing );
} else { } else {
/* an allHere message should be coming immediately, so no /* an allHere message should be coming immediately, so no
notification now. */ notification now. */
@ -368,6 +363,7 @@ relay_error_gtk( void* closure, XWREASON relayErr )
proc = invoke_new_game_conns; proc = invoke_new_game_conns;
break; break;
case XWRELAY_ERROR_TOO_MANY: case XWRELAY_ERROR_TOO_MANY:
case XWRELAY_ERROR_BADPROTO:
proc = invoke_new_game; proc = invoke_new_game;
break; break;
default: default:
@ -488,7 +484,7 @@ createOrLoadObjects( GtkAppGlobals* globals )
} else if ( !isServer ) { } else if ( !isServer ) {
XWStreamCtxt* stream = XWStreamCtxt* stream =
mem_stream_make( MEMPOOL params->vtMgr, globals, CHANNEL_NONE, mem_stream_make( MEMPOOL params->vtMgr, globals, CHANNEL_NONE,
sendOnClose ); sendOnCloseGTK );
server_initClientConnection( globals->cGlobals.game.server, server_initClientConnection( globals->cGlobals.game.server,
stream ); stream );
#endif #endif
@ -785,7 +781,7 @@ new_game_impl( GtkAppGlobals* globals, XP_Bool fireConnDlg )
globals->cGlobals.params->vtMgr, globals->cGlobals.params->vtMgr,
globals, globals,
CHANNEL_NONE, CHANNEL_NONE,
sendOnClose ); sendOnCloseGTK );
server_initClientConnection( globals->cGlobals.game.server, server_initClientConnection( globals->cGlobals.game.server,
stream ); stream );
} }
@ -1600,7 +1596,7 @@ gtk_util_makeStreamFromAddr(XW_UtilCtxt* uc, XP_PlayerAddr channelNo )
XWStreamCtxt* stream = mem_stream_make( MEMPOOL XWStreamCtxt* stream = mem_stream_make( MEMPOOL
globals->cGlobals.params->vtMgr, globals->cGlobals.params->vtMgr,
uc->closure, channelNo, uc->closure, channelNo,
sendOnClose ); sendOnCloseGTK );
return stream; return stream;
} /* gtk_util_makeStreamFromAddr */ } /* gtk_util_makeStreamFromAddr */
#endif #endif
@ -2042,7 +2038,7 @@ gtk_socket_acceptor( int listener, Acceptor func, CommonGlobals* globals,
} /* gtk_socket_acceptor */ } /* gtk_socket_acceptor */
static void static void
sendOnClose( XWStreamCtxt* stream, void* closure ) sendOnCloseGTK( XWStreamCtxt* stream, void* closure )
{ {
GtkAppGlobals* globals = closure; GtkAppGlobals* globals = closure;