I’m looking for a way to designate a config value as “dedicated server only”; that is, I want it such that when UE4 builds a client (non-dedicated server), it automatically strips the given configuration value from the build so that it is not included in the final client package.
Our plugin involves the use of a public/private key pair, and while I want the private key pair to be present during development (when you’re using the editor, so that multiplayer PIE works), I need to ensure that the private key never gets shipped with the game.
So far I haven’t been able to find anything on this topic. Does anyone have any ideas?
EDIT: Actually, I’d also settle for having a configuration item that is stripped out of all builds if server-only is not an option, since our plugin can also accept the private key as an environment variable for the dedicated server.
That will change the code so that it doesn’t load the value at runtime if it’s on the client. But what I actually want is for the value to not appear in the config files at all on the client. Effectively, I want the packaging process to strip out config values that are “server only” when building the game client.
Don’t put the private key into the project at all.
Have your code read it from an environment variable (e g, with “getenv()”) and set that environment variable when you run the server in question.
Development workstations can use a development private key and set up their own environment variables as part of build setup.