Fix UseServerName config options, to now work properly. Remove duplicate unused code. Ensure that everywhere we use Main.WorldName, we are sending the config server name.

This commit is contained in:
Zack Piispanen 2015-04-09 22:58:32 -04:00
parent 5f77f21e03
commit 904c44a1b6
5 changed files with 15 additions and 81 deletions

View file

@ -333,7 +333,7 @@ namespace TShockAPI
{"port", TShock.Config.ServerPort},
{"playercount", Main.player.Where(p => null != p && p.active).Count()},
{"maxplayers", TShock.Config.MaxSlots},
{"world", Main.worldName},
{"world", (TShock.Config.UseServerName ? TShock.Config.ServerName : Main.worldName)},
{"uptime", (DateTime.Now - System.Diagnostics.Process.GetCurrentProcess().StartTime).ToString(@"d'.'hh':'mm':'ss")},
{"serverpassword", !string.IsNullOrEmpty(TShock.Config.ServerPassword)}
};
@ -707,7 +707,7 @@ namespace TShockAPI
{
return new RestObject()
{
{"name", Main.worldName},
{"name", (TShock.Config.UseServerName ? TShock.Config.ServerName : Main.worldName)},
{"size", Main.maxTilesX + "*" + Main.maxTilesY},
{"time", Main.time},
{"daytime", Main.dayTime},