Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yukieiji committed Sep 1, 2024
2 parents 41f5630 + 1009731 commit 792fa44
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 22 deletions.
18 changes: 18 additions & 0 deletions ExtremeRoles.Test/ExtremeRolesTestPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ public override void Load()
if (assembly is null) { return; }
Il2CppRegisterAttribute.Registration(assembly);
}

public static void RunReleaseTest()
{
try
{
TestRunnerBase.Run<AllAssetLoadRunner>();
TestRunnerBase.Run<TranslationTestRunner>();
TestRunnerBase.Run<OptionRunner>();
}
catch(System.Exception ex)
{
Instance.Log.LogError(ex);
}
}
}

[HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))]
Expand All @@ -40,7 +54,11 @@ public static void Prefix(ChatController __instance)
{

GameUtility.ChangePresetTo(19);
#if RELEASE
ExtremeRolesTestPlugin.RunReleaseTest();
#else
TestRunnerBase.Run<TranslationTestRunner>();
#endif
}
}
}
6 changes: 5 additions & 1 deletion ExtremeRoles.Test/OptionRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
18 changes: 18 additions & 0 deletions ExtremeRoles.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ExtremeRoles/ExtremeRoles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<WarningLevel>7</WarningLevel>
<!--<Version>11.1.1.0</Version>-->
<VersionPrefix>12.0.0</VersionPrefix>
<Version>12.0.0.1</Version>
<!--<VersionPrefix>12.0.0</VersionPrefix>-->
<VersionSuffix>Invitation-AmongUsV2024813</VersionSuffix>
<Description>Extreme Roles for Advanced user</Description>
<Authors>yukieiji</Authors>
Expand Down
5 changes: 5 additions & 0 deletions ExtremeRoles/Module/ApiServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
40 changes: 23 additions & 17 deletions ExtremeRoles/Resources/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,33 +312,39 @@ private static T loadObjectFromAsset<T>(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<byte> byteArray)
Expand Down
2 changes: 1 addition & 1 deletion ExtremeSkins/ExtremeSkins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<WarningLevel>7</WarningLevel>
<Version>10.0.0.11</Version>
<Version>10.0.0.12</Version>
<!--<VersionPrefix>10.0.0</VersionPrefix>-->
<VersionSuffix>AmongUsv20240618</VersionSuffix>
<Description>Extreme Skins for Extreme Roles</Description>
Expand Down
2 changes: 1 addition & 1 deletion ExtremeVoiceEngine/ExtremeVoiceEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<WarningLevel>7</WarningLevel>
<Version>2.0.0.73</Version>
<Version>2.0.0.74</Version>
<!--<VersionPrefix>2.0.0</VersionPrefix>-->
<!--<VersionSuffix>AmongUsV20230711</VersionSuffix>-->
<Description>Extreme Voice Engine for bridging Extreme Roles and Voice Engine</Description>
Expand Down
1 change: 1 addition & 0 deletions packing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 792fa44

Please sign in to comment.