mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
passing pool into word-listing code a mistake as it put tiles back
when undoing and so the pool grew each time. Fix, and remove server API as it's unneeded.
This commit is contained in:
parent
d000c430b9
commit
35a0a3a291
5 changed files with 6 additions and 17 deletions
|
@ -2052,9 +2052,8 @@ recordWord( const XP_UCHAR* word, XP_Bool isLegal, void* closure )
|
|||
return XP_TRUE;
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
model_getWordsPlayed( ModelCtxt* model, PoolContext* pool,
|
||||
XP_U16 nTurns, XWStreamCtxt* stream )
|
||||
void
|
||||
model_getWordsPlayed( ModelCtxt* model, XP_U16 nTurns, XWStreamCtxt* stream )
|
||||
{
|
||||
XP_ASSERT( !!stream );
|
||||
StackCtxt* stack = model->vol.stack;
|
||||
|
@ -2067,7 +2066,7 @@ model_getWordsPlayed( ModelCtxt* model, PoolContext* pool,
|
|||
nTurns = nEntries;
|
||||
}
|
||||
|
||||
if ( model_undoLatestMoves( model, pool, nTurns, NULL, NULL ) ) {
|
||||
if ( model_undoLatestMoves( model, NULL, nTurns, NULL, NULL ) ) {
|
||||
RecordWordsInfo info = { .stream = stream, .nWords = 0 };
|
||||
WordNotifierInfo notifyInfo = { .proc = recordWord,
|
||||
.closure = &info,
|
||||
|
@ -2083,7 +2082,6 @@ model_getWordsPlayed( ModelCtxt* model, PoolContext* pool,
|
|||
NULL );
|
||||
}
|
||||
stack_destroy( tmpStack );
|
||||
return XP_TRUE;
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
|
|
|
@ -252,8 +252,8 @@ XP_S16 model_getPlayerScore( ModelCtxt* model, XP_S16 player );
|
|||
|
||||
XP_Bool model_getPlayersLastScore( ModelCtxt* model, XP_S16 player,
|
||||
XP_UCHAR* expl, XP_U16* explLen );
|
||||
XP_Bool model_getWordsPlayed( ModelCtxt* model, PoolContext* pool,
|
||||
XP_U16 nTurns, XWStreamCtxt* stream );
|
||||
void model_getWordsPlayed( ModelCtxt* model, XP_U16 nTurns,
|
||||
XWStreamCtxt* stream );
|
||||
|
||||
/* Have there been too many passes (so game should end)? */
|
||||
XP_Bool model_recentPassCountOk( ModelCtxt* model );
|
||||
|
|
|
@ -2631,12 +2631,6 @@ server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream,
|
|||
}
|
||||
} /* server_formatRemainingTiles */
|
||||
|
||||
void
|
||||
server_listWordsPlayed( ServerCtxt* server, XWStreamCtxt* stream, XP_U16 nMoves )
|
||||
{
|
||||
(void)model_getWordsPlayed( server->vol.model, server->pool, nMoves, stream );
|
||||
}
|
||||
|
||||
#define IMPOSSIBLY_LOW_SCORE -1000
|
||||
void
|
||||
server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream )
|
||||
|
|
|
@ -124,9 +124,6 @@ void server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream,
|
|||
void server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream,
|
||||
XP_S16 player );
|
||||
|
||||
void server_listWordsPlayed( ServerCtxt* server, XWStreamCtxt* stream,
|
||||
XP_U16 nMoves );
|
||||
|
||||
void server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream );
|
||||
|
||||
#ifdef CPLUS
|
||||
|
|
|
@ -1714,7 +1714,7 @@ gtk_util_playerScoreHeld( XW_UtilCtxt* uc, XP_U16 player )
|
|||
XWStreamCtxt* stream =
|
||||
mem_stream_make( MEMPOOL globals->cGlobals.params->vtMgr, globals,
|
||||
CHANNEL_NONE, catOnClose );
|
||||
server_listWordsPlayed( globals->cGlobals.game.server, stream, 1000 );
|
||||
(void)model_getWordsPlayed( globals->cGlobals.game.model, 1000, stream );
|
||||
stream_destroy( stream );
|
||||
#else
|
||||
|
||||
|
|
Loading…
Reference in a new issue