Skip to content

Commit 40f35b7

Browse files
authored
Merge pull request #5 from FlashpointProject/dev
optimization: only download configs when needed
2 parents 63ecf00 + 9dab4e8 commit 40f35b7

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

FlashpointSecurePlayer/Program.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -876,17 +876,6 @@ private static string GetValidEXEConfigurationName(string name) {
876876
return invalidNameCharactersRegex.Replace(name, ".").ToLower();
877877
}
878878

879-
public static async Task DownloadEXEConfiguration(string name) {
880-
try {
881-
name = GetValidEXEConfigurationName(name);
882-
await DownloadAsync("http://" + CONFIGURATION_DOWNLOAD_NAME + "/" + name + ".config").ConfigureAwait(false);
883-
} catch (Exceptions.DownloadFailedException) {
884-
// Fail silently.
885-
} catch (ConfigurationErrorsException) {
886-
// Fail silently.
887-
}
888-
}
889-
890879
private static Configuration GetActiveEXEConfiguration() {
891880
// get cached if exists
892881
if (ActiveEXEConfiguration != null) {
@@ -992,6 +981,20 @@ private static Configuration GetEXEConfiguration(bool create, string name) {
992981
EXEConfigurationName = name;
993982
return EXEConfiguration;
994983
}
984+
public static async Task DownloadEXEConfiguration(string name) {
985+
try {
986+
GetEXEConfiguration(false, name);
987+
} catch (ConfigurationErrorsException) {
988+
try {
989+
name = GetValidEXEConfigurationName(name);
990+
await DownloadAsync("http://" + CONFIGURATION_DOWNLOAD_NAME + "/" + name + ".config").ConfigureAwait(false);
991+
} catch (Exceptions.DownloadFailedException) {
992+
// Fail silently.
993+
} catch (ConfigurationErrorsException) {
994+
// Fail silently.
995+
}
996+
}
997+
}
995998

996999
public static FlashpointSecurePlayerSection GetFlashpointSecurePlayerSection(bool create, string exeConfigurationName) {
9971000
FlashpointSecurePlayerSection flashpointSecurePlayerSection = null;

FlashpointSecurePlayer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.0.4.0")]
37-
[assembly: AssemblyFileVersion("1.0.4.0")]
36+
[assembly: AssemblyVersion("1.0.5.0")]
37+
[assembly: AssemblyFileVersion("1.0.5.0")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

FlashpointSecurePlayer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Flashpoint Secure Player 1.0.4
1+
# Flashpoint Secure Player 1.0.5
22
This player attempts to solve common compatibility or portability issues posed by browser plugins on Windows for the purpose of playback in BlueMaxima's Flashpoint.
33

44
It is compatible with Windows 7, Windows 8, Windows 8.1 and Windows 10, and requires .NET Framework 4.5. If you are on Windows 8.1 or Windows 10, or if you are on Windows 7/8 and have updates enabled, you already have .NET Framework 4.5. Otherwise, you may [download .NET Framework 4.5.](http://www.microsoft.com/en-us/download/details.aspx?id=30653)

0 commit comments

Comments
 (0)