mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
add room name to callback used when device connects
This commit is contained in:
parent
5400fad50d
commit
41fc05106b
2 changed files with 12 additions and 5 deletions
|
@ -794,6 +794,9 @@ comms_getInitialAddr( CommsAddrRec* addr
|
|||
XP_MEMCPY( addr->u.ip_relay.hostName, name, XP_STRLEN(name)+1 );
|
||||
XP_MEMCPY( addr->u.ip_relay.invite, room, XP_STRLEN(room)+1 );
|
||||
}
|
||||
addr->u.ip_relay.seeksPublicRoom = XP_FALSE;
|
||||
addr->u.ip_relay.advertiseRoom = XP_FALSE;
|
||||
|
||||
#elif defined PLATFORM_PALM
|
||||
/* default values; default is still IR where there's a choice, at least on
|
||||
Palm... */
|
||||
|
@ -1203,11 +1206,13 @@ got_connect_cmd( CommsCtxt* comms, XWStreamCtxt* stream,
|
|||
|
||||
if ( ! reconnected ) {
|
||||
/* This may belong as an alert to user so knows has connected. */
|
||||
(*comms->procs.rconnd)( comms->procs.closure, XP_FALSE, nSought - nHere );
|
||||
(*comms->procs.rconnd)( comms->procs.closure,
|
||||
comms->addr.u.ip_relay.invite,
|
||||
XP_FALSE, nSought - nHere );
|
||||
}
|
||||
XP_LOGF( "%s: have %d of %d players", __func__, nHere, nSought );
|
||||
setHeartbeatTimer( comms );
|
||||
}
|
||||
} /* got_connect_cmd */
|
||||
|
||||
static XP_Bool
|
||||
relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
||||
|
@ -1261,7 +1266,9 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
|||
comms_resendAll( comms );
|
||||
/* } */
|
||||
if ( XWRELAY_ALLHERE == cmd ) { /* initial connect? */
|
||||
(*comms->procs.rconnd)( comms->procs.closure, XP_TRUE, 0 );
|
||||
(*comms->procs.rconnd)( comms->procs.closure,
|
||||
comms->addr.u.ip_relay.invite,
|
||||
XP_TRUE, 0 );
|
||||
}
|
||||
set_relay_state( comms, COMMS_RELAYSTATE_ALLCONNECTED );
|
||||
break;
|
||||
|
|
|
@ -119,8 +119,8 @@ typedef void (*TransportReset)( void* closure );
|
|||
|
||||
#ifdef XWFEATURE_RELAY
|
||||
typedef void (*RelayStatusProc)( void* closure, CommsRelayState newState );
|
||||
typedef void (*RelayConndProc)( void* closure, XP_Bool allHere,
|
||||
XP_U16 nMissing );
|
||||
typedef void (*RelayConndProc)( void* closure, XP_UCHAR* const room,
|
||||
XP_Bool allHere, XP_U16 nMissing );
|
||||
typedef void (*RelayErrorProc)( void* closure, XWREASON relayErr );
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue