Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

`/off-nosave` is saving world #2938

Open Arthri opened 1 year ago

Arthri commented 1 year ago

Reproduction steps (if applicable)?

  1. Start server
  2. /off-nosave

Any stack traces or error messages (if known)?

Server executed: /off-nosave.
Server shutting down.
Saving before exit...
Saving world...
Saving world data:
Validating world save:

Any screenshots?

None

Any log messages from files that end in .log or .txt? What are the last 100 log messages from the server console?

2023-04-29 00:03:06 - TShock: INFO: TShock 5.1.3.0 (Thank you, everyone, for your support of TShock all these years! <3) now running.
2023-04-29 00:03:06 - TShock: INFO: AutoSave Enabled
2023-04-29 00:03:06 - TShock: INFO: Backups Enabled
2023-04-29 00:03:06 - TShock: INFO: Welcome to TShock for Terraria!
2023-04-29 00:03:06 - TShock: INFO: TShock comes with no warranty & is free software.
2023-04-29 00:03:06 - TShock: INFO: You can modify & distribute it under the terms of the GNU GPLv3.
2023-04-29 00:03:11 - TShock: INFO: Login before join enabled. Users may be prompted for an account specific password instead of a server password on connect.
2023-04-29 00:03:11 - TShock: INFO: Login using UUID enabled. Users automatically login via UUID.
2023-04-29 00:03:11 - TShock: INFO: A malicious server can easily steal a user's UUID. You may consider turning this option off if you run a public server.
2023-04-29 00:03:12 - Utils: INFO: Server executed: /off-nosave.
2023-04-29 00:03:12 - Utils: INFO: Broadcast: Server shutting down.
2023-04-29 00:03:12 - Utils: INFO: Broadcast: Saving world...

What plugins and what versions of those plugins are you running?

None

Arthri commented 1 year ago

Terraria's server loop is saving the world. Terraria has a separate field(Netplay.SaveOnServerExit) for controlling save on exit

ghost commented 11 months ago

This is to not save the DATABASE for if a batabase error accours

Arthri commented 11 months ago

This is to not save the DATABASE for if a batabase error accours

The command explicitly specifies to not save the world, but it fails now because Terraria has implemented a different pathway since then

https://github.com/Pryaxis/TShock/blob/b1a054472fcabd14182c9dd1ec7fa3871ab9eb39/TShockAPI/Commands.cs#L2044-L2047

https://github.com/Pryaxis/TShock/blob/b1a054472fcabd14182c9dd1ec7fa3871ab9eb39/TShockAPI/Utils.cs#L575-L580

Metratrj commented 7 months ago

Added the proposal from @Arthri. Checked it and should work now.