wrecking-ball-revived

#48 - published 5 months ago

Wrecking Ball Revived

Notice: This plugin has been forked from ApokPT\’s Wrecking Ball plugin, and fixed for the newer updates of Unturned and rocket.

 

Due to the lack of updates/development for the plugin from the original author ApokPT, the plugin has been forked and fixed to work on the newer versions of Unturned and Rocket. The original repository for this plugin can be found here: https://github.com/ApokPT/Rocket-Plugin-Wrecking-Ball. My fork of the plugin can be found here: https://github.com/cartman-2000/Rocket-Plugin-Wrecking-Ball

 

This plugin can also make use of this plugin to get extended info in the scans. The plugin isn\’t required for this plugin to work, without it you will only get an output of player Steam ID\’s in the scans.
https://harbor.rocketmod.net/plugins/player-info-library/

 

This addon allows you clear stuff in a defined radius using filters

Available Commands

/wreck <filter> <radius> [<x> <y> <z>]
/wreck <ItemID> <radius> [<x> <y> <z>]
/wreck <SteamID> <filter> <radius> [<x> <y> <z>]
Creates new elements destruction list. An xyz position is to be used when executing it from the console.
You can also use an ItemID or SteamID.
The filter flags in this are case sensitive.
/wreck confirm Confirms list destruction
/wreck abort Aborts list destruction
/wreck scan <filter> <radius> [<x> <y> <z>]
/wreck scan <ItemID> <radius> [<x> <y> <z>]
/wreck scan <SteamID> <filter> <radius> [<x> <y> <z>]
Scan for <filter> in <radius> and list counts for each type of element. An xyz position is to be used when executing it from the console.
You can also use an ItemID or SteamID.
The filter flags in this are case sensitive.
/wreck teleport b|s|v Teleports caller to a barricade/structure/vehicle at a random location.
/w Alias: Has same syntax as the above commands.
/listvehicles [radius] Command for listing all the vehicles plus the position and number of elements for those vehicles in a radius.
Running the command from the console will print out the full list of vehicles on the server.
The radius on the command is only used/needed when running it from a client.
/disablecleanup <\”playername\” | SteamID> Disables cleanup on a player until the next time they log onto the server, works as a toggle.
If you want to disable cleanup on specific players permanently, you should apply the cleanup skipping permissions to the player instead.
/listtopplayers Displays a list of players with the highest element counts on the server.

 

Available Filters

b Beds
t Traps
d Doors
c Containers
y Trophy Containers/Weapon Racks
l Ladders
w Walls / Windows
f Floors
p Pillars
r Roofs / Holes
s Stairs / Ramps
m Freeform Buildables
n Signs
g Guards (Barricades / Fortifications)
o Protections (Safe Zone Generator / Claim Flags)
i Illumination (Fireplaces / Torches)
u Industrial (Generators / Oil Derrick)
a Agriculture (Planters / Crops)
D Map Decorations (Furniture like elements, Sofas / Counters, etc)
V Vehicles
Z Zombies
A Animals
! Uncategorized (Everything else that isn\’t in the id list in the plugin.)
* Everything (Except zombies.)

 

Available Permissions

wreck.* Allows caller to use the full /wreck command(wreck/scan/teleport).
wreck.wreck Allows caller to use the wrecking portion of the /wreck command.
wreck.scan Allows caller to use the scanning portion of the /wreck command.
wreck.teleport Allows caller to use the teleport portion of the /wreck command.
wb.skipbuildables The Auto Cleanup feature will skip over cleaning up the player\’s buildables if they have this perm.
wb.skipplayerdata The Auto Cleanup feature will skip over cleaning up the player\’s data files if they have this perm.
wb.bypassvehiclecap Allows a player to bypass the vehicle cap, the car will never destroyed by the cap. Works as long as the car is locked, or has a sign owned by the player with this perm.
listvehicles Allows caller to use the /listvehicles command.
disablecleanup Allows the use of the /disablecleanup command.
listtopplayers Allows the use of the /listtopplayers command.

 

