aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-05 10:28:51 -0500
committerMichael <[email protected]>2017-03-05 10:28:51 -0500
commit308006ff9de8ce34e00d31d39ccffa43d98cba5e (patch)
tree304ee0dd65eb9d331ce6e3c1fa62adcc20d2f952 /ShiftOS.WinForms/Applications
parentfc55d4feecb64c2bae355cceac93bdac73fe00ea (diff)
downloadshiftos_thereturn-308006ff9de8ce34e00d31d39ccffa43d98cba5e.tar.gz
shiftos_thereturn-308006ff9de8ce34e00d31d39ccffa43d98cba5e.tar.bz2
shiftos_thereturn-308006ff9de8ce34e00d31d39ccffa43d98cba5e.zip
Add Shiftnet subscription metadata
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/Downloader.cs21
1 files changed, 3 insertions, 18 deletions
diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs
index 48a5cfd..da90c6d 100644
--- a/ShiftOS.WinForms/Applications/Downloader.cs
+++ b/ShiftOS.WinForms/Applications/Downloader.cs
@@ -173,28 +173,13 @@ namespace ShiftOS.WinForms.Applications
/// <returns>Download speed in bytes.</returns>
public static int GetDownloadSpeed()
{
- switch (SaveSystem.CurrentSave.ShiftnetSubscription)
- {
- case 0:
- return 256/*B*/;
- case 1:
- return 1024 * 1024/*KB*/;
- case 2:
- return 1024 * 10240/*KB*/;
- case 3:
- return 1024 * 1024 * 1024/*MB*/;
- }
- return 256;
+ return GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription].DownloadSpeed;
}
- public static IEnumerable<ShiftOS.Objects.EngineShiftnetSubscription> GetAllSubscriptions()
+ public static ShiftOS.Objects.EngineShiftnetSubscription[] GetAllSubscriptions()
{
//For now we'll have them hard-coded into the client but in future they'll be in the MUD.
-
- foreach(var sub in JsonConvert.DeserializeObject<ShiftOS.Objects.EngineShiftnetSubscription[]>(Properties.Resources.ShiftnetServices))
- {
- yield return sub;
- }
+ return JsonConvert.DeserializeObject<ShiftOS.Objects.EngineShiftnetSubscription[]>(Properties.Resources.ShiftnetServices);
}
public static void StartDownload(Download down)