mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
clear name on delete; remove logging
This commit is contained in:
parent
21b8cc0d95
commit
b0cc6dd744
3 changed files with 22 additions and 19 deletions
|
@ -541,7 +541,7 @@ stack_getNextTurn( StackCtxt* stack )
|
|||
stack_freeEntry( stack, &dummy );
|
||||
}
|
||||
|
||||
LOG_RETURNF( "%d", result );
|
||||
// LOG_RETURNF( "%d", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -3685,7 +3685,6 @@ server_commitMove( ServerCtxt* server, XWEnv xwe, XP_U16 player, TrayTileSet* ne
|
|||
static void
|
||||
finishMove( ServerCtxt* server, XWEnv xwe, TrayTileSet* newTiles, XP_U16 turn )
|
||||
{
|
||||
LOG_FUNC();
|
||||
ModelCtxt* model = server->vol.model;
|
||||
CurGameInfo* gi = server->vol.gi;
|
||||
|
||||
|
@ -3732,8 +3731,8 @@ finishMove( ServerCtxt* server, XWEnv xwe, TrayTileSet* newTiles, XP_U16 turn )
|
|||
} else {
|
||||
nextTurn( server, xwe, PICK_NEXT );
|
||||
}
|
||||
XP_LOGFF( "player %d now has %d tiles", turn,
|
||||
model_getNumTilesInTray( model, turn ) );
|
||||
/* XP_LOGFF( "player %d now has %d tiles", turn, */
|
||||
/* model_getNumTilesInTray( model, turn ) ); */
|
||||
} /* finishMove */
|
||||
|
||||
XP_Bool
|
||||
|
|
|
@ -132,7 +132,7 @@ EM_JS(void, call_get_dict, (const char* lc, GotDictProc proc,
|
|||
});
|
||||
|
||||
EM_JS(void, show_name, (const char* name), {
|
||||
let jsname = UTF8ToString(name);
|
||||
let jsname = name ? UTF8ToString(name) : "";
|
||||
document.getElementById('gamename').textContent = jsname;
|
||||
});
|
||||
|
||||
|
@ -493,20 +493,23 @@ updateGameButtons( Globals* globals )
|
|||
static void
|
||||
showName( GameState* gs )
|
||||
{
|
||||
Globals* globals = gs->globals;
|
||||
const char* title = gs->gameName;
|
||||
char buf[64];
|
||||
if ( true || 1 < countDicts( globals ) ) {
|
||||
char langName[32];
|
||||
const char* lc = lcToLocale(gs->gi.dictLang);
|
||||
const XP_UCHAR* keys[] = {KEY_DICTS, lc, KEY_LANG_NAME, NULL };
|
||||
XP_U32 len = sizeof(langName);
|
||||
dutil_loadPtr( globals->dutil, NULL, keys, langName, &len );
|
||||
if ( 0 != len ) {
|
||||
lc = langName;
|
||||
const char* title = NULL;
|
||||
if ( !!gs ) {
|
||||
Globals* globals = gs->globals;
|
||||
title = gs->gameName;
|
||||
char buf[64];
|
||||
if ( true || 1 < countDicts( globals ) ) {
|
||||
char langName[32];
|
||||
const char* lc = lcToLocale(gs->gi.dictLang);
|
||||
const XP_UCHAR* keys[] = {KEY_DICTS, lc, KEY_LANG_NAME, NULL };
|
||||
XP_U32 len = sizeof(langName);
|
||||
dutil_loadPtr( globals->dutil, NULL, keys, langName, &len );
|
||||
if ( 0 != len ) {
|
||||
lc = langName;
|
||||
}
|
||||
sprintf( buf, "%s (%s)", title, lc );
|
||||
title = buf;
|
||||
}
|
||||
sprintf( buf, "%s (%s)", title, lc );
|
||||
title = buf;
|
||||
}
|
||||
show_name( title );
|
||||
}
|
||||
|
@ -633,6 +636,7 @@ deleteGame( GameState* gs )
|
|||
formatGameID( gameIDStr, sizeof(gameIDStr), gameID );
|
||||
const XP_UCHAR* keys[] = {KEY_GAMES, gameIDStr, NULL};
|
||||
dutil_remove( globals->dutil, keys );
|
||||
showName( NULL );
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1006,7 +1010,7 @@ gameFromInvite( Globals* globals, const NetLaunchInfo* invite )
|
|||
} else {
|
||||
char msg[128];
|
||||
sprintf( msg, "Invitation requires a wordlist %s for "
|
||||
"language %s; download now?", invite->dict, lc );
|
||||
"locale %s; download now?", invite->dict, lc );
|
||||
|
||||
DictDownState* dds = XP_MALLOC( globals->mpool, sizeof(*dds) );
|
||||
dds->globals = globals;
|
||||
|
|
Loading…
Reference in a new issue