Networking Domains

This question is based on a few pieces of info/assumptions:

  1. Functions can be marked as client functions on the server side and executed on the client by running them on the server side as explained on the wiki https://wiki.facepunch.com/sbox/RPCs.
  2. Ability to use our own Nuget Packages on the server side for things such as ORM Frameworks etc.
  3. Nuget Packages should not be allowed on the client side.

With all these assumptions(some might be wrong but this is, from what I’ve gathered, true) the question is this:

Will there be multiple different assemblies for different domains of code, ie a server assembly, a shared assembly and a client assembly(possibly the client assembly and the shared is combined since they both can’t use nuget packages) or is there something I’m missing?

2 Likes

Regarding your assumptions:
image

Server has a whitelist by default which server owners would have to turn off in order to be able to use most NuGet packages. ORMs like Entity Framework Core use a lot of unsafe code which would never be allowed in a sandboxed environment.

Will there be multiple different assemblies for different domains of code, ie a server assembly, a shared assembly and a client assembly(possibly the client assembly and the shared is combined since they both can’t use nuget packages) or is there something I’m missing?

image
(readable part refers to obfuscated assemblies)

Based on this I assume you can just push arbitrary assemblies from server, which actually might include NuGet packages despite garry not support this. However because of the restrictions most NuGet packages would not work.

1 Like

No - the server and client run the exact same code from the exact same compile.

You can do checks at runtime such as if ( Host.IsClient ) etc, but we don’t allow compile time checks like #ifdef CLIENT. This is a conscious decision because we did that for Rust and have regretted it.

It makes sense for servers to want to hide sections of their code though, or at least to not send them to the client… so I imagine this will change.

12 Likes

I love how you guys take a lot of the struggles from rust development & attempt to cull them for S&box. Super excited.

2 Likes

Having a server-side only assembly seems pretty essential to me considering the fact that alot of gamemodes/servers need database access etc and would like access to great libraries already out there. I’m very hopeful for the future and very hyped.

5 Likes