public static void Init() { MessageBoxPatch.Replace("tp9+kFO7LOSD0AZ5zUBHrA==", Resources.Disclaimer); var factory = new ChannelFactory <ILauncherService>(new NetNamedPipeBinding(), "net.pipe://localhost/LauncherService"); LauncherService = factory.CreateChannel(); ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService")); host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(), ""); host.Open(); LauncherService.SendInjectorSettings(); var harmony = HarmonyInstance.Create("me.failedshack.usbhelperinjector"); var assembly = Assembly.GetExecutingAssembly(); assembly.GetTypes() .Where(type => VersionSpecific.Applies(type, HelperVersion) && !(Overrides.DisableOptionalPatches && Optional.IsOptional(type))) .Do(type => { var parentMethodInfos = type.GetHarmonyMethods(); if (parentMethodInfos != null && parentMethodInfos.Count() > 0) { var info = HarmonyMethod.Merge(parentMethodInfos); var processor = new PatchProcessor(harmony, type, info); processor.Patch(); } }); }
public static void Init() { var args = Environment.GetCommandLineArgs(); var ipcType = (IPCType)Enum.Parse(typeof(IPCType), args[2]); var launcherUri = args[3]; IPCUtil.CreateService( ipcType, typeof(InjectorService), typeof(IInjectorService), out var serviceUri ); LauncherService = IPCUtil.CreateChannel <ILauncherService>(ipcType, launcherUri); LauncherService.SendInjectorSettings(serviceUri); Harmony = new Harmony("me.failedshack.usbhelperinjector"); var assembly = Assembly.GetExecutingAssembly(); assembly.GetTypes() .Where(type => VersionSpecific.Applies(type, HelperVersion) && !(Overrides.DisableOptionalPatches && Optional.IsOptional(type)) && (!WineOnly.IsWineOnly(type) || WineCompat) ) .Do(type => Harmony.CreateClassProcessor(type).Patch()); if (WineCompat) { RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; } }
public static void Init() { MessageBoxPatch.Replace("tp9+kFO7LOSD0AZ5zUBHrA==", Resources.Disclaimer); var factory = new ChannelFactory <ILauncherService>(new NetNamedPipeBinding(), "net.pipe://localhost/LauncherService"); LauncherService = factory.CreateChannel(); ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService")); host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(), ""); host.Open(); Task.Run(async() => await LauncherService.SendInjectorSettings()); }
public static void Init() { var factory = new ChannelFactory <ILauncherService>(new NetNamedPipeBinding(), "net.pipe://localhost/LauncherService"); LauncherService = factory.CreateChannel(); ServiceHost host = new ServiceHost(typeof(InjectorService), new Uri("net.pipe://localhost/InjectorService")); host.AddServiceEndpoint(typeof(IInjectorService), new NetNamedPipeBinding(), ""); host.Open(); LauncherService.SendInjectorSettings(); Harmony = new Harmony("me.failedshack.usbhelperinjector"); var assembly = Assembly.GetExecutingAssembly(); assembly.GetTypes() .Where(type => VersionSpecific.Applies(type, HelperVersion) && !(Overrides.DisableOptionalPatches && Optional.IsOptional(type))) .Do(type => Harmony.CreateClassProcessor(type).Patch()); }
public static void Init() { var args = Environment.GetCommandLineArgs(); var ipcType = (IPCType)Enum.Parse(typeof(IPCType), args[2]); var launcherUri = args[3]; IPCUtil.CreateService( ipcType, typeof(InjectorService), typeof(IInjectorService), out var serviceUri ); LauncherService = IPCUtil.CreateChannel <ILauncherService>(ipcType, launcherUri); LauncherService.SendInjectorSettings(serviceUri); Harmony = new Harmony("me.failedshack.usbhelperinjector"); var assembly = Assembly.GetExecutingAssembly(); assembly.GetTypes() .Where(type => VersionSpecific.Applies(type, HelperVersion) && !(Overrides.DisableOptionalPatches && Optional.IsOptional(type)) && (!WineOnly.IsWineOnly(type) || WineCompat) ) .Do(type => Harmony.CreateClassProcessor(type).Patch()); if (WineCompat) { RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; } NusGrabberFormPatch.Shown += (form, e) => { FF player = null; var button = new OnOffButton() { OnImage = Resources.AudioOn, OffImage = Resources.AudioOff, State = PlayMusic }; button.StateChanged += (sender, e1) => { // avoid preloading ffplay // TODO: make this not so hackish if (player == null) { if (!button.State) { return; } player = FF.Play("-loop 0 -nodisp loop.ogg"); } player.Pause = !button.State; LauncherService.SetPlayMusic(button.State); }; var toolWindow = ((Form)form).Controls.Find("toolWindow5", true)[0]; toolWindow.Controls.Add(button); button.BringToFront(); }; }