原创地址AutoRestart UI – 插件 – Codefling
Works with
-
经济学
-
服务器奖励
-
重启状态
关于 AutoRestart UI
AutoRestart 是一个高级且完全可配置的插件,可促进 Rust 服务器的自动重启,确保性能一致,并通过有效的调度和通知最大限度地减少停机时间。
该插件已在 Pterodactyl 和 Wisp 中进行了测试,没有问题。由于每个管理员如何配置他们的 bat 文件,Windows 可能会出现问题,这可能会导致插件无法再次启动服务器。
主要特点
交互式 UI:包括一个交互式 UI,允许管理员轻松修改所有插件设置。
Scheduled Rerestart(计划的重启):使用 UTC 时区配置以定义的时间间隔自动重启服务器,以实现统一调度。
Discord 集成:向指定的 Discord 频道发送通知,让社区了解重启和服务器可用性。
玩家提醒:通过 UI 和聊天在游戏中发出通知,具有可配置的倒计时(例如 60 分钟、30 分钟、10 分钟),包括可见的最后一分钟倒计时。
声音警报:提供可选的听觉通知,以伴随视觉或聊天警报。
手动管理员重启:管理员可以使用 /restart [seconds] 命令启动手动重启,包括实时警报。
取消重启:允许管理员使用 /restartstop 命令取消或重新安排重启。
玩家限制保护:通过设置玩家计数阈值来防止在玩家活动频繁时重启。
uMod 更新支持:自动检查并应用 uMod 更新,然后重新启动服务器。
奖励系统:为服务器重启后连接的玩家提供全面的奖励系统,支持 Economics、ServerRewards 和自定义物品奖励。
多语言消息:英语、西班牙语、意大利语、俄语、乌克兰语、法语、葡萄牙语。
权限
autorestart.use:授予执行手动重启、取消计划或手动重启、修改重启设置以及访问配置 UI 的管理权限。
聊天命令
/restart config:打开主配置 UI。
/restart <time>(例:30s/5m/1h):安排指定时间手动重启。
/restart now:立即启动服务器重启。
/restart cancel:取消任何计划的重启。
/restart status:检查距离下一次计划重启的时间。
控制台命令
restart:显示距离下一次计划重启的时间。
restart <time>(例如 30s/5m/1h):安排在指定时间内手动重启。
restart now:立即启动服务器重启。
restart cancel:取消任何计划的重新启动。
API 方法
Available Hooks OnRestartScheduled Called when a restart is scheduled (both automatic and manual) void OnRestartScheduled(int seconds, bool isCustom) { // seconds: Time until restart in seconds // isCustom: true if manually triggered, false if automatic schedule Puts($"Restart scheduled in {seconds} seconds (Custom: {isCustom})"); } OnRestartCancelled Called when a restart is cancelled void OnRestartCancelled(string reason) { // reason: Why the restart was cancelled // Possible values: "Manual cancellation", "Too many players", "Plugin unload" Puts($"Restart cancelled: {reason}"); } OnRestartWarning Called during countdown warnings (every significant interval) void OnRestartWarning(int secondsLeft) { // secondsLeft: Seconds remaining until restart // Called at: 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 seconds if (secondsLeft <= 10) Puts($"URGENT: Server restarting in {secondsLeft} seconds!"); } OnRestartInitiated Called right before the server restart process begins void OnRestartInitiated() { // Server save and quit commands will execute after this hook Puts("Server restart initiated - saving and shutting down now!"); }
Config
{ "Version": "3.0.0", "Restart": { "RestartTimes": [ "12:00", "12:15", "12:30", "13:55", "20:40", "15:40", "09:20", "08:20" ], "AlertSound": "assets/prefabs/locks/keypad/effects/lock.code.lock.prefab", "UseSound": true, "UseChatAlerts": true, "SkipWipeDays": false, "WipeDays": [ "Monday", "Wednesday", "Thursday", "Sunday" ] }, "PlayerRestrictions": { "MaxPlayersBeforeCancel": 10, "RestrictPlayerCount": false }, "Alerts": { "InGameWarningTimes": [ 30, 15, 10, 5, 3, 2, 1 ], "DiscordWarningTimes": [ 30, 15, 10, 5, 1 ] }, "UpdateCheck": { "CheckForUpdates": true, "CheckInterval": 1200 }, "UI": { "UseCustomUI": true, "UseRustUI": true, "CustomUI": { "AnchorMin": "0 0.5", "AnchorMax": "0 0.5", "OffsetMin": "10 -45.9695", "OffsetMax": "177.325 46.7435", "CheckIcon": "✓", "CrossIcon": "✗", "CheckIconColor": "0.5568627 0.7764706 0.1843137 1", "CrossIconColor": "0.7764706 0.5137255 0.4196078 1", "TitleColor": "1 1 1 1", "MessageColor": "0.9 0.9 0.9 1", "IconColor": "0.3 0.6 1 1", "CurrentIcon": "assets/icons/download.png", "BorderType": "None", "CustomTitle": "reinicio", "CustomMessage": "The server will restart in {0}.", "BackgroundColorHex": "#191919", "TitleFontSize": 14, "MessageFontSize": 12 }, "GametipStyle": 1 }, "Discord": { "WebhookUrl": "https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "ServerName": "Rust Server", "DiscordNotifications": true, "UseFullMinuteCountdown": true, "MessageContent": "@everyone Server restart | @here | <@&role-id>", "BotName": "AutoRestart Bot", "BotAvatarUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "Embeds": {}, "Embed": { "AuthorName": "Server Restart", "AuthorIconUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "Title": "Scheduled Server Restart", "Description": "The server will restart in {0}", "ThumbnailUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "FooterText": "Server Restart | {DateTime}", "FooterIconUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "FieldTitle": "Server Info", "FieldContent": "The server will be back online in approximately 3-5 minutes", "ColorHex": "#FF9900" } }, "DisableDiscordCountdownMessages": false, "Rewards": { "EnableRewards": true, "UseEconomics": false, "UseServerRewards": false, "EconomicsAmount": 10.0, "ServerRewardsPoints": 10, "RewardTimeLimit": 300, "RewardItems": [] } }
Lang
{ "Version": "3.0.0", "ChatRestartAlert": "Server restart scheduled in {0}.", "ChatRestartCanceled": "The server restart has been canceled.", "ChatRestartNow": "RESTARTING...", "ChatRestartCanceledTooManyPlayers": "Restart canceled due to too many players.", "NoRestartScheduled": "No restart is currently scheduled.", "RustUITitle": "SCHEDULED SERVER RESTART", "RustUIMessage": "The server will restart in {0}.", "CustomUITitle": "SCHEDULED SERVER RESTART", "CustomUIMessage": "The server will restart in {0}.", "NoPermission": "You do not have permission to use this command.", "Usage": "Usage: /restart <time>[s|m|h] (e.g., 30s, 5m, 1h)", "InvalidNumber": "Invalid time format. Use <number>[s|m|h] (e.g., 30s, 5m, 1h)", "UpdateDetected": "A uMod update has been detected. The server will restart to apply the update.", "DiscordRestartAlert": " **SERVER RESTART**\nServer will restart in {0}.", "DiscordRestarting": " **RESTARTING**\nServer is restarting now. Please wait 5 minutes for the server to be back online.", "DiscordOnline": " **SERVER ONLINE**\nServer is now online and ready to play!", "TimeMinute": "minute", "TimeMinutes": "minutes", "TimeHour": "hour", "TimeHours": "hours", "TimeSecond": "second", "TimeSeconds": "seconds", "RewardEconomicsReceived": "You received ${0} from Economics reward!", "RewardPointsReceived": "You received {0} RP from ServerRewards!", "RewardItemReceived": "You received {0}x {1} from Item rewards!", "RewardTimeLeft": "You received rewards for connecting during server restart. Rewards will be available for {0} more.", "RewardPeriodEnded": "The reward period has ended.", "ConfigTitle": "AutoRestart UI Configurator", "DiscordSettings": "Discord Settings", "RewardSettings": "Reward Settings", "TimeSettings": "Restart Times Settings", "NotificationSettings": "Notification Settings", "Save": "Save", "Close": "Close", "Back": "Back", "SavedSuccessfully": "Configuration saved successfully!", "Search": "Search items...", "AllCategories": "All Categories", "CategoryWeapons": "Weapons", "CategoryTools": "Tools", "CategoryConstruction": "Construction", "CategoryItems": "Items", "CategoryResources": "Resources", "CategoryAttire": "Attire", "CategoryMedical": "Medical", "CategoryFood": "Food", "CategoryAmmo": "Ammunition", "CategoryTraps": "Traps", "CategoryMisc": "Miscellaneous", "CategoryComponents": "Components", "CategoryElectrical": "Electrical", "CategoryFun": "Fun", "ManageRewards": "AutoRestart - Reward Manager", "ItemSelector": "AutoRestart - Item Selector", "NoRewards": "No rewards configured. Click the 'Add Reward' button to add some.", "EnterQuantity": "Enter quantity for {0}", "AddReward": "Add Reward", "RemoveAll": "Remove All", "ConfirmRemoveAll": "Are you sure you want to remove all rewards?", "Yes": "Yes", "No": "No", "RewardAdded": "Added {0}x {1} to restart rewards.", "RewardRemoved": "Removed {0}x {1} from restart rewards.", "RewardUpdated": "Updated {0} quantity to {1}.", "InvalidItem": "Invalid item. Please try again.", "InvalidQuantity": "Please enter a valid quantity greater than 0.", "CategoriesReset": "Item categories have been reset to default values.", "TimesListTitle": "Restart Times (UTC)", "AddTime": "Add Time", "RemoveTime": "Remove", "InvalidTimeFormat": "Invalid time format. Please use HH:MM format (e.g., 04:30)", "AddWipeDay": "Add Wipe Day", "WipeDaysTitle": "Wipe Days (Restarts Skipped)", "WipeDayAdded": "Added {0} to wipe days. Restarts will be skipped on this day.", "WipeDayRemoved": "Removed {0} from wipe days.", "MessageSettings": "Message Settings", "EmbedSettings": "Embed Settings", "WebhookSettings": "Webhook Settings" }
![图片[22]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_8nFFoGZYT1.jpg.6bc83596f46977eeacaf034ce8eb3836.jpg)
![图片[23]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_D0kdlFq03o.png.6c8d3b7b2af9d00da93a023c4b7757ca.png)
![图片[24]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_rUYAywnyI3.png.4438ddc91347acf9a0507ee9edc4157a.png)
![图片[25]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_wz3ehdcu4V.png.9e5c8c55905d65d24073598fdc801a6a.png)
![图片[26]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_EiC4TuqGWm.png.7e058977801aea13ec23eef9295ff7e0.png)
![图片[27]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_0V0tI1TziB.png.167419aa514ff90b84f332fc1955ca39.png)
![图片[28]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_DB10NoQf4p.png.7a1bd4e8169b572d79a09af9812ba281.png)
![图片[29]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_D26XzTyHZy.png.513edfe23a7c7b94c5190c2e1769083f.png)
![图片[30]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_5rTdjZFlwO.png.06df704c7dbdc4493553aaaef45b99b4.png)
![图片[31]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_JCvG6l6qYp.png.8a49b9739dbe47a5787e59ed82e30555.png)
![图片[32]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_LSOyOEyAFq.png.b783744c28682bfe3f836dab73dac1d5.png)
![图片[33]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_TAbHgYB0Qd.png.d6996856d36b9041827f48ea452cf3b9.png)
![图片[34]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_f45Yiz9RsI.png.0c679fa64ff80b42c5b038340f968120.png)
![图片[35]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_c8gv3RLJvl.png.131876c1d85193f7087fd068654cd0fb.png)
![图片[36]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_iPRhHeIP9I.png.e102629fe69778d9ad6278f819bee827.png)
![图片[37]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_Jcq7KWqTVv.png.412b41df920e6b27b10bfbc09b271d2b.png)
![图片[38]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_obGthHEMeL.png.0565e6bb4a16de9c1087f331ed20d84d.png)
![图片[39]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_d1jhcTAOCy.png.0b80e8e7804dfecd38673e5657ac43bf.png)
![图片[40]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_10/RustClient_8v3wkgzZEL.jpg.7d84f0db6a21111c4acaa73c618f2cc1.jpg)
![图片[41]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_10/RustClient_tDdGBvBdaR.jpg.3c23d13b898ba8a383659e2ea932f7e5.jpg)
![图片[42]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_10/Discord_nVWgzr86Mk.png.43d72ed87b1fcb9d2b7461ff9f26b71a.png)
![图片[43]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_09/RustClient_npDHxhWf4Y.png.b1fd2222f14b9db85addbd63aa9ec355.png)
![图片[44]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_09/RustClient_A62Jn5L7RB.png.387490a722f8787ea022b8192debbfcd.png)
![图片[45]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2024_09/RustClient_iHEXl17ztF.png.aa558edced1d61c1ace9e97afc485f89.png)
![图片[46]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_02/NVIDIA_Overlay_MC7oUVyZTG.png.4186a688df0d147bb3bfaffdadb3e863.png)
![图片[47]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_vOAt60Mcmu.png.f480514a9788568bf16407e63fb6a45b.png)
![图片[48]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_JmodC4rjcr.png.eeb3039aa68f70b366eaa3337be181df.png)
![图片[49]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_sScRVCe6CI.png.dc8d2bd80bd83845087a1658b9786137.png)
![图片[50]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_RISSC0B4y5.png.90e3b726669c4e0e41defc32d164babf.png)
![图片[51]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_xiZU2YJ2EG.png.809264ddb465625d43630f4bc5a72fc4.png)
![图片[52]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_MhsyH133J8.png.d2c7e70f9b5787575bf8953752c3a131.png)
![图片[53]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_LhQndyNG0B.png.db61497be0af0568e88429c4fac931e0.png)
![图片[54]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_sXWUyEOODM.png.35fdcf2cf866fca9ec0d98f3dc4fe1fe.png)
![图片[55]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_7BHO1pHyce.png.261721fe476e2a60ae6279008009145e.png)
![图片[56]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_fcsAjMKLsD.png.3a6cab8d4e5d4b111d3061e0d2376867.png)
![图片[57]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_C2WZks0NoS.png.a9d6ac83244ddc31fd6eb0db06fb0bee.png)
![图片[58]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_NWjtVWLjRu.png.91399f029c40e37a61adae586f2407a9.png)
![图片[59]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_FSHDSQ7tPl.jpg.258eeebc8404d688400529ac165d29a6.jpg)
![图片[60]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_KJrrVZag44.png.42237a4d738a21221a49e6a06691ced9.png)
![图片[61]-自动重启 UI 2.5.1-PCI1](https://codefling.com/uploads/monthly_2025_06/RustClient_pmnUu4Z82H.png.b6c1aa559cd093c5a40296fde0b99a21.png)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END


















暂无评论内容