From 1a231455f0cb6e5fe2cd65e025039425eb6a6668 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 5 Dec 2020 19:59:03 -0800 Subject: [PATCH 01/14] add manual message-send to fcm_loop for testing --- xwords4/relay/scripts/fcm_loop.py | 140 +++++++++++++++++------------- 1 file changed, 80 insertions(+), 60 deletions(-) diff --git a/xwords4/relay/scripts/fcm_loop.py b/xwords4/relay/scripts/fcm_loop.py index 267d134a9..8551fb259 100755 --- a/xwords4/relay/scripts/fcm_loop.py +++ b/xwords4/relay/scripts/fcm_loop.py @@ -6,7 +6,7 @@ # # Depends on the gcm module -import getpass, sys, psycopg2, time, signal, shelve, json, urllib2 +import argparse, getpass, sys, psycopg2, time, signal, shelve, json, urllib2 from time import gmtime, strftime from os import path from oauth2client.service_account import ServiceAccountCredentials @@ -135,8 +135,7 @@ def asGCMIds(con, devids, typ): if g_debug: print 'asGCMIds() =>', result return result -def notifyViaFCM( devids, typ, target ): - global g_accessToken +def notifyViaFCM(devids, typ, target): success = False if typ == DEVTYPE_FCM: if 'clntVers' in target and 3 <= target['clntVers'] and target['msg64']: @@ -152,40 +151,45 @@ def notifyViaFCM( devids, typ, target ): 'data' : data, } } - params = json.dumps( values ) - - if g_skipSend: - print - print "not sending:", params - else: - for ignore in [True, True]: # try twice at most - req = urllib2.Request( FCM_URL, params ) - req.add_header( 'Authorization', 'Bearer ' + g_accessToken ) - req.add_header( 'Content-Type', 'application/json' ) - try: - response = urllib2.urlopen( req ).read() - asJson = json.loads( response ) - - # not sure what the response format looks like to test for success.... - if 'name' in asJson: # and len(asJson['name']) == len(devids): - print "OK; no failures: ", response - success = True - else: - print "Errors: " - print response - break - - except urllib2.URLError as e: - print 'error from urlopen:', e.reason - if e.reason == 'Unauthorized': - g_accessToken = get_access_token() - else: - break - + success = send(values) else: print "not sending to", len(devids), "devices because typ ==", typ return success +def send(values): + global g_accessToken + success = False + params = json.dumps(values) + + if g_skipSend: + print + print "not sending:", params + else: + for ignore in [True, True]: # try twice at most + req = urllib2.Request( FCM_URL, params ) + req.add_header( 'Authorization', 'Bearer ' + g_accessToken ) + req.add_header( 'Content-Type', 'application/json' ) + try: + response = urllib2.urlopen( req ).read() + asJson = json.loads( response ) + + # not sure what the response format looks like to test for success.... + if 'name' in asJson: # and len(asJson['name']) == len(devids): + print "OK; no failures: ", response + success = True + else: + print "Errors: " + print response + break + + except urllib2.URLError as e: + print 'error from urlopen:', e.reason + if e.reason == 'Unauthorized': + g_accessToken = get_access_token() + else: + break + return success + def shouldSend(val): pow = 1 while pow < val: pow *= 2 @@ -238,39 +242,17 @@ def handleSigTERM( one, two ): print 'handleSigTERM called: ', one, two cleanup() -def usage(): - print "usage:", sys.argv[0], "[--loop ] [--type typ] [--verbose]" - sys.exit(); - -def main(): +def loop(args): global g_con, g_sent, g_debug - loopInterval = 0 g_con = init() emptyCount = 0 - typ = DEVTYPE_FCM - - ii = 1 - while ii < len(sys.argv): - arg = sys.argv[ii] - if arg == '--loop': - ii += 1 - loopInterval = float(sys.argv[ii]) - elif arg == '--type': - ii += 1 - typ = int(sys.argv[ii]) - elif arg == '--verbose': - g_debug = True - else: - usage() - ii = ii + 1 - signal.signal( signal.SIGTERM, handleSigTERM ) signal.signal( signal.SIGINT, handleSigTERM ) while g_con: if g_debug: print nSent = 0 - devids = getPendingMsgs( g_con, typ ) + devids = getPendingMsgs( g_con, args.TYPE ) # print "got msgs:", len(devids) if 0 < len(devids): devids = addClntVers( g_con, devids ) @@ -284,7 +266,7 @@ def main(): toDelete = [] for devid in targets.keys(): for targetRow in targets[devid]: - if notifyViaFCM( asGCMIds(g_con, [devid], typ), typ, targetRow ) \ + if notifyViaFCM( asGCMIds(g_con, [devid], args.TYPE), args.TYPE, targetRow ) \ and 3 <= targetRow['clntVers'] \ and targetRow['msg64']: toDelete.append( str(targetRow['id']) ) @@ -299,11 +281,49 @@ def main(): sys.stdout.write('.') sys.stdout.flush() if 0 == (emptyCount % (LINE_LEN*5)): print "" - if 0 == loopInterval: break - time.sleep( loopInterval ) + if 0 == args.LOOP_SECONDS: break + time.sleep( args.LOOP_SECONDS ) cleanup() +def sendMessage(args): + message = args.SEND_MSG + fcmid = args.FCMID + if not message: + print('--send-msg required') + elif not fcmid: + print('--fcmid required') + else: + data = {'msg': message, 'title' : 'needs title'} + values = { + 'message' : { + 'token' : fcmid, + 'data' : data, + } + } + success = send(values) + print( 'sendMessage({}): send() => {}'.format(message, success)) + +def mkParser(): + parser = argparse.ArgumentParser() + parser.add_argument('--send-msg', dest = 'SEND_MSG', type = str, default = None, + help = 'a message to send (then exit)') + parser.add_argument('--fcmid', dest = 'FCMID', type = str, default = None, + help = 'the FCMID of the device to send to (then exit)') + parser.add_argument('--loop', dest = 'LOOP_SECONDS', type = int, default = 5, + help = 'loop forever, checking the relay every seconds' ) + parser.add_argument('--type', dest = 'TYPE', type = int, default = DEVTYPE_FCM, + help = 'type. Just use the default') + parser.add_argument('--verbose', dest = 'VERBOSE', action = 'store_true', default = False) + return parser + +def main(): + args = mkParser().parse_args() + global g_debug + g_debug = args.VERBOSE + if args.SEND_MSG or args.FCMID: sendMessage( args ) + else: loop(args); + ############################################################################## if __name__ == '__main__': main() From 858b6d3fbe276d9cd399add13bd5ca0b153eda30 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 6 Dec 2020 21:27:12 -0800 Subject: [PATCH 02/14] a bit of cleanup --- xwords4/android/jni/anddict.c | 4 ++-- xwords4/android/jni/andutils.c | 4 ++-- xwords4/android/jni/drawwrapper.c | 2 +- xwords4/android/jni/jniutlswrapper.c | 2 +- xwords4/android/jni/utilwrapper.c | 17 ++++++++--------- xwords4/android/jni/xportwrapper.c | 2 +- xwords4/android/jni/xwjni.c | 27 +++++++++++++-------------- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/xwords4/android/jni/anddict.c b/xwords4/android/jni/anddict.c index 6391f0bfe..fdbe98b20 100644 --- a/xwords4/android/jni/anddict.c +++ b/xwords4/android/jni/anddict.c @@ -206,7 +206,7 @@ and_dictionary_destroy( DictionaryCtxt* dict, XWEnv xwe ) { AndDictionaryCtxt* ctxt = (AndDictionaryCtxt*)dict; ASSERT_ENV( ctxt->ti, xwe ); - XP_LOGF( "%s(dict=%p); code=%x", __func__, ctxt, ctxt->dbgid ); + XP_LOGFF( "(dict=%p); code=%x", ctxt, ctxt->dbgid ); XP_U16 nSpecials = countSpecials( &ctxt->super ); JNIEnv* env = xwe; @@ -376,7 +376,7 @@ makeDict( MPFORMAL JNIEnv* env, /* copy the name */ anddict->super.name = copyString( mpool, name ); - XP_LOGF( "%s(dict=%p); code=%x; name=%s", __func__, anddict, + XP_LOGFF( "(dict=%p); code=%x; name=%s", anddict, anddict->dbgid, anddict->super.name ); anddict->super.langName = getStringCopy( MPPARM(mpool) env, jlangname ); diff --git a/xwords4/android/jni/andutils.c b/xwords4/android/jni/andutils.c index fc9f5046e..edc3b94e9 100644 --- a/xwords4/android/jni/andutils.c +++ b/xwords4/android/jni/andutils.c @@ -487,8 +487,8 @@ getMethodID( JNIEnv* env, jobject obj, const char* proc, const char* sig ) #endif jmethodID mid = (*env)->GetMethodID( env, cls, proc, sig ); if ( !mid ) { - XP_LOGF( "%s: no mid for proc %s, sig %s in object of class %s", - __func__, proc, sig, buf ); + XP_LOGFF( "no mid for proc %s, sig %s in object of class %s", + proc, sig, buf ); } XP_ASSERT( !!mid ); deleteLocalRef( env, cls ); diff --git a/xwords4/android/jni/drawwrapper.c b/xwords4/android/jni/drawwrapper.c index 6f2749634..1f7bbe962 100644 --- a/xwords4/android/jni/drawwrapper.c +++ b/xwords4/android/jni/drawwrapper.c @@ -379,7 +379,7 @@ and_draw_drawTimer( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, XP_U16 player XP_S16 secondsLeft, XP_Bool inDuplicateMode ) { if ( rect->width == 0 ) { - XP_LOGF( "%s: exiting b/c rect empty", __func__ ); + XP_LOGFF( "exiting b/c rect empty" ); } else { DRAW_CBK_HEADER("drawTimer", "(Landroid/graphics/Rect;IIZ)V" ); diff --git a/xwords4/android/jni/jniutlswrapper.c b/xwords4/android/jni/jniutlswrapper.c index ae66853a0..9fda6f64b 100644 --- a/xwords4/android/jni/jniutlswrapper.c +++ b/xwords4/android/jni/jniutlswrapper.c @@ -112,7 +112,7 @@ and_util_getMD5SumForDict( JNIUtilCtxt* jniutil, JNIEnv* env, const XP_UCHAR* na #ifdef DEBUG if ( !!result ) { const char* chars = (*env)->GetStringUTFChars( env, result, NULL ); - XP_LOGF( "%s(%s, len=%d) => %s", __func__, name, len, chars ); + XP_LOGFF( "(%s, len=%d) => %s", name, len, chars ); (*env)->ReleaseStringUTFChars( env, result, chars ); } #endif diff --git a/xwords4/android/jni/utilwrapper.c b/xwords4/android/jni/utilwrapper.c index 29e13cbb6..e974c33ac 100644 --- a/xwords4/android/jni/utilwrapper.c +++ b/xwords4/android/jni/utilwrapper.c @@ -86,8 +86,7 @@ and_util_makeStreamFromAddr( XW_UtilCtxt* uc, XWEnv XP_UNUSED(xwe), #define UTIL_CBK_TAIL() \ } else { \ - XP_LOGF( "%s: skipping call into java because jutil==NULL", \ - __func__ ); \ + XP_LOGFF( "skipping call into java because jutil==NULL" ); \ } #define DUTIL_CBK_HEADER(nam,sig) \ @@ -135,7 +134,7 @@ and_util_userError( XW_UtilCtxt* uc, XWEnv xwe, UtilErrID id ) if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); (*env)->ExceptionClear(env); - XP_LOGF( "exception found" ); + XP_LOGFF( "exception found" ); } UTIL_CBK_TAIL(); } @@ -333,10 +332,10 @@ utilTimerFired( XW_UtilCtxt* uc, XWEnv xwe, XWTimerReason why, int handle ) if ( !!proc ) { handled = (*proc)( timerStorage->closure, xwe, why ); } else { - XP_LOGF( "%s(why=%d): ERROR: no proc set", __func__, why ); + XP_LOGFF( "(why=%d): ERROR: no proc set", why ); } } else { - XP_LOGF( "%s: mismatch: handle=%d; timerStorage=%d", __func__, + XP_LOGFF( "mismatch: handle=%d; timerStorage=%d", handle, (int)timerStorage ); } return handled; @@ -454,10 +453,10 @@ and_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XWEnv xwe, int indx = 0; for ( ; indx < MAX_QUANTITY_STRS; ++indx ) { if ( !ptrs[indx] ) { - XP_LOGF( "%s: found empty slot %d for %s", __func__, indx, jchars ); + XP_LOGFF( "found empty slot %d for %s", indx, jchars ); break; } else if ( 0 == XP_STRCMP( jchars, ptrs[indx] ) ) { - XP_LOGF( "%s: found %s at slot %d", __func__, jchars, indx ); + XP_LOGFF( "found %s at slot %d", jchars, indx ); break; } } @@ -731,9 +730,9 @@ and_dutil_getDevID( XW_DUtilCtxt* duc, XWEnv xwe, DevIDType* typ ) jsize len = (*env)->GetStringUTFLength( env, jresult ); if ( NULL != dutil->devIDStorage && 0 == XP_MEMCMP( dutil->devIDStorage, jchars, len ) ) { - XP_LOGF( "%s: already have matching devID", __func__ ); + XP_LOGFF( "already have matching devID" ); } else { - XP_LOGF( "%s: allocating storage for devID", __func__ ); + XP_LOGFF( "allocating storage for devID" ); XP_FREEP( dutil->dutil.mpool, &dutil->devIDStorage ); dutil->devIDStorage = XP_MALLOC( dutil->dutil.mpool, len + 1 ); XP_MEMCPY( dutil->devIDStorage, jchars, len ); diff --git a/xwords4/android/jni/xportwrapper.c b/xwords4/android/jni/xportwrapper.c index 017a78d0d..02f769e78 100644 --- a/xwords4/android/jni/xportwrapper.c +++ b/xwords4/android/jni/xportwrapper.c @@ -75,7 +75,7 @@ and_xport_send( XWEnv xwe, const XP_U8* buf, XP_U16 len, } if ( result < len ) { - XP_LOGF( "%s(): changing result %d to -1", __func__, result ); + XP_LOGFF( "changing result %d to -1", result ); result = -1; /* signal failure. Not sure where 0's coming from */ } diff --git a/xwords4/android/jni/xwjni.c b/xwords4/android/jni/xwjni.c index 446c34178..9f43e67b4 100644 --- a/xwords4/android/jni/xwjni.c +++ b/xwords4/android/jni/xwjni.c @@ -91,8 +91,8 @@ static MemPoolCtx* getMPoolImpl( JNIGlobalState* globalState, const char* user ) { if ( globalState->mpoolInUse ) { - XP_LOGF( "%s(): mpoolInUse ALREADY SET!!!! (by %s)", - __func__, globalState->mpoolUser ); + XP_LOGFF( "mpoolInUse ALREADY SET!!!! (by %s)", + globalState->mpoolUser ); } globalState->mpoolInUse = XP_TRUE; globalState->mpoolUser = user; @@ -106,8 +106,7 @@ releaseMPool( JNIGlobalState* globalState ) { // XP_ASSERT( globalState->mpoolInUse ); /* fired again!!! */ if ( !globalState->mpoolInUse ) { - XP_LOGF( "%s() line %d; ERROR ERROR ERROR mpoolInUse not set", - __func__, __LINE__ ); + XP_LOGFF( "line %d; ERROR ERROR ERROR mpoolInUse not set", __LINE__ ); } globalState->mpoolInUse = XP_FALSE; } @@ -133,7 +132,7 @@ countUsed( const EnvThreadInfo* ti ) EnvThreadEntry* entry = &ti->entries[ii]; if ( 0 != entry->owner ) { # ifdef LOG_MAPPING_ALL - XP_LOGF( "%s(): ii=%d; owner: %x", __func__, ii, (unsigned int)entry->owner ); + XP_LOGFF( "ii=%d; owner: %x", ii, (unsigned int)entry->owner ); # endif ++count; } @@ -292,7 +291,7 @@ envForMe( EnvThreadInfo* ti, const char* caller ) #ifdef DEBUG if( !result ) { pthread_t self = pthread_self(); - XP_LOGF( "no env for %s (thread %x)", caller, (int)self ); + XP_LOGFF( "no env for %s (thread %x)", caller, (int)self ); XP_ASSERT(0); } #endif @@ -354,8 +353,8 @@ getState( JNIEnv* env, GamePtrType gamePtr, const char* func ) { #ifdef DEBUG if ( NULL == gamePtr ) { - XP_LOGF( "ERROR: getState() called from %s() with null gamePtr", - func ); + XP_LOGFF( "ERROR: getState() called from %s() with null gamePtr", + func ); } #endif XP_ASSERT( NULL != gamePtr ); /* fired */ @@ -373,7 +372,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_globalsInit { #ifdef MEM_DEBUG MemPoolCtx* mpool = mpool_make( NULL ); - XP_LOGF( "%s(): ptr size: %zu", __func__, sizeof(mpool) ); + XP_LOGFF( "ptr size: %zu", sizeof(mpool) ); #endif int seed = (int)jseed; XP_LOGFF( "calling srandom(seed %d)", seed ); @@ -888,7 +887,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_gi_1from_1stream &gi, NULL, NULL, NULL, NULL, NULL, NULL ) ) { setJGI( env, jgi, &gi ); } else { - XP_LOGF( "%s: game_makeFromStream failed", __func__ ); + XP_LOGFF( "game_makeFromStream failed" ); } gi_disposePlayerInfo( MPPARM(mpool) &gi ); @@ -939,7 +938,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream jnli = makeObjectEmptyConst( env, PKG_PATH("NetLaunchInfo") ); setNLI( env, jnli, &nli ); } else { - XP_LOGF( "%s: game_makeFromStream failed", __func__ ); + XP_LOGFF( "game_makeFromStream failed" ); } stream_destroy( stream, env ); @@ -1282,7 +1281,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_smsproto_1prepInbound (*env)->ReleaseStringUTFChars( env, jFromPhone, fromPhone ); (*env)->ReleaseByteArrayElements( env, jData, data, 0 ); } else { - XP_LOGF( "%s() => null (null input)", __func__ ); + XP_LOGFF( " => null (null input)" ); } return result; } @@ -1389,7 +1388,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame j_paths, j_lang ); #ifdef STUBBED_DICT if ( !dict ) { - XP_LOGF( "falling back to stubbed dict" ); + XP_LOGFF( "falling back to stubbed dict" ); dict = make_stubbed_dict( MPPARM_NOCOMMA(mpool) ); } #endif @@ -2219,7 +2218,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1augmentHostAddr getJAddrRec( env, &addr, jaddr ); comms_augmentHostAddr( state->game.comms, env, &addr ); } else { - XP_LOGF( "%s: no comms this game", __func__ ); + XP_LOGFF( "no comms this game" ); } XWJNI_END(); } From 3f6106b064b01353cc514a589bd6268fb24b2f5c Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 7 Dec 2020 08:59:20 -0800 Subject: [PATCH 03/14] show gameID in connections summary --- .../main/java/org/eehouse/android/xw4/ConnStatusHandler.java | 5 +++-- .../src/main/java/org/eehouse/android/xw4/DelegateBase.java | 3 ++- .../src/main/java/org/eehouse/android/xw4/GameListItem.java | 2 +- xwords4/android/app/src/main/res/values/strings.xml | 2 +- xwords4/android/res_src/values-ca/strings.xml | 2 +- xwords4/android/res_src/values-de/strings.xml | 2 +- xwords4/android/res_src/values-fr/strings.xml | 4 ++-- xwords4/android/res_src/values-ja/strings.xml | 2 +- xwords4/android/res_src/values-nb-rNO/strings.xml | 2 +- xwords4/android/res_src/values-nl/strings.xml | 2 +- xwords4/android/res_src/values-pl/strings.xml | 2 +- xwords4/android/res_src/values-pt/strings.xml | 2 +- xwords4/android/res_src/values-sk/strings.xml | 3 --- 13 files changed, 16 insertions(+), 17 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java index 32989dcd9..97132b2a0 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/ConnStatusHandler.java @@ -178,7 +178,7 @@ public class ConnStatusHandler { }; public static String getStatusText( Context context, XwJNI.GamePtr gamePtr, - CommsConnTypeSet connTypes, + int gameID, CommsConnTypeSet connTypes, CommsAddrRec addr ) { String msg; @@ -190,7 +190,8 @@ public class ConnStatusHandler { synchronized( ConnStatusHandler.class ) { sb.append( LocUtils.getString( context, R.string.connstat_net_fmt, - connTypes.toString( context, true ))); + connTypes.toString( context, true ), + gameID )); for ( CommsConnType typ : sDisplayOrder ) { if ( !connTypes.contains(typ) ) { continue; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java index 27e20ec8b..ac21ee44f 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java @@ -680,7 +680,8 @@ public abstract class DelegateBase implements DlgClickNotify, final GameSummary summary = GameUtils.getSummary( context, gamePtr.getRowid(), 1 ); if ( null != summary ) { final String msg = ConnStatusHandler - .getStatusText( context, gamePtr, summary.conTypes, addr ); + .getStatusText( context, gamePtr, summary.gameID, + summary.conTypes, addr ); post( new Runnable() { @Override diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java index 1b26688aa..fcd42c535 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java @@ -264,7 +264,7 @@ public class GameListItem extends LinearLayout case R.string.game_summary_field_empty: break; case R.string.game_summary_field_gameid: - value = String.format( "%d", m_summary.gameID ); + value = String.format( "ID:%X", m_summary.gameID ); break; case R.string.game_summary_field_rowid: value = String.format( "%d", m_rowid ); diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 1a2c778fc..9ccdaa484 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1830,7 +1830,7 @@ device supports, or you may have recently removed its last way of connecting.) - Network status for game connected via + Network status for game (ID=%2$X) connected via %1$s: Invitations sent for game connected via diff --git a/xwords4/android/res_src/values-ca/strings.xml b/xwords4/android/res_src/values-ca/strings.xml index 938894632..3c8eddfaa 100644 --- a/xwords4/android/res_src/values-ca/strings.xml +++ b/xwords4/android/res_src/values-ca/strings.xml @@ -675,7 +675,7 @@ Introduïu el vostre nom aquí. S\'usarà en crear partides noves. (Podreu \nPodeu arrossegar les fitxes entre el faristol i el tauler, o podeu tocar una casella buida per a col·locar la fletxa del tauler. Les fitxes del faristol que toqueu substituiran la fletxa (es mourà una casella en la direcció que assenyali.) Toqueu la fletxa un cop per a canviar-ne l\'orientació, una segon cop per a amagar-la. Un casella de verificació a la secció Aparença de la Configuració permet amagar-la permanentment. Aquest llistat telefònic és buit. Useu el botó «Importa un contacte» per a afegir persones que voleu convidar, el botó + per a introduir números directament. Aquesta partida en xarxa no té forma de connectar i no es podrà jugar mai.\n\n(probablement fou creada amb una invitació que no especifica cap via de connexió suportada pel vostre aparell.) - Estat de xarxa per a la partida connectada via %1$s: + Estat de xarxa (ID=%2$X) per a la partida connectada via %1$s: Últim enviament fou %1$s (%2$s) (últim error fou %1$s) (últim enviament correcte fou %1$s) diff --git a/xwords4/android/res_src/values-de/strings.xml b/xwords4/android/res_src/values-de/strings.xml index 61e80699a..328ee5a2d 100644 --- a/xwords4/android/res_src/values-de/strings.xml +++ b/xwords4/android/res_src/values-de/strings.xml @@ -436,7 +436,7 @@ Diese Netzwerk-Partie hat keine Verbindungsmöglichkeit und kann nicht gespielt werden. \n \n(Sie wurde wahrscheinlich durch eine Einladung angelegt, die keine von Ihrem Gerät unterstützte Verbindungsart angegeben hat, oder hat vor Kurzem ihre letzte Verbindungsart entfernt.) - "Netwerk-Status für über %1$s verbundene Partie:" + "Netwerk-Status für über %1$s (ID=%2$X) verbundene Partie:" Einladungen geschickt für die Partie verbunden über %1$s: erfolgreich nicht erfolgreich diff --git a/xwords4/android/res_src/values-fr/strings.xml b/xwords4/android/res_src/values-fr/strings.xml index 70d829e8e..484bcbd5c 100644 --- a/xwords4/android/res_src/values-fr/strings.xml +++ b/xwords4/android/res_src/values-fr/strings.xml @@ -2063,8 +2063,8 @@ illimités ? Annulez si vous n\'êtes pas sûr. - État du réseau pour la partie connectée par -%1$s : + État du réseau (ID=%2$X) pour la + partie connectée par %1$s : succès diff --git a/xwords4/android/res_src/values-ja/strings.xml b/xwords4/android/res_src/values-ja/strings.xml index 2480d3897..4516720a6 100644 --- a/xwords4/android/res_src/values-ja/strings.xml +++ b/xwords4/android/res_src/values-ja/strings.xml @@ -399,7 +399,7 @@ このネットワークゲームは接続する方法がなく、プレイできません。 \n \n(お使いデバイスがサポートしていない接続方法が指定された招待状から作成したか、最新の接続方法を削除した可能性があります。) - %1$s 経由で接続されたゲームのネットワーク状況: + %1$s 経由で接続されたゲーム(ID=%2$X)のネットワーク状況: 成功 不成功 最後の送信 %1$s (%2$s) diff --git a/xwords4/android/res_src/values-nb-rNO/strings.xml b/xwords4/android/res_src/values-nb-rNO/strings.xml index 64b686d27..045be1f77 100644 --- a/xwords4/android/res_src/values-nb-rNO/strings.xml +++ b/xwords4/android/res_src/values-nb-rNO/strings.xml @@ -576,7 +576,7 @@ Sjongler stativ Bygger spillsammendrag… Sammendrag utilgjengelig - Nettverksstatus for spill tilkoblet via %1$s: + Nettverksstatus for spill (ID=%2$X) tilkoblet via %1$s: Invitasjoner sendt for spill tilkoblet via %1$s: vellykket mislyktes diff --git a/xwords4/android/res_src/values-nl/strings.xml b/xwords4/android/res_src/values-nl/strings.xml index 23c9a3314..072fd8f0a 100644 --- a/xwords4/android/res_src/values-nl/strings.xml +++ b/xwords4/android/res_src/values-nl/strings.xml @@ -400,7 +400,7 @@ Bekijk woordenlijst Samenvatting spel opbouwen… Dit netwerk spel heeft geen manier om te verbinden en zal nooit speelbaar worden.\n\n(Het was waarschijnlijk gemaakt via een uitnodiging die geen verbindingsmanier specificeert die jouw apparaat ondersteund.) - Netwerkstatus voor spel verbonden via %1$s: + Netwerkstatus voor spel (ID=%2$X) verbonden via %1$s: succesvol onsuccesvol Laatst verstuurd was %1$s (%2$s) diff --git a/xwords4/android/res_src/values-pl/strings.xml b/xwords4/android/res_src/values-pl/strings.xml index d2499b199..537cc52c9 100644 --- a/xwords4/android/res_src/values-pl/strings.xml +++ b/xwords4/android/res_src/values-pl/strings.xml @@ -502,7 +502,7 @@ Ta gra w sieciowa nie ma możliwości nawiązania połączenia i nie może być odtwarzana. \n \n(Prawdopodobnie została utworzona na podstawie zaproszenia, które nie zawierało żadnego sposobu połączenia obsługiwanego przez urządzenie, lub może ostatnio usunięto ostatni sposób połączenia.) - Stan sieci dla gry podłączonej przez %1$s: + Stan sieci (ID=%2$X) dla gry podłączonej przez %1$s: Wysłano zaproszenia do gry połączone za pośrednictwem %1$s: pomyślnie niepowodzenie diff --git a/xwords4/android/res_src/values-pt/strings.xml b/xwords4/android/res_src/values-pt/strings.xml index 5d747a59c..d455918b0 100644 --- a/xwords4/android/res_src/values-pt/strings.xml +++ b/xwords4/android/res_src/values-pt/strings.xml @@ -1561,7 +1561,7 @@ Carregando resumo do jogo… - Informações de rede para jogo conectado + Informações de rede (ID=%2$X) para jogo conectado por %1$s: com sucesso diff --git a/xwords4/android/res_src/values-sk/strings.xml b/xwords4/android/res_src/values-sk/strings.xml index 785eb41d2..1a66f7538 100644 --- a/xwords4/android/res_src/values-sk/strings.xml +++ b/xwords4/android/res_src/values-sk/strings.xml @@ -1051,9 +1051,6 @@ XLATE ME: successful - XLATE ME: Network status for game connected via - %1$s: - XLATE ME: Building game summary… XLATE ME: Browse wordlist From 9f6b122b56b97368832e284a9afe17be08f873e3 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 7 Dec 2020 21:03:03 -0800 Subject: [PATCH 04/14] don't use hex version of gameID It's too hard to force the relay's webview to do the same --- .../app/src/main/java/org/eehouse/android/xw4/GameListItem.java | 2 +- xwords4/android/app/src/main/res/values/strings.xml | 2 +- xwords4/android/res_src/values-ca/strings.xml | 2 +- xwords4/android/res_src/values-de/strings.xml | 2 +- xwords4/android/res_src/values-fr/strings.xml | 2 +- xwords4/android/res_src/values-ja/strings.xml | 2 +- xwords4/android/res_src/values-nb-rNO/strings.xml | 2 +- xwords4/android/res_src/values-nl/strings.xml | 2 +- xwords4/android/res_src/values-pl/strings.xml | 2 +- xwords4/android/res_src/values-pt/strings.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java index fcd42c535..72c29a196 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameListItem.java @@ -264,7 +264,7 @@ public class GameListItem extends LinearLayout case R.string.game_summary_field_empty: break; case R.string.game_summary_field_gameid: - value = String.format( "ID:%X", m_summary.gameID ); + value = String.format( "ID:%d", m_summary.gameID ); break; case R.string.game_summary_field_rowid: value = String.format( "%d", m_rowid ); diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 9ccdaa484..443bbbff8 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1830,7 +1830,7 @@ device supports, or you may have recently removed its last way of connecting.) - Network status for game (ID=%2$X) connected via + Network status for game (ID=%2$d) connected via %1$s: Invitations sent for game connected via diff --git a/xwords4/android/res_src/values-ca/strings.xml b/xwords4/android/res_src/values-ca/strings.xml index 3c8eddfaa..aa1dd1ae4 100644 --- a/xwords4/android/res_src/values-ca/strings.xml +++ b/xwords4/android/res_src/values-ca/strings.xml @@ -675,7 +675,7 @@ Introduïu el vostre nom aquí. S\'usarà en crear partides noves. (Podreu \nPodeu arrossegar les fitxes entre el faristol i el tauler, o podeu tocar una casella buida per a col·locar la fletxa del tauler. Les fitxes del faristol que toqueu substituiran la fletxa (es mourà una casella en la direcció que assenyali.) Toqueu la fletxa un cop per a canviar-ne l\'orientació, una segon cop per a amagar-la. Un casella de verificació a la secció Aparença de la Configuració permet amagar-la permanentment. Aquest llistat telefònic és buit. Useu el botó «Importa un contacte» per a afegir persones que voleu convidar, el botó + per a introduir números directament. Aquesta partida en xarxa no té forma de connectar i no es podrà jugar mai.\n\n(probablement fou creada amb una invitació que no especifica cap via de connexió suportada pel vostre aparell.) - Estat de xarxa (ID=%2$X) per a la partida connectada via %1$s: + Estat de xarxa (ID=%2$d) per a la partida connectada via %1$s: Últim enviament fou %1$s (%2$s) (últim error fou %1$s) (últim enviament correcte fou %1$s) diff --git a/xwords4/android/res_src/values-de/strings.xml b/xwords4/android/res_src/values-de/strings.xml index 328ee5a2d..4f42bbc2f 100644 --- a/xwords4/android/res_src/values-de/strings.xml +++ b/xwords4/android/res_src/values-de/strings.xml @@ -436,7 +436,7 @@ Diese Netzwerk-Partie hat keine Verbindungsmöglichkeit und kann nicht gespielt werden. \n \n(Sie wurde wahrscheinlich durch eine Einladung angelegt, die keine von Ihrem Gerät unterstützte Verbindungsart angegeben hat, oder hat vor Kurzem ihre letzte Verbindungsart entfernt.) - "Netwerk-Status für über %1$s (ID=%2$X) verbundene Partie:" + "Netwerk-Status für über %1$s (ID=%2$d) verbundene Partie:" Einladungen geschickt für die Partie verbunden über %1$s: erfolgreich nicht erfolgreich diff --git a/xwords4/android/res_src/values-fr/strings.xml b/xwords4/android/res_src/values-fr/strings.xml index 484bcbd5c..a3ea7b6dc 100644 --- a/xwords4/android/res_src/values-fr/strings.xml +++ b/xwords4/android/res_src/values-fr/strings.xml @@ -2063,7 +2063,7 @@ illimités ? Annulez si vous n\'êtes pas sûr. - État du réseau (ID=%2$X) pour la + État du réseau (ID=%2$d) pour la partie connectée par %1$s : diff --git a/xwords4/android/res_src/values-ja/strings.xml b/xwords4/android/res_src/values-ja/strings.xml index 4516720a6..60fa3a8ec 100644 --- a/xwords4/android/res_src/values-ja/strings.xml +++ b/xwords4/android/res_src/values-ja/strings.xml @@ -399,7 +399,7 @@ このネットワークゲームは接続する方法がなく、プレイできません。 \n \n(お使いデバイスがサポートしていない接続方法が指定された招待状から作成したか、最新の接続方法を削除した可能性があります。) - %1$s 経由で接続されたゲーム(ID=%2$X)のネットワーク状況: + %1$s 経由で接続されたゲーム(ID=%2$d)のネットワーク状況: 成功 不成功 最後の送信 %1$s (%2$s) diff --git a/xwords4/android/res_src/values-nb-rNO/strings.xml b/xwords4/android/res_src/values-nb-rNO/strings.xml index 045be1f77..51df3fbc2 100644 --- a/xwords4/android/res_src/values-nb-rNO/strings.xml +++ b/xwords4/android/res_src/values-nb-rNO/strings.xml @@ -576,7 +576,7 @@ Sjongler stativ Bygger spillsammendrag… Sammendrag utilgjengelig - Nettverksstatus for spill (ID=%2$X) tilkoblet via %1$s: + Nettverksstatus for spill (ID=%2$d) tilkoblet via %1$s: Invitasjoner sendt for spill tilkoblet via %1$s: vellykket mislyktes diff --git a/xwords4/android/res_src/values-nl/strings.xml b/xwords4/android/res_src/values-nl/strings.xml index 072fd8f0a..70e59853e 100644 --- a/xwords4/android/res_src/values-nl/strings.xml +++ b/xwords4/android/res_src/values-nl/strings.xml @@ -400,7 +400,7 @@ Bekijk woordenlijst Samenvatting spel opbouwen… Dit netwerk spel heeft geen manier om te verbinden en zal nooit speelbaar worden.\n\n(Het was waarschijnlijk gemaakt via een uitnodiging die geen verbindingsmanier specificeert die jouw apparaat ondersteund.) - Netwerkstatus voor spel (ID=%2$X) verbonden via %1$s: + Netwerkstatus voor spel (ID=%2$d) verbonden via %1$s: succesvol onsuccesvol Laatst verstuurd was %1$s (%2$s) diff --git a/xwords4/android/res_src/values-pl/strings.xml b/xwords4/android/res_src/values-pl/strings.xml index 537cc52c9..d4f8d0c96 100644 --- a/xwords4/android/res_src/values-pl/strings.xml +++ b/xwords4/android/res_src/values-pl/strings.xml @@ -502,7 +502,7 @@ Ta gra w sieciowa nie ma możliwości nawiązania połączenia i nie może być odtwarzana. \n \n(Prawdopodobnie została utworzona na podstawie zaproszenia, które nie zawierało żadnego sposobu połączenia obsługiwanego przez urządzenie, lub może ostatnio usunięto ostatni sposób połączenia.) - Stan sieci (ID=%2$X) dla gry podłączonej przez %1$s: + Stan sieci (ID=%2$d) dla gry podłączonej przez %1$s: Wysłano zaproszenia do gry połączone za pośrednictwem %1$s: pomyślnie niepowodzenie diff --git a/xwords4/android/res_src/values-pt/strings.xml b/xwords4/android/res_src/values-pt/strings.xml index d455918b0..32d490acf 100644 --- a/xwords4/android/res_src/values-pt/strings.xml +++ b/xwords4/android/res_src/values-pt/strings.xml @@ -1561,7 +1561,7 @@ Carregando resumo do jogo… - Informações de rede (ID=%2$X) para jogo conectado + Informações de rede (ID=%2$d) para jogo conectado por %1$s: com sucesso From 0c2e294caa439590dc5bef702cfa34572b5a338a Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 8 Dec 2020 14:52:31 -0800 Subject: [PATCH 05/14] don't require title in FCM notification And turn off the raised-tile thing for now --- .../app/src/main/res/values/strings.xml | 5 ++++ .../org/eehouse/android/xw4/FBMService.java | 25 +++++++++++-------- xwords4/android/jni/Android.mk | 4 ++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 443bbbff8..91e981840 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2638,6 +2638,11 @@ the person’s name is listed, just select it and an invitation will be sent immediately. + + + Remote message + Internet/MQTT MQTT Invitation diff --git a/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java b/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java index 465e9753e..952c3d2d2 100644 --- a/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java +++ b/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java @@ -33,6 +33,8 @@ import org.json.JSONArray; import java.util.Map; +import org.eehouse.android.xw4.loc.LocUtils; + public class FBMService extends FirebaseMessagingService { private static final String TAG = FBMService.class.getSimpleName(); @@ -111,18 +113,19 @@ public class FBMService extends FirebaseMessagingService { value = data.get( "msg" ); if ( null != value ) { - String title = data.get( "title" ); - if ( null != title ) { - String teaser = data.get( "teaser" ); - if ( null == teaser ) { - teaser = value; - } - Intent alertIntent = GamesListDelegate - .makeAlertIntent( this, value ); - int code = value.hashCode() ^ title.hashCode(); - Utils.postNotification( this, alertIntent, title, - teaser, code ); + String title = data.get( "titlexx" ); + if ( null == title ) { + title = LocUtils.getString( this, R.string.remote_msg_title ); } + String teaser = data.get( "teaser" ); + if ( null == teaser ) { + teaser = value; + } + Intent alertIntent = GamesListDelegate + .makeAlertIntent( this, value ); + int code = value.hashCode() ^ title.hashCode(); + Utils.postNotification( this, alertIntent, title, + teaser, code ); } } } diff --git a/xwords4/android/jni/Android.mk b/xwords4/android/jni/Android.mk index 389fe3ed6..8cc0a5b96 100644 --- a/xwords4/android/jni/Android.mk +++ b/xwords4/android/jni/Android.mk @@ -39,7 +39,6 @@ LOCAL_DEFINES += \ -DHASH_STREAM \ -DXWFEATURE_DEVID \ -DXWFEATURE_CHAT \ - -DXWFEATURE_RAISETILE \ -DCOMMON_LAYOUT \ -DXWFEATURE_WIDER_COLS \ -DNATIVE_NLI \ @@ -50,6 +49,9 @@ LOCAL_DEFINES += \ -DRELAY_ROOM_DEFAULT=\"\" \ -D__LITTLE_ENDIAN \ +# XWFEATURE_RAISETILE: first, fix to not use timer +# -DXWFEATURE_RAISETILE \ + # -DNO_ADD_MQTT_TO_ALL \ # -DXWFEATURE_SCOREONEPASS \ From 5929f9d50f518d697ff1c026284ae07f2cf167c0 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 8 Dec 2020 15:02:10 -0800 Subject: [PATCH 06/14] oops --- .../src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java b/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java index 952c3d2d2..d1053d788 100644 --- a/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java +++ b/xwords4/android/app/src/xw4NoSMS/java/org/eehouse/android/xw4/FBMService.java @@ -113,7 +113,7 @@ public class FBMService extends FirebaseMessagingService { value = data.get( "msg" ); if ( null != value ) { - String title = data.get( "titlexx" ); + String title = data.get( "title" ); if ( null == title ) { title = LocUtils.getString( this, R.string.remote_msg_title ); } From 95d3880db5c982d67ed7c65c35713618988d532f Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 9 Dec 2020 16:21:19 -0800 Subject: [PATCH 07/14] display BT Mac addr in About dialog (debug only) It's useful so why not. --- .../src/main/java/org/eehouse/android/xw4/AboutAlert.java | 6 ++++++ xwords4/android/app/src/main/res/values/strings.xml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java index bd2069d2b..8caded91a 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java @@ -75,6 +75,12 @@ public class AboutAlert extends XWDialogFragment { } str = getString( R.string.about_devid_fmt, XwJNI.dvc_getMQTTDevID(null) ); + if ( BuildConfig.NON_RELEASE ) { + String[] pair = BTUtils.getBTNameAndAddress(); + if ( null != pair && 2 >= pair.length && null != pair[1] ) { + str += "\n\n" + getString( R.string.about_btaddr_fmt, pair[1] ); + } + } ((TextView)view.findViewById( R.id.about_build )) .setText( str ); diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 91e981840..ae34a2e8b 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1503,6 +1503,9 @@ \n\tSource (Git) rev: %4$s \n\tBuilt: %5$s Device ID: %1$s + + BT Mac Addr: %1$s + CrossWords for Android \nCopyright (C) 1998-2020 by Eric House. This free/open source software is From 754af8c59e1ec89f6e113e3890a633df029c6225 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 9 Dec 2020 17:14:21 -0800 Subject: [PATCH 08/14] include relayDevID when registering with mosquitto Will make it easier to debug stuff --- .../app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java index 6a581a496..73fe9324a 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java @@ -318,6 +318,7 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba params.put( "loc", LocUtils.getCurLocale( mContext ) ); params.put( "tmpKey", getTmpKey(mContext) ); params.put( "frstV", Utils.getFirstVersion( mContext ) ); + params.put( "relayDID", DevID.getRelayDevID( mContext ) ); String fcmid = FBMService.getFCMDevID( mContext ); if ( null != fcmid ) { From e4d7f99ebee8842c04fca6aac8d16765c1eb6296 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 10 Dec 2020 19:45:19 -0800 Subject: [PATCH 09/14] revert string changes (overriding translator :-) Known Players is a feature I'm devloping and right now want to keep it capitalized as players learn what it is. It's only in debug builds at the moment anyway. --- xwords4/android/app/src/main/res/values/strings.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index ae34a2e8b..036aae633 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -521,7 +521,8 @@ %2$s. Recipient unknown. - Invite forwarded via MQTT/Internet to the known player “%1$s” on %2$s. + Invite forwarded via MQTT/internet + to Known Player “%1$s” on %2$s. To invite via QR code, let your opponent scan the code with the camera on their Android phone. @@ -1503,9 +1504,9 @@ \n\tSource (Git) rev: %4$s \n\tBuilt: %5$s Device ID: %1$s - + BT Mac Addr: %1$s - CrossWords for Android \nCopyright (C) 1998-2020 by Eric House. This free/open source software is From c8237bb7669ad922af2183906f23f65c49685b54 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 11 Dec 2020 10:06:14 -0800 Subject: [PATCH 10/14] fix to print older wordlists with tiny headers --- xwords4/dawg/dawg2dict.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xwords4/dawg/dawg2dict.py b/xwords4/dawg/dawg2dict.py index 6a4da909d..d27ef70d6 100755 --- a/xwords4/dawg/dawg2dict.py +++ b/xwords4/dawg/dawg2dict.py @@ -155,11 +155,14 @@ def process(args): print( 'header: read nWords: {}'.format(nWords ), file=sys.stderr ) - msg = getNullTermParam(header) - if args.DUMP_MSG: - print( 'msg: {}'.format(msg)) - md5Sum = getNullTermParam(header) - print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr ) + try: # older wordlists won't have these + msg = getNullTermParam(header) + if args.DUMP_MSG: + print( 'msg: {}'.format(msg)) + md5Sum = getNullTermParam(header) + print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr ) + except: + md5Sum = None if args.GET_SUM: print( '{}'.format(md5Sum), file=sys.stdout ) From 4478e8996d30d9b67b834aa0538acda29a58543a Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 11 Dec 2020 12:44:15 -0800 Subject: [PATCH 11/14] include mqttdevid in app info sent for upgrade check --- .../org/eehouse/android/xw4/UpdateCheckReceiver.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java index 0fe2b683f..a19b5e4c4 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java @@ -33,10 +33,12 @@ import android.os.SystemClock; import java.io.File; import javax.net.ssl.HttpsURLConnection; -import org.eehouse.android.xw4.loc.LocUtils; import org.json.JSONArray; import org.json.JSONObject; +import org.eehouse.android.xw4.jni.XwJNI; +import org.eehouse.android.xw4.loc.LocUtils; + public class UpdateCheckReceiver extends BroadcastReceiver { private static final String TAG = UpdateCheckReceiver.class.getSimpleName(); private static final boolean LOG_QUERIES = false; @@ -66,6 +68,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver { private static final String k_LEN = "len"; private static final String k_URL = "url"; private static final String k_DEVID = "did"; + private static final String k_MQTTDEVID = "devid"; private static final String k_DEBUG = "dbg"; private static final String k_XLATEINFO = "xlatinfo"; private static final String k_STRINGSHASH = "strings"; @@ -148,6 +151,10 @@ public class UpdateCheckReceiver extends BroadcastReceiver { appParams.put( k_DEBUG, BuildConfig.DEBUG ); params.put( k_APP, appParams ); params.put( k_DEVID, XWPrefs.getDevID( context ) ); + + String[] topic = {null}; + String devID = XwJNI.dvc_getMQTTDevID( topic ); + params.put( k_MQTTDEVID, devID ); } catch ( org.json.JSONException jse ) { Log.ex( TAG, jse ); } From b878f1db763586cb5e802a5584ed966cc42b1be8 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 11 Dec 2020 12:45:30 -0800 Subject: [PATCH 12/14] offer debug menuitems on NON_RELEASE builds not just DEBUG --- .../main/java/org/eehouse/android/xw4/GamesListDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 68c39999c..9f318f062 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -1664,7 +1664,7 @@ public class GamesListDelegate extends ListDelegateBase if ( m_menuPrepared ) { boolean nothingSelected = 0 == (nGroupsSelected + nGamesSelected); - final boolean showDbg = BuildConfig.DEBUG + final boolean showDbg = BuildConfig.NON_RELEASE || XWPrefs.getDebugEnabled( m_activity ); showItemsIf( DEBUG_ITEMS, menu, nothingSelected && showDbg ); Utils.setItemVisible( menu, R.id.games_menu_loaddb, From 2f9737ed0a444ea94c91678b301d8b29936b699a Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 11 Dec 2020 12:46:19 -0800 Subject: [PATCH 13/14] fix to build wordlist from current sources I'd lost the old source, so uncompressed a current list to recreate. --- xwords4/dawg/English/Makefile.TWL06 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xwords4/dawg/English/Makefile.TWL06 b/xwords4/dawg/English/Makefile.TWL06 index 937e8357d..c2eb0f71c 100644 --- a/xwords4/dawg/English/Makefile.TWL06 +++ b/xwords4/dawg/English/Makefile.TWL06 @@ -22,11 +22,11 @@ TARGET_TYPE=WINCE include ../Makefile.langcommon -# from http://www.3zsoftware.com/en/wordmagic/lists.php -SOURCEDICT ?= $(XWDICTPATH)/English/twl06.zip +DICTNOTE = "from http://www.3zsoftware.com/en/wordmagic/lists.php" +SOURCEDICT ?= $(XWDICTPATH)/English/TWL06.txt $(XWLANG)Main.dict.gz: $(SOURCEDICT) Makefile - zcat $< | grep -e "^[A-Z]\{2,15\}$$" | gzip -c > $@ + cat $< | grep -e "^[A-Z]\{2,15\}$$" | gzip -c > $@ # Everything but creating of the Main.dict file is inherited from the # "parent" Makefile.langcommon in the parent directory. From d0dd319b87a567f92c091923b328460851110896 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 10 Dec 2020 19:33:58 -0800 Subject: [PATCH 14/14] up version strings and changelog --- xwords4/android/app/build.gradle | 4 ++-- xwords4/android/app/src/main/assets/changes.html | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index 030247391..5f0f637e5 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -19,8 +19,8 @@ */ def INITIAL_CLIENT_VERS = 10 -def VERSION_CODE_BASE = 166 -def VERSION_NAME = '4.4.170' +def VERSION_CODE_BASE = 167 +def VERSION_NAME = '4.4.171' def BUILD_INFO_NAME = "build-info.txt" // Not all variants use the same BT_UUID. Those with the same talk to diff --git a/xwords4/android/app/src/main/assets/changes.html b/xwords4/android/app/src/main/assets/changes.html index 76e0ef13d..ce93e2f75 100644 --- a/xwords4/android/app/src/main/assets/changes.html +++ b/xwords4/android/app/src/main/assets/changes.html @@ -13,10 +13,9 @@ -

CrossWords 4.4.170 release

+

CrossWords 4.4.171 release

-

This release improves play via Bluetooth and enables inviting - nearby players via a QR code

+

This release fixes an annoyance dragging tiles to the board