refuse to a create second game from an invitation unless a debug pref

is set.
This commit is contained in:
Eric House 2013-11-11 20:44:08 -08:00
parent 360479bff5
commit 8099b77e52
5 changed files with 19 additions and 2 deletions

View file

@ -107,6 +107,7 @@
<string name="key_na_browseall">key_na_browseall</string>
<string name="key_na_values">key_na_values</string>
<string name="key_enable_debug">key_enable_debug</string>
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
<string name="key_download_path">key_download_path</string>
<!-- Nor is my email address -->
@ -138,6 +139,9 @@
<string name="name_dict_fmt">%1$s/%2$s</string>
<string name="gamel_menu_storedb">Write DB to SD card</string>
<string name="gamel_menu_loaddb">Load DB from SD card</string>
<string name="enable_dupes_title">Accept duplicate invites</string>
<string name="enable_dupes_summary">Accept invitations more than once</string>
<string name="game_thumb_half">1/2</string>
<string name="game_thumb_third">1/3</string>

View file

@ -2166,5 +2166,5 @@
<string name="prefs_thumb">Thumbnails</string>
<string name="prefs_thumb_summary">Setting for game snapshots</string>
<string name="dropped_dupe">Invitation ignored: already used</string>
</resources>

View file

@ -325,6 +325,12 @@
android:defaultValue="false"
/>
<CheckBoxPreference android:key="@string/key_enable_dup_invite"
android:title="@string/enable_dupes_title"
android:summary="@string/enable_dupes_summary"
android:defaultValue="false"
/>
<!-- For broken devices like my Blaze 4G that report a download
directory that doesn't exist, allow users to set it. Mine:
/sdcard/external_sd/download

View file

@ -1063,11 +1063,13 @@ public class GamesList extends XWExpandableListActivity
if ( checkWarnNoDict( nli ) ) {
makeNewNetGame( nli );
}
} else {
} else if ( XWPrefs.getSecondInviteAllowed( this ) ) {
String msg = getString( R.string.dup_game_queryf,
create.toString() );
m_netLaunchInfo = nli;
showConfirmThen( msg, GamesActions.NEW_NET_GAME.ordinal() );
} else {
Utils.showToast( this, R.string.dropped_dupe );
}
} // startNewNetGame

View file

@ -39,6 +39,11 @@ public class XWPrefs {
return getPrefsBoolean( context, R.string.key_enable_debug, false );
}
public static boolean getSecondInviteAllowed( Context context )
{
return getPrefsBoolean( context, R.string.key_enable_dup_invite, false );
}
public static String getDefaultRelayHost( Context context )
{
return getPrefsString( context, R.string.key_relay_host );