void jGuiButton_ServerOk(jGuiButton ctrl)
    {
        var lbl = (jGuiControl)ctrl.GetParent().FindCtrl("ServerStatus");

        if (lbl.GetText().Contains("Offline"))
        {
            return;
        }

        m_jGuiStage.HideModalWindow();
        int iOrder      = ctrl.GetParent().m_jxE.GetOrder();
        jxE eServerList = m_CMD.GetCurrServerList();

        if (iOrder >= eServerList.size())
        {
            m_CMD.LogWarning("ctrl.m_jxE.GetOrder() is overflow : " + iOrder + "eServerList.size() = " + eServerList.size());
            return;
        }
        jxE server = eServerList.GetChild(iOrder);

        m_CMD.m_ServerIP   = server.Attr("IP");
        m_CMD.m_ServerName = server.Attr("NAME");
        m_CMD.m_ServerPort = server.AttrVar("PORT").Get_int();
        //Debug.Log("ip : " + m_CMD.m_ServerIP + " " + m_CMD.m_ServerPort + " " + m_CMD.m_ServerName);

        var c = GetComponent <GuiEvent_CommandWindow>();

        c.Reload_PlayerCmd();


        GuiEvent_CommandWindow cmdWin = GetComponent <GuiEvent_CommandWindow>();

        cmdWin.SetWindowText(m_CMD.m_ServerName + " - " + m_CMD.m_ServerIP + ":" + m_CMD.m_ServerPort);
    }
Example #2
0
            public override void Load(jGuiStage stage, jGuiWindow win, jGuiControl parent, jxE g, jxE overrideAttribute)
            {
                base.Load(stage, win, parent, g, overrideAttribute);
                m_listText = new string[g.size()];
                int i = 0;

                foreach (jxE e in g)
                {
                    m_listText[i++] = e.Get_string();
                }
            }
Example #3
0
            public void Init(jxE eLogFilter)
            {
                m_FilteredLogList = new jFilteredLogNode[eLogFilter.size()];
                foreach (jxE e in eLogFilter)
                {
                    string sFilter = e.Attr("FILTER");
                    if (sFilter == null)
                    {
                        throw new System.Exception(e.ToString() + " : FILTER attribute not found.");
                    }

                    string[] strList = nNWM.jString.jSplit(sFilter, "| ");

                    if (strList == null)
                    {
                        throw new System.Exception(e.ToString() + " : split filter is null : " + sFilter);
                    }

                    m_FilteredLogList[e.GetOrder()] = new jFilteredLogNode(strList);
                }
                m_CurrFilteredLog = m_FilteredLogList[0];
            }
    void OnShowModal_ServerList(jGuiWindow win)     // "ServerList"라는 모달
    {
        jxE eServerList = m_CMD.GetCurrServerList();

        if (eServerList == null)
        {
            m_CMD.LogWarning(m_CMD.m_DefaultServerListName + " is not found in ServerList xml");
            return;
        }

        int iSize = eServerList.size() - m_guiServerList.m_jxE.size();

        if (iSize > 0)        // 다운로드 받은 서버리스트 보다 gui xml의 서버리스트 컨트롤이 적다면 컨트롤 추가.
        {
            for (int i = 0; i < iSize; ++i)
            {
                jxE eServer = m_guiServerList.m_jxE.begin().MakeClone();
                m_guiServerList.m_jxE.InsertChild(eServer);

                // jGuiContorl 리로딩.
                jGuiControl new_ctrl = m_guiServerList.GetStage().CreateRTTI(eServer);
                if (new_ctrl == null)
                {
                    eServer.DebugPrint();
                    throw new System.Exception("CreateRTTI : new_ctrl==null");
                }
                new_ctrl.m_isLayouted = m_guiServerList.m_isLayouted;
                new_ctrl.Load(m_guiServerList.GetStage()
                              , m_guiServerList.GetWindow()
                              , m_guiServerList
                              , eServer
                              , m_guiServerList.Get_OverrideAttribute());
            }
        }
        int idx = 0;

        foreach (jGuiControl gui in m_guiServerList)
        {
            if (idx >= eServerList.size())
            {
                gui.SetEnabled(false);
                continue;
            }
            var    btn    = (jGuiButton)gui.FindCtrl("ServerOk");
            jxE    server = eServerList.GetChild(idx);
            string name   = server.Attr("NAME");
            string text   = name + " " + server.Attr("IP") + ":" + server.AttrVar("PORT").Get_int().ToString();
            var    lbl    = (jGuiLabel)gui.FindCtrl("ServerStatus");
            if (name == m_CMD.m_ServerName)
            {
                lbl.SetText("Selected");
            }
            else
            {
                lbl.SetText("Unkown");
            }

            btn.SetText(text);
            ++idx;
        }
        UpdateServerStatus();
    }