From 146ee41d9e5d91858f52c80f23fae4ef550fde64 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 13 Jun 2021 23:49:53 -0700 Subject: [PATCH] Show world path in /worldinfo This allows server operators to more easily locate their world paths, particularly on Linux and macOS, where it isn't very obvious. To determine where the actively loaded world is, simply run `/worldinfo`. --- CHANGELOG.md | 1 + TShockAPI/Commands.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1a1b558..c6727a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed `/warp send` failing a nullcheck if the warp didn't exist. The previous behavior may have always been buggy or broken. In other words, sending someone to a warp that doesn't exist should result in a nicer error. (@hakusaro, @punchready) * Fixed `/group del` allowing server operators to delete the default group that guests are put into. This is a really critical group and the server doesn't behave correctly when it happens. As a result, it's better to prevent this from happening than not. Additionally, `GroupManagerException`s will be thrown if this is attempted programmatically. Finally, if the exception is thrown in response to `/group del` (or if any other exception is thrown that the command handler can handle), the stack trace will no longer be present. Fixes [#2165](https://github.com/Pryaxis/TShock/issues/2165). (@hakusaro, @DeveloperLuxo, @Rozen4334, @moisterrific, @bartico6, @Quinci135) * Removed the old `ConfigFile` class. If you are updating a plugin, you should use `TShock.Config.Settings` instead of the accessor you were using. This is typically a really easy change. For most plugin authors, updating to the new config format is as simple as changing the reference to the old static config to point to the new location. If you were using this for your own configs, you should swap to using a `IConfigFile` (see `TShockAPI.Configuration.ConfigFile`). (@hakusaro, @bartico6) +* Added `Main.worldPathName` to `/worldinfo` command. Now, if you need to see what the location on disk for your world file is, you can simply run `/worldinfo` to find out. This is particularly helpful on Linux and macOS, where the world path isn't obvious. (@hakusaro) ## TShock 4.5.4 * Fixed ridiculous typo in `GetDataHandlers` which caused TShock to read the wrong field in the packet for `usingBiomeTorches`. (@hakusaro, @Arthri) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 0dbe6980..b6ba179f 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1161,11 +1161,12 @@ namespace TShockAPI private static void WorldInfo(CommandArgs args) { - args.Player.SendInfoMessage("Information of the currently running world"); + args.Player.SendInfoMessage("Information about the currently running world"); args.Player.SendInfoMessage("Name: " + (TShock.Config.Settings.UseServerName ? TShock.Config.Settings.ServerName : Main.worldName)); args.Player.SendInfoMessage("Size: {0}x{1}", Main.maxTilesX, Main.maxTilesY); args.Player.SendInfoMessage("ID: " + Main.worldID); args.Player.SendInfoMessage("Seed: " + WorldGen.currentWorldSeed); + args.Player.SendInfoMessage("Path: " + Main.worldPathName); } #endregion