Protecting C++ server code from decompiling

Hi, I want to create a multiplayer game with downloadable clients and private servers, so none will have the dedicated server executable. But the problem is that the server code is still included in the client. Is there a way to make the server code private?

Buidling game and enigne in “client” build should compile only code nessesery for client (i guess you will need to use #ifs in your code for that too if needed). Other then that you would need to use some 3rd party code protection software, but considering high modularity of UE4 (dense dll linking) there might be issues for using those on UE4.

Keep in mind anyone has “easy” access to UE4’s replication system source code, so anyone can figure how it works without digging to your code or else you use your own custom system.