diff --git a/xwords4/wasm/main.c b/xwords4/wasm/main.c index b85f14d70..d26ac3b9d 100644 --- a/xwords4/wasm/main.c +++ b/xwords4/wasm/main.c @@ -148,7 +148,7 @@ EM_JS(void, call_get_dict, (const char* lc, GotDictProc proc, EM_JS(void, show_name, (const char* name), { let jsname = name ? UTF8ToString(name) : ""; - document.getElementById('gamename').textContent = jsname; + document.getElementById('gamename').innerHTML = jsname; }); EM_JS(void, show_msgcount, (int count), { @@ -648,7 +648,7 @@ langNameFor( Globals* globals, const char* lc, char buf[], size_t buflen ) static void showName( GameState* gs ) { - char title[128] = {0}; + char title[256] = {0}; if ( !!gs ) { Globals* globals = gs->globals; sprintf( title, "%s", gs->gameName ); @@ -662,7 +662,9 @@ showName( GameState* gs ) } #ifdef DEBUG char* start = title + strlen(title); - sprintf( start, " (gid=%d/%X)", gs->gi.gameID, gs->gi.gameID ); + sprintf( start, " (gid=%d/%X)", + globals->myDevIDStr, gs->gi.gameID, gs->gi.gameID, gs->gi.gameID ); #endif } show_name( title ); @@ -1181,9 +1183,9 @@ initDeviceGlobals( Globals* globals ) MQTTDevID devID; dvc_getMQTTDevID( globals->dutil, NULL_XWE, &devID ); - XP_UCHAR buf[32]; - XP_SNPRINTF( buf, VSIZE(buf), MQTTDevID_FMT, devID ); - XP_LOGFF( "got mqtt devID: %s", buf ); + XP_SNPRINTF( globals->myDevIDStr, VSIZE(globals->myDevIDStr), + MQTTDevID_FMT, devID ); + XP_LOGFF( "got mqtt devID: %s", globals->myDevIDStr ); int now = dutil_getCurSeconds( globals->dutil, NULL_XWE ); bool dbg = #ifdef DEBUG @@ -1203,7 +1205,7 @@ initDeviceGlobals( Globals* globals ) XP_LOGFF( "got topic %d: %s", ii, topics[ii] ); } - call_setup( globals, dbg, buf, GITREV, now, onConflict, + call_setup( globals, dbg, globals->myDevIDStr, GITREV, now, onConflict, onFocussed, onMqttMsg, nTopics, topics ); } diff --git a/xwords4/wasm/main.h b/xwords4/wasm/main.h index 800e28ca5..8e85ea96f 100644 --- a/xwords4/wasm/main.h +++ b/xwords4/wasm/main.h @@ -67,6 +67,7 @@ typedef struct Globals { TransportProcs transportProcs; CommonPrefs cp; DictMgrCtxt* dictMgr; + char myDevIDStr[32]; int useWidth, useHeight; diff --git a/xwords4/wasm/xwutils.js b/xwords4/wasm/xwutils.js index 801dc8596..d2e87c6a2 100644 --- a/xwords4/wasm/xwutils.js +++ b/xwords4/wasm/xwutils.js @@ -151,7 +151,7 @@ function jssetup(closure, dbg, devid, gitrev, now, noTabProc, registerOnce(devid, gitrev, now, dbg); - document.getElementById("mqtt_span").textContent=devid; + document.getElementById("mqtt_span").textContent = devid; function onConnChange(isConn) { state.connected = isConn;