From 40e42b79c54b3e96f1d56426320aad371e882341 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Sat, 30 Oct 2010 09:11:47 -0700 Subject: [PATCH 1/7] up version numbers and strings -- getting ready for release --- xwords4/android/XWords4/AndroidManifest.xml | 4 +- xwords4/android/XWords4/res/raw/changes | 52 +++++++++++++------ .../org/eehouse/android/xw4/XWConstants.java | 2 +- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index 06c5ce721..952ce1612 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -21,8 +21,8 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/res/raw/changes b/xwords4/android/XWords4/res/raw/changes index 71f5a0d86..1b0e319cc 100644 --- a/xwords4/android/XWords4/res/raw/changes +++ b/xwords4/android/XWords4/res/raw/changes @@ -6,27 +6,49 @@ -Crosswords 4.4 beta 16 release +Crosswords 4.4 beta 17 release -

This is a another quick bug-fix release while I continue -work on the new relay connection code -- which is coming along, -BTW. Please email if you're willing to comment on an early version.

+

This release changes how networked games are created, configured +and connect with each other. It tries to make the process simpler and +should mean it's much more likely to succeed. I've also scattered +"new user hints" around the app, dialogs with tips that you can +dismiss with a "Do not show again" button when you don't need to see +that hint again.

-
    Bugs fixed: -
  • Dictionary download could be routed to Browser if you weren't careful or - your phone maker hard-coded the type. Now it always routes to Crosswords. - (Thanks B.S.)
  • -
+

I'm breaking from tradition and not listing bugs fixed or features +added here -- because there have been well over 300 separate changes +committed since the last beta. Instead I'll outline how you get +started with a two-player networked game.

