From 02f61778cd032e5ed9e4213d8b60942cbd88616e Mon Sep 17 00:00:00 2001 From: thiago.filipe Date: Mon, 6 Mar 2017 10:54:20 -0300 Subject: [PATCH] Fix connection exceptions --- Assets/Scenes/Main.unity | 2 +- Assets/Scripts/Export Video/ExportVideo.cs | 32 ++++++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 4306090..e9bf423 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -10184,7 +10184,7 @@ RectTransform: m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 41.42856, y: 0} + m_SizeDelta: {x: 53.71428, y: 0} m_Pivot: {x: 1, y: 0} --- !u!114 &1371075866 MonoBehaviour: diff --git a/Assets/Scripts/Export Video/ExportVideo.cs b/Assets/Scripts/Export Video/ExportVideo.cs index 33a5db1..3ba9d7f 100644 --- a/Assets/Scripts/Export Video/ExportVideo.cs +++ b/Assets/Scripts/Export Video/ExportVideo.cs @@ -72,7 +72,7 @@ public class ExportVideo : MonoBehaviour { } - private void onClickExport() + public void onClickExport() { PlayerLogger.Log("ExportVideo", "OnClickExport", "Starting Export..."); @@ -166,7 +166,7 @@ public class ExportVideo : MonoBehaviour { * shows the progress bar while getting video info*/ public void startExport() { - // new AndroidToast().showToast("Gerando Video...", "SHORT"); + new AndroidToast().showToast("Gerando Video...", "SHORT"); screenManager.changeExportStates(ExportLayers.ExportLayer.Export_Layer, false); screenManager.changeExportStates(ExportLayers.ExportLayer.Progress_Layer, true); @@ -307,7 +307,15 @@ public class ExportVideo : MonoBehaviour { { screenManager.changeExportStates(ExportLayers.ExportLayer.All, true); + if (videoInfoRequest.error.ToLower().Contains("connection refused")) + { + GetConnectionStatusError(ExportLayers.ConnectionStatusError.ERROR_CONNECTION_FAILURE); + + } + else + { GetConnectionStatusError(ExportLayers.ConnectionStatusError.INTERNET_CONNECTION_FAILURE); + } PlayerLogger.Log("ExportVideo", "requestVideoInfo", "(WWW) Error: " + videoInfoRequest.error); } @@ -389,7 +397,15 @@ public class ExportVideo : MonoBehaviour { { screenManager.changeExportStates(ExportLayers.ExportLayer.All, true); - GetConnectionStatusError(ExportLayers.ConnectionStatusError.INTERNET_CONNECTION_FAILURE); + if (videoStatusRequest.error.ToLower().Contains("connection refused")) + { + GetConnectionStatusError(ExportLayers.ConnectionStatusError.ERROR_CONNECTION_FAILURE); + + } + else + { + GetConnectionStatusError(ExportLayers.ConnectionStatusError.INTERNET_CONNECTION_FAILURE); + } PlayerLogger.Log("ExportVideo", "VideoStatus", "(WWW) Error: " + videoStatusRequest.error); break; @@ -478,7 +494,15 @@ public class ExportVideo : MonoBehaviour { if (DownloadVideo.error != null) { - GetConnectionStatusError(ExportLayers.ConnectionStatusError.INTERNET_CONNECTION_FAILURE); + if (DownloadVideo.error.ToLower().Contains("connection refused")) + { + GetConnectionStatusError(ExportLayers.ConnectionStatusError.ERROR_CONNECTION_FAILURE); + + } + else + { + GetConnectionStatusError(ExportLayers.ConnectionStatusError.INTERNET_CONNECTION_FAILURE); + } ErrorDownloading(); } -- libgit2 0.21.2