private void deployServerToMemory() { GameServer_Management DeployConfig = new GameServer_Management(); DeployConfig.DeployGameserver( //Server-based Properties txtServerGivenName.Text, DeploymentValues.SERVER_type, DeploymentValues.SERVER_launch_arguments, false, //Directory-based Properties DeploymentValues.DIR_install_location, DeploymentValues.DIR_executable, DeploymentValues.DIR_config, DeploymentValues.DIR_config_file, //Steam-based Properties DeploymentValues.STEAM_authrequired, DeploymentValues.STEAM_steamcmd_required, DeploymentValues.STEAM_workshop_enabled, //Miscellanious Properties DeploymentValues.ENGINE_type, DeploymentValues.bsm_integration, //Deployment Property false); btnCancelDeployGameserver.Visible = false; btnDeployGameserver.Enabled = true; }
//===================================================================================// // Download Config Data via API into Memory // //===================================================================================// public static void QUERY_DATA(string appID) { GameServer_Management.deployment_server.Clear(); //Clear the deployment server list. GameServer_Management.GameServer DeploymentServer = new GameServer_Management.GameServer(); using (var webClient = new System.Net.WebClient()) { var json = webClient.DownloadString("http://phantom-net.duckdns.org:1337/config/" + appID); GameServer_Management Deploy = new GameServer_Management(); Deploy.addDeploymentServer(JObject.Parse(json)); } }
private void BorealisServerManager_FormClosed(object sender, FormClosedEventArgs e) { //Write data in memory to disk into gameservers.json if (GameServer_Management.server_collection != null) { //Delete existing gameservers.json if (System.IO.File.Exists(Environment.CurrentDirectory + @"\gameservers.json")) { System.IO.File.Delete(Environment.CurrentDirectory + @"\gameservers.json"); } foreach (JObject gameserver in GameServer_Management.server_collection) { GameServer_Management WriteConfigOnClose = new GameServer_Management(); WriteConfigOnClose.DeployGameserver( //Server-based Properties (string)gameserver["SERVER_name_friendly"], (string)gameserver["SERVER_type"], (string)gameserver["SERVER_launch_arguments"], (bool)gameserver["SERVER_running_status"], //Directory-based Properties (string)gameserver["DIR_install_location"], (string)gameserver["DIR_executable"], (string)gameserver["DIR_config"], (string)gameserver["DIR_config_file"], //Steam-based Properties (bool)gameserver["STEAM_authrequired"], (bool)gameserver["STEAM_steamcmd_required"], (bool)gameserver["STEAM_workshop_enabled"], //Miscellanious Properties (string)gameserver["ENGINE_type"], (string)gameserver["bsm_integration"], //Deployment Property true); } } }
//===================================================================================// // 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; }