Facepunch / sbox-issues

176 stars 12 forks source link

Allow loading safe assemblies at runtime #3006

Closed gio3k closed 2 months ago

gio3k commented 1 year ago

For?

S&Box

What can't you do?

This is a bit of a long shot - but it'd be really cool to have

I can't load assemblies without downloading an addon from asset.party

I'd like my game to be able to create assemblies -> have them go through access control -> run them

How would you like it to work?

SafeAssembly.Load(Stream) SafeAssembly.LoadFrom(string)

What have you tried?

Nothing - This could be a feature already but I haven't found it, please lmk if so

Additional context

This could make stuff like Lua interpreters or different languages make sense - instead of interpreting a Lua addon line by line it could just be compiled into an assembly and then handled by the runtime JIT

garrynewman commented 1 year ago

What do you mean by create assemblies? You want to self compile or get them from somewhere else?

gio3k commented 1 year ago

That is something to think about - I would like to self compile preferably!

This issue is just to make this type of thing possible at all, but it would be helpful to add an API for creating assemblies - s&box already ships with Mono.Cecil for IL verifying, even just a little wrapper to create an assembly with custom IL would add a bunch of new possibilities