How to use compiled extensions?Solved
Hello,

I am a C# developer with almost 10 years of experience. Last year I came across RUST and still play it. Was willing to make some moeny trying to develop some plugins for the servers. Have seen a lot of plugins posted as C# code files. I saw a few Oxide plugins being distributed as managed DLLs. How can that be achieved with uMod?

Looking forward to hearing from you guys!
Oxide extentions are the only things compiled as DLLs. These are usually projects that may contain a plugin, but not always. Extensions are installed where other game and Oxide DLLs are, whereas plugins are under oxide/plugins and compiled on server startup.

Oxide itself is comprised mostly of extensions, with Oxide.Rust being an extension itself.

That being said, plugins are what are mainly supported, not extensions. We will be moving away from the idea of third-party extensions on our site down the road, as plugins will be able to handle a lot more than they currently are able to.
Thanks Wulf for the explanations, now speaking programmatically for me extension or plugin are synonyms. The basic idea being able to extend a system by injecting (loading) modules dynamically. Being said that, your answer explains that plugins must be in the form of a single code file containing the single class. .NET ecosystem or sticking to SOLID princples, a complex project needs to be broken into several class files. How do you propose this to be achieved when their is a single C# file to be given as plugin since putting multiple classes in a file is bad practice and so does definition of sub classes (or private classes).

Another concern being if one writes a paid plugin/service then he would not like the code to be distributed as plain code file.

Do let me know how you propose to tackle the above two problems.

Merged post

Thanks Wulf for the explanations, now speaking programmatically for me extension or plugin are synonyms. The basic idea being able to extend a system by injecting (loading) modules dynamically. Being said that, your answer explains that plugins must be in the form of a single code file containing the single class. .NET ecosystem or sticking to SOLID princples, a complex project needs to be broken into several class files. How do you propose this to be achieved when their is a single C# file to be given as plugin since putting multiple classes in a file is bad practice and so does definition of sub classes (or private classes).

Another concern being if one writes a paid plugin/service then he would not like the code to be distributed as plain code file.

Do let me know how you propose to tackle the above two problems.
Plugins are currently single files, and will likely remain that way. You can have multiple plugins that communicate with each other though. Once our Marketplace is available, we will provide options for protection there, but as with any .NET application... it isn't guaranteed security as .NET is a very open language.
True that, I am aware of software protection methods like code obfuscation and all but most of them are applied on compiled DLLs.
Right, but even with obfuscation, there is deobfuscation. Just a matter of how hard you want that source.
Okay another question, are their any quick start tutorials for getting on with the project. Like explaining what all DLLs to reference in order to make a plugin? Another thing being what .NET version to target while making the class library project for uMod plugin (I mostly work with .NET core these days mostly but can work with legacy .NET framework too.

Below are some of the projects I have made. Do let me know if I can contribute to your company (uMod) in any programatic way. You can checkout my GitHub profile for more info.
https://github.com/waliarubal/Covid19
https://github.com/waliarubal/Jaya
The DLLs to reference depend on what you want to do. If working with games, you'd generally reference the mail DLLs relevant to that game. For Oxide (uMod is not released), you'd reference most of the Oxide DLLs found in the downloads.

Most of Oxide and uMod is comprised of extensions though, so if you want an example there are many there.

uMod: https://gitlab.com/umod

Oxide: https://github.com/OxideMod
Locked automatically