mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
on receipt of invitation, remove address modes the device doesn't
support.
This commit is contained in:
parent
f93f0cd926
commit
d89c0d2847
1 changed files with 15 additions and 1 deletions
|
@ -185,6 +185,8 @@ public class NetLaunchInfo {
|
|||
}
|
||||
}
|
||||
|
||||
removeUnsupported( supported );
|
||||
|
||||
dict = data.getQueryParameter( WORDLIST_KEY );
|
||||
String langStr = data.getQueryParameter( LANG_KEY );
|
||||
lang = Integer.decode( langStr );
|
||||
|
@ -369,6 +371,7 @@ public class NetLaunchInfo {
|
|||
|
||||
private void init( Context context, String data )
|
||||
{
|
||||
CommsConnTypeSet supported = CommsConnTypeSet.getSupported( context );
|
||||
try {
|
||||
JSONObject json = new JSONObject( data );
|
||||
|
||||
|
@ -386,7 +389,6 @@ public class NetLaunchInfo {
|
|||
m_gameID = json.optInt( MultiService.GAMEID, 0 );
|
||||
|
||||
// Try each type
|
||||
CommsConnTypeSet supported = CommsConnTypeSet.getSupported( context );
|
||||
for ( CommsConnType typ : supported.getTypes() ) {
|
||||
if ( hasAddrs && !m_addrs.contains( typ ) ) {
|
||||
continue;
|
||||
|
@ -422,6 +424,8 @@ public class NetLaunchInfo {
|
|||
DbgUtils.loge( jse );
|
||||
}
|
||||
|
||||
removeUnsupported( supported );
|
||||
|
||||
calcValid();
|
||||
}
|
||||
|
||||
|
@ -529,6 +533,16 @@ public class NetLaunchInfo {
|
|||
&& 0 != gameID();
|
||||
}
|
||||
|
||||
private void removeUnsupported( CommsConnTypeSet supported )
|
||||
{
|
||||
for ( Iterator<CommsConnType> iter = m_addrs.iterator();
|
||||
iter.hasNext(); ) {
|
||||
if ( !supported.contains( iter.next() ) ) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void calcValid()
|
||||
{
|
||||
boolean valid = hasCommon() && null != m_addrs;
|
||||
|
|
Loading…
Add table
Reference in a new issue