mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-08 23:19:14 +08:00
Update server status max player
This commit is contained in:
parent
7f10eb8ac4
commit
563cee5c4c
@ -25,6 +25,9 @@ namespace GrasscutterTools.DispatchServer.Model
|
|||||||
[JsonProperty("playerCount")]
|
[JsonProperty("playerCount")]
|
||||||
public int PlayerCount { get; set; }
|
public int PlayerCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("MaxPlayer")]
|
||||||
|
public int MaxPlayer { get; set; } = -1;
|
||||||
|
|
||||||
[JsonProperty("version")]
|
[JsonProperty("version")]
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -1129,6 +1129,9 @@ namespace GrasscutterTools.Forms
|
|||||||
{
|
{
|
||||||
var status = await DispatchServerAPI.QueryServerStatus(TxtHost.Text);
|
var status = await DispatchServerAPI.QueryServerStatus(TxtHost.Text);
|
||||||
LblServerVersion.Text = status.Version;
|
LblServerVersion.Text = status.Version;
|
||||||
|
if (status.MaxPlayer >= 0)
|
||||||
|
LblPlayerCount.Text = $"{status.PlayerCount}/{status.MaxPlayer}";
|
||||||
|
else
|
||||||
LblPlayerCount.Text = status.PlayerCount.ToString();
|
LblPlayerCount.Text = status.PlayerCount.ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user