diff --git a/BeWoLauncher/LauncherWindow.xaml.cs b/BeWoLauncher/LauncherWindow.xaml.cs
index da226357f..ca8805151 100644
--- a/BeWoLauncher/LauncherWindow.xaml.cs
+++ b/BeWoLauncher/LauncherWindow.xaml.cs
@@ -103,7 +103,7 @@ namespace BeWoLauncher
}
public void StartWaiting()
{
- Dispatcher.BeginInvoke(DispatcherPriority.Normal,
+ Dispatcher.BeginInvoke(DispatcherPriority.Render,
(Action)delegate
{
if (_WaitLayer == null)
@@ -120,7 +120,7 @@ namespace BeWoLauncher
public void EndWaiting()
{
Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
+ DispatcherPriority.Render,
(Action)delegate
{
if (_WaitLayer != null)
diff --git a/BeWoLauncher/Logic/Behavior/ViewSwitchBehavior.cs b/BeWoLauncher/Logic/Behavior/ViewSwitchBehavior.cs
index e1f2a2660..708018f60 100644
--- a/BeWoLauncher/Logic/Behavior/ViewSwitchBehavior.cs
+++ b/BeWoLauncher/Logic/Behavior/ViewSwitchBehavior.cs
@@ -57,7 +57,9 @@ namespace BeWoLauncher.Logic.Behavior
public void ShowView(ViewType vt)
{
- CurrentView = ViewController.ViewBuilder.GetNewView(vt);
+ var view = ViewController.ViewBuilder.GetNewView(vt);
+
+ CurrentView = view;
}
public void ShowFrame(FrameType ft)
{
@@ -129,6 +131,8 @@ namespace BeWoLauncher.Logic.Behavior
public void BackToLogin(object sender, EventArgs e)
{
+ StartWaiting();
+
ShowView(ViewType.LoginView);
}
public void LoginSuccessful(object sender, EventArgs e)
@@ -174,6 +178,7 @@ namespace BeWoLauncher.Logic.Behavior
}
public void UpdateSuccess(object sender, EventArgs e)
{
+ LauncherAppdataConfig.SetFirstInstallationSuccess(true);
ShowFrame(FrameType.LoadingScreen);
}
@@ -183,6 +188,7 @@ namespace BeWoLauncher.Logic.Behavior
}
public void UninstallSuccess(object sender, EventArgs e)
{
+ LauncherAppdataConfig.Reset();
ShowFrame(FrameType.UninstallSuccessful);
}
}
diff --git a/BeWoLauncher/Logic/Controller/DownloadController.cs b/BeWoLauncher/Logic/Controller/DownloadController.cs
index 7024b29f8..c2cf66fc5 100644
--- a/BeWoLauncher/Logic/Controller/DownloadController.cs
+++ b/BeWoLauncher/Logic/Controller/DownloadController.cs
@@ -100,7 +100,7 @@ namespace BeWoLauncher.Logic.Controller
GenericTextLogger.Post($"Anfrage wurde erfolgreich verarbeitet. Server gibt Version {client_version} vor.");
- if (!response.HasToDo())
+ if (!response.HasToDo)
can_quick_start = true;
return null;
@@ -118,6 +118,8 @@ namespace BeWoLauncher.Logic.Controller
public static string TryLoadUninstallPlan()
{
+ GenericTextLogger.PostImportantInfo("Starting Uninstall Process");
+
try
{
Manager.GetDeletePlan();
diff --git a/BeWoLauncher/Logic/Controller/ViewController.cs b/BeWoLauncher/Logic/Controller/ViewController.cs
index af1e21ff9..efcf4f089 100644
--- a/BeWoLauncher/Logic/Controller/ViewController.cs
+++ b/BeWoLauncher/Logic/Controller/ViewController.cs
@@ -56,6 +56,8 @@ namespace BeWoLauncher.Logic.Controller
ViewBuilder = new ViewBuilder();
}
+ public static string GetErrorString() => ErrorString ?? Error?.ToString() ?? "unbekannt";
+
public static void InitWindow(LauncherWindow window)
{
if (CurrentWindow is null)
diff --git a/BeWoLauncher/Logic/Utils/Download/DownloadManager.cs b/BeWoLauncher/Logic/Utils/Download/DownloadManager.cs
index 34cef8fb6..afc06dbf1 100644
--- a/BeWoLauncher/Logic/Utils/Download/DownloadManager.cs
+++ b/BeWoLauncher/Logic/Utils/Download/DownloadManager.cs
@@ -119,24 +119,28 @@ namespace BeWoLauncher.Logic.Utils.Download
private void Download()
{
+ var tries_per_file = UpdatePlanResponse.TriesPerFile;
+
DownloadFolder.CreateFolder();
DownloadFolder.Lock(SkipLock);
DownloadFolder.SaveCurrentInfo("current");
- UpdateFileRequest req = new UpdateFileRequest(UpdatePlanResponse.CurrentPackage.Version);
+ UpdateFileRequest req = new UpdateFileRequest(UpdatePlanResponse);
- req.Login = new LoginDC()
- {
- Username = SessionInformation.Login.Username,
- Password = SessionInformation.Login.Password,
- CoreServerAddress = SessionInformation.Connection.CoreServerAddress,
- Pin = SessionInformation.Login.Pin,
- ClientID = SessionInformation.Login.ClientId,
- CheckTenant = true,
- TempUsername = SessionInformation.Login.TempUsername,
- };
+ req.SessionId = UpdatePlanResponse.SessionId;
+
+ //req.Login = new LoginDC()
+ //{
+ // Username = SessionInformation.Login.Username,
+ // Password = SessionInformation.Login.Password,
+ // CoreServerAddress = SessionInformation.Connection.CoreServerAddress,
+ // Pin = SessionInformation.Login.Pin,
+ // ClientID = SessionInformation.Login.ClientId,
+ // CheckTenant = true,
+ // TempUsername = SessionInformation.Login.TempUsername,
+ //};
foreach (var file2request in UpdatePlanResponse.FilesToRequest)
{
@@ -144,12 +148,16 @@ namespace BeWoLauncher.Logic.Utils.Download
UpdateFileResponse response = null;
- for (int i = 0; i < 5; i++)
+ for (int i = 1; i <= tries_per_file; i++)
{
response = AskForFile(req);
if (response is object)
break;
+
+ Feedback((int)LauncherProgress.DownloadRetry, new DownloadRetryEventArgs(i + 1, tries_per_file, file2request));
+
+ Thread.Sleep(500);
}
if (response is null)
@@ -157,14 +165,21 @@ namespace BeWoLauncher.Logic.Utils.Download
throw new UpdateException($"file: {file2request.RelativePath} - response null");
}
- var download_path = DownloadFolder.Combine(file2request.RelativePath);
+ if (response.Successful)
+ {
+ var download_path = DownloadFolder.Combine(file2request.RelativePath);
- Path.GetDirectoryName(download_path).CreateFolder();
- download_path.SaveFile(response.FileData);
+ Path.GetDirectoryName(download_path).CreateFolder();
+ download_path.SaveFile(response.FileData);
- var size = NonspecificTools.SizeSuffix((ulong)response.FileData.Length);
+ var size = NonspecificTools.SizeSuffix((ulong)response.FileData.Length);
- Feedback((int)LauncherProgress.DownloadUpdate, new DownloadProgressEventArgs(size, file2request));
+ Feedback((int)LauncherProgress.DownloadUpdate, new DownloadProgressEventArgs(size, file2request));
+ }
+ else
+ {
+ throw new HideClientUpdateException(response.Error);
+ }
}
DownloadFolder.Unlock(SkipLock);
@@ -246,7 +261,11 @@ namespace BeWoLauncher.Logic.Utils.Download
private UpdateFileResponse AskForFile(UpdateFileRequest request)
{
- return LauncherServiceFacade.DoDownloadBeWoServiceSyncWithException(x => x.GetUpdateFile(request));
+ UpdateFileResponse response;
+
+ response = LauncherServiceFacade.DoDownloadBeWoServiceSyncWithException(x => x.GetUpdateFile(request));
+
+ return response;
}
private void GetUpdatePlanResponse()
diff --git a/BeWoLauncher/Logic/Utils/LauncherAppdataConfig.cs b/BeWoLauncher/Logic/Utils/LauncherAppdataConfig.cs
index d91363dc5..a3768bf3d 100644
--- a/BeWoLauncher/Logic/Utils/LauncherAppdataConfig.cs
+++ b/BeWoLauncher/Logic/Utils/LauncherAppdataConfig.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -10,6 +11,7 @@ namespace BeWoLauncher.Logic.Utils
public static class LauncherAppdataConfig
{
private static string _Location;
+ private static string _Folder;
public static string Location
{
@@ -17,6 +19,12 @@ namespace BeWoLauncher.Logic.Utils
set { _Location = value; }
}
+ public static string Folder
+ {
+ get => _Folder ?? (_Folder = Directory.GetParent(Location).FullName);
+ set { _Folder = value; }
+ }
+
public static string GetPlanerLocation()
{
@@ -65,5 +73,12 @@ namespace BeWoLauncher.Logic.Utils
return e.Filename;
}
}
+
+ public static void Reset()
+ {
+ SetFirstInstallationSuccess(false);
+ SetInstallLocationSetSuccess(false);
+ SetPlanerLocation(null);
+ }
}
}
diff --git a/BeWoLauncher/Logic/Utils/LauncherPaths.cs b/BeWoLauncher/Logic/Utils/LauncherPaths.cs
index c33c35692..ea0ace528 100644
--- a/BeWoLauncher/Logic/Utils/LauncherPaths.cs
+++ b/BeWoLauncher/Logic/Utils/LauncherPaths.cs
@@ -83,7 +83,7 @@ namespace BeWoLauncher.Logic.Utils
}
public static string GetLoggerPath()
{
- return Path.Combine(new string[] { LauncherAppdataConfig.Location, "log", "update" });
+ return Path.Combine(new string[] { LauncherAppdataConfig.Folder, "log", "update" });
}
public static string GetDownloadPath()
{
diff --git a/BeWoLauncher/Logic/ViewBuilder.cs b/BeWoLauncher/Logic/ViewBuilder.cs
index 9fc0d7257..57a1c0c44 100644
--- a/BeWoLauncher/Logic/ViewBuilder.cs
+++ b/BeWoLauncher/Logic/ViewBuilder.cs
@@ -63,7 +63,7 @@ namespace BeWoLauncher.Logic
throw new NotImplementedException("ViewBuilder: Frame nicht implementiert");
}
- private UserControl getLoginView()
+ private LoginView getLoginView()
{
var login = new LoginView();
@@ -113,7 +113,7 @@ namespace BeWoLauncher.Logic
var uninstallFailed = new InfoFrame();
uninstallFailed.Title = "Deinstallation fehlgeschlagen!";
- uninstallFailed.Text = Error.ToString();
+ uninstallFailed.Text = GetErrorString();
uninstallFailed.Button1Click += ViewBehavior.BackToLogin;
@@ -145,7 +145,7 @@ namespace BeWoLauncher.Logic
var updateError = new InfoFrame();
updateError.Title = "Update fehlgeschlagen!";
- updateError.Text = Error.ToString();
+ updateError.Text = GetErrorString();
updateError.Button1Click += ViewBehavior.BackToLogin;
@@ -177,7 +177,7 @@ namespace BeWoLauncher.Logic
var installError = new InfoFrame();
installError.Title = "Installation fehlgeschlagen!";
- installError.Text = Error.ToString();
+ installError.Text = GetErrorString();
installError.Button1Click += ViewBehavior.BackToLogin;
@@ -189,7 +189,7 @@ namespace BeWoLauncher.Logic
var genError = new InfoFrame();
genError.Title = "Loader fehlgeschlagen!";
- genError.Text = ErrorString ?? Error.ToString();
+ genError.Text = GetErrorString();
genError.Button1Click += ViewBehavior.BackToLogin;
diff --git a/BeWoLauncher/View/FrameView.xaml b/BeWoLauncher/View/FrameView.xaml
index 98c31b4a3..7ef83abc9 100644
--- a/BeWoLauncher/View/FrameView.xaml
+++ b/BeWoLauncher/View/FrameView.xaml
@@ -35,7 +35,7 @@
-
+
@@ -44,10 +44,10 @@
-
+
-
- www.beyondsoft.de
+
+ www.ownsoft.de
diff --git a/BeWoLauncher/View/FrameView.xaml.cs b/BeWoLauncher/View/FrameView.xaml.cs
index 898b7ce1f..3516946f8 100644
--- a/BeWoLauncher/View/FrameView.xaml.cs
+++ b/BeWoLauncher/View/FrameView.xaml.cs
@@ -33,7 +33,7 @@ namespace BeWoLauncher.View
if (DateTime.Now > dt)
dt = DateTime.Now;
- txtCopyright.Text = String.Format("Copyright {0:yyyy} | beyondSoft GmbH", dt);
+ txtCopyright.Text = String.Format("Copyright {0:yyyy} | ownSoft GmbH", dt);
lblVersion.Content = LauncherApp.Version;
}
diff --git a/BeWoLauncher/View/Frames/InfoFrame.xaml b/BeWoLauncher/View/Frames/InfoFrame.xaml
index e876cb9a2..3c4c28ccd 100644
--- a/BeWoLauncher/View/Frames/InfoFrame.xaml
+++ b/BeWoLauncher/View/Frames/InfoFrame.xaml
@@ -14,7 +14,7 @@
-
+
Hier könnte ihre Fehlermeldung stehen!
diff --git a/BeWoLauncher/View/Frames/ProgressFrame.xaml.cs b/BeWoLauncher/View/Frames/ProgressFrame.xaml.cs
index ed4c9dbff..ecdad474a 100644
--- a/BeWoLauncher/View/Frames/ProgressFrame.xaml.cs
+++ b/BeWoLauncher/View/Frames/ProgressFrame.xaml.cs
@@ -1,5 +1,6 @@
using BeWoLauncher.Logic.Controller;
using BS.SharedLauncher.Enums;
+using BS.SharedLauncher.Exceptions;
using BS.SharedLauncher.Update;
using System;
using System.Collections.Generic;
@@ -23,9 +24,9 @@ namespace BeWoLauncher.View.Frames
private string[][] keywords = new string[][]
{
- new string[]{"Installation", "Ungebrauchte Datei(en) gefunden." },
- new string[]{"Update", "Ungebrauchte Datei(en) gefunden."},
- new string[]{"Deinstallation", "Deinstallation startet..."},
+ new string[]{"Installation", "Ungebrauchte Datei(en) gefunden.", "Ungebrauchte Datei(en) entfernt!" },
+ new string[]{"Update", "Ungebrauchte Datei(en) gefunden.", "Ungebrauchte Datei(en) entfernt!"},
+ new string[]{"Deinstallation", "Deinstallation startet...", "Deinstallation erfolgreich!"},
};
private int keyword_mode;
@@ -106,7 +107,14 @@ namespace BeWoLauncher.View.Frames
{
if (e.Error != null)
{
- ViewController.Error = e.Error;
+ if(e.Error is HideClientUpdateException)
+ {
+ ViewController.ErrorString = e.Error.Message;
+ }
+ else
+ {
+ ViewController.Error = e.Error;
+ }
Exception.Invoke(this, new EventArgs());
}
@@ -141,11 +149,17 @@ namespace BeWoLauncher.View.Frames
case LauncherProgress.DownloadUpdate:
var args = obj as DownloadProgressEventArgs;
Message = "Download wird ausgeführt...";
- SubMessage = $"{args.File.RelativePath} ({args.Size})\n wurde heruntergeladen...";
+ SubMessage = $"{args.File.RelativePath} ({args.Size}) wurde heruntergeladen...";
Bar1MakeStep();
Bar2MakeStep();
break;
+ case LauncherProgress.DownloadRetry:
+ var args7 = obj as DownloadRetryEventArgs;
+ Message = "Download wird wiederholt...";
+ SubMessage = $"{args7.File.RelativePath} wird erneut heruntergeladen... (Versuch: {args7.Try_Num}/{args7.Max_Tries})";
+ break;
+
case LauncherProgress.DownloadFinish:
Message = "Download abgeschlossen!";
SubMessage = "";
@@ -190,13 +204,13 @@ namespace BeWoLauncher.View.Frames
break;
case LauncherProgress.DeleteFinished:
- Message = "Säuberung abgeschlossen!";
+ Message = getKeyword(2);
SubMessage = "";
Bar1Hide();
break;
case LauncherProgress.CleanupStart:
- Message = "Räume hier noch eben auf...";
+ Message = "Räume Ordner auf...";
SubMessage = "";
Bar1Show();
Bar1Deactivate();
@@ -206,7 +220,7 @@ namespace BeWoLauncher.View.Frames
break;
case LauncherProgress.CleanupFinished:
- Message = "Blitze blank...";
+ Message = "Ordner aufgeräumt!";
SubMessage = "";
break;
diff --git a/BeWoLauncher/View/LoginView.xaml b/BeWoLauncher/View/LoginView.xaml
index 37e02f0b3..c10f3f3f8 100644
--- a/BeWoLauncher/View/LoginView.xaml
+++ b/BeWoLauncher/View/LoginView.xaml
@@ -19,7 +19,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
@@ -173,9 +173,9 @@
-
+
-
+
www.ownsoft.de
diff --git a/Service/ServiceImplementations/DownloadBeWoServiceImp.cs b/Service/ServiceImplementations/DownloadBeWoServiceImp.cs
index f7feca60a..ab1c1dd4a 100644
--- a/Service/ServiceImplementations/DownloadBeWoServiceImp.cs
+++ b/Service/ServiceImplementations/DownloadBeWoServiceImp.cs
@@ -23,6 +23,8 @@ namespace BeWo.Service.ServiceImplementations
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
public class DownloadBeWoServiceImp : IDownloadBeWoService
{
+ private const int FILE_REQUEST_COUNT = 5;
+
public string Tenant => MultitenancyOperationContextExt.Current.Tenant;
public UpdatePlanResponse GetUpdatePlan(UpdatePlanRequest request)
@@ -33,6 +35,8 @@ namespace BeWo.Service.ServiceImplementations
var response = new UpdatePlanResponse(false);
+ response.TriesPerFile = FILE_REQUEST_COUNT;
+
try
{
GenericTextLogger.Post("Validiere Plan Request.");
@@ -43,6 +47,9 @@ namespace BeWo.Service.ServiceImplementations
UpdatePlanResponseBuilder.BuildResponse(request, Tenant, response);
+ if(response.HasToDo)
+ UpdateServerSessionManager.CreateSession(response, Tenant);
+
response.Successful = true;
response.Error = null;
@@ -99,6 +106,8 @@ namespace BeWo.Service.ServiceImplementations
GenericTextLogger.Post("Baue Antwort.");
+ UpdateServerSessionManager.LoadAbsolutePath(request);
+
UpdateFileResponseBuilder.BuildResponse(request, Tenant, response);
response.Successful = true;
@@ -132,6 +141,8 @@ namespace BeWo.Service.ServiceImplementations
if(response.Error is object)
{
+ UpdateServerSessionManager.CloseSession(request.SessionId);
+
Thread.Sleep(3000);
}
diff --git a/Service/ServiceImplementations/LauncherServiceImp.cs b/Service/ServiceImplementations/LauncherServiceImp.cs
index 639411814..4ca12204b 100644
--- a/Service/ServiceImplementations/LauncherServiceImp.cs
+++ b/Service/ServiceImplementations/LauncherServiceImp.cs
@@ -47,7 +47,7 @@ namespace BeWo.Service.ServiceImplementations
{ BS.Shared.UserValidationResult.UnkownError, BS.SharedLauncher.Enums.UserValidationResult.UnknownError},
{ BS.Shared.UserValidationResult.UserValid, BS.SharedLauncher.Enums.UserValidationResult.UserValid},
{ BS.Shared.UserValidationResult.UserValidTwoFactorAuthenticationNeeded, BS.SharedLauncher.Enums.UserValidationResult.UnknownError},
- { BS.Shared.UserValidationResult.EmployeeDeleted, BS.SharedLauncher.Enums.UserValidationResult.EmployeeDeleted},
+ { BS.Shared.UserValidationResult.BeWoPasswordNotAllowed, BS.SharedLauncher.Enums.UserValidationResult.EmployeeDeleted},
};
public PasswordValidationResult CheckPassword(long userOid, string pOldPassword, string pNewPassword)
diff --git a/Service/ServiceUtils/Update/UpdateConfigReader.cs b/Service/ServiceUtils/Update/UpdateConfigReader.cs
index 0ca3546d9..8aa8596a5 100644
--- a/Service/ServiceUtils/Update/UpdateConfigReader.cs
+++ b/Service/ServiceUtils/Update/UpdateConfigReader.cs
@@ -50,7 +50,7 @@ namespace BeWo.Service.ServiceUtils.Update
{
try
{
- return Document.SelectSingleNode($"/config/versions/tenant[@id='{Tenant}']/version").InnerXml;
+ return Document.SelectSingleNode($"/config/versions/tenant[@id='{Tenant}']/version")?.InnerXml;
}
catch (Exception)
{
diff --git a/Service/ServiceUtils/Update/UpdatePlanResponseBuilder.cs b/Service/ServiceUtils/Update/UpdatePlanResponseBuilder.cs
index 052a4caa2..39a6312c6 100644
--- a/Service/ServiceUtils/Update/UpdatePlanResponseBuilder.cs
+++ b/Service/ServiceUtils/Update/UpdatePlanResponseBuilder.cs
@@ -36,7 +36,7 @@ namespace BeWo.Service.ServiceUtils.Update
_Response.CurrentPackage = new UpdatePlanDC
{
DefaultVersion = default_version,
- TenantVersion = tenant_version
+ TenantVersion = tenant_version,
};
// Lädt komplettes Paket ohne Hash
diff --git a/Service/ServiceUtils/Update/UpdateRequestValidator.cs b/Service/ServiceUtils/Update/UpdateRequestValidator.cs
index 6dac884f5..b038ed141 100644
--- a/Service/ServiceUtils/Update/UpdateRequestValidator.cs
+++ b/Service/ServiceUtils/Update/UpdateRequestValidator.cs
@@ -100,7 +100,7 @@ namespace BeWo.Service.ServiceUtils.Update
private static bool TryValidateFileRequestProperties(UpdateFileRequest request)
{
- if (string.IsNullOrWhiteSpace(request.UpdateSessionId))
+ if (string.IsNullOrWhiteSpace(request.SessionId))
return false;
if (string.IsNullOrWhiteSpace(request.Version))
@@ -152,10 +152,10 @@ namespace BeWo.Service.ServiceUtils.Update
}
private static string TryValidateSession(UpdateFileRequest request, string tenant)
{
- var session = UpdateServerSessionManager.CurrentSession(request.UpdateSessionId);
+ var session = UpdateServerSessionManager.CurrentSession(request.SessionId);
if (session is null)
- return $"Session \"{request.UpdateSessionId}\" nicht verfügbar";
+ return $"Session \"{request.SessionId}\" nicht verfügbar";
if (session.Tenant != tenant)
return $"Tenant konnte nicht bestätigt werden. {session.Tenant} != {tenant}";
@@ -165,7 +165,7 @@ namespace BeWo.Service.ServiceUtils.Update
return $"Angefragte Datei nicht verfügbar. Anfrage an \"{request.UpdateFile.RelativePath}\"";
if (session.IsTimeouted)
- return $"Session \"{request.UpdateSessionId}\" nicht mehr verfügbar - Timeout";
+ return $"Session \"{request.SessionId}\" nicht mehr verfügbar - Timeout";
return null;
}
diff --git a/Service/ServiceUtils/Update/UpdateServerSessionManager.cs b/Service/ServiceUtils/Update/UpdateServerSessionManager.cs
index a8e6c121e..a2342ebd0 100644
--- a/Service/ServiceUtils/Update/UpdateServerSessionManager.cs
+++ b/Service/ServiceUtils/Update/UpdateServerSessionManager.cs
@@ -33,7 +33,7 @@ namespace BeWo.Service.ServiceUtils.Update
}
}
- public static string GenerateUniqueSessionId()
+ private static string GenerateUniqueSessionId()
{
var session_id = Guid.NewGuid().ToString();
@@ -69,7 +69,7 @@ namespace BeWo.Service.ServiceUtils.Update
_UpdateServerSessions.Add(session_id, session);
- res.Session_Id = session_id;
+ res.SessionId = session_id;
}
finally
{
@@ -122,7 +122,7 @@ namespace BeWo.Service.ServiceUtils.Update
var file_id = request.UpdateFile.RelativePath;
- var session_id = request.UpdateSessionId;
+ var session_id = request.SessionId;
var session = _UpdateServerSessions[session_id];
var limiter = session.FileLimiterDict[file_id];
diff --git a/SharedLauncher/DataContract/UpdateFileRequest.cs b/SharedLauncher/DataContract/UpdateFileRequest.cs
index 799d70ab8..6a9c3e9e5 100644
--- a/SharedLauncher/DataContract/UpdateFileRequest.cs
+++ b/SharedLauncher/DataContract/UpdateFileRequest.cs
@@ -18,17 +18,22 @@ namespace BS.SharedLauncher.DataContract
}
- public UpdateFileRequest(string version, string session_id) : base()
+ public UpdateFileRequest(string version, string session_id) : this()
{
Version = version;
- UpdateSessionId = session_id;
+ SessionId = session_id;
+ }
+
+ public UpdateFileRequest(UpdatePlanResponse response) : this(response.CurrentPackage.Version, response.SessionId)
+ {
+
}
[DataMember]
public string Version { get; set; }
[DataMember]
- public string UpdateSessionId { get; set; }
+ public string SessionId { get; set; }
[DataMember]
public UpdateFileDC UpdateFile { get; set; }
diff --git a/SharedLauncher/DataContract/UpdateFileResponse.cs b/SharedLauncher/DataContract/UpdateFileResponse.cs
index 3aeea03e9..2fcc2a58c 100644
--- a/SharedLauncher/DataContract/UpdateFileResponse.cs
+++ b/SharedLauncher/DataContract/UpdateFileResponse.cs
@@ -22,6 +22,9 @@ namespace BS.SharedLauncher.DataContract
}
+ [DataMember]
+ public bool RetryIfFailed { get; set; }
+
[DataMember]
public byte[] FileData { get; set; }
}
diff --git a/SharedLauncher/DataContract/UpdatePlanResponse.cs b/SharedLauncher/DataContract/UpdatePlanResponse.cs
index 08a27f865..124604542 100644
--- a/SharedLauncher/DataContract/UpdatePlanResponse.cs
+++ b/SharedLauncher/DataContract/UpdatePlanResponse.cs
@@ -22,11 +22,14 @@ namespace BS.SharedLauncher.DataContract
}
[DataMember]
- public string Session_Id { get; set; }
+ public string SessionId { get; set; }
[DataMember]
public UpdatePlanDC CurrentPackage { get; set; }
+ [DataMember]
+ public int TriesPerFile { get; set; }
+
[DataMember]
public bool HasToDo { get; set; }
diff --git a/SharedLauncher/LauncherEnums.cs b/SharedLauncher/LauncherEnums.cs
index 06889183a..18e7cad66 100644
--- a/SharedLauncher/LauncherEnums.cs
+++ b/SharedLauncher/LauncherEnums.cs
@@ -46,6 +46,7 @@ namespace BS.SharedLauncher.Enums
ProgressStart = 0,
DownloadStart = 1,
DownloadUpdate = 2,
+ DownloadRetry = 21,
DownloadFinish = 3,
ApplyStart = 4,
ApplyUpdate = 5,
diff --git a/SharedLauncher/SharedLauncher.csproj b/SharedLauncher/SharedLauncher.csproj
index 6a6d8c69d..03db19869 100644
--- a/SharedLauncher/SharedLauncher.csproj
+++ b/SharedLauncher/SharedLauncher.csproj
@@ -82,6 +82,7 @@
+
diff --git a/SharedLauncher/Update/DownloadRetryEventArgs.cs b/SharedLauncher/Update/DownloadRetryEventArgs.cs
new file mode 100644
index 000000000..acb985802
--- /dev/null
+++ b/SharedLauncher/Update/DownloadRetryEventArgs.cs
@@ -0,0 +1,29 @@
+using BS.SharedLauncher.DataContract;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.SharedLauncher.Update
+{
+ public class DownloadRetryEventArgs : EventArgs
+ {
+ public int Try_Num { get; set; }
+ public int Max_Tries { get; set; }
+
+ public UpdateFileDC File { get; set; }
+
+ public DownloadRetryEventArgs()
+ {
+
+ }
+
+ public DownloadRetryEventArgs(int try_num, int max_tries, UpdateFileDC file) : this()
+ {
+ Try_Num = try_num;
+ Max_Tries = max_tries;
+ File = file;
+ }
+ }
+}