- Edited
Hello, I'm new to godot (2 days) and I'm trying to build a simple networked game. I'm trying to export a dedicated server and put in my VPS.
I'm using C# and coming from Unity world, I always write the scripts with code stripping in mind. For example, I don't want a specific function to be exposed on client side, so I try to use preprocessors to do that:
#if GODOT_SERVER
GD.PushError("server code!");
#else
GD.PushError("client/editor/debug code");
#endif
But this doesn't work. It seems we cant specify custom preprocessor in the export window, so we can't differenciate a desktop build (windows/linux) from a dedicated server build...I checked the MSbuild call when exporting in "dedicated server mode" and GODOT_SERVER is not set when building the C# assembly:
/define:GODOT;GODOT_WINDOWS;GODOT_PC;TRACE;EXPORTRELEASE;NET;NET6_0;NETCOREAPP;NET5_0_OR_GREATER;NET6_0_OR_GREATER;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2
How can I achieve this please? Is it possible atm? Thanks.