Exemple #1
0
        void DoGen(string name, string args)
        {
            mapgen = true;
            try {
                Command.Find("NewLvl").Use(Player.Console, args);
            } catch (Exception ex) {
                Logger.LogError(ex);
                Popup.Error("Failed to generate level. Check error logs for details.");
                mapgen = false;
                return;
            }

            if (LevelInfo.MapExists(name))
            {
                Popup.Message("Level successfully generated.");
                RunOnUI_Async(() => {
                    Map_UpdateUnloadedList();
                    Map_UpdateLoadedList();
                    Main_UpdateMapList();
                });
            }
            else
            {
                Popup.Error("Level was not generated. Check main log for details.");
            }
            mapgen = false;
        }
Exemple #2
0
 void sql_linkDownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try {
         System.Diagnostics.Process.Start("http://dev.mysql.com/downloads/");
     } catch {
         Popup.Error("Failed to open link!");
     }
 }
Exemple #3
0
 public static void OpenBrowser(string url)
 {
     try {
         Process.Start(url);
     } catch (Exception ex) {
         Logger.LogError("Opening url in browser", ex);
         Popup.Error("Failed to open " + url);
     }
 }
Exemple #4
0
 static void RunGUI()
 {
     if (!File.Exists("MCGalaxy_.dll"))
     {
         Popup.Error("Cannot start server as MCGalaxy_.dll is missing\r\n" +
                     "Download it from https://github.com/Hetal728/MCGalaxy/tree/master/Uploads");
         return;
     }
     // separate method, in case MCGalaxy_.dll is missing
     StartGUI();
 }
Exemple #5
0
 static void RunGUI()
 {
     if (!File.Exists("MCGalaxy_.dll"))
     {
         Popup.Error("Cannot start server as MCGalaxy_.dll is missing from " + Environment.CurrentDirectory
                     + "\r\nDownload it from " + Updater.UploadsURL);
         return;
     }
     // separate method, in case MCGalaxy_.dll is missing
     StartGUI();
 }
Exemple #6
0
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (!File.Exists("MCGalaxy_.dll"))
            {
                Popup.Error("Cannot start server as MCGalaxy_.dll is missing from " + Environment.CurrentDirectory
                            + "\r\nDownload it from " + Updater.UploadsURL);
                return;
            }
            // separate method, in case MCGalaxy_.dll is missing
            StartGUI();
        }
Exemple #7
0
        public static void Main(string[] args)
        {
            SetCurrentDirectory();

            // separate method, in case MCGalaxy_.dll is missing
            try {
                StartGUI();
            } catch (FileNotFoundException) {
                // If MCGalaxy_.dll is missing, a FileNotFoundException will get thrown for MCGalaxy dll
                Popup.Error("Cannot start server as MCGalaxy_.dll is missing from " + Environment.CurrentDirectory
                            + "\n\nDownload it from " + Updater.UploadsURL);
                return;
            }
        }
Exemple #8
0
        void logs_dateGeneral_Changed(object sender, EventArgs e)
        {
            string date = logs_dateGeneral.Value.ToString("yyyy-MM-dd");
            string path = Path.Combine("logs", date + ".txt");

            try {
                logs_txtGeneral.Text = File.ReadAllText(path);
            } catch (FileNotFoundException) {
                logs_txtGeneral.Text = "No logs found for: " + date;
            } catch (Exception ex) {
                logs_txtGeneral.Text = null;

                Logger.LogError("Opening " + path, ex);
                Popup.Error("Failed to open logfile " + path);
            }
        }