Discovery Gaming Community
[Coding] Clear up which plugins are safe to reload and which are not (and why) - Printable Version

+- Discovery Gaming Community (https://discoverygc.com/forums)
+-- Forum: Discovery Development (https://discoverygc.com/forums/forumdisplay.php?fid=7)
+--- Forum: Discovery Mod General Discussion (https://discoverygc.com/forums/forumdisplay.php?fid=37)
+---- Forum: Discovery Mod Bug Reports (https://discoverygc.com/forums/forumdisplay.php?fid=573)
+---- Thread: [Coding] Clear up which plugins are safe to reload and which are not (and why) (/showthread.php?tid=199811)



[Coding] Clear up which plugins are safe to reload and which are not (and why) - Alex. - 10-23-2023

Type: Coding
Bug: What it says on the tin. Some things, like ducktales, disabledock, getrep, jsonbuddy, and more presumably hold no or very little state and can be reloaded at will. Others may hold state but properly persist it properly such that we can safely unload them, change both their configs and the DLL files themselves, and re-reload them. That we do not have the confidence to just unload some plugins right now is bad.


RE: [Coding] Clear up which plugins are safe to reload and which are not (and why) - Aingar - 10-23-2023

Alley - Unsafe due to how many different functionalities are crammed into it.

Autobuy - Safe. It has no concept of persistence and performs a thorough scan from beginning to the end when entering a base.

BalanceMagic - Gone, reduced to atoms.

Base - Unsafe, while it does do its best to destroy all custom spawned solars, it's not waterproof enough to reliably do it at scale.

CloakPlugin - Unsafe, ships already in cloak would stop draining fuel and remain in their cloaked state until they dock/launch.

CommodityLimit - Somewhat unsafe, would allow people to perform otherwise illegal transactions for the duration. Otherwise no risk to server state.

Conn - Safe. All persistence is happening within the player files and as such, nothing is lost during the reload.

DroneBays - not used

DSAceSrv - Unsafe, too much stuff in it.

Disable_Dock - Extremely safe, single hook that checks if docking should be blocked or not.

Event - Safe if no event is currently ongoing, unsafe otherwise.

JSONBuddy - Safe

[color=#00BF00]Kill_Tracker - Safe, only damage is resetting the current damage counts.


Mobile_Dock - Impossible. Due to asynchronous handling of the file save handling method, the plugin was made impossible to pause or unload even if a madlad tried to do it.

MarketFlipper - Safe, no persistence, everything is logged to a file and not kept in memory.

MiningControl - Somewhat unsafe. It has no handling for currently deployed mining containers, which would simply become inert and remain destroyable. Beyond that, it'd potentially allow people to spawn somewhat-obscene amount of CLoot objects by shooting mineable rocks.

MiscCommands - Safe, no persistence

MunitionCntl - Safe. Only persistence is the config-loaded collection of projectiles requiring special handling.

NPC_Controller - Safe. As long as there are no custom spawned NPCs present in the game, no action needs to be taken, if they are, they will simply persist until they're left alone for a minute or blown up. No risk to damage the server state.

PlayerControl - Unsafe simply by sheer volume of stuff crammed into that plugin.

PVE_Controller - Safe. The only persistent elements are pending bouties which would be lost, and config loaded settings.

TempBan - Safe, no persistence other than currently temp banned players.


RE: [Coding] Clear up which plugins are safe to reload and which are not (and why) - Laz - 10-23-2023

(10-23-2023, 09:13 AM)Aingar Wrote: Safe, no persistence other than currently temp banned players.

Don't know how this differs from 3.1 and 4.0 - but I would make absolutely sure with this one. I remember having to clear out a bunch of references back when this was a plugin.

(10-23-2023, 09:13 AM)Aingar Wrote: Mobile_Dock - Impossible. Due to asynchronous handling of the file save handling method, the plugin was made impossible to pause or unload even if a madlad tried to do it.
Would be quite easy to to setup a call to dll unload, properly wait for thread termination. I can show you how if you decide to go down this route.

(10-23-2023, 09:13 AM)Aingar Wrote: Event - Safe if no event is currently ongoing, unsafe otherwise.
If that's the case, remove it from the load list when no event is happening.

(10-23-2023, 09:13 AM)Aingar Wrote: CloakPlugin - Unsafe, ships already in cloak would stop draining fuel and remain in their cloaked state until they dock/launch.
There is a hack we can implement that will have cloaks be "off by default" rather than on, additionally, there are steps that can be performed during shutdown to put things into the correct state. Again, happy to show if you decide to make these changes.


RE: [Coding] Clear up which plugins are safe to reload and which are not (and why) - Aingar - 10-23-2023

I'd love to see the cloak change, it'd stop cloak equipped ships from playing this stupid animation when undocking/coming into view.