diff --git a/xwords4/wasm/main.c b/xwords4/wasm/main.c index fb97d53ce..dd0f7ad8f 100644 --- a/xwords4/wasm/main.c +++ b/xwords4/wasm/main.c @@ -395,6 +395,18 @@ main_playerScoreHeld( Globals* globals, XP_U16 player ) } } + +void +main_showGameOver( Globals* globals ) +{ + XWStreamCtxt* stream = mem_stream_make_raw( MPPARM(globals->mpool) + globals->vtMgr ); + server_writeFinalScores( globals->game.server, NULL, stream ); + stream_putU8( stream, 0 ); + call_alert( (const XP_UCHAR*)stream_getPtr( stream ) ); + stream_destroy( stream, NULL ); +} + static time_t getCurMS() { diff --git a/xwords4/wasm/main.h b/xwords4/wasm/main.h index 0c8045d6e..fcfa42294 100644 --- a/xwords4/wasm/main.h +++ b/xwords4/wasm/main.h @@ -74,5 +74,6 @@ void main_onGameMessage( Globals* globals, XP_U32 gameID, void main_sendOnClose( XWStreamCtxt* stream, XWEnv env, void* closure ); void main_playerScoreHeld( Globals* globals, XP_U16 player ); +void main_showGameOver( Globals* globals ); #endif diff --git a/xwords4/wasm/wasmutil.c b/xwords4/wasm/wasmutil.c index ac50f1ec0..63984f2f6 100644 --- a/xwords4/wasm/wasmutil.c +++ b/xwords4/wasm/wasmutil.c @@ -350,7 +350,7 @@ wasm_util_notifyGameOver( XW_UtilCtxt* uc, XWEnv xwe, XP_S16 quitter ) { WasmUtilCtx* wuctxt = (WasmUtilCtx*)uc; Globals* globals = (Globals*)wuctxt->closure; - main_alert( globals, "Game over" ); + main_showGameOver( globals ); } static XP_Bool