-
    (Still) coming soon -
  • builtin hints and help, starting with the Game Settings - screen
  • +

    Assume you and a friend each have Crosswords on an Android phone. +You both need to +

      +
    • Launch Crosswords and tap the "Add networked game" button on + your device
    • -
    • rewrite of gameplay via relay to make connecting easier (no - host/guest stuff or requirement that both be online at the same - time) and allow closed game to receive moves.
    • +
    • When the game appears, long-tap it and choose "Game settings..." + from the menu
    • + +
    • Agree on a "room name" -- let's say it's "andy" --and enter it + in the "New room name" text box.
    • + +
    • Scroll to the bottom of the window and tap the "Play game" button
    • + +
    • Wait as your phones connect. You'll see a status message and + maybe a "new user hint", then the status icon in the upper-right + will go all-green and boards on both phones will get tiles
    • + +
    • Now the first player makes a move, commits it, and it shows up + on the other device. Rinse, lather, repeat.
    • + +
    • The "relay" server stores moves it receives until it can deliver + them. If you have a bunch of networked games going, choose the + "Check server" menu on the main list-of-games screen. It will + redraw all games for which there are waiting messages. You can then + open them and they will sync up.
    +

    Please remember that this is beta software. Letting me know (at eehouse@eehouse.org) what's broken and what features you'd most like diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConstants.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConstants.java index bf35c8221..866f0e882 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConstants.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConstants.java @@ -23,5 +23,5 @@ package org.eehouse.android.xw4; public interface XWConstants { public static final String GAME_EXTN = ".xwg"; public static final String DICT_EXTN = ".xwd"; - public static final String VERSION_STR = "4.4 beta 16"; + public static final String VERSION_STR = "4.4 beta 17"; } From 2d9851902c962ab9c9513a317a429e8880ddbacf Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 06:55:37 -0700 Subject: [PATCH 2/7] replace chat menuitem with chat button enabled using comms_canChat() --- xwords4/linux/gtkmain.c | 39 ++++++++++++++++++++++----------------- xwords4/linux/gtkmain.h | 3 +++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 6b59402ba..eac4a69ef 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -503,6 +503,7 @@ createOrLoadObjects( GtkAppGlobals* globals ) #endif server_do( globals->cGlobals.game.server ); + disenable_buttons( globals ); } /* createOrLoadObjects */ /* Create a new backing pixmap of the appropriate size and set up contxt to @@ -880,18 +881,6 @@ handle_resend( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) } } /* handle_resend */ -#ifdef XWFEATURE_CHAT -static void -handle_chat( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) -{ - gchar* msg = gtkGetChatMessage( globals ); - if ( NULL != msg ) { - server_sendChat( globals->cGlobals.game.server, msg ); - g_free( msg ); - } -} -#endif - #ifdef DEBUG static void handle_commstats( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) @@ -992,10 +981,6 @@ makeMenus( GtkAppGlobals* globals, int XP_UNUSED(argc), #ifndef XWFEATURE_STANDALONE_ONLY (void)createAddItem( fileMenu, "Resend", GTK_SIGNAL_FUNC(handle_resend), globals ); -# ifdef XWFEATURE_CHAT - (void)createAddItem( fileMenu, "Send Chat", - GTK_SIGNAL_FUNC(handle_chat), globals ); -# endif # ifdef DEBUG (void)createAddItem( fileMenu, "Stats", GTK_SIGNAL_FUNC(handle_commstats), globals ); @@ -1024,6 +1009,10 @@ disenable_buttons( GtkAppGlobals* globals ) XP_Bool canToggle = board_canTogglePending( globals->cGlobals.game.board ); gtk_widget_set_sensitive( globals->toggle_undo_button, canToggle ); + + XP_Bool canChat = !!globals->cGlobals.game.comms + && comms_canChat( globals->cGlobals.game.comms ); + gtk_widget_set_sensitive( globals->chat_button, canChat ); } static gboolean @@ -1172,6 +1161,18 @@ handle_zoomout_button( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) } } /* handle_done_button */ +#ifdef XWFEATURE_CHAT +static void +handle_chat_button( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) +{ + gchar* msg = gtkGetChatMessage( globals ); + if ( NULL != msg ) { + server_sendChat( globals->cGlobals.game.server, msg ); + g_free( msg ); + } +} +#endif + static void scroll_value_changed( GtkAdjustment *adj, GtkAppGlobals* globals ) { @@ -1788,7 +1789,11 @@ makeVerticalBar( GtkAppGlobals* globals, GtkWidget* XP_UNUSED(window) ) gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 ); button = makeShowButtonFromBitmap( globals, "../done.xpm", "-", G_CALLBACK(handle_zoomout_button) ); - globals->zoomout_button = button; +#ifdef XWFEATURE_CHAT + button = makeShowButtonFromBitmap( globals, "", "chat", + G_CALLBACK(handle_chat_button) ); + globals->chat_button = button; +#endif gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 ); gtk_widget_show( vbox ); diff --git a/xwords4/linux/gtkmain.h b/xwords4/linux/gtkmain.h index 4200fd8c8..949894247 100644 --- a/xwords4/linux/gtkmain.h +++ b/xwords4/linux/gtkmain.h @@ -91,6 +91,9 @@ typedef struct GtkAppGlobals { GtkWidget* zoomin_button; GtkWidget* zoomout_button; GtkWidget* toggle_undo_button; +#ifdef XWFEATURE_CHAT + GtkWidget* chat_button; +#endif EngineCtxt* engine; From 804070efc7f5a3cceec2648461290e25813fa505 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 06:57:41 -0700 Subject: [PATCH 3/7] base comms_canChat() on whether connID's been assigned. It's possible to send a message from a client immediately after its initial message but init-message dupe-detection in comms will drop that because only one channel-0 message is expected -- the initial connection message. So don't encourage platform code to enable the feature before common code can deliver the message. --- xwords4/common/comms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index c22c926d3..4be26cd22 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -1653,8 +1653,8 @@ comms_checkComplete( const CommsAddrRec* addr ) XP_Bool comms_canChat( const CommsCtxt* const comms ) { - XP_Bool canChat = COMMS_CONN_RELAY == comms_getConType( comms ) - && COMMS_RELAYSTATE_CONNECTED <= comms->r.relayState; + XP_Bool canChat = comms_isConnected( comms ) + && comms->connID != 0; LOG_RETURNF( "%s", canChat?"true":"false" ); return canChat; } From 3d70da5a8d8545ecc6279346b370b5ec602fe093 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 06:57:54 -0700 Subject: [PATCH 4/7] cleanup --- xwords4/common/server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index cdefe9fe8..16a7c3882 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -528,7 +528,8 @@ server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream ) static void sendChatTo( ServerCtxt* server, XP_U16 devIndex, const XP_UCHAR const* msg ) { - XWStreamCtxt* stream = messageStreamWithHeader( server, devIndex, XWPROTO_CHAT ); + XWStreamCtxt* stream = messageStreamWithHeader( server, devIndex, + XWPROTO_CHAT ); stringToStream( stream, msg ); stream_destroy( stream ); } @@ -545,7 +546,8 @@ sendChatToClientsExcept( ServerCtxt* server, XP_U16 skip, } } -void server_sendChat( ServerCtxt* server, const XP_UCHAR const* msg ) +void +server_sendChat( ServerCtxt* server, const XP_UCHAR const* msg ) { if ( server->vol.gi->serverRole == SERVER_ISCLIENT ) { sendChatTo( server, SERVER_DEVICE, msg ); From 8f55469930e791518f5627d4e64644cc71059e27 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 18:12:14 -0700 Subject: [PATCH 5/7] remove strings no longer in English --- xwords4/android/XWords4/res/values-ca/strings.xml | 3 --- xwords4/android/XWords4/res/values-cs/strings.xml | 1 - xwords4/android/XWords4/res/values-sk/strings.xml | 1 - 3 files changed, 5 deletions(-) diff --git a/xwords4/android/XWords4/res/values-ca/strings.xml b/xwords4/android/XWords4/res/values-ca/strings.xml index 1c94c71ec..8bbde96ee 100644 --- a/xwords4/android/XWords4/res/values-ca/strings.xml +++ b/xwords4/android/XWords4/res/values-ca/strings.xml @@ -190,8 +190,6 @@ Ordena el faristol en agafar noves fitxes Zoom amb els botons de volum Apropa o allunya el tauler fent servir les tecles de volum. - Clic per a jugar - obre la partida en fer-hi clic al llistat de partides, en compte d\'obrir un menú d\'opcions Amaga la capçalera Permet que el tauler sigui una mica més gran @@ -266,7 +264,6 @@ Bluetooth (en desenvolupament) Esteu connectat al repetidor. S\'està esperant a %d jugador/s. - Ja hi són tots els jugadors. Estat de la connexió. Error en la connexió diff --git a/xwords4/android/XWords4/res/values-cs/strings.xml b/xwords4/android/XWords4/res/values-cs/strings.xml index 67dbe5555..760fb93b3 100644 --- a/xwords4/android/XWords4/res/values-cs/strings.xml +++ b/xwords4/android/XWords4/res/values-cs/strings.xml @@ -237,7 +237,6 @@ Bluetooth (připravuje se) Připojen na relay. Čekám na %d hráče. - Všichni hráči jsou zde. Stav připojení. Chyba připojení diff --git a/xwords4/android/XWords4/res/values-sk/strings.xml b/xwords4/android/XWords4/res/values-sk/strings.xml index 7e625d84d..cfe043b83 100644 --- a/xwords4/android/XWords4/res/values-sk/strings.xml +++ b/xwords4/android/XWords4/res/values-sk/strings.xml @@ -235,7 +235,6 @@ Bluetooth (pripravuje sa) Pripojený na relay. Čakám na %d hráčov. - Všetci hráči sú tu. Stav pripojenia. Chyba pripojenia From 1e5a85628791da4b1b26eeb9b7f96e3c9bb9f42d Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 18:53:36 -0700 Subject: [PATCH 6/7] log host/port connecting to. Too useful to omit. --- .../XWords4/src/org/eehouse/android/xw4/CommsTransport.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java index a0bcfb35d..c464ae93d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java @@ -144,6 +144,9 @@ public class CommsTransport extends Thread implements TransportProcs { try { m_socketChannel = SocketChannel.open(); m_socketChannel.configureBlocking( false ); + Utils.logf( "connecting to %s:%d", + m_addr.ip_relay_hostName, + m_addr.ip_relay_port ); InetSocketAddress isa = new InetSocketAddress( m_addr.ip_relay_hostName, m_addr.ip_relay_port ); From 8bf8383d601db45c5e35a44755bafd56803f953a Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 1 Nov 2010 18:56:23 -0700 Subject: [PATCH 7/7] reread preferences in case of an upgrade. Fixes bug where default port was 0 because the new key, meant to change the value, was not being initialized. It's a hack to use a side-effect to determine whether this is an upgrade, but since I'm already calculating it didn't see any point to doing it again. --- .../src/org/eehouse/android/xw4/FirstRunDialog.java | 6 ++++-- .../XWords4/src/org/eehouse/android/xw4/GamesList.java | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/FirstRunDialog.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/FirstRunDialog.java index 4f172dea6..01efffaf5 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/FirstRunDialog.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/FirstRunDialog.java @@ -39,7 +39,7 @@ public class FirstRunDialog { private static final String HIDDEN_PREFS = "xwprefs_hidden"; private static final String SHOWN_VERSION_KEY = "SHOWN_VERSION_KEY"; - static void show( Context context, boolean skipCheck ) + static boolean show( Context context, boolean skipCheck ) { int thisVersion = 0; int shownVersion = 0; @@ -61,7 +61,8 @@ public class FirstRunDialog { shownVersion = prefs.getInt( SHOWN_VERSION_KEY, 0 ); } - if ( skipCheck || shownVersion < thisVersion ) { + boolean isUpgrade = shownVersion < thisVersion; + if ( skipCheck || isUpgrade ) { showDialog( context ); if ( !skipCheck ) { @@ -70,6 +71,7 @@ public class FirstRunDialog { editor.commit(); } } + return isUpgrade; } private static void showDialog( Context context ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 4fa3ebd91..64128d423 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -64,10 +64,11 @@ public class GamesList extends XWListActivity m_handler = new Handler(); - PreferenceManager.setDefaultValues( this, R.xml.xwprefs, false ); - setContentView(R.layout.game_list); + boolean isUpgrade = FirstRunDialog.show( this, false ); + PreferenceManager.setDefaultValues( this, R.xml.xwprefs, isUpgrade ); + // setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT); registerForContextMenu( getListView() ); @@ -94,8 +95,6 @@ public class GamesList extends XWListActivity m_adapter = new GameListAdapter( this ); setListAdapter( m_adapter ); - FirstRunDialog.show( this, false ); - RelayReceiver.RestartTimer( this ); }