Exemplo n.º 1
0
    void UpdateLobby()
    {
        //uLink.HostData[] hostData = uLink.MasterServer.PollHostList(hostFilter, masterServerRefreshHostListIntervalSec);
        // UpdateScreenList(lobbyHostData);

        if (LobbyClient.IsConnected)
        {
            int index = 0;

            List <LobbyClient.Server> Servers = LobbyClient.GetServers();

            foreach (LobbyClient.Server Server in Servers)
            {
                UpdateHostLine(index, Server);
                index++;
            }

            //pokd jeste neni vybrany radek (nebo je mimo zobrazeny rozsah), vyber prvni radek
            if ((mSelectedIndex == -1 || mSelectedIndex >= index) && index > 0)
            {
                //but only when widget is already visible
                int hg = 0;

                ServerLineGui line = linesGui[hg];

                if (line.button.Widget.IsVisible())
                {
                    SelectServerLine(hg);
                }
            }
            else if (index == 0)
            {
                SelectServerLine(-1);
            }

            //skryj zbytek nevyuzitych radku
            for (int i = index; i < maxLines; i++)
            {
                HideServerLine(i);
            }
        }
    }