GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Release SmartCleanup 0.4.0 safety hardening · SeesAll/SmartCleanup@53f05e1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • CHANGELOG.md
  • README.md
  • SmartCleanup.cs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboard
+23-21Lines changed: 23 additions & 21 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
# SmartCleanup Changelog
22

3+
## v0.4.0
4+
5+
- Added layered event protection for RaidableBases, AirfieldEvent, MonumentAddons, CopyPaste, unsaved entities, plugin-owned entities, monument bounds, and protected skin IDs.
6+
- Added `API_ProtectEntity`, `API_UnprotectEntity`, and `CanSmartCleanupEntity` integration paths for future event plugins.
7+
- Added whole-connected-building protection so cleanup cannot partially remove a protected base.
8+
- Persisted entity first-seen/activity state and recent-owner activity across plugin reloads and server restarts, with automatic wipe reset.
9+
- Replaced synchronous full-index rebuilding with bounded per-tick batches and periodic reconciliation.
10+
- Added a mandatory successful dry-run and 120-second confirmation window before manual cleanup execution.
11+
- Fixed profile settings being unintentionally overwritten by advanced values; added explicit override switches.
12+
- Made `AutoTuneWriteToConfig` pin the resolved profile only when explicitly enabled.
13+
- Added invalid-config backup and fail-safe testing mode instead of silently running scheduled cleanup with defaults.
14+
- Added event and connected-structure totals to dry-run/run summaries and expanded status reporting.
15+
- Updated configuration schema to version 7.
16+
317
## v0.3.1
418

5-
- Added default Always Allow Cleanup prefabs:
6-
- campfire
7-
- lantern.deployed
8-
- bbq.deployed
9-
- Improved config migration logic
10-
- Updated config schema to version 6
19+
- Added default Always Allow Cleanup prefabs: `campfire`, `lantern.deployed`, and `bbq.deployed`.
20+
- Improved config migration logic.
21+
- Updated config schema to version 6.
1122

1223
## v0.3.0
1324

14-
- Production ready build
15-
- Added testing mode (Disable Scheduled Cleanup For Testing)
16-
- Added scheduled cleanup logging controls
17-
- Improved deployable classification
18-
- Improved rebuild logic to preserve entity age
19-
- Reduced console spam from scheduled runs
20-
- Improved dry-run reporting (WouldRemove)
25+
- Added testing mode and scheduled cleanup logging controls.
26+
- Improved deployable classification and rebuild age preservation.
27+
- Reduced scheduled-run console noise and improved dry-run reporting.
2128

2229
## v0.2.x
2330

24-
- Added deployable cleanup categories
25-
- Added force-allow and never-clean prefab lists
26-
- Added protected reason reporting
27-
- Fixed recent-owner protection override
31+
- Added deployable cleanup categories, prefab override lists, and protected-reason reporting.
32+
- Fixed recent-owner protection override.
2833

2934
## v0.1.x
3035

31-
- Initial SmartCleanup rewrite
32-
- Added TC privilege protection
33-
- Added disconnected structure cleanup
34-
- Implemented manual admin commands
36+
- Initial SmartCleanup rewrite with TC protection, disconnected structure cleanup, and admin commands.
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+66-120Lines changed: 66 additions & 120 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,100 @@
1-
# SmartCleanup (Rust / uMod Plugin)
1+
# SmartCleanup (Rust / Carbon and uMod Plugin)
22

3-
**Author:** SeesAll\
4-
**Version:** 0.3.1
3+
**Author:** SeesAll
54

6-
SmartCleanup is a modern replacement for legacy Rust cleanup plugins
7-
such as EntityCleanup. It safely removes abandoned structures and
8-
deployables while protecting legitimate player builds.
5+
**Version:** 0.4.0
96

10-
------------------------------------------------------------------------
7+
SmartCleanup is a safety-first replacement for legacy Rust cleanup plugins such as EntityCleanup. It identifies abandoned structures and selected deployables without repeatedly scanning and mutating the server's entire entity collection.
118

12-
## Why SmartCleanup Exists
9+
## Highlights
1310

