Skip to content

Commit

Permalink
chore: workaround VRCSDK bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Sep 14, 2024
1 parent 7e8c84c commit 3123d9e
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- [#379] Fix CurrentThreadIsMainThread assertion in AsyncProfiler
- [#386]
Workaround [VRCSDK bug](https://feedback.vrchat.com/sdk-bug-reports/p/string-conversion-errors-from-runtimeassemblygetcodebase-with-japanese-locale-an)
caused by non-ASCII project paths.

### Changed

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal sealed class PatchLoader
{
HandleUtilityPatches.Patch_FilterInstanceIDs,
PickingObjectPatch.Patch,
VRCSDKBug_AssemblyGetNameExceptionHandling.Patch
//HierarchyViewPatches.Patch
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions Editor/Harmony/VRCSDKBug_AssemblyGetNameExceptionHandling.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HarmonyLib;

namespace nadena.dev.ndmf.preview
{
internal static class VRCSDKBug_AssemblyGetNameExceptionHandling
{
internal static void Patch(Harmony h)
{
var t_Tools = AccessTools.TypeByName("VRC.Tools");
var p_HasTypeVRCApplication = AccessTools.Property(t_Tools, "HasTypeVRCApplication");

h.Patch(p_HasTypeVRCApplication.GetMethod,
new HarmonyMethod(typeof(VRCSDKBug_AssemblyGetNameExceptionHandling), nameof(AlwaysFalse)));
}

private static bool AlwaysFalse(ref bool __result)
{
__result = false;

return false;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3123d9e

Please sign in to comment.