mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
make msgNo reflect srcID, not channelNo
It's more useful if it's per-device unique within a game. (Just used for debugging now, so no impact on anything.)
This commit is contained in:
parent
89cb97c3bb
commit
21b0815923
1 changed files with 6 additions and 6 deletions
|
@ -1039,10 +1039,10 @@ comms_formatRelayID( const CommsCtxt* comms, XP_U16 indx,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
formatMsgNo( const MsgQueueElem* elem, XP_UCHAR* buf, XP_U16 len )
|
formatMsgNo( const CommsCtxt* comms, const MsgQueueElem* elem,
|
||||||
|
XP_UCHAR* buf, XP_U16 len )
|
||||||
{
|
{
|
||||||
XP_SNPRINTF( buf, len, "%d:%d", elem->channelNo & CHANNEL_MASK,
|
XP_SNPRINTF( buf, len, "%d:%d", comms->rr.myHostID, elem->msgID );
|
||||||
elem->msgID );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get *my* "relayID", a combo of connname and host id */
|
/* Get *my* "relayID", a combo of connname and host id */
|
||||||
|
@ -1432,7 +1432,7 @@ sendMsg( CommsCtxt* comms, MsgQueueElem* elem, const CommsConnType filter )
|
||||||
nSent = elem->len;
|
nSent = elem->len;
|
||||||
} else if ( comms->rr.relayState >= COMMS_RELAYSTATE_CONNECTED ) {
|
} else if ( comms->rr.relayState >= COMMS_RELAYSTATE_CONNECTED ) {
|
||||||
XP_UCHAR msgNo[16];
|
XP_UCHAR msgNo[16];
|
||||||
formatMsgNo( elem, msgNo, sizeof(msgNo) );
|
formatMsgNo( comms, elem, msgNo, sizeof(msgNo) );
|
||||||
if ( send_via_relay( comms, XWRELAY_MSG_TORELAY, destID,
|
if ( send_via_relay( comms, XWRELAY_MSG_TORELAY, destID,
|
||||||
elem->msg, elem->len, msgNo ) ){
|
elem->msg, elem->len, msgNo ) ){
|
||||||
nSent = elem->len;
|
nSent = elem->len;
|
||||||
|
@ -1471,7 +1471,7 @@ sendMsg( CommsCtxt* comms, MsgQueueElem* elem, const CommsConnType filter )
|
||||||
XP_U32 gameid = gameID( comms );
|
XP_U32 gameid = gameID( comms );
|
||||||
logAddr( comms, &addr, __func__ );
|
logAddr( comms, &addr, __func__ );
|
||||||
XP_UCHAR msgNo[16];
|
XP_UCHAR msgNo[16];
|
||||||
formatMsgNo( elem, msgNo, sizeof(msgNo) );
|
formatMsgNo( comms, elem, msgNo, sizeof(msgNo) );
|
||||||
nSent = (*comms->procs.send)( elem->msg, elem->len, msgNo, &addr,
|
nSent = (*comms->procs.send)( elem->msg, elem->len, msgNo, &addr,
|
||||||
typ, gameid, comms->procs.closure );
|
typ, gameid, comms->procs.closure );
|
||||||
break;
|
break;
|
||||||
|
@ -3103,7 +3103,7 @@ sendNoConn( CommsCtxt* comms, const MsgQueueElem* elem, XWHostID destID )
|
||||||
XP_U16 len = stream_getSize( stream );
|
XP_U16 len = stream_getSize( stream );
|
||||||
if ( 0 < len ) {
|
if ( 0 < len ) {
|
||||||
XP_UCHAR msgNo[16];
|
XP_UCHAR msgNo[16];
|
||||||
formatMsgNo( elem, msgNo, sizeof(msgNo) );
|
formatMsgNo( comms, elem, msgNo, sizeof(msgNo) );
|
||||||
success = (*comms->procs.sendNoConn)( stream_getPtr( stream ),
|
success = (*comms->procs.sendNoConn)( stream_getPtr( stream ),
|
||||||
len, msgNo, relayID,
|
len, msgNo, relayID,
|
||||||
comms->procs.closure );
|
comms->procs.closure );
|
||||||
|
|
Loading…
Reference in a new issue