clear name on delete; remove logging

This commit is contained in:
Eric House 2021-03-08 07:54:05 -08:00
parent 21b8cc0d95
commit b0cc6dd744
3 changed files with 22 additions and 19 deletions

View file

@ -541,7 +541,7 @@ stack_getNextTurn( StackCtxt* stack )
stack_freeEntry( stack, &dummy ); stack_freeEntry( stack, &dummy );
} }
LOG_RETURNF( "%d", result ); // LOG_RETURNF( "%d", result );
return result; return result;
} }

View file

@ -3685,7 +3685,6 @@ server_commitMove( ServerCtxt* server, XWEnv xwe, XP_U16 player, TrayTileSet* ne
static void static void
finishMove( ServerCtxt* server, XWEnv xwe, TrayTileSet* newTiles, XP_U16 turn ) finishMove( ServerCtxt* server, XWEnv xwe, TrayTileSet* newTiles, XP_U16 turn )
{ {
LOG_FUNC();
ModelCtxt* model = server->vol.model; ModelCtxt* model = server->vol.model;
CurGameInfo* gi = server->vol.gi; CurGameInfo* gi = server->vol.gi;
@ -3732,8 +3731,8 @@ finishMove( ServerCtxt* server, XWEnv xwe, TrayTileSet* newTiles, XP_U16 turn )
} else { } else {
nextTurn( server, xwe, PICK_NEXT ); nextTurn( server, xwe, PICK_NEXT );
} }
XP_LOGFF( "player %d now has %d tiles", turn, /* XP_LOGFF( "player %d now has %d tiles", turn, */
model_getNumTilesInTray( model, turn ) ); /* model_getNumTilesInTray( model, turn ) ); */
} /* finishMove */ } /* finishMove */
XP_Bool XP_Bool

View file

@ -132,7 +132,7 @@ EM_JS(void, call_get_dict, (const char* lc, GotDictProc proc,
}); });
EM_JS(void, show_name, (const char* name), { EM_JS(void, show_name, (const char* name), {
let jsname = UTF8ToString(name); let jsname = name ? UTF8ToString(name) : "";
document.getElementById('gamename').textContent = jsname; document.getElementById('gamename').textContent = jsname;
}); });
@ -493,8 +493,10 @@ updateGameButtons( Globals* globals )
static void static void
showName( GameState* gs ) showName( GameState* gs )
{ {
const char* title = NULL;
if ( !!gs ) {
Globals* globals = gs->globals; Globals* globals = gs->globals;
const char* title = gs->gameName; title = gs->gameName;
char buf[64]; char buf[64];
if ( true || 1 < countDicts( globals ) ) { if ( true || 1 < countDicts( globals ) ) {
char langName[32]; char langName[32];
@ -508,6 +510,7 @@ showName( GameState* gs )
sprintf( buf, "%s (%s)", title, lc ); sprintf( buf, "%s (%s)", title, lc );
title = buf; title = buf;
} }
}
show_name( title ); show_name( title );
} }
@ -633,6 +636,7 @@ deleteGame( GameState* gs )
formatGameID( gameIDStr, sizeof(gameIDStr), gameID ); formatGameID( gameIDStr, sizeof(gameIDStr), gameID );
const XP_UCHAR* keys[] = {KEY_GAMES, gameIDStr, NULL}; const XP_UCHAR* keys[] = {KEY_GAMES, gameIDStr, NULL};
dutil_remove( globals->dutil, keys ); dutil_remove( globals->dutil, keys );
showName( NULL );
} }
static void static void
@ -1006,7 +1010,7 @@ gameFromInvite( Globals* globals, const NetLaunchInfo* invite )
} else { } else {
char msg[128]; char msg[128];
sprintf( msg, "Invitation requires a wordlist %s for " 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) ); DictDownState* dds = XP_MALLOC( globals->mpool, sizeof(*dds) );
dds->globals = globals; dds->globals = globals;