This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to support latest VRChat, Small Futureproof
- Loading branch information
Showing
8 changed files
with
164 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30225.117 | ||
VisualStudioVersion = 16.0.31229.75 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SafetyPresets", "SafetyPresets\SafetyPresets.csproj", "{D79864E5-CA35-47D2-95DB-F2AB7359B12F}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SafetyPresets", "SafetyPresets/SafetyPresets.csproj", "{CB6EBC58-FDB1-40EF-8784-0A1497FB9437}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D79864E5-CA35-47D2-95DB-F2AB7359B12F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D79864E5-CA35-47D2-95DB-F2AB7359B12F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D79864E5-CA35-47D2-95DB-F2AB7359B12F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D79864E5-CA35-47D2-95DB-F2AB7359B12F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{CB6EBC58-FDB1-40EF-8784-0A1497FB9437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{CB6EBC58-FDB1-40EF-8784-0A1497FB9437}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{CB6EBC58-FDB1-40EF-8784-0A1497FB9437}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{CB6EBC58-FDB1-40EF-8784-0A1497FB9437}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {335A34DB-595F-4195-9684-378005CFAC12} | ||
SolutionGuid = {2A31B023-5C50-47F8-AD78-9AE40890973E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Reflection; | ||
using UnhollowerRuntimeLib.XrefScans; | ||
|
||
namespace SafetyPresets | ||
{ | ||
class SafetyXref | ||
{ | ||
// Yoinked with love from https://github.com/BenjaminZehowlt/DynamicBonesSafety/blob/master/DynamicBonesSafetyMod.cs | ||
// or well, the current alternative https://github.com/loukylor/VRC-Mods/blob/main/PlayerList/Utilities/Xref.cs | ||
|
||
public static bool CheckMethod(MethodInfo method, string match) | ||
{ | ||
try | ||
{ | ||
return XrefScanner.XrefScan(method) | ||
.Where(instance => instance.Type == XrefType.Global && instance.ReadAsObject().ToString().Contains(match)).Any(); | ||
} | ||
catch { } | ||
return false; | ||
} | ||
public static bool CheckUsed(MethodInfo method, string methodName) | ||
{ | ||
try | ||
{ | ||
return XrefScanner.UsedBy(method) | ||
.Where(instance => instance.TryResolve() != null && instance.TryResolve().Name.Contains(methodName)).Any(); | ||
} | ||
catch { } | ||
return false; | ||
} | ||
public static bool CheckUsing(MethodInfo method, string match, Type type) | ||
{ | ||
foreach (XrefInstance instance in XrefScanner.XrefScan(method)) | ||
if (instance.Type == XrefType.Method) | ||
try | ||
{ | ||
if (instance.TryResolve().DeclaringType == type && instance.TryResolve().Name.Contains(match)) | ||
return true; | ||
} | ||
catch | ||
{ | ||
|
||
} | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" /> | ||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net472" /> | ||
</packages> |