原创地址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" }
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容