Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Third Party Get list of connected clients in Mirror

Discussion in 'Multiplayer' started by kiel814, Oct 20, 2021.

  1. kiel814

    kiel814

    Joined:
    Aug 30, 2021
    Posts:
    17
    So I'm starting to look into different ways of handling multiplayer. I started with this basic tutorial:
    https://docs-multiplayer.unity3d.com/docs/tutorials/helloworld/helloworldintro/index.html
    It seems to work fine, but I've read some suggestions about using Mirror instead of MLAPI so I decided to give it a go.
    I've been looking for several minutes and I can't seem to find a way to get a list of connected clients from NetworkManager.singleton...
    In MLAPI you can get it with:
    Code (CSharp):
    1. NetworkManager.Singleton.ConnectedClientsList
    Seems such a basic feature. Is there a simple way to do this with Mirror? Or do I have to keep my own list and update it every time a client connects/disconnects?

    There seem to be other NetowrkManagers out there, like Photon...
    What are the differences between each of the options out there?
     
    mackeraldev and orangetech like this.
  2. Immaculate_Games

    Immaculate_Games

    Joined:
    Nov 29, 2021
    Posts:
    1
    I found this unanswered question before I found the answer you should use
    (field) static Dictionary<int, NetworkConnectionToClient> NetworkServer.connections
    Dictionary of all server connections, with connectionId as key