//public Process Start(string version) //{ // System.Net.ServicePointManager.DefaultConnectionLimit = 256; // var _path = path; // var game = new MinecraftPath(_path); // var launcher = new CMLauncher(game); // launcher.ProgressChanged += Download_Progress; // launcher.FileChanged += Download_ChangeFile; // //var versionMeta = MVersionLoader.GetVersionMetadatas(game); // //var versionLocal = MVersionLoader.GetVersionMetadatasFromLocal(game); // //var findMVersion = versionMeta.GetVersion(version); // //if (findMVersion == null) // { // return null; // } // //var findLVersion = versionLocal.GetVersion(version); // //if (findLVersion == null) // //{ // //MDownloader downloader = new MDownloader(game, findMVersion); // //downloader.ChangeFile += Download_ChangeFile; // //downloader.ChangeProgress += Download_Progress; // //downloader.DownloadAll(); // //} // var launchOption = new MLaunchOption // { // MaximumRamMb = 2048, // Session = se, // Path = game, // //StartVersion = findLVersion, // GameLauncherName = "JML", // GameLauncherVersion = "1.0" // }; // var process = launcher.CreateProcess(launchOption); // process.Start(); // return process; //} //public bool Start(string path, string version, string _ip, int _port, int _ram) //{ // System.Net.ServicePointManager.DefaultConnectionLimit = 256; // ip = _ip; // port = _port; // ram = _ram; // var game = new MinecraftPath(path); // //var launcher = new CMLauncher(game); // //var versionMeta = MVersionLoader.GetVersionMetadatas(game); // //var versionLocal = MVersionLoader.GetVersionMetadatasFromLocal(game); // //var findMVersion = versionMeta.GetVersion(version); // //if (findMVersion == null) // { // return false; // } // //var findLVersion = versionLocal.GetVersion(version); // //if(findLVersion == null) // //{ // // MDownloader downloader = new MDownloader(game, findMVersion); // // downloader.ChangeFile += Download_ChangeFile; // // downloader.ChangeProgress += Download_Progress; // // downloader.DownloadAll(); // //} // var launchOption = new MLaunchOption // { // Path = game, // //StartVersion = findLVersion, // Session = se, // MaximumRamMb = ram, // //ServerIp = ip, // //ServerPort = port, // GameLauncherName = "JML" // }; // //var process = launcher.CreateProcess(version, launchOption); // var launch = new MLaunch(launchOption); // var process = launch.GetProcess(); // return process.Start(); //} private void Download_ChangeFile(DownloadFileChangedEventArgs e) { if (download_file_change != null) { download_file_change(e); } }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { Invoke(new Action(() => { label3.Text = $"{e.FileKind.ToString()} : {e.FileName} ({e.ProgressedFileCount}/{e.TotalFileCount})"; })); }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { Console.WriteLine(String.Format("Now Downloading : {0} - {1} ({2}/{3})", e.FileKind, e.FileName, e.CurrentValue, e.MaxValue)); Invoke((MethodInvoker) delegate { GaddPage.GP.UpdateDownloadString("Now Downloading : " + e.FileKind + "/" + e.FileName + ", " + e.CurrentValue + e.MaxValue); }); }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { // https://github.com/AlphaBs/CmlLib.Core/wiki/Handling-Events#downloadfilechangedeventargs Console.WriteLine("[{0}] ({2}/{3}) {1} ", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount); endTop = Console.CursorTop; }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { Invoke((MethodInvoker) delegate { Lv_Status.Text = e.FileKind.ToString() + " : " + e.FileName; progressBar1.Maximum = e.MaxValue; progressBar1.Value = e.CurrentValue; }); }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { Invoke(new Action(() => { Pb_File.Maximum = e.TotalFileCount; Pb_File.Value = e.ProgressedFileCount; Lv_Status.Text = $"{e.FileKind.ToString()} : {e.FileName} ({e.ProgressedFileCount}/{e.TotalFileCount})"; })); }
private void Forge_FileChanged(DownloadFileChangedEventArgs e) { Invoke(new Action(() => { lbStatus.Text = $"{e.FileKind} - {e.FileName}"; pbProgress.Maximum = e.TotalFileCount; pbProgress.Value = e.ProgressedFileCount; })); }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { Invoke(new Action(() => { progressBar1.Maximum = e.TotalFileCount; progressBar1.Value = e.ProgressedFileCount; Lv_Status.Text = e.FileKind.ToString() + " : " + e.FileName; })); }
public void Download_File_Change(DownloadFileChangedEventArgs e) { int total = e.TotalFileCount; int progress = e.ProgressedFileCount; string name = e.FileName; string msg = $"Download({progress}/{total})... {{{name}}}"; G.InfoLog(msg); }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { if (Thread.CurrentThread.ManagedThreadId != uiThreadId) { Debug.WriteLine(e); } Pb_File.Maximum = e.TotalFileCount; Pb_File.Value = e.ProgressedFileCount; Lv_Status.Text = $"{e.FileKind} : {e.FileName} ({e.ProgressedFileCount}/{e.TotalFileCount})"; //Debug.WriteLine(Lv_Status.Text); }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { if (e.FileKind == MFile.Resource) { if (e.ProgressedFileCount < e.TotalFileCount) { } } else { } }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { // More information about DownloadFileChangedEventArgs // https://github.com/AlphaBs/CmlLib.Core/wiki/Handling-Events#downloadfilechangedeventargs Console.WriteLine("[{0}] {1} - {2}/{3} ", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount); if (e.FileKind == MFile.Resource && string.IsNullOrEmpty(e.FileName)) { Console.SetCursorPosition(0, Console.CursorTop - 1); } nextline = Console.CursorTop; }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { Dispatcher.Invoke(new Action(() => { LaunchLog.Content = string.Format("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount); if (e.FileKind == MFile.Resource) { LaunchProgress.Maximum = e.TotalFileCount; LaunchProgress.Value = e.ProgressedFileCount; } })); }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { if (e.FileKind == MFile.Resource) { Console.WriteLine("[Resource] {0} - {1} / {2}", e.FileName, e.ProgressedFileCount, e.TotalFileCount); if (e.ProgressedFileCount < e.TotalFileCount) { Console.SetCursorPosition(0, Console.CursorTop - 1); } } else { Console.WriteLine("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount); nextline = Console.CursorTop; } }
private void fire(DownloadFileChangedEventArgs e) { FileChanged.Invoke(e); }
private void Downloader_ChangeFile(DownloadFileChangedEventArgs e) { // when the progress of current downloading file was changed // [Library] hi.jar - 3/51 Console.WriteLine("[{0}] {1} - {2}/{3}", e.FileKind.ToString(), e.FileName, e.ProgressedFileCount, e.TotalFileCount); }
private void Launcher_FileChanged(DownloadFileChangedEventArgs e) { }