Project Zomboid

Project Zomboid

Server Alert Fix [ONLY B41 - Fixed in B42]
16 Comments
SiCK 6 Jan @ 5:20am 
Thank YOU for your friendly and detailed responses :) Highly recommended as a person and as a mod author <3<3<3
Vorshim  [author] 6 Jan @ 5:17am 
Thanks for the feedback SiCK! Really appreciate it! <3 <3 <3
SiCK 6 Jan @ 5:14am 
After the last Update it works like a charme.

We use the mod in conjunction with UdderlyUpToDate so that the red message is shown on the display when the server restarts during mod updates.

!!!! WITH THIS MOD YOU NO LONGER NEED TO LEAVE THE CHAT WINDOW OPEN !!!!

Finally no more players complaining because the server restarts without warning :)
Vorshim  [author] 1 Jan @ 2:40pm 
@Sick hello! thaanks!! you too mate, happy new year.
These days I'm free, and I'll finally be able to try Udderly in combo with my mod (server alert fix).
In the meantime, I'd be curious to understand how the system you're using on your host works. If you want to add me on Steam or Discord, I can try to help and see if you can simply use my script, which is much simpler and saves you from using mods altogether (except for server alert fix itself). Let me know!
SiCK 1 Jan @ 1:12pm 
Hi @Vorshim, wish you a blessed new year my friend :)

The thing is, my hoster offers a direct option in the dashboard for restarting the server in conjunction with udderlyuptodate. They even have a link to this mod in their wiki.
Does the script you posted here also work like the udderly mod and restarts the server automatically when there is a mod update? Or do you have to do it manually with this script?
We have someone on the server at almost any time and at night I couldn't restart manually because I'm asleep :D
that's why I decided on the udderly variant.

Translated with DeepL.com (free version)
Vorshim  [author] 31 Dec, 2024 @ 8:46am 
hi @Sick ! Thanks for your response. It seems very strange to me because I tried using the same method that Udderly uses to send the message, and it works on my end. I have some doubts, maybe about the order of the installed mods? As soon as I have a moment, I’ll try using this mod (which I don’t use for safety reasons because I knew it had a problem with saving). Anyway, I don’t use these mods to manage the server restart. I use an external script that handles everything through RCON (with discord webhook message also). If you’re interested, it’s simple to use and there’s a guide. I’m leaving you the GitHub link: https://github.com/Vorshim92/PZ-WATCHDOG
SiCK 31 Dec, 2024 @ 8:05am 
Hi Vorshim, sorry for the late response. Normal servermsg command is working fine
Vorshim  [author] 4 Dec, 2024 @ 3:18pm 
Hi Sick! Interesting!!! did you test if servermsg is working?
SiCK 4 Dec, 2024 @ 1:45pm 
hi vorshim, thank you for the nice responses.

i tested your mod right now (with udderly up to date) and sadly there was no red message on screen while chat was closed.

After reopening the chat the red message on screen appeared in the same moment.
Vorshim  [author] 4 Dec, 2024 @ 5:12am 
Even though I believe that from the chat, as an admin, you can already type:
/servermsg "HELLO"

And since my mod is active, it will still work, even if the chat is disabled.
Vorshim  [author] 4 Dec, 2024 @ 5:11am 
As for the second request, yes, I can consider doing something. I could add a button in the admin panel to handle it.

Keep in mind that, by default, you can send a server message to the screen using my mod directly from the debug console with:
ISChat.instance.serverMessageUI:setServerMessage("HELLO EVERYONE")

The issue is that this would only send the message to yourself. I would probably need to create propagation using sendServerCommand. It's not difficult, and I think it's a good feature. I'll think about it and let you know!
Vorshim  [author] 4 Dec, 2024 @ 5:07am 
I'm almost 100% sure that Udderly Up to Date sends messages as isAlert:
UdderlyUpToDate.message(msg, isAlert)
so it should be compatible. The mod does not cause any issues with other mods, so you can safely install it and test it yourself.

All the messages that are collected are first checked with message:isServerAlert(). If they are, my mod bypasses the vanilla method that handles them and creates a secondary rendering, canceling the original one. This way, the alert message rendering is separated from the chat itself.

With the latest update, I also added a sandbox option that lets you choose the duration (in ms, default is 5000 like vanilla) for how long the message stays on the screen.
SiCK 4 Dec, 2024 @ 1:46am 
is there any possibility to add a function to your mod where i as an admin are able to send a self written message to the screen? maybe through the chat or something like that?
SiCK 4 Dec, 2024 @ 1:44am 
no worries all good :) the Udderly up to date checks if there is a modupdate on the workshop and just shuts the server down if there is an update. along with finding an update it sends a red message to the screen that the server will shut down in x minutes. But this message only appears when the chat window is opened
Vorshim  [author] 3 Dec, 2024 @ 3:15am 
sorry SiCK, didn't see your comment! What Udderly Up To Date does? btw if it add a server message alert yes.
SiCK 29 Nov, 2024 @ 5:14pm 
Hi, this works for example with "udderly up to date"???