textual-engine
textual-engine copied to clipboard
prune old rooms from state
trafficstars
Remove old rooms from the state struct when it reaches the configured limit. Remove the oldest rooms first, by visitation time/turn.
This should be handled with an ordered and limited-size list of visited IDs in the state service. When focus changes, add to the list, and remove items that exceed the limit. When items are removed, remove the corresponding rooms (with actors and items) from state. Ensure they will no longer receive script events or be written into the state file, and are eligible for GC.