Facepunch / sbox-issues

175 stars 12 forks source link

Whitelist ModuleInitializerAttribute #5759

Closed badandbest closed 1 month ago

badandbest commented 3 months ago

What it is?

Whitelist Error: System.Private.CoreLib/System.Runtime.CompilerServices.ModuleInitializerAttribute

It runs methods with the ModuleInitializerAttribute when the containing module is initialized. https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.moduleinitializerattribute?view=net-8.0

Discord peeps seem to agree It could be a useful thing to whitelist for libraries in general. If not this, then please a custom s&box implementation.

Why do you need to use this?

In my case, during the setup of my library, the player needs to request their player data from my server. Obviously the time to get this data from the server is going to vary from connection to connection, but ideally I would want to start this request at the earliest possible moment so that players experience as small of a delay as possible.

Things I've tried:

garrynewman commented 1 month ago

This doesn't seem like a good idea