Open zrisher opened 9 years ago
The only problem I have with this is, a lot of hosted servers won't be in the same timezone, and I see plenty of instances where clocks do not keep up to date with ntp servers. Its easy enough to get around, by using the user/client time and gettin the difference and sending the TimeSpan to the server instead. It just comes down to educating the users to use their local clocks and not the server.
While I think most users doing scheduled notifications will likely already be aware of the local timezone for their server, some education or adaption could be helpful.
But you have to be careful or provide an alternate option because some things are being scheduled in relation to the actual server clock. I.e. I know that my server will restart at 04:00 and 17:00 every day according to its clock, so I want my notification to occur at 3:59 server time. If that corresponds to 3:56 my time because the server clock is 3 minutes fast, I want still want it to be 1 minute before the restart and not 4.
The command's syntax is gonna be a little complex:
Syntax: /scheduledmessage <add|remove|list|enable|disable> <title> <notification[:color]|chat> <intervall|fixed> [startTime] [level], <message>
Title: A unique Id to identify the scheduled message and remove it later, in general to work with it. StartTime: timestamp where the timer starts, default: DateTime.Now
Level: required level to see the message (permission), default: 0
There is a comma before the message because there are optional parameters in the command. Any comments are welcome.
It would be great if admins could set automatic notifications to be displayed to all players, i.e.:
/admin timed 15, "Thanks for playing on My Awesome Server! Type /motd for server info", white
in chatand
/admin scheduled 03:59, "The server will restart in one minute, stop your ships!", red
in chatObviously the color argument could be optional, default to white. And you could add another optional arg for notification length.
Now that you guys have implemented server-client messaging this should be much easier to achieve.