How do i compile my code without the server rpc functions

I’ve already compiled the unreal engine from source code, so i already have the option to compile a dedicated server and a client only build.

How do i compile a client without the client having the server functions installed on there machine??
also is there a way for me to compile my client and skip certain cpp/header files?

Thanks -

There isn’t by default, as it’s not needed. If they’re Server functions they won’t run on the Client anyway.

Only way to add this kind of support in would be to create a set of #DEFINE tags such as BUILD_WITHSERVER or something, that only includes them in special builds. Would require a source-code level change though, and quite a lot of them I suspect.

I thought there was a #if server #end , or something. I’m sure iv’e seen it somewhere.

Hmm, not seen anything in the example content that I’ve gone through so far. ShooterGame has an extensive MP code base and it’s not used anywhere in there. It might appear in source code of the engine somewhere… you shouldn’t have to use it though.

You can wrap your code in #if WITH_SERVER_CODE #endif

Would that skip the code inside the tags if i compile a client. Also would my server functions still get called even though the function isn’t installed on there machine, thanks.