Skip to content

Commit 63ecf00

Browse files
authored
Merge pull request #4 from FlashpointProject/dev
Dev
2 parents d3a7f61 + d7b2556 commit 63ecf00

11 files changed

Lines changed: 35 additions & 26 deletions

FlashpointSecurePlayer/EnvironmentVariables.cs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public void Activate(string name, string server, string applicationMutexName) {
2121
base.Activate(name);
2222
ModificationsElement modificationsElement = GetModificationsElement(true, Name);
2323
string value = null;
24+
List<string> values = null;
2425
string compatibilityLayerValue = null;
26+
List<string> compatibilityLayerValues = new List<string>();
2527

2628
try {
2729
compatibilityLayerValue = Environment.GetEnvironmentVariable(COMPATIBILITY_LAYER_NAME);
@@ -31,10 +33,6 @@ public void Activate(string name, string server, string applicationMutexName) {
3133
throw new TaskRequiresElevationException();
3234
}
3335

34-
if (compatibilityLayerValue != null) {
35-
compatibilityLayerValue = compatibilityLayerValue.ToUpper();
36-
}
37-
3836
EnvironmentVariablesElement environmentVariablesElement = null;
3937

4038
for (int i = 0;i < modificationsElement.EnvironmentVariables.Count;i++) {
@@ -54,15 +52,23 @@ public void Activate(string name, string server, string applicationMutexName) {
5452
throw new TaskRequiresElevationException();
5553
}
5654

57-
if (value != null) {
58-
value = value.ToUpper();
59-
}
60-
6155
// if this is the compatibility layer variable
6256
// and the value is not what we want to set it to
6357
// and we're in server mode...
64-
if (environmentVariablesElement.Name == COMPATIBILITY_LAYER_NAME && value != compatibilityLayerValue && !String.IsNullOrEmpty(server)) {
65-
throw new CompatibilityLayersException();
58+
if (environmentVariablesElement.Name == COMPATIBILITY_LAYER_NAME && !String.IsNullOrEmpty(server)) {
59+
values = new List<string>();
60+
61+
if (compatibilityLayerValue != null) {
62+
compatibilityLayerValues = compatibilityLayerValue.ToUpper().Split(' ').ToList();
63+
}
64+
65+
if (value != null) {
66+
values = value.ToUpper().Split(' ').ToList();
67+
}
68+
69+
if (values.Except(compatibilityLayerValues).Any()) {
70+
throw new CompatibilityLayersException();
71+
}
6672
}
6773
}
6874
}
@@ -81,7 +87,9 @@ public void Deactivate(string server) {
8187
}
8288

8389
string value = null;
90+
List<string> values = null;
8491
string compatibilityLayerValue = null;
92+
List<string> compatibilityLayerValues = new List<string>();
8593

8694
try {
8795
compatibilityLayerValue = Environment.GetEnvironmentVariable(COMPATIBILITY_LAYER_NAME);
@@ -92,7 +100,7 @@ public void Deactivate(string server) {
92100
}
93101

94102
if (compatibilityLayerValue != null) {
95-
compatibilityLayerValue = compatibilityLayerValue.ToUpper();
103+
compatibilityLayerValues = compatibilityLayerValue.ToUpper().Split(' ').ToList();
96104
}
97105

98106
EnvironmentVariablesElement environmentVariablesElement = null;
@@ -105,15 +113,16 @@ public void Deactivate(string server) {
105113
}
106114

107115
value = environmentVariablesElement.Value;
116+
values = new List<string>();
108117

109118
if (value != null) {
110-
value = value.ToUpper();
119+
values = value.ToUpper().Split(' ').ToList();
111120
}
112121

113122
// if this isn't the compatibility layer variable
114123
// or the value isn't what we want to set it to
115124
// or we're not in server mode...
116-
if (environmentVariablesElement.Name != COMPATIBILITY_LAYER_NAME || value != compatibilityLayerValue && String.IsNullOrEmpty(server)) {
125+
if (environmentVariablesElement.Name != COMPATIBILITY_LAYER_NAME || values.Except(compatibilityLayerValues).Any() || String.IsNullOrEmpty(server)) {
117126
try {
118127
Environment.SetEnvironmentVariable(environmentVariablesElement.Name, null);
119128
} catch (ArgumentException) {

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer2.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</environmentVariables>
1919
<registryBackups binaryType="SCS_32BIT_BINARY">
2020
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
21-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x"
21+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x"
2222
valueKind="String" />
2323
</registryBackups>
2424
<singleInstance strict="false" commandLine="basilisk.exe" />

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer2scaling.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</environmentVariables>
2020
<registryBackups binaryType="SCS_32BIT_BINARY">
2121
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
22-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x"
22+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x"
2323
valueKind="String" />
2424
</registryBackups>
2525
<singleInstance strict="false" commandLine="basilisk.exe" />

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer3.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</environmentVariables>
1919
<registryBackups binaryType="SCS_32BIT_BINARY">
2020
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
21-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d3.x"
21+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d3.x"
2222
valueKind="String" />
2323
</registryBackups>
2424
<singleInstance strict="false" commandLine="basilisk.exe" />

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer3scaling.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</environmentVariables>
2020
<registryBackups binaryType="SCS_32BIT_BINARY">
2121
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
22-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d3.x"
22+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d3.x"
2323
valueKind="String" />
2424
</registryBackups>
2525
<singleInstance strict="false" commandLine="basilisk.exe" />

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer5.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</environmentVariables>
1919
<registryBackups binaryType="SCS_32BIT_BINARY">
2020
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
21-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d5.x"
21+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d5.x"
2222
valueKind="String" />
2323
</registryBackups>
2424
<singleInstance strict="false" commandLine="basilisk.exe" />

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/unitywebplayer5scaling.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</environmentVariables>
2121
<registryBackups binaryType="SCS_32BIT_BINARY">
2222
<registryBackup type="VALUE" keyName="HKEY_CURRENT_USER\Software\Unity\WebPlayer"
23-
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d5.x"
23+
valueName="Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d5.x"
2424
valueKind="String" />
2525
</registryBackups>
2626
<singleInstance strict="false" commandLine="basilisk.exe" />

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.3.0")]
37-
[assembly: AssemblyFileVersion("1.0.3.0")]
36+
[assembly: AssemblyVersion("1.0.4.0")]
37+
[assembly: AssemblyFileVersion("1.0.4.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.3
1+
# Flashpoint Secure Player 1.0.4
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)

FlashpointSecurePlayer/RegistryBackups.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ private void KCBStopped(RegistryTraceData registryTraceData) {
13481348
// we want to take care of any queued registry timeline events
13491349
// an event entails the date and time of the registry modification
13501350
if (ModificationsQueue.ContainsKey(safeKeyHandle)) {
1351-
while (ModificationsQueue[safeKeyHandle].Count > 0) {
1351+
while (ModificationsQueue[safeKeyHandle].Any()) {
13521352
// get the first event
13531353
queuedModification = ModificationsQueue[safeKeyHandle].First();
13541354

0 commit comments

Comments
 (0)