For an online game, how could I get the total number of players, and who's who?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By System_Error

Hi all.

For the game I’m working on, the “Game Master” needs to know how many players there are, and who’s in control of which army.

How would I go about that?

Is it p2p or do you have a server? If its a dedicated server, just store the numbers in an array by sessions, if its p2p, send the number in a packet to every player. You can increment/decrement it on connect/disconnect.

RazorSh4rk | 2020-04-20 22:16

I haven’t decided yet which one the game should go with, but I’ll keep this in mind.

System_Error | 2020-04-20 22:25