Add current gamemode to /worldmode

To help debug #2516, this commit adds the currently running game mode to
/worldinfo. I didn't bother converting this in the dictionary back since
my primary goal by adding it right now is to debug the currently running
mode, not to necessarily try to parse the data.
This commit is contained in:
Lucas Nicodemus 2021-11-27 17:32:46 -08:00
parent ce9f3b244c
commit 87d5b476ea
2 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Add the new allowed buff TentacleSpike to NPC buff cheat detection bouncer. (@sgkoishi)
* Changed hook `GetDataHandlers.OnNewProjectile` so that it passes the projectile's AI (by updating `NewProjectileEventArgs` and parsing this during the TShock hook) to support processing projectile AI in bouncer. (@AgaSpace)
* Fixed an issue where certain projectiles could be sent to the server with uncapped size parameters, which resulted in large disruptive client artifacts that could be used to grief players. (@AgaSpace, @Arthri)
* Added the currently running value of `Main.GameMode` to `/worldmode` as "Mode". (@hakusaro)
## TShock 4.5.10
* Changed the server behavior when `SIGINT` is received. When `SIGINT` is trapped, the server will attempt to shut down safely. When it is trapped a second time in a session, it will immediately exit. (`SIGINT` is typically triggered via CTRL + C.) This means that it is possible to corrupt your world if you force shutdown at the wrong time (e.g., while the world is saving), but hopefully you expect this to happen if you hit CTRL + C twice in a session and you read the warning. (@hakusaro, @Onusai)

View file

@ -1195,6 +1195,7 @@ namespace TShockAPI
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("Mode: " + Main.GameMode);
args.Player.SendInfoMessage("Path: " + Main.worldPathName);
}
@ -2413,7 +2414,7 @@ namespace TShockAPI
if (args.Parameters.Count < 1)
{
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: {0}worldmode <mode>", Specifier);
args.Player.SendErrorMessage("Valid mode: {0}", String.Join(", ", _worldModes.Keys));
args.Player.SendErrorMessage("Valid modes: {0}", String.Join(", ", _worldModes.Keys));
return;
}