Remove redundant servername config options
This commit is contained in:
parent
55ae626131
commit
c803edd8a8
2 changed files with 2 additions and 4 deletions
|
|
@ -132,8 +132,6 @@ namespace TShockAPI
|
||||||
[Description("This will turn on a token requirement for the /status API endpoint.")] public bool
|
[Description("This will turn on a token requirement for the /status API endpoint.")] public bool
|
||||||
EnableTokenEndpointAuthentication;
|
EnableTokenEndpointAuthentication;
|
||||||
|
|
||||||
[Description("This is used when the API endpoint /status is queried.")] public string ServerNickname = "TShock Server";
|
|
||||||
|
|
||||||
[Description("Enable/Disable the rest api.")] public bool RestApiEnabled;
|
[Description("Enable/Disable the rest api.")] public bool RestApiEnabled;
|
||||||
|
|
||||||
[Description("This is the port which the rest api will listen on.")] public int RestApiPort = 7878;
|
[Description("This is the port which the rest api will listen on.")] public int RestApiPort = 7878;
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ namespace TShockAPI
|
||||||
var activeplayers = Main.player.Where(p => null != p && p.active).ToList();
|
var activeplayers = Main.player.Where(p => null != p && p.active).ToList();
|
||||||
return new RestObject()
|
return new RestObject()
|
||||||
{
|
{
|
||||||
{"name", TShock.Config.ServerNickname},
|
{"name", TShock.Config.ServerName},
|
||||||
{"port", Convert.ToString(Netplay.serverPort)},
|
{"port", Convert.ToString(Netplay.serverPort)},
|
||||||
{"playercount", Convert.ToString(activeplayers.Count())},
|
{"playercount", Convert.ToString(activeplayers.Count())},
|
||||||
{"players", string.Join(", ", activeplayers.Select(p => p.name))},
|
{"players", string.Join(", ", activeplayers.Select(p => p.name))},
|
||||||
|
|
@ -140,7 +140,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
var ret = new RestObject()
|
var ret = new RestObject()
|
||||||
{
|
{
|
||||||
{"name", TShock.Config.ServerNickname},
|
{"name", TShock.Config.ServerName},
|
||||||
{"port", TShock.Config.ServerPort},
|
{"port", TShock.Config.ServerPort},
|
||||||
{"playercount", Main.player.Where(p => null != p && p.active).Count()},
|
{"playercount", Main.player.Where(p => null != p && p.active).Count()},
|
||||||
{"maxplayers", TShock.Config.MaxSlots},
|
{"maxplayers", TShock.Config.MaxSlots},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue