diff --git a/xwords4/relay/dbmgr.cpp b/xwords4/relay/dbmgr.cpp index 66df622fc..96d497189 100644 --- a/xwords4/relay/dbmgr.cpp +++ b/xwords4/relay/dbmgr.cpp @@ -436,11 +436,10 @@ DBMgr::ReregisterDevice( DevIDRelay relayID, const DevID* host, StrWPF query; query.printf( "UPDATE " DEVICES_TABLE " SET " "devTypes = array_prepend( %d, devTypes), " - "devids = array_prepend('%s', devids), ", + "devids = array_prepend('%s', devids), ", host->m_devIDType, host->m_devIDString.c_str() ); formatUpdate( query, desc, clientVersion, model, osVers, relayID ); - execSql( query ); } @@ -477,7 +476,8 @@ DBMgr::formatUpdate( StrWPF& query, const char* const desc, int clientVersion, const char* const model, const char* const osVers, DevIDRelay relayID ) { - query.printf( "mtime='now'" ); + // query.printf( "mtimes=array_prepend('now', mtimes)" ); // FIXME: too many + query.printf( "mtimes[1]='now'" ); if ( NULL != desc && '\0' != desc[0] ) { query.printf( ", clntVers=%d, versDesc='%s'", clientVersion, desc ); } diff --git a/xwords4/relay/scripts/showinplay.sh b/xwords4/relay/scripts/showinplay.sh index 1ac19e90d..a41b02e58 100755 --- a/xwords4/relay/scripts/showinplay.sh +++ b/xwords4/relay/scripts/showinplay.sh @@ -37,6 +37,6 @@ echo "SELECT connname, hid, devid, count(*), sum(msglen) "\ "GROUP BY connname, hid, devid ORDER BY connname LIMIT $LIMIT;" \ | psql xwgames -echo "SELECT id, model, osvers, mtime, array_length(devTypes, 1) as cnt, devTypes[1] as dTyp, devids[1] as devid FROM devices WHERE id IN (select UNNEST(devids) FROM games $QUERY) ORDER BY id LIMIT $LIMIT;" \ +echo "SELECT id, model, osvers, array_length(mtimes, 1) as mcnt, mtimes[1] as mtime, array_length(devTypes, 1) as dcnt, devTypes[1] as dTyp, devids[1] as devid FROM devices WHERE id IN (select UNNEST(devids) FROM games $QUERY) ORDER BY id LIMIT $LIMIT;" \ | psql xwgames diff --git a/xwords4/relay/xwrelay.sh b/xwords4/relay/xwrelay.sh index b55fd0142..5a50d1fc7 100755 --- a/xwords4/relay/xwrelay.sh +++ b/xwords4/relay/xwrelay.sh @@ -88,7 +88,7 @@ id INTEGER UNIQUE PRIMARY KEY ,model TEXT ,osvers TEXT ,ctime TIMESTAMP DEFAULT CURRENT_TIMESTAMP -,mtime TIMESTAMP +,mtimes TIMESTAMP[] ,unreg BOOLEAN DEFAULT FALSE ); EOF