Ivan3z
(Ivan3z)
February 20, 2025, 11:27pm
1
I’m building dedicated server for the first time.
For now the only thing I’ve done is create my file
MyProjectServer.Target.cs
And compile
I have an error when compiling that I don’t have when compiling the client/listen
error C2039: "ShiftChild": is not a member of "UVerticalBox"
I know that the dedicated server doesn’t render, it doesn’t have widgets, sounds, particles and stuff like that…
I just want to know how I can make it skip unnecessary code at compile time.
Should I to use some predefined macro definitions wirh Preprocessor directives?
If so, what is the definition?
Otherwise… how should I handle this correctly?
Thank you so much!!
Ivan3z
(Ivan3z)
February 21, 2025, 12:01am
2
Ok, i found this publication
Seems it let me compile without errors…
#if !WITH_SERVER_CODE
Container->ShiftChild(0, Widget);
#endif // WITH_SERVER_CODE
I just hope it does not omit the code for listen server
The key to this is the Server and Client code configuration. So to build a cooked client that doesn’t have access to dedicated server code you can build “Development Client”, which is almost the same as “Development” but with server-only code disabled. What this does is set the WITH_SERVER_CODE define to false. When this is false various things like server-side networking are compiled out in the engine. There is no client-only configuration with editor functionality enabled, so this only works w…
Thank you so much @Ben_Zeigler
Edited 1:
I don’t understand why only this function generated errors.
I have many widgets in my project.
Can someone explain if I really need to skip code?
I mean… maybe all the widget code is set up to be skipped by default.
And for some reason they forgot to skip this function → ShiftChild();
Or should I skip the code even if I don’t get any errors when compiling?
Thank you so much !!
Edited 2:
Well… I found the reason for the compilation error.
This isn’t going to work in the shipping version, right?