midspace / Space-Engineers-Admin-script-mod

Modding script for Space Engineers with dozens of Admin commands for creating game scenarios or supporting servers.
44 stars 13 forks source link

ENH: way for server admins to establish age of an object #126

Closed jpcsupplies closed 5 years ago

jpcsupplies commented 9 years ago

This may be difficult now since listships is broken..
The idea crossed my mind for economy mod, but its more an admin maintenance information item so is more appropriate to the admin mod.

Basically some sort of object ID database logging the date each object was first encountered by the admin script would assist in cleaning up maps. (similarly to how /seen works in economy but for ships/stations) On long running servers working out if an item is old broken junk... or recently added new construction makes it difficult when deleting junk. (be cool if SE toolbox sees the file too)

For the sake of efficiency this list could only update when the server starts, meaning new items will not have a date yet - which could be reflected by simply calling such items "new" or "recent" in any such query. It could also only update on invoke of the command, instead of server start; but that may introduce lag in player heavy and large map servers; while on startup an extra few seconds is unlikely to be noticed.

We are only working with ship/stationIDs here so location etc would be irrelevant. (Although such behavior could be used a a temp hack/workaround for the /listship line of sight/loaded chunk issue #120 if this database also recorded locations) The list could be built server side, similarly to how the listship command was constructed, which should cater for similarly named objects as different objects too hopefully.

Downsides: If the ID is based on ship name, the date will reset if a player renames it. (minor issue since that means recent activity anyway) Location will be out of date between server restarts on moving objects; unless it updates on invoke. Items that a player simply hasn't got around to finishing, but the player themself is still active may show as old (so maybe record owner details too)

Upsides: Admins can now effectively date the age of objects, and delete old junk... instead of that new ship someone was building.. that just happens to look like junk.. Can use some existing logic in admin mod - it is just being logged with a date.

jpcsupplies commented 5 years ago

Vanilla game now records last logged in date for grid owners, and also has a delete grids if owner idle option now, its not perfect but seems adequate.