diff --git a/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs b/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs index b6d179112..533c819f1 100644 --- a/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs +++ b/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs @@ -29,6 +29,20 @@ public override void Load() if (assembly is null) { return; } Il2CppRegisterAttribute.Registration(assembly); } + + public static void RunReleaseTest() + { + try + { + TestRunnerBase.Run(); + TestRunnerBase.Run(); + TestRunnerBase.Run(); + } + catch(System.Exception ex) + { + Instance.Log.LogError(ex); + } + } } [HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))] @@ -40,7 +54,11 @@ public static void Prefix(ChatController __instance) { GameUtility.ChangePresetTo(19); +#if RELEASE + ExtremeRolesTestPlugin.RunReleaseTest(); +#else TestRunnerBase.Run(); +#endif } } } \ No newline at end of file diff --git a/ExtremeRoles.Test/OptionRunner.cs b/ExtremeRoles.Test/OptionRunner.cs index 87ead4771..24cc794ac 100644 --- a/ExtremeRoles.Test/OptionRunner.cs +++ b/ExtremeRoles.Test/OptionRunner.cs @@ -13,8 +13,12 @@ namespace ExtremeRoles.Test; internal sealed class OptionRunner : TestRunnerBase { +#if RELEASE + private const int iteration = 3; +#endif +#if DEBUG private const int iteration = 100000; - +#endif public override void Run() { diff --git a/ExtremeRoles.sln b/ExtremeRoles.sln index 374cf5282..2222a081e 100644 --- a/ExtremeRoles.sln +++ b/ExtremeRoles.sln @@ -18,6 +18,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtremeRoles.Test", "Extrem EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtremeRoles.Generator", "ExtremeRoles.Generator\ExtremeRoles.Generator.csproj", "{BF8843AA-F849-4F21-B3D5-1AB29E135DA6}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{DED4EEB9-DD02-4EAD-9D44-CF23AD1726FC}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitattributes = .gitattributes + .gitconfig = .gitconfig + .gitignore = .gitignore + .gitmodules = .gitmodules + .vsconfig = .vsconfig + createtransdatareport.py = createtransdatareport.py + ExtremeSkinsTransData.xlsx = ExtremeSkinsTransData.xlsx + LICENSE.md = LICENSE.md + MakeEnv.bat = MakeEnv.bat + makelanguagejson.py = makelanguagejson.py + packing.ps1 = packing.ps1 + README.md = README.md + requirements.txt = requirements.txt + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/ExtremeRoles/ExtremeRoles.csproj b/ExtremeRoles/ExtremeRoles.csproj index 6afc83dc3..b312823d0 100644 --- a/ExtremeRoles/ExtremeRoles.csproj +++ b/ExtremeRoles/ExtremeRoles.csproj @@ -3,8 +3,8 @@ net6.0 latest 7 - - 12.0.0 + 12.0.0.1 + Invitation-AmongUsV2024813 Extreme Roles for Advanced user yukieiji diff --git a/ExtremeRoles/Module/ApiServer.cs b/ExtremeRoles/Module/ApiServer.cs index 4ac26d01b..fecb7133e 100644 --- a/ExtremeRoles/Module/ApiServer.cs +++ b/ExtremeRoles/Module/ApiServer.cs @@ -66,6 +66,11 @@ private ApiServer() public static void Create() { + if (instance is not null) + { + return; + } + if (handler.Count == 0) { ExtremeRolesPlugin.Logger.LogWarning($"ExR ApiServer: Disable, Register URL is ZERO"); diff --git a/ExtremeRoles/Resources/Loader.cs b/ExtremeRoles/Resources/Loader.cs index eaafbff46..c53809ce9 100644 --- a/ExtremeRoles/Resources/Loader.cs +++ b/ExtremeRoles/Resources/Loader.cs @@ -312,33 +312,39 @@ private static T loadObjectFromAsset(AssetBundle bundle, string objName) wher private static AssetBundle getAssetBundleFromFilePath( string filePath) { - if (cachedBundle.TryGetValue(filePath, out AssetBundle? bundle) || - bundle != null) + lock (cachedBundle) { - bundle.Unload(true); - cachedBundle.Remove(filePath); - } - var byteArray = Il2CppFile.ReadAllBytes(filePath); - bundle = loadAssetFromByteArray(byteArray); + if (cachedBundle.TryGetValue(filePath, out AssetBundle? bundle) || + bundle != null) + { + bundle.Unload(true); + cachedBundle.Remove(filePath); + } + var byteArray = Il2CppFile.ReadAllBytes(filePath); + bundle = loadAssetFromByteArray(byteArray); - cachedBundle.Add(filePath, bundle); + cachedBundle.Add(filePath, bundle); - return bundle; + return bundle; + } } private static AssetBundle GetAssetBundleFromAssembly( string bundleName, Assembly assembly) { - if (!cachedBundle.TryGetValue(bundleName, out AssetBundle? bundle) || - bundle == null) + lock (cachedBundle) { - using var stream = getStreamFromResource(assembly, bundleName); - var byteArray = getBytedArryFrom(stream); - bundle = loadAssetFromByteArray(byteArray); - - cachedBundle.Add(bundleName, bundle); + if (!cachedBundle.TryGetValue(bundleName, out AssetBundle? bundle) || + bundle == null) + { + using var stream = getStreamFromResource(assembly, bundleName); + var byteArray = getBytedArryFrom(stream); + bundle = loadAssetFromByteArray(byteArray); + + cachedBundle.Add(bundleName, bundle); + } + return bundle; } - return bundle; } private static AssetBundle loadAssetFromByteArray(Il2CppStructArray byteArray) diff --git a/ExtremeSkins/ExtremeSkins.csproj b/ExtremeSkins/ExtremeSkins.csproj index 94982d729..5f55df29f 100644 --- a/ExtremeSkins/ExtremeSkins.csproj +++ b/ExtremeSkins/ExtremeSkins.csproj @@ -3,7 +3,7 @@ net6.0 latest 7 - 10.0.0.11 + 10.0.0.12 AmongUsv20240618 Extreme Skins for Extreme Roles diff --git a/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj b/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj index ce712697c..bee6dba60 100644 --- a/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj +++ b/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj @@ -4,7 +4,7 @@ net6.0 latest 7 - 2.0.0.73 + 2.0.0.74 Extreme Voice Engine for bridging Extreme Roles and Voice Engine diff --git a/packing.ps1 b/packing.ps1 index 53ac32284..c77879ecb 100644 --- a/packing.ps1 +++ b/packing.ps1 @@ -36,3 +36,4 @@ Copy-Item -Path ExtremeSkins/bin/Release/net6.0/ExtremeSkins.dll -Destination wo Copy-Item -Path ExtremeRoles/bin/Release/net6.0/ExtremeRoles.dll -Destination workspace/dll/ExtremeRoles.dll -Force -Recurse Copy-Item -Path ExtremeSkins/bin/Release/net6.0/ExtremeSkins.dll -Destination workspace/dll/ExtremeSkins.dll -Force -Recurse Copy-Item -Path ExtremeVoiceEngine/bin/Release/net6.0/ExtremeVoiceEngine.dll -Destination workspace/dll/ExtremeVoiceEngine.dll -Force -Recurse +Copy-Item -Path ExtremeRoles.Test/bin/Release/net6.0/ExtremeRoles.Test.dll -Destination workspace/dll/ExtremeRoles.Test.dll -Force -Recurse