diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index a73fb0d1..9ed1bd7e 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -83,7 +83,8 @@ namespace TShockAPI [Description("Not implemented")] public string RconPassword = ""; [Description("Not implemented")] public int RconPort = 7777; - [Description("Used when replying to a rest /status request.")] public string ServerName = ""; + [Description("Used when replying to a rest /status request or sent to the client when UseServerName is true.")] public string ServerName = ""; + [Description("Sends ServerName in place of the world name to clients.")] public bool UseServerName = false; [Description("Not implemented")] public string MasterServer = "127.0.0.1"; [Description("Valid types are \"sqlite\" and \"mysql\"")] public string StorageType = "sqlite"; diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index d7cd86af..3df802d3 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -238,7 +238,7 @@ namespace TShockAPI } - private void SendWorldInfo(int tilex, int tiley, bool fakeid) + public void SendWorldInfo(int tilex, int tiley, bool fakeid) { using (var ms = new MemoryStream()) { @@ -263,7 +263,7 @@ namespace TShockAPI (NPC.downedBoss3 ? WorldInfoFlag.DownedBoss3 : WorldInfoFlag.None) | (Main.hardMode ? WorldInfoFlag.HardMode : WorldInfoFlag.None) | (NPC.downedClown ? WorldInfoFlag.DownedClown : WorldInfoFlag.None), - WorldName = Main.worldName + WorldName = TShock.Config.UseServerName ? TShock.Config.ServerName : Main.worldName }; msg.PackFull(ms); SendRawData(ms.ToArray()); diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index ae975e26..9816bc15 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -739,6 +739,7 @@ namespace TShockAPI handler.Handled = true; return; } + player.SendWorldInfo(Main.spawnTileX, Main.spawnTileY, false); } private void OnLeave(int ply)