About Offline Raid Protection
The Offline Raid Protection plugin is a comprehensive solution designed to protect players' structures and vehicles while they are offline. It offers a range of customisable protection levels based on real-time or the length of time a player has been offline, and integrates with the Clans plugin and the in-game teams feature to determine protection status based on the online status of all clan or team members and authorised players.
Key Features
Configurable Protection Levels: Set protection levels based on real time or the amount of time since a player went offline. For example, a building can have 100% protection one hour after a player goes offline, and 50% protection after two hours. This feature is highly configurable.
Clan/Team Integration: The plugin integrates with the Clans plugin and the in-game teams feature. The protection status of a structure or vehicle is determined by the online status of all clan or team members and authorised players.
Penalty System: An optional penalty system is implemented to prevent abuse of the protection feature. For example, if a player leaves a clan or team, a penalty can be applied to all members and protection can be disabled for a configurable period of time.
Game Tip Messages: The plugin displays game tip messages to players when they hit a protected structure or vehicle. The message includes the percentage of protection and is colour coded according to the level of protection. It supports all the languages available in Rust.
Commands: Players with permission can use commands to check the protection status of other players, change the offline time of other players, and change the penalty status.
Cache System: The plugin uses a caching system to optimise performance and keep the impact on the server to a bare minimum.
Configuration: The plugin includes a configuration file that allows you to customise the behaviour of the plugin.
Modular Boat and Tugboat protection: These can optionally be protected just like player bases.
Commands
All commands can be configured.
- /orp or /ao <steam id or full name> — Check a player's offline protection status. You can type the command without a name when looking at a player's structure.
- /raidprot — Display offline raid protection information.
- /orp.fill.onlinetimes — Fill all players offline times. (Chat & Console command)
- /orp.test.offline <steam id or full name> <hours> — Change a player's offline time.
- /orp.test.online <steam id or full name> — Change a player's offline time to the current time.
- /orp.test.penalty <steam id or full name> <hours> — Change the duration of a player's penalty. A negative value or zero would disable the penalty.
- /orp.update.permission — Update the permissions status (offlineraidprotection.protect) for all players.
- orp.update.prefabs <true> - Updates the 'Prefabs to protect' list in the configuration. Overwrites the list with the 'true' argument. (Console command)
- orp.dump.prefabs - Clears the 'Prefabs to protect' list in the configuration. (Console command)
Permissions
All permissions can be configured.
- offlineraidprotection.protect — Allows a player to be protected from raids.
- offlineraidprotection.check — Allows a player to check the offline protection status of other players.
- offlineraidprotection.admin — Allows a player to use all admin commands of the plugin.
To grant a permission, use carbon/oxide.grant <user or group> <steamname or ID> <permission>. To revoke a permission, use carbon/oxide.revoke <user or group> <steamname or ID> <permission>.
Configuration
The configuration is to a large extent self-explanatory.
Raid Protection Options
Only mitigate damage caused by players:
- Choose whether or not to only mitigate damage caused directly by players.
- Enable this to prevent players from causing base damage by baiting patrol helicopters, etc.
Protect players that are online:
- Choose whether or not to protect the bases of the players who are online.
- Works when "Scale of damage depending on the current hour of the real day" is configured.
Scale of damage depending on the current hour of the real day:
- Defines the protection levels based on the current hour of the real day.
- The key is the hour of the day (0-23), and the value is the protection scale (0 — 340282300000000000000000000000000000000).
Example:
"0": 0.0, "1": 0.0, "2": 0.0, "3": 0.0 This means that the protection level is 100% from midnight to 3am.
Scale of damage depending on the offline time in hours:
- Defines the protection levels based on the time since the player went offline. The key is the number of hours since the player went offline, and the value is the protection scale (0 — 340282300000000000000000000000000000000).
- The value of the hours can also be a decimal number.
Example:
"12": 0.25, "24": 0.5, "48": 1.0, "96": 2.0 This means that 12 hours after the player goes offline, the protection level will be 75%. After 24 hours it will be 50% and after 48 hours it will be 0%. After 96 hours, the damage is increased by 200%.
Cooldown in minutes:
- During this time, damage levels will remain vanilla. Raids are possible.
- Set this to a positive value to discourage defenders from interrupting raids by logging off.
Scale of damage between the cooldown and the first configured time:
- During this time, the level of damage between the cooldown and the first configured time can be set to a specific value, such as 0.0
Online time to qualify for offline raid protection in minutes:
- Time to qualify for offline raid protection after a player connects
- Set this to a positive value to discourage players from quickly logging on and back off solely to reset protection.
Protect all prefabs:
- Choose whether to protect all prefabs or only specific ones.
- This will protect anything in the TC range.
Protect AI (animals, NPCs, Bradley and attack helicopters etc.) if 'Protect all Prefabs' is enabled:
- Choose whether or not to protect AI entities if "Protect all Prefabs" is enabled.
- Set to false to reduce hook times, and to avoid protecting wild animals that wander by offline bases.
Protect modular and tug boats:
- Choose whether to protect modular boats and tugboats and their deployables.
- Checks wheel authorisation list, plus optionally lock authorisation lists.
Protect vehicles:
- Choose whether to protect vehicles or not.
- Vehicle lock authorisation always has priority.
- If you want to exclude certain vehicles from protection, add them to the blacklist.
- Tugboats and modular boats are separate from this.
Protect twigs:
- Choose whether to protect twigs or not.
Protect decaying buildings:
- Choose whether to protect buildings that are either decaying, or have at least 50% of building blocks below 90% health.
Ignore decay if due solely to twig:
- Choose whether to ignore decay state caused solely due to the presence of twig building blocks combined with a lack of wood in the TC.
- Set to true to ensure raiders cannot disable protection by building twig onto an offline base.
Prefabs to protect:
- List of prefabs that will be protected.
- Make sure you remove the prefabs you don't want to protect, some of them are pointless.
Prefabs blacklist:
- List of prefabs that will not be protected.
- Prefabs in the blacklist will always have priority to be unprotected.
Timezone Options
The fallback timezone is UTC if you leave it blank in the configuration, or if your configured timezone doesn't exist.
The timezone identifiers are different for Windows and Linux.
You can check the appendices to find your preferred timezone.
Conclusion:
The Offline Raid Protection plugin provides a comprehensive solution for protecting players' structures and vehicles. This plugin is essential for any Rust server owner who wants to provide a fair and enjoyable gaming experience for their players.
Acknowledgments
Special thanks to @Kulltero for his valuable feedback and suggestions during the development of this plugin.
