Hi. How can I detect if a piece of C++ code is being executed on a dedicated server at runtime in the editor ? I’ve tried ‘IsRunningDedicatedServer()’ and this returns false for both server and client processes while running in the editor.
I’m trying to write some client-side only logic and I’m having real problems detecting when I’m just running as a client.
Thanks, is there any way to perform this check from UGameInstance constructor at game boot time ? I want to bring up certain manager objects only if running on the server. At the point I would like to do this there is no valid World object.
Hi, When I add that check around the code and run in the editor all the code thinks it is being run on the server… 8/
Is there any documentation on the differences between running inside the editor in the various modes versus running in standalone builds ? What’s the best strategy for testing and debugging client/server logic when inside the editor ?
You want to use HasAuthority(). Though I am also not thrilled that IsRunningDedicatedServer() does not return true when simulating in the editor and the “Run Dedicated Server” option is checked.