Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/off-nosave is saving world #2938

Open
Arthri opened this issue Apr 28, 2023 · 4 comments · May be fixed by #3015
Open

/off-nosave is saving world #2938

Arthri opened this issue Apr 28, 2023 · 4 comments · May be fixed by #3015

Comments

@Arthri
Copy link
Contributor

Arthri commented Apr 28, 2023

  • TShock version: 5.1.3
  • TShock build number (if known): N/A

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
Copy link
Contributor Author

Arthri commented Apr 28, 2023

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

@ghost
Copy link

ghost commented Oct 2, 2023

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

@Arthri
Copy link
Contributor Author

Arthri commented Oct 2, 2023

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

TShock/TShockAPI/Commands.cs

Lines 2044 to 2047 in b1a0544

private static void OffNoSave(CommandArgs args)
{
string reason = ((args.Parameters.Count > 0) ? GetString("Server shutting down: ") + String.Join(" ", args.Parameters) : GetString("Server shutting down."));
TShock.Utils.StopServer(false, reason);

TShock/TShockAPI/Utils.cs

Lines 575 to 580 in b1a0544

public void StopServer(bool save = true, string reason = "Server shutting down!")
{
TShock.ShuttingDown = true;
if (save)
SaveManager.Instance.SaveWorld();

Metratrj added a commit to Metratrj/TShock that referenced this issue Jan 30, 2024
Added seting SaveOnSeverExit befor shutting down the server
Fixes Pryaxis#2938
@Metratrj Metratrj linked a pull request Jan 30, 2024 that will close this issue
@Metratrj
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants