Fixes to locked logging IDs and Control Panel

This commit is contained in:
Cyberboss
2017-11-01 18:37:34 -04:00
parent eace72f747
commit 14a374a6e9
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -27,8 +27,9 @@ namespace TGControlPanel
/// <param name="I">The <see cref="TGServiceInterface.Interface"/> for the <see cref="ControlPanel"/></param>
public ControlPanel(Interface I)
{
Interface = I;
InitializeComponent();
Interface = I;
Text += " Instance: " + I.InstanceName;
if (Interface.VersionMismatch(out string error) && MessageBox.Show(error, "Warning", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
Close();
+1 -2
View File
@@ -95,8 +95,7 @@ namespace TGControlPanel
/// <param name="instanceName">The name of the <see cref="TGServiceInterface.Components.ITGInstance"/> to connect to</param>
async void TryConnectToInstance(string instanceName)
{
var activeCP = ControlPanel.InstancesInUse[instanceName];
if(activeCP != null)
if(ControlPanel.InstancesInUse.TryGetValue(instanceName, out ControlPanel activeCP))
{
activeCP.BringToFront();
return;
+2
View File
@@ -391,6 +391,7 @@ namespace TGServerService
var instance = (ServerInstance)host.SingletonInstance;
host.Close();
instance.Dispose();
UnlockLoggingID(instance.LoggingID);
}
}
catch (Exception e)
@@ -615,6 +616,7 @@ namespace TGServerService
path = inst.ServerDirectory();
inst.Offline();
inst.Dispose();
UnlockLoggingID(inst.LoggingID);
return null;
}
}