Ejemplo n.º 1
0
        private void localSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            MabiVersion version = (MabiVersion)localSelect.Items[localSelect.SelectedIndex];

            Properties.Settings.Default.Locale = version.ToString();

            patcher = new Patcher(this, version.GetPatchInfo());

            if (patcher.PatchInfo["patch_accept"] != "1")
            {
                MessageBox.Show("Mabinogi is currently offline!");
            }
        }
Ejemplo n.º 2
0
        private void redownloadInFullBtn_Click(object sender, EventArgs e)
        {
            IsPatching = true;
            Task.Factory.StartNew(() =>
            {
                var clean = MessageBox.Show("Would you like to clean the package folder? (If unsure, press Yes)", "Clean?", MessageBoxButtons.YesNo);
                Logger.Info("Redownload in full: User opts to clean package folder: {0}", clean);

                if (clean == System.Windows.Forms.DialogResult.Yes)
                {
                    var files = Directory.GetFiles("package", "*.pack");

                    foreach (var file in files)
                    {
                        Logger.Info("Cleaning {0}", file);

                        try
                        {
                            File.Delete(file);
                        }
                        catch (Exception ex)
                        {
                            Logger.Warning("Unable to delete: {0}", ex.ToString());
                        }
                    }
                }

                try
                {
                    var seq = patcher.FindSequence(bottomVersion: 0, topVersion: Patcher.ReadVersion());
                    patcher.Patch(seq);
                }
                catch (PatchSequenceNotFoundException ex)
                {
                    Logger.Warning(ex.ToString());
                    MessageBox.Show(ex.Message, "Can't find patch", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception exc)
                {
                    Logger.Warning("Cannot redownload in full: {0}", exc.ToString());
                    MessageBox.Show("Failed to redownload in full. (See the log for more details)");
                }

                IsPatching = false;
            });
        }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var ppVers = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Logger.Info("Power Patcher version: {0}", ppVers);
            var mabiVers = Patcher.ReadVersion();

            Logger.Info("Mabinogi version: {0}", mabiVers);
            ppVersionLabel.Text = ppVers.ToString();
            SetClientVersionText(mabiVers);

            localSelect.Items.AddRange(MabiVersion.Versions.ToArray());
            localSelect.SelectedIndex = MabiVersion.Versions.IndexOf(
                MabiVersion.Versions.FirstOrDefault(v => v.ToString() == Properties.Settings.Default.Locale) ??
                MabiVersion.Versions.FirstOrDefault(v => v.Name.StartsWith("North Am")) ?? MabiVersion.Versions.First());

            Task.Factory.StartNew(() => CheckForUpdates());
            Task.Factory.StartNew(() => webBrowser1.Navigate(Properties.Settings.Default.StartupPage));
        }
Ejemplo n.º 4
0
 private void writeCustonVersionBtn_Click(object sender, EventArgs e)
 {
     Patcher.WriteVersion((int)cVersionNumber.Value);
     SetClientVersionText((int)cVersionNumber.Value);
 }
Ejemplo n.º 5
0
        private void startGameBtn_Click(object sender, EventArgs e)
        {
            Logger.Info("Beginning client launch...");

            try
            {
                runCommands(Properties.Settings.Default.PreArgs);

                var args = Properties.Settings.Default.CustomArgs;
                if (string.IsNullOrEmpty(args))
                {
                    args = string.Format("code:1622 ver:{0} logip:{1} logport:11000 {2}", Patcher.ReadVersion(), patcher.PatchInfo["login"], patcher.PatchInfo["arg"]);
                }

                if (Program.CmdArgs.Any(a => a.ToLower().StartsWith("/p")))
                {
                    args += " " + Program.CmdArgs.First(a => a.ToLower().StartsWith("/p"));
                }

                Logger.Info("Starting {0} with the following args: {1}", Properties.Settings.Default.TargetName, args);

                try
                {
                    Process.Start(Properties.Settings.Default.TargetName, args);
                }
                catch (Exception ex)
                {
                    Logger.Error("Cannot start Mabinogi: {0}", ex.ToString());
                    MessageBox.Show("Cannot start Mabinogi: " + ex.Message);

                    throw new IOException();
                }

                runCommands(Properties.Settings.Default.PostArgs);

                Logger.Info("Client start success");

                if (Properties.Settings.Default.CloseAfterStart)
                {
                    Close();
                }
            }
            catch (IOException)
            {
                Logger.Warning("Client start finished with errors");
            }
        }