bring over saved file format change from relay_conn branch so builds

from each will be able to open each other's files.
This commit is contained in:
Eric House 2015-08-10 06:24:40 -07:00
parent 87e3108296
commit 517cfe6fda
2 changed files with 7 additions and 7 deletions

View file

@ -632,7 +632,8 @@ comms_makeFromStream( MPFORMAL XWStreamCtxt* stream, XW_UtilCtxt* util,
isServer = stream_getU8( stream );
addrFromStream( &addr, stream );
if ( addr_hasType( &addr, COMMS_CONN_RELAY ) ) {
if ( version >= STREAM_VERS_DEVIDS
|| addr_hasType( &addr, COMMS_CONN_RELAY ) ) {
nPlayersHere = (XP_U16)stream_getBits( stream, 4 );
nPlayersTotal = (XP_U16)stream_getBits( stream, 4 );
} else {
@ -846,10 +847,8 @@ comms_writeToStream( CommsCtxt* comms, XWStreamCtxt* stream,
stream_putU8( stream, (XP_U8)comms->isServer );
logAddr( comms, &comms->addr, __func__ );
addrToStream( stream, &comms->addr );
if ( addr_hasType( &comms->addr, COMMS_CONN_RELAY ) ) {
stream_putBits( stream, 4, comms->rr.nPlayersHere );
stream_putBits( stream, 4, comms->rr.nPlayersTotal );
}
stream_putBits( stream, 4, comms->rr.nPlayersHere );
stream_putBits( stream, 4, comms->rr.nPlayersTotal );
stream_putU32( stream, comms->connID );
stream_putU16( stream, comms->nextChannelNo );
@ -1051,7 +1050,7 @@ comms_getConTypes( const CommsCtxt* comms )
XP_LOGF( "%s: returning COMMS_CONN_NONE for null comms", __func__ );
}
return typ;
} /* comms_getConType */
} /* comms_getConTypes */
XP_Bool
comms_getIsServer( const CommsCtxt* comms )

View file

@ -47,6 +47,7 @@
#endif
#define MAX_COLS MAX_ROWS
#define STREAM_VERS_DEVIDS 0x19
#define STREAM_VERS_MULTIADDR 0x18
#define STREAM_VERS_MODELDIVIDER 0x17
#define STREAM_VERS_COMMSBACKOFF 0x16
@ -86,7 +87,7 @@
#define STREAM_VERS_405 0x01
/* search for FIX_NEXT_VERSION_CHANGE next time this is changed */
#define CUR_STREAM_VERS STREAM_VERS_MULTIADDR
#define CUR_STREAM_VERS STREAM_VERS_DEVIDS
typedef struct XP_Rect {
XP_S16 left;