Is there any way that oxide can be made to update without requiring a server restart?
Request Update Oxide without restart
Discussion in 'Feature Suggestions' started by [X] Meep, Aug 1, 2015.
-
Wulf Community Admin
It's not easily done, as Oxide modifies the main DLL for Rust. I may be wrong though, but I did discuss it with others not too long ago. It may be possible to replace it, but I'm not sure that the system will see the changes until it has been unloaded and loaded via a restart.
-
maybe it can be done by cleaning the dll data, and inject a new one on the fly
-
Its simple actually
There is AppDomains for control assemblies.
If all DLLs load in a domain, it can be unload (maybe needs same cleaning too but not that much) and reload with same load function/s.
Code:var exampleDomain = AppDomain.CreateDomain("exampleDomain", AppDomain.CurrentDomain.Evidence, new AppDomainSetup { ApplicationBase = "dll directory" }); exampleDomain.Load("assemblyName"); AppDomain.Unload(exampleDomain);
-
Wulf Community Admin
AppDomains are also are not suitable for high performance software, they require serialization and a IPC for communication with other AppDomains which introduces a massive amount of overhead. It's not always as simple as what StackOverflow shows.
We will be adding automatic updating support eventually, but it would best to handle it before starting the server. There are other priorities right now though. -
Actually I didn't check the source of Oxide and its just my opinion for help. Please keep it in mind while you read this., there is some guessings about Oxide's do. And what do you mean with "It's not always as simple as what StackOverflow shows."? It's my knownledge about c# and reflection library. Don't be heartbreaker.
There is no need for IPC becouse you will need only one AppDomain.
And what is the point of serialization for it? No need again.
AppDomains are equal with your current domain and its just a "pool" as current one which means there is no performance issues. And also there is no changes between AppDomains and current domain except breaking the communication with current one. But you will use a simple communication already like before do. Want or not, Microsoft already forcing you to use it and you have a default AppDomain pool already. -
Wulf Community Admin
-
Restart/shutdown is better way to do this of course