public unsafe override void OnApplicationStart() { Config.LoadConfig(); IL2CPP_Class API2 = NET_SDK.SDK.GetClass("VRC.Core", "API"); IL2CPP_Class Amp = NET_SDK.SDK.GetClass("AmplitudeSDKWrapper", "AmplitudeWrapper"); IL2CPP_Class WS = NET_SDK.SDK.GetClass("Transmtn", "WebsocketPipeline"); //Thanks Zoey#9420 for pointing out Websockets var oldhwid = VRC.Core.API.DeviceID; H.Patch(API2.GetProperty("DeviceID").GetGetMethod(), AccessTools.Method(typeof(Main), "DeviceID")); H.Patch(Amp.GetMethod("InitializeDeviceId"), AccessTools.Method(typeof(Main), "DeviceID1")); H.Patch(Amp.GetMethods(x => x.Name == "LogEvent" && x.GetParameterCount() == 4 && NET_SDK.IL2CPP.il2cpp_type_get_name(x.GetParameters()[2].Ptr).Equals("System.Int64")).First(), AccessTools.Method(typeof(Main), "LogEvent")); var original = *(IntPtr *)WS.GetMethod("ProcessPipe").Ptr; HookMethod((IntPtr)(&original), Marshal.GetFunctionPointerForDelegate(new Action <IntPtr, IntPtr>(ProcessPipeFix))); ProcessCall = Marshal.GetDelegateForFunctionPointer <ProcessFix>(original); if (Config.CFG.ConsolePrint) { HVHLogger.Log("Old HWID:"); HVHLogger.Log(oldhwid); HVHLogger.Log("New HWID:"); HVHLogger.Log(VRC.Core.API.DeviceID); } }
public override void OnApplicationStart() { HVHLogger.Init(); Mods.Add(new Modules.QMUI()); Mods.Add(new Modules.FuckPlus()); Mods.Add(new Modules.HWID()); foreach (HVHSystem mod in Mods) { HVHLogger.Log($"{mod.ModName} loaded!"); mod.OnEarlierStart(); } NetworkManagerHooks.OnJoin += NetworkManagerHooks_OnJoin; NetworkManagerHooks.OnLeave += NetworkManagerHooks_OnLeave; }
public override void OnPlayerJoin(Player player) { string playerName = player.gameObject.GetComponent <VRCPlayer>().ToString(); HVHLogger.Log($"{playerName} joined room!"); }