remove more relay code (and undef XWFEATURE_RELAY)

This commit is contained in:
Eric House 2022-05-07 13:45:11 -07:00
parent b52d263f61
commit 3953ab19a4
5 changed files with 1 additions and 133 deletions

View file

@ -1420,69 +1420,10 @@ public class BoardDelegate extends DelegateBase
//////////////////////////////////////////////////
// TransportProcs.TPMsgHandler interface
//////////////////////////////////////////////////
@Override
public void tpmRelayErrorProc( TransportProcs.XWRELAY_ERROR relayErr )
{
int strID = -1;
DlgID dlgID = DlgID.NONE;
boolean doToast = false;
Object[] params = null;
switch ( relayErr ) {
case TOO_MANY:
strID = R.string.msg_too_many;
dlgID = DlgID.DLG_OKONLY;
break;
case NO_ROOM:
strID = R.string.msg_no_room;
dlgID = DlgID.DLG_RETRY;
break;
case DUP_ROOM:
strID = R.string.msg_dup_room;
dlgID = DlgID.DLG_OKONLY;
break;
case LOST_OTHER:
case OTHER_DISCON:
strID = R.string.msg_lost_other;
doToast = true;
break;
case DEADGAME:
case DELETED:
postDeleteOnce( null );
break;
case OLDFLAGS:
case BADPROTO:
case RELAYBUSY:
case SHUTDOWN:
case TIMEOUT:
case HEART_YOU:
case HEART_OTHER:
break;
}
if ( doToast ) {
showToast( strID );
} else if ( dlgID != DlgID.NONE ) {
final DlgID dlgIDf = dlgID;
final Object[] paramsF = null == params
? new Object[] {R.string.relay_alert, getString( strID )}
: params;
post( new Runnable() {
@Override
public void run() {
showDialogFragment( dlgIDf, paramsF );
}
});
}
}
@Override
public void tpmCountChanged( final int newCount )
{
Log.d( TAG, "tpmCountChanged(newCount=%d)", newCount );
// Log.d( TAG, "tpmCountChanged(newCount=%d)", newCount );
ConnStatusHandler.updateMoveCount( m_activity, newCount );
final GameOverAlert goAlert = mGameOverAlert;

View file

@ -391,26 +391,6 @@ public class CommsTransport implements TransportProcs,
return nSent;
}
@Override
public void relayConnd( String room, int devOrder, boolean allHere,
int nMissing )
{
// m_tpHandler.tpmRelayConnd( room, devOrder, allHere, nMissing );
}
@Override
public void relayErrorProc( XWRELAY_ERROR relayErr )
{
m_tpHandler.tpmRelayErrorProc( relayErr );
}
@Override
public boolean relayNoConnProc( byte[] buf, String msgID, String relayID )
{
RelayService.logGoneFail( TAG, 1 );
return false;
}
@Override
public void countChanged( int newCount )
{

View file

@ -136,27 +136,9 @@ public class MultiMsgSink implements TransportProcs {
return nSent;
}
@Override
public void relayErrorProc( XWRELAY_ERROR relayErr )
{
}
@Override
public void relayConnd( String room, int devOrder, boolean allHere,
int nMissing )
{
}
@Override
public void countChanged( int newCount )
{
Log.d( TAG, "countChanged(new=%d); dropping", newCount );
}
@Override
public boolean relayNoConnProc( byte[] buf, String msgNo, String relayID )
{
RelayService.logGoneFail( TAG, 2 );
return false;
}
}

View file

@ -31,43 +31,9 @@ public interface TransportProcs {
int transportSend( byte[] buf, String msgNo, CommsAddrRec addr,
CommsConnType conType, int gameID );
enum CommsRelayState { COMMS_RELAYSTATE_UNCONNECTED
, COMMS_RELAYSTATE_DENIED
, COMMS_RELAYSTATE_CONNECT_PENDING
, COMMS_RELAYSTATE_CONNECTED
, COMMS_RELAYSTATE_RECONNECTED
, COMMS_RELAYSTATE_ALLCONNECTED
};
void relayConnd( String room, int devOrder, boolean allHere, int nMissing );
void countChanged( int newCount );
public static enum XWRELAY_ERROR { NONE
,OLDFLAGS
,BADPROTO
,RELAYBUSY
,SHUTDOWN
,TIMEOUT
,HEART_YOU
,HEART_OTHER
,LOST_OTHER
,OTHER_DISCON
,NO_ROOM
,DUP_ROOM
,TOO_MANY
,DELETED
,NORECONN
,DEADGAME
};
void relayErrorProc( XWRELAY_ERROR relayErr );
boolean relayNoConnProc( byte[] buf, String msgNo, String relayID );
public interface TPMsgHandler {
// public void tpmRelayConnd( String room, int devOrder, boolean allHere,
// int nMissing );
public void tpmRelayErrorProc( XWRELAY_ERROR relayErr );
public void tpmCountChanged( int newCount );
}
}

View file

@ -15,7 +15,6 @@ ifeq ($(BUILD_TARGET),debug)
endif
LOCAL_DEFINES += \
$(LOCAL_DEBUG) \
-DXWFEATURE_RELAY \
-DXWFEATURE_BLUETOOTH \
-DXWFEATURE_SMS \
-DXWFEATURE_P2P \