Open gio3k opened 3 days ago
Very usefull for standalone and dedicated servers, but not really for games published on S&box because the whitelist is very strict and a lot of assemblies will not pass the whitelist..
I.g Newtonsoft use Linq.Expressions, and this package is not whitelisted MongoDb use Linq.Expressions for building json filters
Another example, if any assembly are printing a message with a simple Console.WriteLine, you will not be able to compile 😅
This proposal is only viable for game that will have disabled the whitelist or for dedicated servers in the future
I don't know if it's realistic to check compiled assemblies against the whitelist easily, and could open up too many risks if it's not perfect. However I absolutely think referencing external assemblies is important for standalone and dedicated servers and is currently the biggest thing holding me back on a standalone-targeted project I'm working on. If the whitelist is turned off there should be very little barriers to development.
I don't know if it's realistic to check compiled assemblies against the whitelist easily
Assemblies are validated at load time too (see Sandbox.AccessControl.VerifyAssembly & Sandbox.PackageLoader.LoadAssemblyFrom*) so this is not a huge problem
I do agree that this being added is pretty much integral for standalone games
This proposal is only viable for game that will have disabled the whitelist or for dedicated servers in the future
I don't fully agree - not every external assembly needs to be a NuGet package or an open-source library, it can be something purpose made for use in both s&box and other projects
What can't you do?
Reference an assembly (or csproj, that could be good too) and use it in the game code
How would you like it to work?
I had an example for tools back when we were in the entity system: https://github.com/Facepunch/sbox-issues/issues/3155#issuecomment-1518638039
That would still be awesome, but this request is for the game environment
What have you tried?
I think a long time ago I patched the publish editor tool to upload a custom assembly alongside the game and base assembly - iirc it was loaded normally and the IL was verified and everything so it was safe
Additional context
I’d like to share a few assemblies (that don’t use code outside of the whitelist) between a backend and my game code
I could get around this by using submodules or symlinks, but that’s pretty annoying and fragile especially if I want to make big changes to the project structure
It’s not something that’s impossible to do at the moment, it’s just something that I don’t want to spend the time hacking around, I’m getting old!