diff --git a/xwords4/relay/crefmgr.cpp b/xwords4/relay/crefmgr.cpp index 38a3b8fc6..c08a0d2c9 100644 --- a/xwords4/relay/crefmgr.cpp +++ b/xwords4/relay/crefmgr.cpp @@ -649,10 +649,14 @@ SafeCref::SafeCref( const char* connName, const char* cookie, HostID hid, nPlayersS, gameSeed, langCode, wantsPublic || makePublic, &isDead ); - /* If the reconnect doesn't check out, treat it as a connect */ + /* If the reconnect doesn't check out, treat it as a connect. But + preserve the existing hid. If the DB was deleted it's important + that devices keep their places (hids) */ if ( NULL == cinfo ) { - logf( XW_LOGINFO, "%s: taking a second crack", __func__ ); - m_hid = HOST_ID_NONE; + logf( XW_LOGINFO, "%s: taking a second crack; (cur hid: %d)", + __func__, hid ); + assert( m_hid == hid ); + // m_hid = HOST_ID_NONE; /* wrong; but why was I doing it? */ cinfo = m_mgr->getMakeCookieRef( cookie, nPlayersH, nPlayersS, langCode, gameSeed, clientIndx, wantsPublic, makePublic, &m_seenSeed );