save gameSeconds even if timer not enabled. Means stream version change.

This commit is contained in:
eehouse 2010-05-14 12:42:53 +00:00
parent bbfa375dfe
commit 4ce0a30b2d
2 changed files with 5 additions and 5 deletions

View file

@ -438,7 +438,7 @@ gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
}
gi->gameID = stream_getU16( stream );
if ( gi->timerEnabled ) {
if ( gi->timerEnabled || strVersion >= STREAM_VERS_GAMESECONDS ) {
gi->gameSeconds = stream_getU16( stream );
}
@ -481,9 +481,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi )
stream_putBits( stream, 1, gi->confirmBTConnect );
stream_putU16( stream, gi->gameID );
if ( gi->timerEnabled) {
stream_putU16( stream, gi->gameSeconds );
}
stream_putU16( stream, gi->gameSeconds );
for ( pl = gi->players, i = 0; i < gi->nPlayers; ++pl, ++i ) {
stringToStream( stream, pl->name );

View file

@ -31,6 +31,8 @@
extern "C" {
#endif
#define STREAM_VERS_GAMESECONDS 0x0B /* save gameSeconds whether or not
timer's enabled */
#define STREAM_VERS_4YOFFSET 0x0A /* 4 bits for yOffset on board */
#define STREAM_VERS_CHANNELSEED 0x09 /* new short in relay connect must be
saved in comms */
@ -44,7 +46,7 @@ extern "C" {
#define STREAM_VERS_41B4 0x02
#define STREAM_VERS_405 0x01
#define CUR_STREAM_VERS STREAM_VERS_4YOFFSET
#define CUR_STREAM_VERS STREAM_VERS_GAMESECONDS
typedef struct LocalPlayer {
XP_UCHAR* name;