Exemple #1
0
 public void Initialize(LanConnectionInfo match, Transform panelTransform)
 {
     this.match      = match;
     buttonText.text = match.name;
     transform.SetParent(panelTransform);
     transform.localScale    = Vector3.one;
     transform.localRotation = Quaternion.identity;
     transform.localPosition = Vector3.zero;
 }
Exemple #2
0
 internal void JoinMatch(LanConnectionInfo match)
 {
     discovery.StopDiscovery();
     if (BNetworkManager.singleton.client == null)
     {
         Debug.Log("StartClient");
         ChangeTo(lobbyPanel);
         BNetworkManager.singleton.networkAddress = match.ipAddress;
         BNetworkManager.singleton.StartClient();
     }
 }
        public void Populate(LanConnectionInfo match, LobbyManager lobbyManager, Color c)
        {
            serverInfoText.text = match.name;

            slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString();;

            lanMatch          = match;
            this.lobbyManager = lobbyManager;

            joinButton.onClick.RemoveAllListeners();
            joinButton.onClick.AddListener(JoinMatch);

            GetComponent <Image>().color = c;
        }
Exemple #4
0
        public void OnClickJoin(LanConnectionInfo match)
        {
            NDiscovery.instance.StopDiscovery();

            lobbyManager.ChangeTo(lobbyPanel);

            lobbyManager.networkAddress = match.ipAddress;
            lobbyManager.StartClient();

            lobbyManager.backDelegate = lobbyManager.StopClientClbk;
            lobbyManager.DisplayIsConnecting();

            lobbyManager.SetServerInfo("Connecting...", lobbyManager.networkAddress);
        }
Exemple #5
0
    // when recieve data
    public override void OnReceivedBroadcast(string fromAddress, string data)
    {
        base.OnReceivedBroadcast(fromAddress, data);
        LanConnectionInfo newLan = new LanConnectionInfo(fromAddress, data);

        if (!ipInfo.ContainsKey(newLan))
        {
            ipInfo.Add(newLan, Time.time + timeout);
            UpdateLanConnection();
        }
        else
        {
            ipInfo[newLan] = Time.time + timeout;
        }
    }
Exemple #6
0
    public override void OnReceivedBroadcast(string fromAddress, string data)
    {
        base.OnReceivedBroadcast(fromAddress, data);

        LanConnectionInfo info = new LanConnectionInfo(fromAddress, data);

        if (lanAdresses.ContainsKey(info) == false)
        {
            lanAdresses.Add(info, Time.time + timeout);
            UpdateMatchInfos();
        }
        else
        {
            lanAdresses[info] = Time.time + timeout;
        }
    }
        public override void OnReceivedBroadcast(string fromAddress, string data)
        {
            base.OnReceivedBroadcast(fromAddress, data);

            LanConnectionInfo info = new LanConnectionInfo(fromAddress, data);

            if (!lanAdresses.ContainsKey(info))
            {
                lanAdresses.Add(info, Utility.StartTimer(timeout));
                UpdateMatchInfos();
            }
            else
            {
                lanAdresses[info] = Utility.StartTimer(timeout);
            }
        }
Exemple #8
0
    public override void OnReceivedBroadcast(string fromAddress, string data)
    {
        base.OnReceivedBroadcast(fromAddress, data);

        string ip = fromAddress.Substring(fromAddress.LastIndexOf(":") + 1, fromAddress.Length - (fromAddress.LastIndexOf(":") + 1));

        LanConnectionInfo info = new LanConnectionInfo(ip, data);

        if (lanAddresses.ContainsKey(info) == false)
        {
            lanAddresses.Add(info, Time.time + timeout);
            UpdateMatchInfos();
        }
        else
        {
            lanAddresses[info] = Time.time + timeout;
        }
    }
    public override void OnReceivedBroadcast(string fromAddress, string data)
    {
        base.OnReceivedBroadcast(fromAddress, data);
        HUDnetManager.JoinRoom(fromAddress);

        return;

        LanConnectionInfo info = new LanConnectionInfo(fromAddress, data);

        if (lanAdresses.ContainsKey(info) == false)
        {
            lanAdresses.Add(info, Time.time + timeOut);

            // To send off an event to UI and say we have new matches
            HUDnetManager.JoinRoom(fromAddress);
        }
        else
        {
            lanAdresses[info] = Time.time + timeOut;
        }
    }
Exemple #10
0
 /// <summary>
 /// Refreshes the text to the stat of the room, mostly used when spawned on room update
 /// </summary>
 public void UpdateText(LanConnectionInfo connectionInfo)
 {
     room_ipAddress    = connectionInfo.ipAddress;
     roomNameTxt.text  = connectionInfo.ipAddress;
     roomSceneTxt.text = "Default";
 }
 public void RefreshRoom(LanConnectionInfo roomInfo)
 {
 }