RUST Smooth Restarter v3.2.0

No permission to download
You can download a maximum of 0 files within 24 hours

What is it?​

This plugin allows you to set up scheduled shutdown times for your server.

Additional features​

  • Restart when the new Oxide version is out
  • Fancy UI
  • Flexible API to be used from other plugins

Important notice, please read before posting in the support section​

This plugin does not re-launches your server after it was shutdown, because it is not possible. You will need an external solution to that.

Configuration​

The settings and options can be configured in the SmoothRestarter file under the config directory. The use of an editor and validator is recommended to avoid formatting issues and syntax errors.
Code:
Please, Log in or Register to view codes content!

Explanation​

  • Daily restarts: This setting allows you to set up time of day, when the server will be shutdown (in hh:mm format)
  • Restart when new Oxide.Rust is out: If set to true - the server will be restarted if current Oxide version is outdated
  • Initiate countdown at: Starting point of the restart countdown (and restart delay for Oxide update restarts). Countdown speed will increase while getting closer to zero
  • Enable UI: Enable or disable plugin UI
  • UI position (X,Y): Sets plugin UI position (0 to 1 floating point number)
  • UI scale: Sets plugin UI relative scale in range from 0.3 to 3
  • Enable console logs: This enables/disables informational console messages
  • Commands: This allows you to change the command used to interact with the plugin, to exclude plugin conflicts and for general convenience
  • Disable chat countdown notifications: Set this to true to disable countdown notifications displayed in chat
  • Custom countdown reference points: Use this to alternate default countdown milestones
  • Use custom countdown reference points: Set this to true to enable previous feature

Localization​

The default messages are in the SmoothRestarter file under the lang/en directory. To add support for another language, create a new language folder (e.g. de for German) if not already created, copy the default language file to the new folder and then customize the messages.
Code:
Please, Log in or Register to view codes content!

Time formatting​

Plugin provides custom time formatter with its own syntaxIn the argument format (after the semicolon in the {0:format} placeholders) you can use templates to output different time formats. To enable custom formatting in some particular argument, you need to use sfmt:: prefix, so argument should look like this: {0:sfmt::}After that prefix you can write text which will be in the resulting format, including some templates which get replaced by corresponding values:

  • sec template gets replaced by seconds value
  • min template gets replaced by minutes value
  • hr template gets replaced by hours value
Templates must follow the form of <template_name>, which result in <min> if you want template to be replaced with value of minutes left before restart

Every template can have additional modifiers which alter it's appearance and behaviour:

  • # - Padding and precision modifier allows template to have its numeric value to be padded/truncated
  • ! - Total modifier results in template being replaced by total value of (seconds/minutes/hours) left
  • ? - Optional modifier makes the whole template to be replaced by the empty string in case of numeric value being equal to zero
  • - Appender modifier allows you to append any text to a template (typed between < and >) and have this text behave same as the template (it will not be displayed if the template itself is not, like when we have and optional modifier with value == 0)
Examples are shown below:

Lets suppose we have 30 minutes and 23 seconds left before restart (30 * 60 23 = 1823 seconds total, or 30,383333 minutes total)Format of <hr>:<min>:<sec> will obviously result in 0:30:23, which is not a pretty number is it?But we can use <hr?:><min?>:<sec?> which will display 30:23 as a result in this case while still showing 1:30:23, if we have 1 hour 30 minutes and 23 seconds left

If you want to take a step further and make all the numbers appear in form of two digits (prepended with 0 while necessary), you can use # padding and precision modifier which helps in this case.<hr#2?:><min#2?:><sec#2?> will be outputted as 01:30:23

If you do not want to display hours, but just use value of minutes and seconds left before restart - use the ! total modifier. Lets say restart will happen in 3 hours, 59 minutes and 17 seconds.If we use the format of <min! minutes ><sec seconds> to display the value as "239 minutes 17 seconds", because our hours value gets transformed into 180 minutes, plus 59 minutes we have which results in 239.The same value of 3 hours, 59 minutes and 17 seconds is total of 239.28333333333 minutes, but the decimal part is hidden by default. What if you want to show it instead of seconds? # padding and precision operator will help us do that as well, just set the format to be <min#0.3! minutes> and the resulting value will be "239.283 minutes", because we use 3 as the precision value, which can actually be any other number greater or equal to zero

Commands​

This plugin provides both chat and console commands using the same syntax. When using a command in chat, prefix it with a forward slash: `/`.
Command prefix is configurable in the configuration, /srestart is used as an example

  • srestart status - Will respond with informational message if server is restarting or not (and the time left)
  • srestart cancel - Cancels current restart process, will also cancel restart initiated by global.restart command
  • srestart restart <time> - Initiates restart process, see Supported formats to understand <time> argument format
  • srestart help (<command>) - Outputs general help message, or info about <command> usage, if present

Supported formats by the time command​

  • 123 - Delay in seconds
  • 123<h|m|s> - Delay in hours/minutes/seconds
  • 1h 2m 3s - Delay of 1 hour, 2 minutes and 3 seconds, total of 3723 seconds. All sections are optional
  • 1:23 - Schedules restart for 01:23 real time (24hr format)

Native restart interaction​

Plugin handles checks for native restart processes (global.restart console command). While you can cancel it with /sr cancel command, you will not be able to initiate new restart process before doing so, neither timed/Oxide update restarts will proceed while native restart is running, so pay attention to this behaviour.

Permissions​

This plugin uses the permission system. To assign a permission, use oxide.grant <user or group> <name or steam id> <permission>. To remove a permission, use oxide.revoke <user or group> <name or steam id> <permission>.
Each permission grants access to the respective plugin command (e.g. smoothrestarter.status for /sr status):

  • smoothrestarter.restart
  • smoothrestarter.cancel
  • smoothrestarter.status
In most cases you would want to have smoothrestarter.status granted to all players while other commands are only available to admins

UI​

Plugin provides simple UI to indicate current restart process' status. UI can be scaled and moved around the screen by manipulating values in the configUI progress bar color is updated automatically relative to the time left before restart

Additional options​

If you want to provide players with rewards if they return to play on your server after a restart happened - be sure to check out Smooth Restarter Rejoin Rewards which provides customizable functionality for this purpose

Developer API​

Code:
Please, Log in or Register to view codes content!
Author
Box2
Downloads
0
Views
15
First release
Last update
Rating
0.00 star(s) 0 ratings

Share this resource

Similar resources

0.00 star(s) 0 ratings
Downloads
0
Updated
Smooth Realistic - детализированный ресурспак
0.00 star(s) 0 ratings
Downloads
0
Updated
Плавное исчезновение трупов
0.00 star(s) 0 ratings
Downloads
0
Updated
Перезапускает карту в конце игры раз в указанный промежуток времени.
0.00 star(s) 0 ratings
Downloads
0
Updated