remove two relay-related prefs

This commit is contained in:
Eric House 2022-05-09 16:15:07 -07:00
parent 5f4dd46f72
commit 5834125058
9 changed files with 5 additions and 40 deletions

View file

@ -609,9 +609,7 @@ public class GameConfigDelegate extends DelegateBase
m_carOrig = XwJNI.comms_getAddr( gamePtr ); m_carOrig = XwJNI.comms_getAddr( gamePtr );
m_remoteAddrs = XwJNI.comms_getAddrs( gamePtr ); m_remoteAddrs = XwJNI.comms_getAddrs( gamePtr );
} else if ( !localOnlyGame() ) { } else if ( !localOnlyGame() ) {
String relayName = XWPrefs.getHostName( m_activity ); m_carOrig = XwJNI.comms_getInitialAddr();
int relayPort = XWPrefs.getDefaultRelayPort( m_activity );
m_carOrig = XwJNI.comms_getInitialAddr( relayName, relayPort );
} else { } else {
// Leaving this null breaks stuff: an empty set, rather than a // Leaving this null breaks stuff: an empty set, rather than a
// null one, represents a standalone game // null one, represents a standalone game

View file

@ -484,9 +484,7 @@ public class NetLaunchInfo implements Serializable {
result.conTypes.add( typ ); result.conTypes.add( typ );
switch( typ ) { switch( typ ) {
case COMMS_CONN_RELAY: case COMMS_CONN_RELAY:
String relayName = XWPrefs.getHostName( context ); Assert.failDbg();
int relayPort = XWPrefs.getDefaultRelayPort( context );
result.setRelayParams( relayName, relayPort, room );
break; break;
case COMMS_CONN_BT: case COMMS_CONN_BT:
result.setBTParams( btAddress, btName ); result.setBTParams( btAddress, btName );

View file

@ -103,17 +103,6 @@ public class XWPrefs {
setPrefsBoolean( context, R.string.key_hide_newgames, set ); setPrefsBoolean( context, R.string.key_hide_newgames, set );
} }
public static int getDefaultRelayPort( Context context )
{
String val = getPrefsString( context, R.string.key_relay_port );
int result = 0;
try {
result = Integer.parseInt( val );
} catch ( Exception ex ) {
}
return result;
}
public static String getDefaultUpdateUrl( Context context ) public static String getDefaultUpdateUrl( Context context )
{ {
String result = getWithHost( context, R.string.key_update_url_path ); String result = getWithHost( context, R.string.key_update_url_path );

View file

@ -428,10 +428,7 @@ public class CommsAddrRec implements Serializable {
{ {
switch ( typ ) { switch ( typ ) {
case COMMS_CONN_RELAY: case COMMS_CONN_RELAY:
String room = GameUtils.makeRandomID(); Assert.failDbg();
String host = XWPrefs.getHostName( context );
int port = XWPrefs.getDefaultRelayPort( context );
setRelayParams( host, port, room );
break; break;
case COMMS_CONN_BT: case COMMS_CONN_BT:
String[] strs = BTUtils.getBTNameAndAddress(); String[] strs = BTUtils.getBTNameAndAddress();

View file

@ -274,8 +274,7 @@ public class XwJNI {
return nli_from_stream( getJNI().m_ptrGlobals, stream ); return nli_from_stream( getJNI().m_ptrGlobals, stream );
} }
public static native CommsAddrRec comms_getInitialAddr( String relayHost, public static native CommsAddrRec comms_getInitialAddr();
int relayPort );
public static native String comms_getUUID(); public static native String comms_getUUID();
// Game methods // Game methods

View file

@ -57,7 +57,6 @@
<string name="key_clr_bonushint_dark">key_clr_bonushint_dark</string> <string name="key_clr_bonushint_dark">key_clr_bonushint_dark</string>
<string name="key_board_line_width_dark">key_board_line_width_dark</string> <string name="key_board_line_width_dark">key_board_line_width_dark</string>
<string name="key_relay_port">key_relay_port2</string>
<string name="key_update_url_path">key_update_url_path</string> <string name="key_update_url_path">key_update_url_path</string>
<string name="key_relay_url_path">key_relay_url_path</string> <string name="key_relay_url_path">key_relay_url_path</string>
<string name="key_mqtt_url_path">key_mqtt_url_path</string> <string name="key_mqtt_url_path">key_mqtt_url_path</string>

View file

@ -2284,10 +2284,8 @@
<string name="board_menu_game_netstats">Network stats</string> <string name="board_menu_game_netstats">Network stats</string>
<string name="board_menu_game_showInvites">Show invites</string> <string name="board_menu_game_showInvites">Show invites</string>
<string name="netstats_title">Game network stats</string> <string name="netstats_title">Game network stats</string>
<string name="relay_port">Relay game port</string>
<string name="mqtt_port">MQTT port</string> <string name="mqtt_port">MQTT port</string>
<string name="mqtt_qos">MQTT QOS</string> <string name="mqtt_qos">MQTT QOS</string>
<string name="proxy_port">Relay device port</string>
<string name="name_dict_fmt">%1$s/%2$s</string> <string name="name_dict_fmt">%1$s/%2$s</string>
<string name="gamel_menu_storedb">Write games to SD card</string> <string name="gamel_menu_storedb">Write games to SD card</string>
<string name="gamel_menu_loaddb">Load games from SD card</string> <string name="gamel_menu_loaddb">Load games from SD card</string>

View file

@ -44,19 +44,6 @@
android:defaultValue="@string/default_relay_url_path" android:defaultValue="@string/default_relay_url_path"
/> />
<org.eehouse.android.xw4.XWEditTextPreference
android:key="@string/key_relay_port"
android:title="@string/relay_port"
android:defaultValue="10997"
android:numeric="decimal"
/>
<org.eehouse.android.xw4.XWEditTextPreference
android:key="@string/key_proxy_port"
android:title="@string/proxy_port"
android:defaultValue="10998"
android:numeric="decimal"
/>
<CheckBoxPreference android:key="@string/key_skip_mqtt_add" <CheckBoxPreference android:key="@string/key_skip_mqtt_add"
android:title="@string/skip_mqtt_add_title" android:title="@string/skip_mqtt_add_title"
android:summary="@string/skip_mqtt_add_summary" android:summary="@string/skip_mqtt_add_summary"

View file

@ -964,7 +964,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_nli_1from_1stream
JNIEXPORT jobject JNICALL JNIEXPORT jobject JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getInitialAddr Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getInitialAddr
( JNIEnv* env, jclass C, jstring jname, jint port ) ( JNIEnv* env, jclass C )
{ {
CommsAddrRec addr; CommsAddrRec addr;
#ifdef XWFEATURE_RELAY #ifdef XWFEATURE_RELAY