2
\$\begingroup\$

Please imagine a turn based multiplayer game. Right now there's no lobby in place and connections are established using Unity's Network Manager HUD.

Now on the server, how can you get a list of all the match participants? Preferably ordered - something like the player on the host should be player 1, the first player who joined the match should be player two, the second player who joined should be player three....

Any advise is welcome, thank you.

\$\endgroup\$
1
\$\begingroup\$

as long as you are inheriting a network behavior you can run a check if (isLocalPlayer) add to list. Or you can override the OnStartLocalPlayer ()

public override void OnStartLocalPlayer()
{
    //Add To Player List
}
\$\endgroup\$
  • \$\begingroup\$ Thank you! That would work. At the end I've decided to first implement the lobby. \$\endgroup\$ – SePröbläm Dec 14 '17 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.