public void UpdateLobby() { List <PlayerConnectionData> players = new List <PlayerConnectionData>(); players.AddRange(_playersConnectionData.Values); Net_UpdateLobby ul = new Net_UpdateLobby(players); SendToAllClients(ul); }
void OnUpdateLobby(int connectionId, int chanelId, int recHostId, Net_UpdateLobby msg) { //if (isServer) // return; //Debug.Log("OnUpdateLobby:"); foreach (PlayerConnectionData p in msg.PlayersData) { //Debug.Log(string.Format("player: {0}#{1} | conn:{2} host:{3} chan:{4}", // p.playerId, p.playerName, p.connectionId, p.hostId, p.chanelId)); _playersConnectionData[p.playerId] = p; if (p.playerId == _connectionData.playerId) { _connectionData.fractionId = p.fractionId; } } MenuController.instance.UpdateLobby(_playersConnectionData); }