overridding ShouldCreateSubsystem to Seperate Client Server Code

a_najafi
Mon, 12 Dec 2022 08:27:56 +0000
Programming & Scripting

Since in PIE mode all modules are loaded I am trying to find a workaround to separate client server code in PIE mode as it is hundreds of time easier to debug and test then packaged builds

I want to check if current gameinstance is client or server before the ShouldCreateSubsystem function call to only create client subsystems for the client and server subsystems for the server

I tried GetNetMode for gameinstance and GetNetMode for UWorld but both throw access violation exceptions on checking NetDriver

what is the correct method checking net mode or any other value type before subsystem creation for any of these two types WorldSubsystem GameInstanceSubsystem

1 post - 1 participant