I want the NetworkConnection of the current connection the task is running on, im adding connected players to a list and this list contains the active connectionid…
Also want to make a foreach loop for the active client connections so i can later find a match?
I can add the connectionid’s and remove them using…
public override void OnServerConnect (NetworkConnection conn)
{
Debug.Log("Client connected: " + conn.connectionId);
base.OnServerConnect (conn);
user myUser = new user();
myUser.connectionId = conn.connectionId.ToString();
myUsers.Add(myUser);
}
public override void OnServerDisconnect (NetworkConnection conn)
{
Debug.Log("Client Disconnected: " + conn.connectionId);
base.OnServerDisconnect (conn);
myUsers.Remove(conn.connectionId.ToString());
}
But I want to also get a refrance the the NetworkConnection manually as well inside other scripts.
Any ideas would be welcome!