mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-12 08:47:50 +01:00
Yet another attempt to deal with bad connectivity: when can't connect
to relay but other address modes are present, offer to remove the relay from the game, and if that choice is taken confirm with an explanation of the limits of what remains.
This commit is contained in:
parent
9d25b0cb65
commit
f93f0cd926
8 changed files with 93 additions and 34 deletions
|
@ -861,6 +861,9 @@ public final class R {
|
|||
of the language is substituted for %1$s.
|
||||
*/
|
||||
public static final int confirm_deleteonly_dicts_fmt=0x7f0500a0;
|
||||
public static final int confirm_drop_relay=0x7f050300;
|
||||
public static final int confirm_drop_relay_bt=0x7f050301;
|
||||
public static final int confirm_drop_relay_sms=0x7f050302;
|
||||
public static final int confirm_get_locdict_fmt=0x7f0502c9;
|
||||
/** Text of confirmation dialog for above
|
||||
*/
|
||||
|
@ -1070,6 +1073,7 @@ public final class R {
|
|||
public static final int download_failed=0x7f05023a;
|
||||
public static final int download_path_title=0x7f05023d;
|
||||
public static final int downloading_dict_fmt=0x7f050185;
|
||||
public static final int drop_relay_warning_fmt=0x7f0502ff;
|
||||
/** <string name="summary_thumb_enabled">Display snapshots of games</string>
|
||||
*/
|
||||
public static final int dropped_dupe=0x7f050256;
|
||||
|
@ -1826,13 +1830,13 @@ public final class R {
|
|||
this and you'll get taken to the "Game configure" screen
|
||||
*/
|
||||
public static final int newgame_configure_first=0x7f050160;
|
||||
public static final int newgame_drop_relay=0x7f050164;
|
||||
/** Text of first of two buttons for new networked games. Tap
|
||||
this and a game will be created, but you probably won't see
|
||||
it immediately because an email or messaging app will be
|
||||
launched to send your invitation.
|
||||
*/
|
||||
public static final int newgame_invite=0x7f050163;
|
||||
public static final int newgame_invite_anyway=0x7f050164;
|
||||
/** Text of first of two buttons for new standalone games. Tap
|
||||
this and a new game will be created and opened. If the first
|
||||
player is a robot it will immediately take its turn.
|
||||
|
@ -2377,7 +2381,6 @@ public final class R {
|
|||
/** explanation of the above
|
||||
*/
|
||||
public static final int skip_confirm_turn_summary=0x7f050147;
|
||||
public static final int skip_relay_warning=0x7f0502ff;
|
||||
public static final int slmenu_clear_sel=0x7f050264;
|
||||
public static final int slmenu_copy_sel=0x7f050263;
|
||||
public static final int slmenu_deselect_all=0x7f05026d;
|
||||
|
|
|
@ -1170,7 +1170,7 @@
|
|||
it immediately because an email or messaging app will be
|
||||
launched to send your invitation. -->
|
||||
<string name="newgame_invite">Invite now</string>
|
||||
<string name="newgame_invite_anyway">Invite anyway</string>
|
||||
<string name="newgame_drop_relay">Drop Relay</string>
|
||||
|
||||
<!-- section separator (white-on-gray bar) for third section:
|
||||
bluetooth games -->
|
||||
|
@ -2467,16 +2467,23 @@
|
|||
<string name="seeking_relay">Connecting to relay…</string>
|
||||
|
||||
<string name="no_relay_conn">This game is configured to use the
|
||||
relay (server) for communication but has been unable to connect,
|
||||
either because of problems with your device\'s internet connection
|
||||
or because the relay is not running.\n\nPlease try opening the game
|
||||
again later after conditions have changed.</string>
|
||||
relay (internet) for communication but has been unable to
|
||||
connect.\n\nPlease try opening the game again later after
|
||||
conditions have changed.</string>
|
||||
|
||||
<string name="wifi_warning">\u0020For example, you may need to be on
|
||||
a different WiFi network.</string>
|
||||
|
||||
<string name="skip_relay_warning">(Because this game has other ways
|
||||
of communicating, you can invite even without a relay connection,
|
||||
but then you\'ll have to play the game without it.)</string>
|
||||
<string name="drop_relay_warning_fmt">(This game can also connect
|
||||
via %1$s, so if you\'d like to play the game without a relay
|
||||
connection you can.)
|
||||
</string>
|
||||
|
||||
<string name="confirm_drop_relay">Are you sure you want to drop this
|
||||
game\'s ability to communicate via the relay?</string>
|
||||
<string name="confirm_drop_relay_bt">Bluetooth only works for nearby
|
||||
devices.</string>
|
||||
<string name="confirm_drop_relay_sms">Not all carriers support play
|
||||
via SMS.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1008,7 +1008,7 @@
|
|||
it immediately because an email or messaging app will be
|
||||
launched to send your invitation. -->
|
||||
<string name="newgame_invite">Etivni won</string>
|
||||
<string name="newgame_invite_anyway">Etivni yawyna</string>
|
||||
<string name="newgame_drop_relay">Pord Yaler</string>
|
||||
<!-- section separator (white-on-gray bar) for third section:
|
||||
bluetooth games -->
|
||||
<string name="newgame_bt_header">Wen Htooteulb emag</string>
|
||||
|
@ -2135,13 +2135,19 @@
|
|||
<string name="db_store_done">DS drac etirw etelpmoc.</string>
|
||||
<string name="seeking_relay">Gnitcennoc ot yaler…</string>
|
||||
<string name="no_relay_conn">Siht emag si derugifnoc ot esu eht
|
||||
yaler )revres( rof noitacinummoc tub sah neeb elbanu ot ,tcennoc
|
||||
rehtie esuaceb fo smelborp htiw ruoy ecived\'s tenretni noitcennoc
|
||||
ro esuaceb eht yaler si ton gninnur.\n\nEsaelp yrt gninepo eht emag
|
||||
niaga retal retfa snoitidnoc evah degnahc.</string>
|
||||
yaler )tenretni( rof noitacinummoc tub sah neeb elbanu ot
|
||||
tcennoc.\n\nEsaelp yrt gninepo eht emag niaga retal retfa
|
||||
snoitidnoc evah degnahc.</string>
|
||||
<string name="wifi_warning">\u0020Rof ,elpmaxe uoy yam deen ot eb no
|
||||
a tnereffid IfIw krowten.</string>
|
||||
<string name="skip_relay_warning">eSuaceb( siht emag sah rehto syaw
|
||||
fo ,gnitacinummoc uoy nac etivni neve tuohtiw a yaler ,noitcennoc
|
||||
tub neht uoy\'ll evah ot yalp eht emag tuohtiw ti.)</string>
|
||||
<string name="drop_relay_warning_fmt">sIht( emag nac osla tcennoc
|
||||
aiv %1$s, os fi uoy\'d ekil ot yalp eht emag tuohtiw a yaler
|
||||
noitcennoc uoy nac.)
|
||||
</string>
|
||||
<string name="confirm_drop_relay">Era uoy erus uoy tnaw ot pord siht
|
||||
emag\'s ytiliba ot etacinummoc aiv eht ?yaler</string>
|
||||
<string name="confirm_drop_relay_bt">Htooteulb ylno skrow rof ybraen
|
||||
secived.</string>
|
||||
<string name="confirm_drop_relay_sms">Ton lla sreirrac troppus yalp
|
||||
aiv SMS.</string>
|
||||
</resources>
|
||||
|
|
|
@ -1008,7 +1008,7 @@
|
|||
it immediately because an email or messaging app will be
|
||||
launched to send your invitation. -->
|
||||
<string name="newgame_invite">INVITE NOW</string>
|
||||
<string name="newgame_invite_anyway">INVITE ANYWAY</string>
|
||||
<string name="newgame_drop_relay">DROP RELAY</string>
|
||||
<!-- section separator (white-on-gray bar) for third section:
|
||||
bluetooth games -->
|
||||
<string name="newgame_bt_header">NEW BLUETOOTH GAME</string>
|
||||
|
@ -2135,13 +2135,19 @@
|
|||
<string name="db_store_done">SD CARD WRITE COMPLETE.</string>
|
||||
<string name="seeking_relay">CONNECTING TO RELAY…</string>
|
||||
<string name="no_relay_conn">THIS GAME IS CONFIGURED TO USE THE
|
||||
RELAY (SERVER) FOR COMMUNICATION BUT HAS BEEN UNABLE TO CONNECT,
|
||||
EITHER BECAUSE OF PROBLEMS WITH YOUR DEVICE\'S INTERNET CONNECTION
|
||||
OR BECAUSE THE RELAY IS NOT RUNNING.\n\nPLEASE TRY OPENING THE GAME
|
||||
AGAIN LATER AFTER CONDITIONS HAVE CHANGED.</string>
|
||||
RELAY (INTERNET) FOR COMMUNICATION BUT HAS BEEN UNABLE TO
|
||||
CONNECT.\n\nPLEASE TRY OPENING THE GAME AGAIN LATER AFTER
|
||||
CONDITIONS HAVE CHANGED.</string>
|
||||
<string name="wifi_warning">\u0020FOR EXAMPLE, YOU MAY NEED TO BE ON
|
||||
A DIFFERENT WIFI NETWORK.</string>
|
||||
<string name="skip_relay_warning">(BECAUSE THIS GAME HAS OTHER WAYS
|
||||
OF COMMUNICATING, YOU CAN INVITE EVEN WITHOUT A RELAY CONNECTION,
|
||||
BUT THEN YOU\'LL HAVE TO PLAY THE GAME WITHOUT IT.)</string>
|
||||
<string name="drop_relay_warning_fmt">(THIS GAME CAN ALSO CONNECT
|
||||
VIA %1$s, SO IF YOU\'D LIKE TO PLAY THE GAME WITHOUT A RELAY
|
||||
CONNECTION YOU CAN.)
|
||||
</string>
|
||||
<string name="confirm_drop_relay">ARE YOU SURE YOU WANT TO DROP THIS
|
||||
GAME\'S ABILITY TO COMMUNICATE VIA THE RELAY?</string>
|
||||
<string name="confirm_drop_relay_bt">BLUETOOTH ONLY WORKS FOR NEARBY
|
||||
DEVICES.</string>
|
||||
<string name="confirm_drop_relay_sms">NOT ALL CARRIERS SUPPORT PLAY
|
||||
VIA SMS.</string>
|
||||
</resources>
|
||||
|
|
|
@ -1405,7 +1405,6 @@ réseau. (Vous pourrez envoyer des invitations plus tard.)</string>
|
|||
launched to send your invitation. -->
|
||||
<!--<string name="newgame_invite">Invite now</string>-->
|
||||
<string name="newgame_invite">Inviter maintenant</string>
|
||||
<string name="newgame_invite_anyway">Inviter malgré tout</string>
|
||||
|
||||
<!-- section separator (white-on-gray bar) for third section:
|
||||
bluetooth games -->
|
||||
|
@ -3457,9 +3456,5 @@ pour la langue</string>
|
|||
<string name="wifi_warning">\u0020Vous pourriez, par exemple,
|
||||
avoir besoin d\'être sur un réseau Wi-Fi différent.</string>
|
||||
|
||||
<string name="skip_relay_warning">(Étant donné que cette partie a
|
||||
d\'autres moyens de communiquer, vous pouvez inviter même sans une
|
||||
connexion à un relai, mais ensuite vous devrez jouer sans elle.)
|
||||
</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -436,7 +436,12 @@ public class BoardDelegate extends DelegateBase
|
|||
lstnr = new OnClickListener() {
|
||||
public void onClick( DialogInterface dialog,
|
||||
int item ) {
|
||||
showInviteChoicesThen( Action.LAUNCH_INVITE_ACTION );
|
||||
if ( m_relayConnected ||
|
||||
! m_connTypes.contains(CommsConnType.COMMS_CONN_RELAY) ) {
|
||||
showInviteChoicesThen( Action.LAUNCH_INVITE_ACTION );
|
||||
} else {
|
||||
askDropRelay();
|
||||
}
|
||||
}
|
||||
};
|
||||
OnClickListener lstnr2 = new OnClickListener() {
|
||||
|
@ -495,8 +500,13 @@ public class BoardDelegate extends DelegateBase
|
|||
message += getString( R.string.wifi_warning );
|
||||
}
|
||||
if ( !relayOnly ) {
|
||||
message += "\n\n" + getString( R.string.skip_relay_warning );
|
||||
buttonTxt = R.string.newgame_invite_anyway;
|
||||
CommsConnTypeSet without = (CommsConnTypeSet)
|
||||
m_connTypes.clone();
|
||||
without.remove( CommsConnType.COMMS_CONN_RELAY );
|
||||
message += "\n\n"
|
||||
+ getString( R.string.drop_relay_warning_fmt,
|
||||
without.toString( m_activity ) );
|
||||
buttonTxt = R.string.newgame_drop_relay;
|
||||
}
|
||||
} else {
|
||||
titleID = R.string.waiting_title;
|
||||
|
@ -1003,6 +1013,9 @@ public class BoardDelegate extends DelegateBase
|
|||
case NFC_TO_SELF:
|
||||
GamesListDelegate.sendNFCToSelf( m_activity, makeNFCMessage() );
|
||||
break;
|
||||
case DROP_RELAY_ACTION:
|
||||
dropRelayAndRestart();
|
||||
break;
|
||||
default:
|
||||
handled = false;
|
||||
}
|
||||
|
@ -1296,6 +1309,29 @@ public class BoardDelegate extends DelegateBase
|
|||
return m_handler;
|
||||
}
|
||||
|
||||
private void askDropRelay()
|
||||
{
|
||||
String msg = getString( R.string.confirm_drop_relay );
|
||||
if ( m_connTypes.contains(CommsConnType.COMMS_CONN_BT) ) {
|
||||
msg += " " + getString( R.string.confirm_drop_relay_bt );
|
||||
}
|
||||
if ( m_connTypes.contains(CommsConnType.COMMS_CONN_SMS) ) {
|
||||
msg += " " + getString( R.string.confirm_drop_relay_sms );
|
||||
}
|
||||
showConfirmThen( msg, Action.DROP_RELAY_ACTION );
|
||||
}
|
||||
|
||||
private void dropRelayAndRestart() {
|
||||
CommsAddrRec addr = new CommsAddrRec();
|
||||
XwJNI.comms_getAddr( m_jniGamePtr, addr );
|
||||
addr.remove( CommsConnType.COMMS_CONN_RELAY );
|
||||
XwJNI.comms_setAddr( m_jniGamePtr, addr );
|
||||
|
||||
finish();
|
||||
|
||||
GameUtils.launchGame( m_activity, m_rowid, m_haveInvited );
|
||||
}
|
||||
|
||||
private void setGotGameDict( String getDict )
|
||||
{
|
||||
m_jniThread.setSaveDict( getDict );
|
||||
|
|
|
@ -83,6 +83,7 @@ public class DlgDelegate {
|
|||
SMS_CONFIG_ACTION,
|
||||
BUTTON_BROWSEALL_ACTION,
|
||||
NFC_TO_SELF,
|
||||
DROP_RELAY_ACTION,
|
||||
|
||||
// Dict Browser
|
||||
FINISH_ACTION,
|
||||
|
|
|
@ -270,6 +270,11 @@ public class CommsAddrRec {
|
|||
}
|
||||
}
|
||||
|
||||
public void remove( CommsConnType typ )
|
||||
{
|
||||
conTypes.remove( typ );
|
||||
}
|
||||
|
||||
public boolean changesMatter( final CommsAddrRec other )
|
||||
{
|
||||
boolean matter = ! conTypes.equals( other.conTypes );
|
||||
|
|
Loading…
Add table
Reference in a new issue