mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
remove dead code
This commit is contained in:
parent
f2b034d710
commit
ec71ea349e
2 changed files with 2 additions and 94 deletions
|
@ -2561,9 +2561,8 @@ public class BoardDelegate extends DelegateBase
|
||||||
|
|
||||||
private void showOrHide( InvitesNeededAlert.Wrapper wrapper )
|
private void showOrHide( InvitesNeededAlert.Wrapper wrapper )
|
||||||
{
|
{
|
||||||
boolean isRematch = null != m_summary && m_summary.hasRematchInfo();
|
|
||||||
wrapper.showOrHide( m_mySIS.isServer, m_mySIS.nMissing,
|
wrapper.showOrHide( m_mySIS.isServer, m_mySIS.nMissing,
|
||||||
m_mySIS.nInvited, isRematch );
|
m_mySIS.nInvited, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
private InvitesNeededAlert.Wrapper mINAWrapper;
|
private InvitesNeededAlert.Wrapper mINAWrapper;
|
||||||
|
@ -2706,11 +2705,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
|
|
||||||
private void tryInvites()
|
private void tryInvites()
|
||||||
{
|
{
|
||||||
if ( 0 < m_mySIS.nMissing && m_summary.hasRematchInfo() ) {
|
if ( null != m_missingDevs ) {
|
||||||
tryRematchInvites( null != m_missingMeans );
|
|
||||||
} else if ( 0 < m_mySIS.nMissing && m_summary.hasInviteInfo() ) {
|
|
||||||
tryOtherInvites();
|
|
||||||
} else if ( null != m_missingDevs ) {
|
|
||||||
Assert.assertNotNull( m_missingMeans );
|
Assert.assertNotNull( m_missingMeans );
|
||||||
String gameName = GameUtils.getName( m_activity, m_rowid );
|
String gameName = GameUtils.getName( m_activity, m_rowid );
|
||||||
for ( int ii = 0; ii < m_missingDevs.length; ++ii ) {
|
for ( int ii = 0; ii < m_missingDevs.length; ++ii ) {
|
||||||
|
@ -2938,7 +2933,6 @@ public class BoardDelegate extends DelegateBase
|
||||||
CommsConnTypeSet connTypes = summary.conTypes;
|
CommsConnTypeSet connTypes = summary.conTypes;
|
||||||
supported = connTypes.contains( CommsConnType.COMMS_CONN_BT )
|
supported = connTypes.contains( CommsConnType.COMMS_CONN_BT )
|
||||||
|| connTypes.contains( CommsConnType.COMMS_CONN_SMS )
|
|| connTypes.contains( CommsConnType.COMMS_CONN_SMS )
|
||||||
|| connTypes.contains( CommsConnType.COMMS_CONN_RELAY )
|
|
||||||
|| connTypes.contains( CommsConnType.COMMS_CONN_MQTT )
|
|| connTypes.contains( CommsConnType.COMMS_CONN_MQTT )
|
||||||
|| connTypes.contains( CommsConnType.COMMS_CONN_P2P );
|
|| connTypes.contains( CommsConnType.COMMS_CONN_P2P );
|
||||||
}
|
}
|
||||||
|
@ -3074,62 +3068,6 @@ public class BoardDelegate extends DelegateBase
|
||||||
return nli;
|
return nli;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true if anything sent
|
|
||||||
private boolean tryRematchInvites( boolean force )
|
|
||||||
{
|
|
||||||
if ( !force ) {
|
|
||||||
SentInvitesInfo info = DBUtils.getInvitesFor( m_activity, m_rowid );
|
|
||||||
force = 0 == info.getMinPlayerCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( force ) {
|
|
||||||
Assert.assertNotNull( m_summary );
|
|
||||||
Assert.assertNotNull( m_gi );
|
|
||||||
// only supports a single invite for now!
|
|
||||||
NetLaunchInfo nli = nliForMe();
|
|
||||||
|
|
||||||
String value;
|
|
||||||
value = m_summary.getStringExtra( GameSummary.EXTRA_REMATCH_PHONE );
|
|
||||||
if ( null != value ) {
|
|
||||||
sendNBSInviteIf( value, nli, true );
|
|
||||||
}
|
|
||||||
value = m_summary.getStringExtra( GameSummary.EXTRA_REMATCH_BTADDR );
|
|
||||||
if ( null != value ) {
|
|
||||||
BTUtils.inviteRemote( m_activity, value, nli );
|
|
||||||
recordInviteSent( InviteMeans.BLUETOOTH, value );
|
|
||||||
}
|
|
||||||
value = m_summary.getStringExtra( GameSummary.EXTRA_REMATCH_P2P );
|
|
||||||
if ( null != value ) {
|
|
||||||
WiDirService.inviteRemote( m_activity, value, nli );
|
|
||||||
recordInviteSent( InviteMeans.WIFIDIRECT, value );
|
|
||||||
}
|
|
||||||
value = m_summary.getStringExtra( GameSummary.EXTRA_REMATCH_MQTT );
|
|
||||||
if ( null != value ) {
|
|
||||||
MQTTUtils.addInvite( m_jniGamePtr, value, nli );
|
|
||||||
// recordInviteSent( InviteMeans.MQTT, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
showToast( R.string.rematch_sent_toast );
|
|
||||||
}
|
|
||||||
Assert.assertTrueNR( !force );
|
|
||||||
return force;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean tryOtherInvites()
|
|
||||||
{
|
|
||||||
boolean result = false;
|
|
||||||
Assert.assertNotNull( m_summary );
|
|
||||||
String str64 = m_summary.getStringExtra( GameSummary.EXTRA_REMATCH_ADDR );
|
|
||||||
try {
|
|
||||||
CommsAddrRec addr = (CommsAddrRec)Utils.string64ToSerializable( str64 );
|
|
||||||
result = tryOtherInvites( addr );
|
|
||||||
} catch ( Exception ex ) {
|
|
||||||
Log.ex( TAG, ex );
|
|
||||||
Assert.failDbg();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean tryOtherInvites( CommsAddrRec addr )
|
private boolean tryOtherInvites( CommsAddrRec addr )
|
||||||
{
|
{
|
||||||
Log.d( TAG, "tryOtherInvites(%s)", addr );
|
Log.d( TAG, "tryOtherInvites(%s)", addr );
|
||||||
|
|
|
@ -48,11 +48,6 @@ import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
*/
|
*/
|
||||||
public class GameSummary implements Serializable {
|
public class GameSummary implements Serializable {
|
||||||
private static final String TAG = GameSummary.class.getSimpleName();
|
private static final String TAG = GameSummary.class.getSimpleName();
|
||||||
public static final String EXTRA_REMATCH_BTADDR = "rm_btaddr";
|
|
||||||
public static final String EXTRA_REMATCH_PHONE = "rm_phone";
|
|
||||||
public static final String EXTRA_REMATCH_P2P = "rm_p2p";
|
|
||||||
public static final String EXTRA_REMATCH_MQTT = "rm_mqtt";
|
|
||||||
public static final String EXTRA_REMATCH_ADDR = "rm_addr";
|
|
||||||
|
|
||||||
public static final int MSG_FLAGS_NONE = 0;
|
public static final int MSG_FLAGS_NONE = 0;
|
||||||
public static final int MSG_FLAGS_TURN = 1;
|
public static final int MSG_FLAGS_TURN = 1;
|
||||||
|
@ -513,31 +508,6 @@ public class GameSummary implements Serializable {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasRematchInfo()
|
|
||||||
{
|
|
||||||
boolean found = false;
|
|
||||||
String[] keys = { EXTRA_REMATCH_BTADDR,
|
|
||||||
EXTRA_REMATCH_PHONE,
|
|
||||||
EXTRA_REMATCH_P2P,
|
|
||||||
EXTRA_REMATCH_MQTT,
|
|
||||||
};
|
|
||||||
for ( String key : keys ) {
|
|
||||||
found = null != getStringExtra( key );
|
|
||||||
if ( found ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Log.d( TAG, "hasRematchInfo() => %b", found );
|
|
||||||
Assert.assertTrueNR( !found );
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasInviteInfo()
|
|
||||||
{
|
|
||||||
boolean found = null != getStringExtra( EXTRA_REMATCH_ADDR );
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean localTurnNextImpl( int flags, int turn )
|
private static boolean localTurnNextImpl( int flags, int turn )
|
||||||
{
|
{
|
||||||
int flag = 2 << (turn * 2);
|
int flag = 2 << (turn * 2);
|
||||||
|
|
Loading…
Reference in a new issue