Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Get list of connected clients in Mirror

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

  1. kiel814


    Aug 30, 2021
    So I'm starting to look into different ways of handling multiplayer. I started with this basic tutorial:
    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. unity_piJyHCftJrvqPA


    Nov 29, 2021
    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