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