//===================================================================================// // Download | Extract | First-Run SteamCMD // //===================================================================================// public static void DownloadSteamCMD() { TAB_DEPLOYMENT ServerDeploymentDelegate = new TAB_DEPLOYMENT(); if (System.IO.File.Exists(Environment.CurrentDirectory + @"\steamcmd.exe") == false) { //Create server directory for SteamCMD System.IO.FileInfo file = new System.IO.FileInfo(Environment.CurrentDirectory); file.Directory.Create(); //Download SteamCMD.zip to Borealis directory using (System.Net.WebClient client = new System.Net.WebClient()) { client.DownloadFile(new Uri("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip"), Environment.CurrentDirectory + @"\SteamCMD.zip"); } //Extract SteamCMD.zip to server directory ZipFile.ExtractToDirectory(Environment.CurrentDirectory + @"\SteamCMD.zip", Environment.CurrentDirectory); //Delete old zip file. System.IO.File.Delete(Environment.CurrentDirectory + @"\SteamCMD.zip"); } }
//===================================================================================// // STARTUP: // //===================================================================================// public void BorealisServerManager_Load(object sender, EventArgs e) { //Create blank gameservers.json if (System.IO.File.Exists(Environment.CurrentDirectory + @"\gameservers.json") == false) { File.Create(Environment.CurrentDirectory + @"\gameservers.json").Dispose(); } //Destroy the bevelled border around MDI parent container. this.SetBevel(false); MdiClient ctlMDI; // Loop through all of the form's controls looking // for the control of type MdiClient. foreach (System.Windows.Forms.Control ctl in this.Controls) { try { // Attempt to cast the control to type MdiClient. ctlMDI = (MdiClient)ctl; // Set the BackColor of the MdiClient control. ctlMDI.BackColor = this.BackColor; } catch (InvalidCastException exc) { // Catch and ignore the error if casting failed. } } //Display current product version. lblVersion.Text = "Version " + Application.ProductVersion + " Alpha"; //Store all gameservers into memory to be used by Borealis. GameServer_Management PullConfig = new GameServer_Management(); PullConfig.addAllServers_fromConfig(); //Instanciate all Panels Immediately //TAB INDEX 0 TAB_DEPLOYMENT ChildInstance_Deployment = new TAB_DEPLOYMENT(); ChildInstance_Deployment.MdiParent = this; ChildInstance_Deployment.AutoScroll = false; ChildInstance_Deployment.Dock = DockStyle.Fill; ChildInstance_Deployment.Show(); //TAB INDEX 1 TAB_Management ChildInstance_Management = new TAB_Management(); ChildInstance_Management.MdiParent = this; ChildInstance_Management.AutoScroll = false; ChildInstance_Management.Dock = DockStyle.Fill; ChildInstance_Management.Show(); //TAB INDEX 2 TAB_CONTROL ChildInstance_Control = new TAB_CONTROL(); ChildInstance_Control.MdiParent = this; ChildInstance_Control.AutoScroll = false; ChildInstance_Control.Dock = DockStyle.Fill; ChildInstance_Control.Show(); //TAB INDEX 3 TAB_ABOUT ChildInstance_Attribution = new TAB_ABOUT(); ChildInstance_Attribution.MdiParent = this; ChildInstance_Attribution.AutoScroll = false; ChildInstance_Attribution.Dock = DockStyle.Fill; ChildInstance_Attribution.Show(); //TAB INDEX 4 TAB_SCHEDULEDTASKS ChildInstance_ScheduledTasks = new TAB_SCHEDULEDTASKS(); ChildInstance_ScheduledTasks.MdiParent = this; ChildInstance_ScheduledTasks.AutoScroll = false; ChildInstance_ScheduledTasks.Dock = DockStyle.Fill; ChildInstance_ScheduledTasks.Show(); //TAB INDEX 5 TAB_DASHBOARD ChildInstance_Dashboard = new TAB_DASHBOARD(); ChildInstance_Dashboard.MdiParent = this; ChildInstance_Dashboard.AutoScroll = false; ChildInstance_Dashboard.Dock = DockStyle.Fill; ChildInstance_Dashboard.Show(); MDI_CURTAINHIDER.Visible = false; }