mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
save/restore new dictLang field; up stream version
This commit is contained in:
parent
c6c1a93de5
commit
0b91e9634e
2 changed files with 8 additions and 1 deletions
|
@ -361,6 +361,7 @@ gi_copy( MPFORMAL CurGameInfo* destGI, const CurGameInfo* srcGI )
|
||||||
replaceStringIfDifferent( mpool, &destGI->dictName,
|
replaceStringIfDifferent( mpool, &destGI->dictName,
|
||||||
srcGI->dictName );
|
srcGI->dictName );
|
||||||
|
|
||||||
|
destGI->dictLang = srcGI->dictLang;
|
||||||
destGI->gameID = srcGI->gameID;
|
destGI->gameID = srcGI->gameID;
|
||||||
destGI->gameSeconds = srcGI->gameSeconds;
|
destGI->gameSeconds = srcGI->gameSeconds;
|
||||||
destGI->nPlayers = (XP_U8)srcGI->nPlayers;
|
destGI->nPlayers = (XP_U8)srcGI->nPlayers;
|
||||||
|
@ -438,6 +439,9 @@ gi_readFromStream( MPFORMAL XWStreamCtxt* stream, CurGameInfo* gi )
|
||||||
}
|
}
|
||||||
|
|
||||||
gi->gameID = stream_getU16( stream );
|
gi->gameID = stream_getU16( stream );
|
||||||
|
if ( strVersion >= STREAM_VERS_DICTLANG ) {
|
||||||
|
gi->dictLang = stream_getU8( stream );
|
||||||
|
}
|
||||||
if ( gi->timerEnabled || strVersion >= STREAM_VERS_GAMESECONDS ) {
|
if ( gi->timerEnabled || strVersion >= STREAM_VERS_GAMESECONDS ) {
|
||||||
gi->gameSeconds = stream_getU16( stream );
|
gi->gameSeconds = stream_getU16( stream );
|
||||||
}
|
}
|
||||||
|
@ -481,6 +485,7 @@ gi_writeToStream( XWStreamCtxt* stream, const CurGameInfo* gi )
|
||||||
stream_putBits( stream, 1, gi->confirmBTConnect );
|
stream_putBits( stream, 1, gi->confirmBTConnect );
|
||||||
|
|
||||||
stream_putU16( stream, gi->gameID );
|
stream_putU16( stream, gi->gameID );
|
||||||
|
stream_putU8( stream, gi->dictLang );
|
||||||
stream_putU16( stream, gi->gameSeconds );
|
stream_putU16( stream, gi->gameSeconds );
|
||||||
|
|
||||||
for ( pl = gi->players, i = 0; i < gi->nPlayers; ++pl, ++i ) {
|
for ( pl = gi->players, i = 0; i < gi->nPlayers; ++pl, ++i ) {
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define STREAM_VERS_DICTLANG 0x0D /* save dict lang code in CurGameInfo */
|
||||||
#define STREAM_VERS_NUNDONE 0x0C /* save undone tile in model */
|
#define STREAM_VERS_NUNDONE 0x0C /* save undone tile in model */
|
||||||
#define STREAM_VERS_GAMESECONDS 0x0B /* save gameSeconds whether or not
|
#define STREAM_VERS_GAMESECONDS 0x0B /* save gameSeconds whether or not
|
||||||
timer's enabled */
|
timer's enabled */
|
||||||
|
@ -47,7 +48,7 @@ extern "C" {
|
||||||
#define STREAM_VERS_41B4 0x02
|
#define STREAM_VERS_41B4 0x02
|
||||||
#define STREAM_VERS_405 0x01
|
#define STREAM_VERS_405 0x01
|
||||||
|
|
||||||
#define CUR_STREAM_VERS STREAM_VERS_NUNDONE
|
#define CUR_STREAM_VERS STREAM_VERS_DICTLANG
|
||||||
|
|
||||||
typedef struct LocalPlayer {
|
typedef struct LocalPlayer {
|
||||||
XP_UCHAR* name;
|
XP_UCHAR* name;
|
||||||
|
@ -65,6 +66,7 @@ typedef struct CurGameInfo {
|
||||||
LocalPlayer players[MAX_NUM_PLAYERS];
|
LocalPlayer players[MAX_NUM_PLAYERS];
|
||||||
XP_U16 gameID; /* uniquely identifies game */
|
XP_U16 gameID; /* uniquely identifies game */
|
||||||
XP_U16 gameSeconds; /* for timer */
|
XP_U16 gameSeconds; /* for timer */
|
||||||
|
XP_LangCode dictLang;
|
||||||
XP_U8 nPlayers;
|
XP_U8 nPlayers;
|
||||||
XP_U8 boardSize;
|
XP_U8 boardSize;
|
||||||
DeviceRole serverRole;
|
DeviceRole serverRole;
|
||||||
|
|
Loading…
Add table
Reference in a new issue