Project Zomboid

Project Zomboid

35 ratings
Update PLZ
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
7.588 KB
Mar 14, 2022 @ 3:54pm
Mar 28, 2022 @ 5:37pm
7 Change Notes ( view )

Subscribe to download
Update PLZ

Description
DATA LOSS WARNING: Restarting while players are online from a mod currently causes DATA LOSS, I have asked the devs for a solution but they do not seem to really care. If you are concerned about data loss please use one of the long delay options or only restart when no players are online. Sorry!

GitHub[github.com]

Don't you hate it when you try and join your server and it disconnects telling you there are outdated Workshop mods? Hate no more thanks to Update PLZ!

This mod will query the server's Workshop mods every minute and check if they were updated after the server started up. If it detects outdated Workshop items, the server will be saved & restarted the next time it is empty.


For dedicated servers ONLY
This mod ONLY works on DEDICATED SERVERS and does nothing in co-op/singleplayer!


How "restarting" works
This mod will SHUT DOWN the server - currently there is no way to RESTART the server from a mod, so please make sure you are using a daemon that will automatically restart the server when it shuts itself down.

If you don't currently have this setup for your server, you can find a simple script (bash script for Linux, Batch script for Windows) online for automatically restarting a program if it exits.


Choosing the restart time
Mod ID
Restarts after
UpdatePlz
When the server becomes empty
UpdatePlz1
1 minute
UpdatePlz5
5 minutes
UpdatePlz10
10 minutes
UpdatePlz15
15 minutes
UpdatePlz30
30 minutes
UpdatePlz60
1 hour


Workshop ID: 2779169728
Mod ID: UpdatePlz
Mod ID: UpdatePlz1
Mod ID: UpdatePlz10
Mod ID: UpdatePlz15
Mod ID: UpdatePlz30
Mod ID: UpdatePlz5
Mod ID: UpdatePlz60
51 Comments
Syn Apr 3 @ 6:51am 
To configure the server to automatically restart after a shutdown, locate the "StartServer32.bat", "StartServer64.bat", or "StartServer64_nosteam.bat" file. Open the batch file in an editor and replace the "pause" command at the end with:

call "%~f0"

Make sure to copy and paste it exactly as shown. This line will enable the server to automatically restart whenever it detects that it has gone offline.

Hope that helps.
Daimyo Nov 12, 2024 @ 6:00pm 
Appears to work
MarujaKing Jun 1, 2024 @ 7:03am 
IS this mode required when not playing muti or with friends?
Zefirr Jul 9, 2023 @ 12:21pm 
same . does it work please ?
ripmaikel May 12, 2023 @ 11:45pm 
it works?? i actually need to do a auto restart system for a linux dedicated server
Methylenedioxymethamphetamine  [author] May 11, 2023 @ 4:53am 
Hello yes it only shuts down the PZ application not the machine - would be kind of crazy if they gave mod developers access to do that lol
TancredTerror May 11, 2023 @ 2:47am 
Hello Billy !
Thank you for the Mod
Do you confirm that your mod shudown the PZ application and not the server machine ?
Because when you say it shutdown the server, both could be understoof.
Thank you for your answer ;)
해솔 Mar 6, 2023 @ 5:21pm 
Mod id UpdatePlz180 = 3hour?
can i 3hour update use?
UdderlyEvelyn Sep 2, 2022 @ 7:22am 
Feel free to mimic the delay feature to fix the data loss in your mod, or just point people to my mod if you'd rather wash your hands of maintenance. Thanks again for letting me base mine on your code!
UdderlyEvelyn Sep 2, 2022 @ 7:21am 
I made my version, you can find it here:
https://steamcommunity.com/sharedfiles/filedetails/?id=2844315442

I fixed the message sending to be compatible with chat mods (the message table was missing some function stubs), added sandbox options for the restart delay and how often to poll the workshop, as well as a new (also configurable) feature to add a delay between saving and quitting to avoid the data loss issue.