add explanation for why rematch doesn't work for games with more than

two players. (The hard part is really more than two devices, but I bet
two players per device in networked games is rarest of all.)
This commit is contained in:
Eric House 2015-07-11 17:06:13 -07:00
parent eebf27d051
commit 7ac5d2259d
6 changed files with 723 additions and 689 deletions

File diff suppressed because it is too large Load diff

View file

@ -128,6 +128,7 @@
<string name="key_xlations_enabled">key_xlations_enabled</string>
<string name="key_invite_multi">key_invite_multi</string>
<string name="key_notagain_enablepublic">key_notagain_enablepublic</string>
<string name="key_na_rematch_two_only">key_notagain_rematch_two_only</string>
<string name="key_na_comms_bt">key_na_comms_bt</string>
<string name="key_na_comms_sms">key_na_comms_sms</string>

View file

@ -2528,4 +2528,9 @@
<string name="str_no_hint_found">Cannot find any moves</string>
<string name="not_again_rematch_two_only">The Rematch button is
diabled because, for now anyway, rematch is limited to two-person
games. I think it\'s rare that people play with more than two. Let
me know if I\'m wrong and I\'ll try harder to make it work.</string>
</resources>

View file

@ -2185,4 +2185,8 @@
<string name="not_again_comms_bt">Esu Htooteulb ot yalp tsniaga a
ybraen ecived taht\'s \"deriap\" htiw sruoy.</string>
<string name="str_no_hint_found">Tonnac dnif yna sevom</string>
<string name="not_again_rematch_two_only">Eht Hctamer nottub si
delbaid ,esuaceb rof won ,yawyna hctamer si detimil ot nosrep-owt
semag. I kniht ti\'s erar taht elpoep yalp htiw erom naht owt. Tel
em wonk fi I\'m gnorw dna I\'ll yrt redrah ot ekam ti krow.</string>
</resources>

View file

@ -2185,4 +2185,8 @@
<string name="not_again_comms_bt">USE BLUETOOTH TO PLAY AGAINST A
NEARBY DEVICE THAT\'S \"PAIRED\" WITH YOURS.</string>
<string name="str_no_hint_found">CANNOT FIND ANY MOVES</string>
<string name="not_again_rematch_two_only">THE REMATCH BUTTON IS
DIABLED BECAUSE, FOR NOW ANYWAY, REMATCH IS LIMITED TO TWO-PERSON
GAMES. I THINK IT\'S RARE THAT PEOPLE PLAY WITH MORE THAN TWO. LET
ME KNOW IF I\'M WRONG AND I\'LL TRY HARDER TO MAKE IT WORK.</string>
</resources>

View file

@ -241,7 +241,7 @@ public class BoardDelegate extends DelegateBase
lstnr = new OnClickListener() {
public void onClick( DialogInterface dlg,
int whichButton ) {
doRematch();
doRematchIf();
}
};
ab.setNegativeButton( R.string.button_rematch, lstnr );
@ -1674,7 +1674,7 @@ public class BoardDelegate extends DelegateBase
m_nMissing = 0;
post( new Runnable() {
public void run() {
showNotAgainDlgThen( R.string.not_again_turnchanged,
showNotAgainDlg( R.string.not_again_turnchanged,
R.string.key_notagain_turnchanged );
}
} );
@ -2512,8 +2512,17 @@ public class BoardDelegate extends DelegateBase
{
boolean supported = false;
if ( XWApp.REMATCH_SUPPORTED ) {
// standalone games are easy to rematch
supported = m_gi.serverRole == DeviceRole.SERVER_STANDALONE;
if ( !supported && 2 == m_gi.nPlayers ) {
if ( !supported )
if ( 2 != m_gi.nPlayers ) {
// show the button if people haven't dismissed the hint yet
supported = ! XWPrefs
.getPrefsBoolean( m_activity,
R.string.key_na_rematch_two_only,
false );
} else {
supported = m_connTypes.contains( CommsConnType.COMMS_CONN_BT )
|| m_connTypes.contains( CommsConnType.COMMS_CONN_SMS )
|| m_connTypes.contains( CommsConnType.COMMS_CONN_RELAY );
@ -2522,13 +2531,20 @@ public class BoardDelegate extends DelegateBase
return supported;
}
private void doRematch()
private void doRematchIf()
{
if ( XWApp.REMATCH_SUPPORTED ) {
boolean doIt = true;
String phone = null;
String btAddr = null;
String relayID = null;
if ( m_gi.serverRole != DeviceRole.SERVER_STANDALONE ) {
if ( DeviceRole.SERVER_STANDALONE == m_gi.serverRole ) {
// nothing to do??
} else if ( 2 != m_gi.nPlayers ) {
showNotAgainDlg( R.string.not_again_rematch_two_only,
R.string.key_na_rematch_two_only );
doIt = false;
} else {
CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr );
for ( int ii = 0; ii < addrs.length; ++ii ) {
CommsAddrRec addr = addrs[ii];
@ -2547,6 +2563,7 @@ public class BoardDelegate extends DelegateBase
}
}
if ( doIt ) {
Intent intent = GamesListDelegate
.makeRematchIntent( m_activity, m_rowid, m_connTypes, btAddr,
phone, relayID );
@ -2556,6 +2573,7 @@ public class BoardDelegate extends DelegateBase
}
}
}
}
private void tryRematchInvites()
{