mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
add new parameter so client always gets notified on connection
including how many players are still missing.
This commit is contained in:
parent
0c3a6d362c
commit
4c5c435fb5
5 changed files with 10 additions and 12 deletions
|
@ -95,7 +95,7 @@ and_xport_relayStatus( void* closure, CommsRelayState newState )
|
|||
}
|
||||
|
||||
static void
|
||||
and_xport_relayConnd( void* closure, XP_UCHAR* const room,
|
||||
and_xport_relayConnd( void* closure, XP_UCHAR* const room, XP_Bool reconnect,
|
||||
XP_U16 devOrder, XP_Bool allHere, XP_U16 nMissing )
|
||||
{
|
||||
AndTransportProcs* aprocs = (AndTransportProcs*)closure;
|
||||
|
|
|
@ -1234,12 +1234,9 @@ got_connect_cmd( CommsCtxt* comms, XWStreamCtxt* stream,
|
|||
sizeof(comms->r.connName) );
|
||||
#endif
|
||||
|
||||
if ( ! reconnected ) {
|
||||
/* This may belong as an alert to user so knows has connected. */
|
||||
(*comms->procs.rconnd)( comms->procs.closure,
|
||||
comms->addr.u.ip_relay.invite,
|
||||
comms->r.myHostID, XP_FALSE, nSought - nHere );
|
||||
}
|
||||
(*comms->procs.rconnd)( comms->procs.closure,
|
||||
comms->addr.u.ip_relay.invite, reconnected,
|
||||
comms->r.myHostID, XP_FALSE, nSought - nHere );
|
||||
XP_LOGF( "%s: have %d of %d players", __func__, nHere, nSought );
|
||||
setHeartbeatTimer( comms );
|
||||
} /* got_connect_cmd */
|
||||
|
@ -1297,7 +1294,7 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
|||
/* } */
|
||||
if ( XWRELAY_ALLHERE == cmd ) { /* initial connect? */
|
||||
(*comms->procs.rconnd)( comms->procs.closure,
|
||||
comms->addr.u.ip_relay.invite,
|
||||
comms->addr.u.ip_relay.invite, XP_FALSE,
|
||||
comms->r.myHostID, XP_TRUE, 0 );
|
||||
}
|
||||
set_relay_state( comms, COMMS_RELAYSTATE_ALLCONNECTED );
|
||||
|
|
|
@ -120,9 +120,9 @@ typedef void (*TransportReset)( void* closure );
|
|||
#ifdef XWFEATURE_RELAY
|
||||
typedef void (*RelayStatusProc)( void* closure, CommsRelayState newState );
|
||||
typedef void (*RelayConndProc)( void* closure, XP_UCHAR* const room,
|
||||
XP_Bool reconnect,
|
||||
XP_U16 devOrder, /* 1 means created room, etc. */
|
||||
XP_Bool allHere,
|
||||
XP_U16 nMissing );
|
||||
XP_Bool allHere, XP_U16 nMissing );
|
||||
typedef void (*RelayErrorProc)( void* closure, XWREASON relayErr );
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1424,7 +1424,7 @@ relay_status_curses( void* XP_UNUSED(closure),
|
|||
|
||||
static void
|
||||
relay_connd_curses( void* XP_UNUSED(closure), XP_UCHAR* const XP_UNUSED(room),
|
||||
XP_U16 XP_UNUSED(devOrder),
|
||||
XP_Bool XP_UNUSED(reconnect), XP_U16 XP_UNUSED(devOrder),
|
||||
XP_Bool XP_UNUSED_DBG(allHere),
|
||||
XP_U16 XP_UNUSED_DBG(nMissing) )
|
||||
{
|
||||
|
|
|
@ -315,7 +315,8 @@ relay_status_gtk( void* closure, CommsRelayState state )
|
|||
|
||||
static void
|
||||
relay_connd_gtk( void* XP_UNUSED(closure), XP_UCHAR* const room,
|
||||
XP_U16 devOrder, XP_Bool allHere, XP_U16 nMissing )
|
||||
XP_Bool XP_UNUSED(reconnect), XP_U16 devOrder,
|
||||
XP_Bool allHere, XP_U16 nMissing )
|
||||
{
|
||||
XP_Bool skip = XP_FALSE;
|
||||
char buf[256];
|
||||
|
|
Loading…
Add table
Reference in a new issue