diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 413799d70..2cd86d0ed 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -36,7 +36,7 @@ #ifndef XWFEATURE_STANDALONE_ONLY #ifndef INITIAL_CLIENT_VERS -# define INITIAL_CLIENT_VERS 1 +# define INITIAL_CLIENT_VERS 2 #endif #ifdef COMMS_HEARTBEAT @@ -1123,7 +1123,8 @@ gameID( const CommsCtxt* comms ) gameID = comms->util->gameInfo->gameID; } XP_ASSERT( 0 == comms->connID - || comms->connID == comms->util->gameInfo->gameID ); + || (comms->connID & 0xFFFF) + == (comms->util->gameInfo->gameID & 0xFFFF) ); /* Most of the time these will be the same, but early in a game they won't be. Would be nice not to have to use gameID. */ return gameID; diff --git a/xwords4/common/game.c b/xwords4/common/game.c index d93467b26..83cbd2d02 100644 --- a/xwords4/common/game.c +++ b/xwords4/common/game.c @@ -196,7 +196,7 @@ game_makeFromStream( MPFORMAL XWStreamCtxt* stream, XWGame* game, XP_Bool hasComms; #endif strVersion = stream_getU8( stream ); - XP_DEBUGF( "strVersion = %d", (XP_U16)strVersion ); + XP_DEBUGF( "%s: strVersion = 0x%x", __func__, (XP_U16)strVersion ); if ( strVersion > CUR_STREAM_VERS ) { XP_LOGF( "%s: aborting; stream version too new!", __func__ ); @@ -506,6 +506,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi ) XP_U16 nColsNBits; #ifdef STREAM_VERS_BIGBOARD XP_U16 strVersion = stream_getVersion( stream ); + XP_LOGF( "%s: strVersion = 0x%x", __func__, strVersion ); XP_ASSERT( STREAM_SAVE_PREVWORDS <= strVersion ); nColsNBits = STREAM_VERS_BIGBOARD > strVersion ? NUMCOLS_NBITS_4 : NUMCOLS_NBITS_5; @@ -525,7 +526,15 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi ) stream_putBits( stream, 1, gi->allowHintRect ); stream_putBits( stream, 1, gi->confirmBTConnect ); - stream_putU32( stream, gi->gameID ); + if ( 0 ) { +#ifdef STREAM_VERS_BIGBOARD + } else if ( STREAM_VERS_BIGBOARD <= strVersion ) { + stream_putU32( stream, gi->gameID ); +#endif + } else { + stream_putU16( stream, gi->gameID ); + } + stream_putU8( stream, gi->dictLang ); stream_putU16( stream, gi->gameSeconds ); diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 188ef46ef..83412fd9a 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -649,7 +649,7 @@ setStreamVersion( ServerCtxt* server ) streamVersion = devVersion; } } - XP_LOGF( "%s: setting streamVersion: %d", __func__, streamVersion ); + XP_LOGF( "%s: setting streamVersion: 0x%x", __func__, streamVersion ); server->nv.streamVersion = streamVersion; }