14-
Older cleanup plugins treated all deployables the same which could lead
15-
to: - accidental removal of legitimate player storage - unsafe cleanup
16-
inside base areas - unnecessary performance overhead
11+
- Building and deployable cleanup with category controls
12+
- Fast PvP, Balanced, PvE/Conservative, Custom, and auto-detected profiles
13+
- Persistent entity age and owner-activity state across reloads/restarts
14+
- Bounded startup/reconciliation indexing and cleanup batches
15+
- Dry-run required before a manual destructive run
16+
- Whole-building protection when any connected part is protected
17+
- Event protection for RaidableBases, AirfieldEvent, MonumentAddons, CopyPaste, monument entities, unsaved entities, non-Steam owners, and configured skin IDs
18+
- Extensible protection API for present and future event plugins
19+
- Invalid-config backup and fail-safe scheduled-cleanup shutdown
1720

18-
SmartCleanup introduces category-aware cleanup, safer privilege
19-
detection, and performance-focused evaluation.
21+
## Safety Model
2022

21-
------------------------------------------------------------------------
23+
SmartCleanup checks protections before cleanup eligibility. By default it protects:
2224

23-
## Key Features
25+
- whitelisted and never-clean prefabs;
26+
- recently active owners;
27+
- entities inside TC privilege and TC-authorized owners;
28+
- an entire connected building when any part of it is protected;
29+
- event and monument entities;
30+
- unsaved or plugin-owned entities;
31+
- entities registered by another plugin.
2432

25-
### Intelligent Cleanup Categories
33+
The default monument protection is intentionally conservative. If a server deliberately wants abandoned player deployables inside monuments cleaned, disable `Protect Entities Inside Monuments` only after testing with all installed event plugins.
2634

27-
Server owners can control which deployable types are eligible for
28-
cleanup:
35+
## Profiles and Overrides
2936

30-
- Production deployables (furnaces, BBQs, campfires)
31-
- Lighting deployables (lanterns, tuna lamps)
32-
- Traps (bear traps, landmines, spike traps)
33-
- Utility deployables
34-
- Water and farming deployables
35-
- Electrical and industrial deployables
36-
- Storage deployables
37-
- Workbench deployables
38-
- Privilege deployables
39-
- Commerce deployables
37+
1. Auto Detect
38+
2. Fast PvP
39+
3. Balanced
40+
4. PvE / Conservative
41+
5. Custom
4042

41-
------------------------------------------------------------------------
43+
Profile defaults now remain authoritative unless the matching `Override Profile ...` switch is enabled. Custom profile values are always taken from the advanced settings. `AutoTuneWriteToConfig` pins the detected profile when explicitly enabled; set `ServerProfile` back to `1` to resume automatic detection.
4244

43-
### Safety Systems
44-
45-
SmartCleanup includes multiple layers of protection:
46-
47-
- TC privilege detection
48-
- Connected structure protection
49-
- Recent player activity protection
50-
- Health thresholds
51-
- Never-clean prefab list
52-
- Force-allow prefab list
53-
54-
These systems prevent accidental cleanup of legitimate bases.
55-
56-
------------------------------------------------------------------------
57-
58-
### Server Profiles
59-
60-
SmartCleanup supports preset environments:
61-
62-
1. Auto Detect
63-
2. Fast PvP
64-
3. Balanced
65-
4. PvE / Conservative
66-
5. Custom
67-
68-
Profiles automatically adjust cleanup timings based on server style.
69-
70-
------------------------------------------------------------------------
71-
72-
### Performance-Focused Design
73-
74-
Compared to older cleanup plugins SmartCleanup improves performance by:
75-
76-
- Tracking cleanup candidates instead of repeatedly scanning all
77-
entities
78-
- Evaluating entities in controlled batches
79-
- Running scheduled checks at configurable intervals
80-
- Avoiding unnecessary processing of protected structures
81-
82-
This design scales significantly better on medium and large Rust
83-
servers.
84-
85-
------------------------------------------------------------------------
86-
87-
### Logging Controls
88-
89-
Admins can choose how much information appears in console:
90-
91-
- Debug logging
92-
- Scheduled cleanup summaries
93-
- Removal-only logging (recommended for production)
94-
95-
------------------------------------------------------------------------
96-
97-
## Default Always-Allow Cleanup Prefabs
98-
99-
SmartCleanup always allows cleanup for common clutter deployables:
45+
## Admin Commands
10046

