mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Display the failing ports when the connection fails
This commit is contained in:
@@ -17,10 +17,14 @@ Item {
|
|||||||
stageText = qsTr("Starting %1...").arg(stage)
|
stageText = qsTr("Starting %1...").arg(stage)
|
||||||
}
|
}
|
||||||
|
|
||||||
function stageFailed(stage, errorCode)
|
function stageFailed(stage, errorCode, failingPorts)
|
||||||
{
|
{
|
||||||
// Display the error dialog after Session::exec() returns
|
// Display the error dialog after Session::exec() returns
|
||||||
streamSegueErrorDialog.text = qsTr("Starting %1 failed: Error %2").arg(stage).arg(errorCode)
|
streamSegueErrorDialog.text = qsTr("Starting %1 failed: Error %2").arg(stage).arg(errorCode)
|
||||||
|
|
||||||
|
if (failingPorts) {
|
||||||
|
streamSegueErrorDialog.text += "\n\n" + qsTr("Check your firewall and port forwarding rules for port(s): %1").arg(failingPorts)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectionStarted()
|
function connectionStarted()
|
||||||
|
|||||||
@@ -73,9 +73,12 @@ void Session::clStageStarting(int stage)
|
|||||||
void Session::clStageFailed(int stage, int errorCode)
|
void Session::clStageFailed(int stage, int errorCode)
|
||||||
{
|
{
|
||||||
// Perform the port test now, while we're on the async connection thread and not blocking the UI.
|
// Perform the port test now, while we're on the async connection thread and not blocking the UI.
|
||||||
s_ActiveSession->m_PortTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443, LiGetPortFlagsFromStage(stage));
|
unsigned int portFlags = LiGetPortFlagsFromStage(stage);
|
||||||
|
s_ActiveSession->m_PortTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443, portFlags);
|
||||||
|
|
||||||
emit s_ActiveSession->stageFailed(QString::fromLocal8Bit(LiGetStageName(stage)), errorCode);
|
char failingPorts[128];
|
||||||
|
LiStringifyPortFlags(portFlags, ", ", failingPorts, sizeof(failingPorts));
|
||||||
|
emit s_ActiveSession->stageFailed(QString::fromLocal8Bit(LiGetStageName(stage)), errorCode, QString(failingPorts));
|
||||||
|
|
||||||
#ifndef USE_ASYNC_CONNECT_THREAD
|
#ifndef USE_ASYNC_CONNECT_THREAD
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
@@ -85,7 +88,8 @@ void Session::clStageFailed(int stage, int errorCode)
|
|||||||
|
|
||||||
void Session::clConnectionTerminated(int errorCode)
|
void Session::clConnectionTerminated(int errorCode)
|
||||||
{
|
{
|
||||||
s_ActiveSession->m_PortTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443, LiGetPortFlagsFromTerminationErrorCode(errorCode));
|
unsigned int portFlags = LiGetPortFlagsFromTerminationErrorCode(errorCode);
|
||||||
|
s_ActiveSession->m_PortTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443, portFlags);
|
||||||
|
|
||||||
// Display the termination dialog if this was not intended
|
// Display the termination dialog if this was not intended
|
||||||
switch (errorCode) {
|
switch (errorCode) {
|
||||||
@@ -94,7 +98,12 @@ void Session::clConnectionTerminated(int errorCode)
|
|||||||
|
|
||||||
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
s_ActiveSession->m_UnexpectedTermination = true;
|
s_ActiveSession->m_UnexpectedTermination = true;
|
||||||
emit s_ActiveSession->displayLaunchError(tr("No video received from host. Check the host PC's firewall and port forwarding rules."));
|
|
||||||
|
char ports[128];
|
||||||
|
SDL_assert(portFlags != 0);
|
||||||
|
LiStringifyPortFlags(portFlags, ", ", ports, sizeof(ports));
|
||||||
|
emit s_ActiveSession->displayLaunchError(tr("No video received from host.") + "\n\n"+
|
||||||
|
tr("Check your firewall and port forwarding rules for port(s): %1").arg(ports));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ML_ERROR_NO_VIDEO_FRAME:
|
case ML_ERROR_NO_VIDEO_FRAME:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void stageStarting(QString stage);
|
void stageStarting(QString stage);
|
||||||
|
|
||||||
void stageFailed(QString stage, int errorCode);
|
void stageFailed(QString stage, int errorCode, QString failingPorts);
|
||||||
|
|
||||||
void connectionStarted();
|
void connectionStarted();
|
||||||
|
|
||||||
|
|||||||
Submodule moonlight-common-c/moonlight-common-c updated: ce546b12b0...cca2ba9aab
Reference in New Issue
Block a user