Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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