Other Options

Enabled Enables the command to be used. (does not apply to admins)
DestructionRate Default: 10. Number of times a second to run an interval for destroying elements. The intervals will run slower than what is set here if the server\’s TPS is less than what this is set to, there can be at most one interval per server tic.
DestructionsPerInterval Default: 10. Number of elements to destroy in one interval. This times the DestructionRate gives you the Number of elements destroyed per second(destruction speed.). Note: Having a total destruction speed over 200 elements per second may lag clients that are in the area when it is being ran.
LogScans Allows scans to be printed to the Rocket Log.
PrintToChat Allows scans to be printed to your chat(can be difficult to use with the limited number of lines allowed in the chat.
Categories List of Categories. The Category Id\’s are specified by a single char, and have to be unique to the others. Invalid chars are control characters and *. The Color attribute are set to the color names from the ConsoleColor Enum class in C#, which you can see here. Deleting this block in the config file will cause the default Categories to be loaded on the next plugin load.
Elements List of Elements. The Element id has to be unique on these records, and the CategoryId is set to the Category Id you want the element to be under. Deleting this block in the config file will cause the default Elements to be loaded on the next plugin load.
EnablePlayerInfo Enables the extended player info output to scans, requires that the Player Info Lib plugin be on the server and loaded, without the lib plugin this option will disable itself on plugin load. (Read update notes for 2.2.0.1, for info on the lib plugin.)
EnableCleanup Enables the auto cleanup feature in the plugin to cleanup buildables and player files by a set time since the player was on. Requires PlayerInfoLib 1.2.0.0 or above.
BuildableCleanup Enables the cleaning up player buildables on the server.
BuildableWaitTime The number of days the player has to be inactive for their buildables to be cleaned up. To use this instead of Unturned\’s internal decay feature, the internal one should be disabled.
CleanupLockedCars Will cars that a player has locked to them be cleaned up as well(destroyed) with their buildables.
PlayerDataCleanup Enables the cleanup of player data files, to keep the Players folder a bit tidy.
PlayerDataWaitTime The number of days the player has to be inactive for their player files to be cleaned up.
CleanupIntervalTime The amount of time between each cleanup batch.
CleanupPerInterval The number of players to cleanup per batch for each cleanup type.
EnableVehicleCap Enables an enforced server wide vehicle cap, to keep the lag caused by vehicles down, this has two mods(see the option below.).
VCapDestroyByElementCount Enables the destroying by element count mode with lowest count first. With this false, it\’ll go by oldest first on the server instead.
MaxVehiclesAllowed Maximum number of vehicles to allow on a server before the cap kicks in.
Warning: This should be set to something higher than the natural spawn count for a map, otherwise it\’ll keep on destroying vehicles on each interval.
VCapCheckInterval How often in seconds to run the check, it\’s best to set this to something higher than the respawn rate for vehicles on your server.
LowElementCountOnly Enables destroying vehicles below a set count only.
MinElementCount Cars with this or more elements are safe from being cleaned up from the cap
KeepVehiclesWithSigns Allows you to keep vehicles with signs/flags from being cleaned up from the cap, will only destroy signless cars with this set.
VehicleSignFlag Set\’s which flag will be counted as a sign, for use with the KeepVehiclesWithSigns variable in the vehicle cap, and the \”Sign by\” outputs on the listvehicles command and /w scan\’s.
LimitSafeGuards Enables the disabling of the min element count and signs safeguards and resetting to the beginning of the loop after a certain percentage of the max allowed vehicles have been skipped by these.
LimitSafeGuardsRatio Max number of vehicles to skip in percentage from max allowed vehicles.
PlayerElementListCutoff Sets the minimum elements needed to be displayed on the /listtopplayers command.
CategoryListVersion Stores the version of the category list in the plugin(Do not modify!)
ElementListVersion Stores the version of the elements list in the plugin(Do not modify!)

How to use:

  • /wreck wpf 200 (will queue all Walls, Pillars and Floors within 200 meters for destruction)
  • /wreck confirm (will confirm the destruction of the above queue)

 

Update Notes:

  • 3.1.1.0: Added plot to the element list, under Agriculture.
  • 3.1.2.0: Added the new Sentries to the Traps category, and the Carepackage to the Containers category(although the carepackage is setup by nelson to not save across server restarts.).
  • 3.2.0.0: Added the /listtopplayers command that will allow you to see a list of players, with element counts, that have the highest element counts on the server. The command will also show extended player info if you have the player info lib plugin on the server.
  • 3.2.1.0: Updated the elements list to include id: 1393 under the category of traps, for the new Precise Charge, you can either delete the elements block in the config file, or add it to the block.
  • 3.2.2.0: Updated the elements list to include id\’s: 1396 and 1397 for the new Ghillie Netting items, both have been added under the freeforms category. You can either delete and regenerate the elements block in the config or add these id\’s with the category letter \’m\’ to the elements list.
  • 3.3.0.0: Update various vehicle messages to print the Steam ID for the one who locked it, it will also print extended info of a player(like in element scans), if the player info lib plugin is active on the server. Added a teleport to vehicle feature(flag v) to /w teleport.
  • 3.3.1.0: Updated the elements list to have the new Mannequins and plaques, under the Trophy Containers category.
  • 3.3.2.0: Updated the elements list to have the new ramp walls, these have been added under the walls(flag w) category, also a check has been added to have a car with players in it skipped over by the vehicle cap, so it doesn\’t kill the players in the vehicle.
  • 3.4.0.0: Split the perms of the wreck command to allow specific parts of the command to be used, you will need to use the perm wreck.* to get all perms for the /wreck command, the other perms are in the permissions info section. Added permissions to allow a player with them to bypass the auto cleanup feature in the plugin(Players with these perms won\’t decay.). Fixed the vehicle cap not working.
  • 3.4.1.0: Added a sign check to the vehicle cap for those that have the \”wb.bypassvehiclecap\” permission.
  • 3.4.1.1: Updated for compitibility with Unturned 3.17.12.1.
  • 3.4.2.0: Added some more aliases, listtp for listtopplayers, listv for listvehicles and disablec for disablecleanup.
  • 3.4.3.0: Added the Stereo to the list of elements, It\’s under the Decorations Category(flag D), with id 1466, you can either delete the Elements block in the config file to regenerate the list on the next plugin load/reload, or add the line to the Elements list yourself.
  • 3.5.0.0: Added some scripting/automation code to the config setup to auto add new categories and elements to the list, when they\’re added to the plugin, this has two new config options for this, you shouldn\’t modify these directly. You can still do a reset of the lists in the plugin, it\’ll run through the list update process again, if it finds one of the lists empty(the version option for that list will get reset if it finds an empty list.). I also split the Unturned libs out of the main libs directory, as the ones on the rocket plugin build server is out of date and will give you an error if you try to wreck something on the server.
  • 3.6.0.0: This is a rather large update: This update has been a compatibility update for the train vehicles in the game, made it so they can\’t be destroyed  by the wreck command, or by the vehicle cap(A special case to this is that you can still destroy the train using wreck, from the console only, for those that have multiple trains stuck on their server\’s.). the ability for players locked vehicles to be destroyed by wreck(steam id search.) and by cleanup(if it\’s enabled.) has been added. The output of the Listvehicles command and /w scan output has been changed too, for vehicles in either command, it\’ll now show the owner of the first sign on the vehicle, if there is one. The /w scan out put will now show item names and vehicle names(and actual vehicle id\’s for vehicles). The ability to kill animals has been added to the server, with the A flag, and the vehicle and zombie flags have been set to uppercase, and the id\’s for them set to the sub 1k range so it won\’t potentially conflict with any workshop mod that has an element with the same id\’s. And finally, Logging has been added to wreck scans and destruction queues, along with the confirmation of a wreck too.
  • 3.6.0.1: Recompiled to work on Unturned 3.21.4.0, the link for it is near the top of the description, as the build server’s Unturned libs are too outdated to build the plugin.
  • 3.6.0.2: Recompiled again to work on newest versions of Unturned(3.22.0.1), something in the newest versions of Unturned “silently” broke some of the vehicle handling stuff in the plugin, so it needed to be recompiled.
  • 3.6.0.5: Fixed the cleanup of cars when the option for it is enabled, in buildables cleanup, updated to reference newer build of playerinfolib(for plugin build).
  • 3.6.1.0: Implemented the new feature in the PlayerInfoLib plugin to show if a player has VIP on the server on things that output info from this plugin.
  • 3.6.1.1: Fix vehicle element count in scans, update libs for Unturned 3.24.0.0.
  • 3.6.2.0: Added the vehicle instance id to the vehicle record scan output.

Todo:

  • Export element id lists to the config file, would allow you to set workshop id\’s to the plugin without the need to import the id\’s into the plugins code. – Completed in 2.0.0.0
  • Try to fix the potential for ghost/indestructible elements after a destruction run: Maybe something Nelson has to fix, as it appears that the barricade and structure arrays(two arrays/lists for both types of elements.) can get out of sync with each other in which only a server restart will fix. – Fixed in 2.0.0.0(As far as I can see in testing.)
  • Add scanning for elements on cars. Completed in 2.1.0.0
  • Add ability to scan by element ID(Will be either scan by the current style Category ID, or by Element ID.) Completed in 3.0.0.0, replace flags parameter with ItemID to use ItemID\’s.
  • Add ability to scan by SteamID. completed in 3.0.0.0.
  • Change the wreck command to be usable from the console too. Completed in 2.3.0.0
  • Look into adding a fix command(to heal elements.).
  • (Later) Add char/steam names to the owner output as well, this would require the creation of a library plugin to store the char/steam names of players on the server.  The plugin will use a mysql database to store the player info, and will be optional to use with this plugin(Steam id\’s only on the owners without the plugin.).  Lib plugin completed, Initial support in Wrecking Ball 2.2.0.1.
  • Add an alternate to the Decay feature in Unturned(would require the player info lib plugin.) Allow the elements and/or player files on the server to be cleaned up automatically after a set amount of time of them not being seen on the server. Completed in 3.0.0.0, for both player buildables and data files.

Default configuration


Default english translation


<?xml version="1.0" encoding="utf-8"?>
<Translations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Translation Id="wreckingball_lv_help" Value="&lt;radius&gt; - distance to scan cars." />
  <Translation Id="wreckingball_lv2_vehicle" Value="Vehicle: {5}({6}) position: {0}, with InstanceID: {1}, Barricade count on car: {2}, Sign By: {3}, Locked By: {4}." />
  <Translation Id="wreckingball_lv2_traincar" Value="Vehicle: Train Car#{5} position: {0}, with InstanceID: {1}, Barricade count on Train Car: {2}, Sign By: {3}, Locked By: {4}." />
  <Translation Id="werckingball_dcu_help" Value="&lt;&quot;playername&quot; | SteamID&gt; - disables cleanup on a player." />
  <Translation Id="werckingball_dcu_not_enabled" Value="This command can only be used if the cleanup feature is enabled on the server." />
  <Translation Id="wreckingball_dcu_player_not_found" Value="Couldn't find a player by that name on the server." />
  <Translation Id="wreckingball_dcu_hasnt_played" Value="Player hasn't played on this server yet." />
  <Translation Id="wreckingball_dcu_cleanup_disabled" Value="Auto Cleanup has been disabled for player {0} [{1}] ({2})" />
  <Translation Id="wreckingball_dcu_cleanup_enabled" Value="Auto Cleanup has been enabled for player {0} [{1}] ({2})" />
  <Translation Id="wreckingball_scan" Value="Found {0} elements of type: {1}, @ {2}m:{3}" />
  <Translation Id="wreckingball_map_clear" Value="Map has no elements!" />
  <Translation Id="wreckingball_not_found" Value="No elements found in a {0} radius!" />
  <Translation Id="wreckingball_complete" Value="Wrecking Ball complete! {0} elements(s) Destroyed!" />
  <Translation Id="wreckingball_initiated" Value="Wrecking Ball initiated: ~{0} sec(s) left." />
  <Translation Id="wreckingball_processing" Value="Wrecking Ball started by: {0}, {1} element(s) left to destroy, ~{2} sec(s) left." />
  <Translation Id="wreckingball_aborted" Value="Wrecking Ball Aborted! Destruction queue cleared!" />
  <Translation Id="wreckingball_help" Value="Please define filter and radius: /wreck &lt;filter&gt; &lt;radius&gt; or /wreck teleport b|s" />
  <Translation Id="wreckingball_help_console" Value="Please define filter, radius and position: /wreck &lt;filter&gt; &lt;radius&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt;" />
  <Translation Id="wreckingball_help_teleport" Value="Please define type for teleport: /wreck teleport s|b|v" />
  <Translation Id="wreckingball_help_scan" Value="Please define a scan filter and radius: /wreck scan &lt;filter&gt; &lt;radius&gt;" />
  <Translation Id="wreckingball_help_scan_console" Value="Please define a scan filter, radius and position: /wreck scan &lt;filter&gt; &lt;radius&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt;" />
  <Translation Id="wreckingball_queued" Value="{0} elements(s) found, ~{1} sec(s) to complete run." />
  <Translation Id="wreckingball_prompt" Value="Type '/wreck confirm' or '/wreck abort'" />
  <Translation Id="wreckingball_structure_array_sync_error" Value="Warning: Structure arrays out of sync, need to restart server." />
  <Translation Id="wreckingball_barricade_array_sync_error" Value="Warning: Barricade arrays out of sync, need to restart server." />
  <Translation Id="wreckingball_sync_error" Value="Warning: Element array sync error, not all elements will be cleaned up in range, server should be restarted." />
  <Translation Id="wreckingball_teleport_not_found" Value="Couldn't find any elements to teleport to, try to run the command again." />
  <Translation Id="wreckingball_teleport_not_allowed" Value="Not allowed to use wreck teleport from the console." />
  <Translation Id="wreckingball_reload_abort" Value="Warning: Current wreck job in progress has been aborted from a plugin reload." />
  <Translation Id="wreckingball_wreck_permission" Value="You need to have the permissions wreck.wreck, or wreck.* to be able to run a wreck." />
  <Translation Id="wreckingball_scan_permission" Value="You need to have the permissions wreck.scan, or wreck.* to be able to run a scan." />
  <Translation Id="wreckingball_teleport_permission" Value="You need to have the permissions wreck.teleport, or wreck.* to be able to run a teleport." />
</Translations>

Commands and permissions


/disablecleanup <"playername" | SteamID>

Permissions: disablecleanup

Disables cleanup on a player.


/listtopplayers

Permissions: listtopplayers

Gets the elements counts for players on the server, displays the top counts.


/listvehicles In-game only: <radius>

Permissions: listvehicles

lists positions and barricade counts on cars on a map.


/wreck Scan: /w scan <Flag|ItemID> <Radius> | /w scan <SteamID> <Flag|ItemID> <Radius>, Destruct: /w <Flag|ItemID> <Radius> | /w <SteamID> <Flag|ItemID> <Radius>, Teleport: /w teleport <b|s|v>

Permissions: wreck

Destroy everything in a specific radius!


Git changelog


ac2c4dd679afd4b 2018-06-11 04:37:54

3.24.1.0 libs.

    Download

    Build #48
    By downloading this file, you agree to our license terms.

    Repository

    github.com

    License

    MIT

    Author

    cartman-2000