-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
Note: The Patcher Progress screen doesnt seem to update any more, but pushing as i need the code at home from work.
- Also added a debug console, only opens during Visual Studio DEBUG mode enabled.
Start the app with --log to open the console logger
It used to sit at 100% while applying file metadata, this is sorted now.
These dont do anything yet.
While not needed to make the project compile, it is needed to keep our application the same throughout
- Is buggy, but commiting so i can grab it at home
While not needed to make the project compile, it is needed to keep our application the same throughout
- Is buggy, but commiting so i can grab it at home
Why is VS doing this?
…x_Launcher into concurrent_downloads
also incremented the version number of the launcher ready for patching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes need to be done, however none of them should break the launcher and I really want to get a patch out with this ASAP.
Please make a separate PR to address comments
@@ -43,8 +43,10 @@ public override int Run(string[] remainingArguments) | |||
return 1; | |||
} | |||
|
|||
RxPatcher.Instance.AddNewUpdateServer(remainingArguments[0], ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patchUrl
would be more descriptive than remainingArguments[0]
// The RenX client seems to crash around here when the cancel button is pressed | ||
// while it does crash, it does however achieve our goal of stopping the download | ||
// (I'm not saying that it's right, i just dont know how to fix it right now.) | ||
RxLogger.Logger.Instance.Write($"{ex.Message}\r\nStack Trace:\r\n{ex.StackTrace}", Logger.ErrorLevel.ErrError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self note: make an issue for this after merging
RxLogger.Logger.Instance.Write( | ||
$"Spawning Background Workers - Detected {Environment.ProcessorCount} processors, using {(Environment.ProcessorCount > 4 ? 4 : Environment.ProcessorCount)} of them"); | ||
|
||
for (var i = 0; i < (Environment.ProcessorCount > MaximumDeltaThreads ? MaximumDeltaThreads : Environment.ProcessorCount); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Min
here would be a bit clearer; this could also probably just be applied directly to MaximumDeltaThreads instead of here. So the end code here might end up just being:
while (bgWorkers.Count < MaximumDeltaThreads)
Min
documentation: https://msdn.microsoft.com/en-us/library/microsoft.xna.framework.mathhelper.min.aspx
// Update progress | ||
progress.AdvanceItem(action.PatchSize); | ||
progressCallback(progress); | ||
foreach (var x in bgWorkers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a stylistic suggestion, try to avoid using single-letter variables. worker
is much more descriptive than x
, for example.
} | ||
|
||
while (tmpActions.Any(x => !x.IsComplete)) | ||
{ | ||
await Task.Delay(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self note: make an issue for this
/// <returns>The name of the country that belongs to the IPAddress</returns> | ||
static async Task<string[]> GrabCountry(string IPAddress) | ||
static async Task<string[]> GrabCountry(string ipAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self note: I still need to add country codes to the server list so we can remove this from the launcher
Name = "0.77-dev", | ||
Number = 077 | ||
Name = "0.8", | ||
Number = 08 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version number actually needs to be at least as big as the last one (8 < 77); I'll PR a change to set this to 0 though and instead start making branches for each release with the version number
GamePatchUrls = UpdateServerModelFactory.CreateUpdateServerModels(versionData["game"]["patch_urls"].ToObject<string[]>()); | ||
|
||
// Server URL's list & Friendly Names | ||
foreach (var x in versionData["game"]["server_urls"].ToObject<dynamic>()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it might not be exclusively urls in the future, maybe we should change this to just mirrors
at some point
return string.Format("{0}%", perc.ToString("0.##")); | ||
return $"{perc:0.##}%"; | ||
} | ||
else if ( progress.DownloadThreads == 0 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really stick to using the state code, rather than checking the download threads manually here
this.StatusMessage = "Operation cancelled by User"; | ||
Application.Current.Shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cancel
should not close the entire application; it should only cancel the patch
To use this feature with logging, including the concurrent download debug window, start the launcher with the --log and --firstInstall parameters.
Image to debug screen This debug screen will only show if --log is set in the parameters, it was very useful to track down some bugs.
I have tested every possible install method (bar updating - i will test this soon), I have also tested it over different operating systems, and different users - all users reported a much faster download and install time with this setup.
The debug dialog can be useful to see what downloads are actually happening.
Also, this update renderes the Friendly Name Pull Request useless, as there is no way to really show what server(s) you're downloading from without it looking extremely cluttered.