mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Separate server status checking logic
This commit is contained in:
parent
2f2c8e24b0
commit
ba25cd6e7c
@ -945,11 +945,18 @@ namespace GrasscutterTools
|
|||||||
var btn = sender as Button;
|
var btn = sender as Button;
|
||||||
btn.Enabled = false;
|
btn.Enabled = false;
|
||||||
btn.Cursor = Cursors.WaitCursor;
|
btn.Cursor = Cursors.WaitCursor;
|
||||||
|
try
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var status = await DispatchServerAPI.QueryServerStatus(TxtHost.Text);
|
var status = await DispatchServerAPI.QueryServerStatus(TxtHost.Text);
|
||||||
LblServerVersion.Text = status.Version;
|
LblServerVersion.Text = status.Version;
|
||||||
LblPlayerCount.Text = status.PlayerCount.ToString();
|
LblPlayerCount.Text = status.PlayerCount.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("查询服务端状态失败:" + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
OC = new OpenCommandAPI(TxtHost.Text);
|
OC = new OpenCommandAPI(TxtHost.Text);
|
||||||
if (await OC.Ping())
|
if (await OC.Ping())
|
||||||
|
Loading…
Reference in New Issue
Block a user