Exemple #1
0
        public void saveGame(object sender, EventArgs e)
        {
            if (saveEnabled && simRunning)
            {
                if (canSaveWhilePaused || (!canSaveWhilePaused && !simPaused))
                {
                    if (!canSaveWhileGround && onGround)
                    {
                        return;
                    }

                    string time = DateTime.Now.ToString();
                    try
                    {
                        p3d.FlightSave("save-" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second, "AutoSave " + DateTime.Now.DayOfWeek.ToString() + " " + (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + " (saved by P3DAutosave)", "P3DAutoSave autosaved flight", 0);
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show("AutoSave failed. See console for more information.");
                        Console.WriteLine(exception.StackTrace);
                    }
                    Console.WriteLine("Saved at " + time);
                }
            }
        }