mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-25 05:53:05 +00:00
Display failing ports when the connection is unsuccessful
This commit is contained in:
parent
7b26852a1f
commit
7cc7953879
@ -1549,11 +1549,16 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
String dialogText = getResources().getString(R.string.conn_error_msg) + " " + stage +" (error "+errorCode+")";
|
||||
|
||||
if (portFlags != 0) {
|
||||
dialogText += "\n\n" + getResources().getString(R.string.check_ports_msg) + "\n" +
|
||||
MoonBridge.stringifyPortFlags(portFlags, "\n");
|
||||
}
|
||||
|
||||
if (portTestResult != MoonBridge.ML_TEST_RESULT_INCONCLUSIVE && portTestResult != 0) {
|
||||
dialogText += "\n\n" + getResources().getString(R.string.nettest_text_blocked);
|
||||
}
|
||||
|
||||
|
||||
Dialog.displayDialog(Game.this, getResources().getString(R.string.conn_error_title), dialogText, true);
|
||||
}
|
||||
}
|
||||
@ -1564,8 +1569,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
public void connectionTerminated(final int errorCode) {
|
||||
// Perform a connection test if the failure could be due to a blocked port
|
||||
// This does network I/O, so don't do it on the main thread.
|
||||
final int portTestResult = MoonBridge.testClientConnectivity(ServerHelper.CONNECTION_TEST_SERVER,
|
||||
443, MoonBridge.getPortFlagsFromTerminationErrorCode(errorCode));
|
||||
final int portFlags = MoonBridge.getPortFlagsFromTerminationErrorCode(errorCode);
|
||||
final int portTestResult = MoonBridge.testClientConnectivity(ServerHelper.CONNECTION_TEST_SERVER,443, portFlags);
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@ -1606,6 +1611,11 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
}
|
||||
|
||||
if (portFlags != 0) {
|
||||
message += "\n\n" + getResources().getString(R.string.check_ports_msg) + "\n" +
|
||||
MoonBridge.stringifyPortFlags(portFlags, "\n");
|
||||
}
|
||||
|
||||
Dialog.displayDialog(Game.this, getResources().getString(R.string.conn_terminated_title),
|
||||
message, true);
|
||||
}
|
||||
|
@ -74,8 +74,9 @@
|
||||
<string name="error_usb_prohibited">USB access is prohibited by your device administrator. Check your Knox or MDM settings.</string>
|
||||
<string name="unable_to_pin_shortcut">Your current launcher does not allow for creating pinned shortcuts.</string>
|
||||
<string name="video_decoder_init_failed">Video decoder failed to initialize. Your device may not support the selected resolution or frame rate.</string>
|
||||
<string name="no_video_received_error">No video received from host. Check the host PC\'s firewall and port forwarding rules.</string>
|
||||
<string name="no_video_received_error">No video received from host.</string>
|
||||
<string name="no_frame_received_error">Your network connection isn\'t performing well. Reduce your video bitrate setting or try a faster connection.</string>
|
||||
<string name="check_ports_msg">Check your firewall and port forwarding rules for port(s):</string>
|
||||
|
||||
<!-- Start application messages -->
|
||||
<string name="conn_establishing_title">Establishing Connection</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user