fix problem where client held on to its first message forever, sending

it each time resendAll was called on connect etc.
This commit is contained in:
Eric House 2010-06-04 22:23:46 -07:00
parent ca968d8294
commit c7a0271830

View file

@ -961,16 +961,16 @@ removeFromQueue( CommsCtxt* comms, XP_PlayerAddr channelNo, MsgID msgID )
XP_Bool knownGood = XP_FALSE; XP_Bool knownGood = XP_FALSE;
next = elem->next; next = elem->next;
/* remove the 0-channel message if we've established a channel /* If I'm the server and there's more than one guest I have
number. Only clients should have any 0-channel messages in the multiple channels to worry about. Not so for the guest. So
queue, and receiving something from the server is an implicit while the guest's messages are labeled with two versions of the
ACK -- IFF it isn't left over from the last game. */ channelNo, the 0th message having the two low bits clear and
all subsequent messages having at least one set, that's not an
if ( (elem->channelNo == 0) && (channelNo != 0) ) { issue here: the client needn't test channelNo. */
XP_ASSERT( !comms->isServer ); if ( comms->isServer ) {
XP_ASSERT( elem->msgID == 0 ); knownGood = elem->channelNo != channelNo;
} else if ( elem->channelNo != channelNo ) { } else {
knownGood = XP_TRUE; knownGood = XP_FALSE;
} }
if ( !knownGood && (elem->msgID <= msgID) ) { if ( !knownGood && (elem->msgID <= msgID) ) {