Download

What's the difference between UE_SERVER and WITH_SERVER_CODE

Which one should I use when writing server only code ?

AFAIK UE_SERVER code is still compiled even in non-server builds but WITH_SERVER_CODE is only compiled in server-builds.

Are you sure about that? I’ve been always thinking that it’s the opposite. UE_SERVER checks if it’s a Server build. And WITH_SERVER_CODE checks if server code is allowed for this build, for example:

Game: UE_SERVER=0, WITH_SERVER_CODE=1
Server: UE_SERVER=1, WITH_SERVER_CODE=1
Client: UE_SERVER=0, WITH_SERVER_CODE=0

Can anyone confirm?

You are right I seem to have gotten it backwards.

UE_SERVER checks if it’s a Server build. And WITH_SERVER_CODE checks if server code is allowed for this build or else try to](https://www.techwhoop.com/fake-person-generator/) generate fake person identityand use that ! worked for me .