-
What I mean by “normally” is as if you’re writing it for single player. Maybe I misunderstood but it looked like you were saying that game code shouldn’t care about the netmode (as in client or server).
-
You get ‘more control’ in the fact that you can choose whether to call the RepNotify function on the Server or not in C++, whereas in BP you don’t get that option. That and about a hundred other ways in which you get more control over replication in C++ than BP.
-
I haven’t really run into this problem to be honest. I write game code to run on a Listen Server, then go through and exclude/wrap code that doesn’t need to run on a Dedicated Server with !UE_SERVER or something.
I haven’t seen any case where game logic is vastly different depending on what kind of server it’s running on. In the case of CMC, the only major thing I know of is the smoothing code, which doesn’t run on a dedicated server (because why bother… nobodies going to see the smoothing anyway).
EDIT: I’ve gone back and found this. I have no idea why you would ever do this ever. I wouldn’t bother with the if statement, I’d just call the OnRep_MyBool on the server regardless of netmode.
If OnRep_MyBool is only used for some visual element, then I guess you could wrap it with a netmode check (which is fine IMO). I prefer preprocessor though personally.
if (Role == ROLE_Authority)
{bMyRepBool = true; if (GetNetMode() != NM_DedicatedServer) { OnRep_bMyRepBool(); } }
EDIT 2.0: Spaces instead of tabs? Eww.