I am (finally!) alpha-testing and working out the bugs in a new gametype mod I'm developing.
One of the issues I'm having is with controlling which pieces of code run for clients vs. which pieces run for the server. Specifically, I created a couple of custom packet types to go from the server to clients on certain events, but I think one of the client packet-receiver functions is running on the server (which causes all kinds of problems).
Am I correct in my understanding of the following?
- A dedicated server acts as \"Player 0\".
- A player server (i.e. a player starts the server through the D3 menu) acts as both a client and the server.
I'm using the DMFCBase->GetLocalRole() function (I think that's the one, I don't have my code in front of me at the moment) to distinguish between them. Or am I missing something?
Client-side vs. Server-side code in a D3-SDK gametype mod
I don't think you can rely on the player number to provide information about the player's role, if I recall correctly, for the very reason you mention: non-dedicated servers.
The best thing you can do is run a dedi and verify which machine is playing what role by using DMFCLog (?). The dedi will print to the server console, and the client should print as a HUD message.
The best thing you can do is run a dedi and verify which machine is playing what role by using DMFCLog (?). The dedi will print to the server console, and the client should print as a HUD message.