Intercept console interrupt and handle nicely
Long ago in the early days of TShock someone asked why CTRL + C wasn't handled and there was an explanation given along the lines of "something something not supported on mono something something" or similar. Attempts were made to try to handle console interrupts unsuccessfully and the code was ripped out. However, it's 2021, and we can now handle this signal and do the right thing (which, ostensibly, is to save the world and shut down). Many people like me reflexively hit CTRL + C because they want to shut down the process. It's very infuriating that the current behavior results in the server just dying and nothing being cleaned up properly. Therefore, this commit changes the behavior to handle the interrupt, save the world, and shut down nicely. (If you still want to shutdown without saving the world, use off-nosave, or idk, send SIGKILL).
This commit is contained in:
parent
933c5f9e49
commit
34da464bab
2 changed files with 17 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
|||
* Added `/slay` as an alias for `/kill` to be more consistent with other server mods. (@hakusaro)
|
||||
* Added `/god` as an alias for `/godmode` to be more consistent with other server mods. (@hakusaro)
|
||||
* Fixed ridiculous typo in `Amethyst Gemtree` text. (@hakusaro)
|
||||
* Fixed `CTRL + C` / interactive console interrupt not safely shutting down the server. Now, interrupts will cause a safe shutdown (saving the world and disconnecting all players before fully shutting down). Previously, interrupts caused an unsafe shutdown (not saving the world). (@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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue