diff --git a/TGCommandLine/AdminCommands.cs b/TGCommandLine/AdminCommands.cs index b50ef3201f..b5c1ce91b7 100644 --- a/TGCommandLine/AdminCommands.cs +++ b/TGCommandLine/AdminCommands.cs @@ -10,7 +10,7 @@ namespace TGCommandLine public AdminCommand() { Keyword = "admin"; - Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminViewPortCommand(), new AdminSetPortCommand(), new AdminMoveServerCommand(), new AdminRecreateStaticCommand() }; + Children = new Command[] { new AdminViewGroupCommand(), new AdminSetGroupCommand(), new AdminClearGroupCommand(), new AdminRecreateStaticCommand() }; } public override string GetHelpText() { @@ -18,31 +18,6 @@ namespace TGCommandLine } } - class AdminMoveServerCommand : Command - { - public AdminMoveServerCommand() - { - Keyword = "move-server"; - RequiredParameters = 1; - } - - protected override ExitCode Run(IList parameters) - { - var res = Interface.GetComponent().MoveServer(parameters[0]); - OutputProc(res ?? "Success"); - return res == null ? ExitCode.Normal : ExitCode.ServerError; - } - - public override string GetArgumentString() - { - return ""; - } - - public override string GetHelpText() - { - return "Move the server installation (BYOND, Repo, Game) to a new location. Nothing else may be running for this task to complete"; - } - } class AdminRecreateStaticCommand : Command { public AdminRecreateStaticCommand() @@ -63,59 +38,6 @@ namespace TGCommandLine } } - class AdminSetPortCommand : Command - { - public AdminSetPortCommand() - { - Keyword = "set-port"; - RequiredParameters = 1; - } - public override string GetHelpText() - { - return "Set the port used for remote access. Requires a service restart to take effect"; - } - - public override string GetArgumentString() - { - return ""; - } - - protected override ExitCode Run(IList parameters) - { - ushort port; - try - { - port = Convert.ToUInt16(parameters[0]); - } - catch - { - OutputProc("Invalid port number!"); - return ExitCode.BadCommand; - } - var res = Interface.GetComponent().SetRemoteAccessPort(port); - OutputProc(res ?? "Success!"); - return ExitCode.Normal; - } - } - - class AdminViewPortCommand : Command { - public AdminViewPortCommand() - { - Keyword = "view-port"; - } - public override string GetHelpText() - { - return "Print the port currently designated for remote access"; - } - - protected override ExitCode Run(IList parameters) - { - var port = Interface.GetComponent().RemoteAccessPort(); - OutputProc(String.Format("{0}", port)); - return ExitCode.Normal; - } - } - class AdminViewGroupCommand : Command { public AdminViewGroupCommand() diff --git a/TGControlPanel/Main.Designer.cs b/TGControlPanel/Main.Designer.cs index 3f787f03be..75c871a157 100644 --- a/TGControlPanel/Main.Designer.cs +++ b/TGControlPanel/Main.Designer.cs @@ -78,8 +78,6 @@ this.WebclientCheckBox = new System.Windows.Forms.CheckBox(); this.WorldAnnounceButton = new System.Windows.Forms.Button(); this.WorldAnnounceField = new System.Windows.Forms.TextBox(); - this.ServerPathTextbox = new System.Windows.Forms.TextBox(); - this.projectNameText = new System.Windows.Forms.TextBox(); this.WorldAnnounceLabel = new System.Windows.Forms.Label(); this.SecuritySelector = new System.Windows.Forms.ComboBox(); this.SecurityTitle = new System.Windows.Forms.Label(); @@ -158,6 +156,7 @@ this.StaticFileCreateButton = new System.Windows.Forms.Button(); this.label6 = new System.Windows.Forms.Label(); this.StaticFileListBox = new System.Windows.Forms.ListBox(); + this.projectNameText = new System.Windows.Forms.TextBox(); this.ChatPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ChatPortSelector)).BeginInit(); this.ChatProviderSelectorPanel.SuspendLayout(); @@ -643,7 +642,6 @@ this.ServerPanel.Controls.Add(this.WebclientCheckBox); this.ServerPanel.Controls.Add(this.WorldAnnounceButton); this.ServerPanel.Controls.Add(this.WorldAnnounceField); - this.ServerPanel.Controls.Add(this.ServerPathTextbox); this.ServerPanel.Controls.Add(this.projectNameText); this.ServerPanel.Controls.Add(this.WorldAnnounceLabel); this.ServerPanel.Controls.Add(this.SecuritySelector); @@ -790,22 +788,6 @@ this.WorldAnnounceField.Size = new System.Drawing.Size(213, 20); this.WorldAnnounceField.TabIndex = 40; // - // ServerPathTextbox - // - this.ServerPathTextbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ServerPathTextbox.Location = new System.Drawing.Point(136, 163); - this.ServerPathTextbox.Name = "ServerPathTextbox"; - this.ServerPathTextbox.Size = new System.Drawing.Size(296, 20); - this.ServerPathTextbox.TabIndex = 32; - // - // projectNameText - // - this.projectNameText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.projectNameText.Location = new System.Drawing.Point(566, 163); - this.projectNameText.Name = "projectNameText"; - this.projectNameText.Size = new System.Drawing.Size(296, 20); - this.projectNameText.TabIndex = 29; - // // WorldAnnounceLabel // this.WorldAnnounceLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1799,6 +1781,14 @@ this.StaticFileListBox.TabIndex = 0; this.StaticFileListBox.SelectedIndexChanged += new System.EventHandler(this.StaticFileListBox_SelectedIndexChanged); // + // projectNameText + // + this.projectNameText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.projectNameText.Location = new System.Drawing.Point(566, 163); + this.projectNameText.Name = "projectNameText"; + this.projectNameText.Size = new System.Drawing.Size(296, 20); + this.projectNameText.TabIndex = 29; + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1882,8 +1872,6 @@ private System.Windows.Forms.CheckBox WebclientCheckBox; private System.Windows.Forms.Button WorldAnnounceButton; private System.Windows.Forms.TextBox WorldAnnounceField; - private System.Windows.Forms.TextBox ServerPathTextbox; - private System.Windows.Forms.TextBox projectNameText; private System.Windows.Forms.Label WorldAnnounceLabel; private System.Windows.Forms.ComboBox SecuritySelector; private System.Windows.Forms.Label SecurityTitle; @@ -1966,5 +1954,6 @@ private System.Windows.Forms.NumericUpDown AutoUpdateInterval; private System.Windows.Forms.CheckBox AutoUpdateCheckbox; private System.Windows.Forms.Label AutoUpdateMLabel; + private System.Windows.Forms.TextBox projectNameText; } } diff --git a/TGControlPanel/ServerPage.cs b/TGControlPanel/ServerPage.cs index 75f7b63ce4..9490650679 100644 --- a/TGControlPanel/ServerPage.cs +++ b/TGControlPanel/ServerPage.cs @@ -25,14 +25,7 @@ namespace TGControlPanel void InitServerPage() { LoadServerPage(); - if (!Interface.AuthenticateAdmin()) - { - ServerPathTextbox.Enabled = false; - ServerPathTextbox.ReadOnly = true; - } FullUpdateWorker.RunWorkerCompleted += FullUpdateWorker_RunWorkerCompleted; - ServerPathTextbox.LostFocus += ServerPathTextbox_LostFocus; - ServerPathTextbox.KeyDown += ServerPathTextbox_KeyDown; projectNameText.LostFocus += ProjectNameText_LostFocus; projectNameText.KeyDown += ProjectNameText_KeyDown; ServerStartBGW.RunWorkerCompleted += ServerStartBGW_RunWorkerCompleted; @@ -51,12 +44,6 @@ namespace TGControlPanel UpdateProjectName(); } - private void ServerPathTextbox_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - UpdateServerPath(); - } - private void FullUpdateWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (updateError != null) @@ -76,34 +63,6 @@ namespace TGControlPanel LoadServerPage(); } - private void ServerPathTextbox_LostFocus(object sender, EventArgs e) - { - UpdateServerPath(); - } - - void UpdateServerPath() - { - if (!Program.CheckAdminWithWarning()) - { - ServerPathTextbox.Enabled = false; - ServerPathTextbox.ReadOnly = true; - return; - } - if (updatingFields || ServerPathTextbox.Text.Trim() == Interface.GetComponent().ServerDirectory()) - return; - var DialogResult = MessageBox.Show("This will move the entire server installation.", "Confim", MessageBoxButtons.YesNo); - if (DialogResult != DialogResult.Yes) - return; - - if (!Program.CheckAdminWithWarning()) - { - ServerPathTextbox.Enabled = false; - ServerPathTextbox.ReadOnly = true; - return; - } - MessageBox.Show(Interface.GetComponent().MoveServer(ServerPathTextbox.Text) ?? "Success!"); - } - void LoadServerPage() { var RepoExists = Interface.GetComponent().Exists(); @@ -146,9 +105,8 @@ namespace TGControlPanel try { updatingFields = true; - - if (!ServerPathTextbox.Focused) - ServerPathTextbox.Text = Config.ServerDirectory(); + + ServerPathLabel.Text = "Server Path: " + Config.ServerDirectory(); SecuritySelector.SelectedIndex = (int)DD.SecurityLevel();