コード例 #1
0
ファイル: Minecraft.cs プロジェクト: rnwkgusasd/MC_Launcher
        //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);
            }
        }
コード例 #2
0
 private void Launcher_FileChanged(DownloadFileChangedEventArgs e)
 {
     Invoke(new Action(() =>
     {
         label3.Text = $"{e.FileKind.ToString()} : {e.FileName} ({e.ProgressedFileCount}/{e.TotalFileCount})";
     }));
 }
コード例 #3
0
 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);
     });
 }
コード例 #4
0
        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;
        }
コード例 #5
0
 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;
     });
 }
コード例 #6
0
 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})";
     }));
 }
コード例 #7
0
ファイル: ForgeInstall.cs プロジェクト: TURX/CmlLib.Core
 private void Forge_FileChanged(DownloadFileChangedEventArgs e)
 {
     Invoke(new Action(() =>
     {
         lbStatus.Text      = $"{e.FileKind} - {e.FileName}";
         pbProgress.Maximum = e.TotalFileCount;
         pbProgress.Value   = e.ProgressedFileCount;
     }));
 }
コード例 #8
0
ファイル: Main.cs プロジェクト: kaiserdj/Techunk-Launcher
 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;
     }));
 }
コード例 #9
0
        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);
        }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: CmlLib/CmlLib.Core
 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);
 }
コード例 #11
0
ファイル: MainCore.cs プロジェクト: maik205/MaiksLauncher
 private void Downloader_ChangeFile(DownloadFileChangedEventArgs e)
 {
     if (e.FileKind == MFile.Resource)
     {
         if (e.ProgressedFileCount < e.TotalFileCount)
         {
         }
     }
     else
     {
     }
 }
コード例 #12
0
        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;
        }
コード例 #13
0
 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;
         }
     }));
 }
コード例 #14
0
ファイル: Program.cs プロジェクト: aleffeh/CmlLib.Core
        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;
            }
        }
コード例 #15
0
ファイル: Techunk.cs プロジェクト: kaiserdj/Techunk-Launcher
 private void fire(DownloadFileChangedEventArgs e)
 {
     FileChanged.Invoke(e);
 }
コード例 #16
0
 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);
 }
コード例 #17
0
 private void Launcher_FileChanged(DownloadFileChangedEventArgs e)
 {
 }