From 025bcb885bd5c178e9bb6c23515d32ef63c602c0 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 9 Feb 2014 19:35:17 -0800 Subject: [PATCH] don't move state forward when should be moving back --- xwords4/common/comms.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 31a0b8ba3..c6e6084e0 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -1569,10 +1569,13 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID ) XP_LOGF( "%s: host id %x disconnected", __func__, srcID ); /* if we don't have connName then RECONNECTED is the wrong state to change to. */ - XP_ASSERT( 0 != comms->rr.connName[0] ); - set_relay_state( comms, COMMS_RELAYSTATE_RECONNECTED ); - /* we will eventually want to tell the user which player's gone */ - util_userError( comms->util, ERR_RELAY_BASE + relayErr ); + if ( COMMS_RELAYSTATE_RECONNECTED < comms->rr.relayState ) { + XP_ASSERT( 0 != comms->rr.connName[0] ); + XP_ASSERT( COOKIE_ID_NONE != comms->rr.cookieID ); + set_relay_state( comms, COMMS_RELAYSTATE_RECONNECTED ); + /* we will eventually want to tell the user which player's gone */ + util_userError( comms->util, ERR_RELAY_BASE + relayErr ); + } break; case XWRELAY_DISCONNECT_YOU: /* Close socket for this? */