-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Right now whenever anything changes (entity is marked dirty) we are attempting to destroy the entity and rebuild it... this is not happening cleanly though.
If the exact spell used by the entity is changed, we should destroy the old instance, create a new instance and attach it to the client. Ideally we don't need to destroy the client, but that might be easier. In either case we need to make sure that we aren't leaking memory or holding on to old references.
If the API key etc is changed, we'll need to completely destroy and restart that client. We want to keep the entity itself alive, but, for example, if we update Discord, we should destroy discord client and restart.
These services are meant to be long-running, so we should make sure they are starting and destroying properly and be meticulous about this.