public override Loader_Error LaunchClient(string client) { string dll = Path.Combine(Config.GetInstallDirectory(), "Crypt.dll"); uint pid = 0; Loader_Error err = (Loader_Error)Load(client, dll, "OnAttach", null, 0, out pid); if (err == Loader_Error.SUCCESS) { try { ClientProc = Process.GetProcessById((int)pid); } catch { // ignore } } if (ClientProc == null) { return(Loader_Error.UNKNOWN_ERROR); } else { return(err); } }
public override Loader_Error LaunchClient(string client) { /*string dir = Directory.GetCurrentDirectory(); * Directory.SetCurrentDirectory( Path.GetDirectoryName( client ) ); * Directory.SetCurrentDirectory( dir ); * * try * { * ProcessStartInfo psi = new ProcessStartInfo( client ); * psi.WorkingDirectory = Path.GetDirectoryName( client ); * * ClientProc = Process.Start( psi ); * * if ( ClientProc != null && !Config.GetBool( "SmartCPU" ) ) * ClientProc.PriorityClass = (ProcessPriorityClass)Enum.Parse( typeof(ProcessPriorityClass), Config.GetString( "ClientPrio" ), true ); * } * catch * { * }*/ string dll = Path.Combine(Config.GetInstallDirectory(), "Crypt.dll"); uint pid = 0; Loader_Error err = (Loader_Error)Load(client, dll, "OnAttach", null, 0, out pid); if (err == Loader_Error.SUCCESS) { try { ClientProc = Process.GetProcessById((int)pid); /*if ( ClientProc != null && !Config.GetBool( "SmartCPU" ) ) * ClientProc.PriorityClass = (ProcessPriorityClass)Enum.Parse( typeof(ProcessPriorityClass), Config.GetString( "ClientPrio" ), true );*/ } catch { } } if (ClientProc == null) { return(Loader_Error.UNKNOWN_ERROR); } else { return(err); } }
public override Loader_Error LaunchClient(string client) { string dll = Path.Combine(Assistant.Engine.RootPath, "Crypt.dll"); uint pid; Loader_Error err = (Loader_Error)DLLImport.Razor.Load(client, dll, "OnAttach", null, 0, out pid); if (err == Loader_Error.SUCCESS) { try { ClientProc = Process.GetProcessById((int)pid); if (ClientProc != null && !RazorEnhanced.Settings.General.ReadBool("SmartCPU")) { ClientProc.PriorityClass = (ProcessPriorityClass)Enum.Parse(typeof(ProcessPriorityClass), RazorEnhanced.Settings.General.ReadString("ClientPrio"), true); } } catch { } } return(ClientProc == null ? Loader_Error.UNKNOWN_ERROR : err); }