101-
campfire
102-
lantern.deployed
103-
bbq.deployed
47+
Permission: `smartcleanup.admin`
10448

105-
These objects are frequently abandoned across the map and safe to remove
106-
when outside TC.
49+
```text
50+
/smartcleanup status
51+
/smartcleanup dryrun
52+
/smartcleanup run confirm
53+
/smartcleanup retune
54+
/smartcleanup rebuild
55+
```
10756

108-
------------------------------------------------------------------------
57+
`dryrun` performs no removals. A successful manual dry-run opens a 120-second confirmation window for `run confirm`. Scheduled cleanup does not require this manual confirmation gate.
10958

110-
## Admin Commands
59+
## Event Plugin Integration
11160

112-
/smartcleanup status
113-
/smartcleanup dryrun
114-
/smartcleanup run
115-
/smartcleanup rebuild
61+
SmartCleanup has built-in conservative protection, but event authors can explicitly protect entities:
11662

117-
### Command Descriptions
63+
```csharp
64+
SmartCleanup?.Call("API_ProtectEntity", entity, "MyEvent");
65+
SmartCleanup?.Call("API_UnprotectEntity", entity, "MyEvent");
66+
```
11867

119-
Command Description
120-
----------------------- ---------------------------------------------
121-
/smartcleanup status Shows current runtime configuration
122-
/smartcleanup dryrun Simulates cleanup without removing entities
123-
/smartcleanup run Executes cleanup immediately
124-
/smartcleanup rebuild Rebuilds the internal candidate tracker
68+
Alternatively, another plugin may block cleanup for an entity:
12569

126-
------------------------------------------------------------------------
70+
```csharp
71+
private object CanSmartCleanupEntity(BaseEntity entity)
72+
{
73+
return IsMyEventEntity(entity) ? (object)false : null;
74+
}
75+
```
12776

128-
## Testing Mode
77+
Register event entities when the event starts and unregister them when it ends. Entity destruction is handled automatically.
12978

130-
For testing cleanup behaviour administrators can disable scheduled
131-
cleanup:
79+
## Testing and Deployment
13280

133-
"Disable Scheduled Cleanup For Testing": true
81+
For a first deployment, enable:
13482

135-
------------------------------------------------------------------------
83+
```json
84+
"Disable Scheduled Cleanup For Testing": true
85+
```
13686

137-
## Performance Notes
87+
Then reload SmartCleanup, wait for the bounded index rebuild to finish, check `/smartcleanup status`, and run `/smartcleanup dryrun`. Only disable testing mode after reviewing the dry-run totals and protected-reason breakdown.
13888

139-
SmartCleanup was built with performance in mind.
89+
SmartCleanup stores runtime state in `oxide/data/SmartCleanup_State.json`. The state is reset automatically on a new Rust save. Configuration remains in `oxide/config/SmartCleanup.json` and is merged forward during schema upgrades.
14090

141-
Compared to legacy plugins it:
91+
Never run SmartCleanup and another automatic entity cleanup plugin at the same time.
14292

143-
- reduces full entity scans
144-
- processes entities in controlled batches
145-
- skips protected structures early
146-
- uses category filtering to minimize work
93+
## Default Cleanup Categories
14794

148-
The result is a cleanup system that scales much better on long-wipe
149-
servers with large entity counts.
95+
Production, lighting, and trap deployables are eligible by default. Storage, workbenches, privilege, commerce, electrical/industrial, water/farming, and utility deployables remain protected unless enabled in configuration.
15096

151-
------------------------------------------------------------------------
97+
Default always-eligible clutter prefabs are `campfire`, `lantern.deployed`, and `bbq.deployed`; they still must pass age, location, activity, event, and other safety checks.
15298

15399
## License
154100

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.