Example #1
0
        public void UpdateView_SelectedServerInfo(string strMachineName, string strServerName)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(strMachineName);

            if (null == refMachineInfo)
            {
                return;
            }

            ServerInfoMgr refServerInfoMgr = refMachineInfo.ServerInfoMgr;

            ServerInfo refServerInfo = refServerInfoMgr.Find(strServerName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            string strSelectedServerInfo;

            strSelectedServerInfo  = "Machine Name : " + strMachineName + "\r\n";
            strSelectedServerInfo += "Server Name : " + refServerInfo.GetName() + "\r\n";
            strSelectedServerInfo += "Server Type : " + refServerInfo.GetServerType().ToString() + "\r\n";
            strSelectedServerInfo += "Process State : " + refServerInfo.GetProcessState().ToString() + "\r\n";
            strSelectedServerInfo += "Servable State : " + refServerInfo.GetServableState().ToString() + "\r\n";
            strSelectedServerInfo += "Revivable : " + refServerInfo.bRevivable.ToString() + "\r\n";
            strSelectedServerInfo += "World ID : " + refServerInfo.WorldID.ToString() + "\r\n";
            strSelectedServerInfo += "Server ID : " + refServerInfo.ServerID.ToString() + "\r\n";
            if (refServerInfo.GetServerType() == SERVER_TYPE.SERVER_GAME)
            {
                strSelectedServerInfo += "Server Player Count : " + refServerInfo.CurPlayerCount.ToString() + "\r\n";
            }

            m_refView.SelectedNodeInfoText = strSelectedServerInfo;
        }
Example #2
0
        private void RebuildTreeView()
        {
            m_refView.refTreeViewCntroller.Clear();

            LinkedListNode <MachineInfo> node = m_machineInfoMgr.MachineInfoList.First;

            for (; node != null; node = node.Next)
            {
                MachineInfo refMachineInfo = node.Value;

                m_refView.refTreeViewCntroller.AddMachineNode(refMachineInfo.MachineName, refMachineInfo.IsConnected);

                ServerInfoMgr refServerInfoMgr = refMachineInfo.ServerInfoMgr;

                string[] arrServerNames;
                refServerInfoMgr.GetAllServerName(out arrServerNames);
                for (int iServerNameIndex = 0; iServerNameIndex < arrServerNames.Length; ++iServerNameIndex)
                {
                    string     strServerName = arrServerNames[iServerNameIndex];
                    ServerInfo refServerInfo = refServerInfoMgr.Find(strServerName);
                    if (null == refServerInfo)
                    {
                        continue;
                    }

                    m_refView.refTreeViewCntroller.AddServerNode(node.Value.MachineName, strServerName);
                    m_refView.refTreeViewCntroller.SetServerIcon(node.Value.MachineName, strServerName
                                                                 , refServerInfo.GetProcessState(), refServerInfo.GetServableState(), refServerInfo.IsRevivable());
                }
            }
        }
Example #3
0
        private void TerminateServer(string strSelectedMachineName, string strSelectedServerName)
        {
            ServerInfoMgr refServerInfoMgr = m_refModel.refMachineInfoMgr.GetServerInfoMgr(strSelectedMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            ServerInfo refServerInfo = refServerInfoMgr.Find(strSelectedServerName);

            if (null == refServerInfo)
            {
                return;
            }

            if (refServerInfo.GetProcessState() == PROCESS_STATE.TERMINATED)
            {
                return;
            }

            string strAskMessage = "{0} 머신의 {1} 를 정지하시겠습니까?";

            strAskMessage = string.Format(strAskMessage, strSelectedMachineName, strSelectedServerName);
            if (ConfirmTerminateServer(strAskMessage) == false)
            {
                return;
            }

            m_refModel.TerminateServer(strSelectedMachineName, strSelectedServerName);
        }
Example #4
0
        private void StartAllServerInMachine(string strSelectedMachineName)
        {
            string[]      arrServerName;
            ServerInfoMgr refServerInfoMgr = m_refModel.refMachineInfoMgr.GetServerInfoMgr(strSelectedMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            refServerInfoMgr.GetAllServerName(out arrServerName);

            for (int i = 0; i < arrServerName.Length; ++i)
            {
                string     strServerName = arrServerName[i];
                ServerInfo refServerInfo = refServerInfoMgr.Find(strServerName);
                if (null == refServerInfo)
                {
                    continue;
                }

                if (refServerInfo.GetProcessState() == PROCESS_STATE.STARTING ||
                    refServerInfo.GetProcessState() == PROCESS_STATE.RUNNING)
                {
                    continue;
                }

                m_refModel.StartServer(strSelectedMachineName, strServerName);
            }
        }
Example #5
0
        private void TerminateAllServerInMachine(string strSelectedMachineName)
        {
            string[]      arrServerName;
            ServerInfoMgr refServerInfoMgr = m_refModel.refMachineInfoMgr.GetServerInfoMgr(strSelectedMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            refServerInfoMgr.GetAllServerName(out arrServerName);

            List <string> listServerName = new List <string>();

            for (int i = 0; i < arrServerName.Length; ++i)
            {
                string     strServerName = arrServerName[i];
                ServerInfo refServerInfo = refServerInfoMgr.Find(strServerName);
                if (null == refServerInfo)
                {
                    continue;
                }

                if (refServerInfo.GetProcessState() == PROCESS_STATE.TERMINATED)
                {
                    continue;
                }

                listServerName.Add(strServerName);
            }

            if (listServerName.Count == 0)
            {
                return;
            }

            string strAskMessage = strSelectedMachineName;

            strAskMessage += " 머신의 모든 서버를 정지하시겠습니까?\r\n";
            strAskMessage += "(!주의! NOUPDATE 상태인 서버는 프로세스가 정상 종료 되지 않을 수 있습니다.)\r\n";
            for (int i = 0; i < listServerName.Count; ++i)
            {
                strAskMessage += " - ";
                strAskMessage += listServerName[i];
                strAskMessage += "\r\n";
            }
            if (ConfirmTerminateServer(strAskMessage) == false)
            {
                return;
            }

            for (int i = 0; i < listServerName.Count; ++i)
            {
                m_refModel.TerminateServer(strSelectedMachineName, listServerName[i]);
            }
        }
Example #6
0
        public void UpdateServerInfo(string strMachineName, string strServerName, PROCESS_STATE eProcessState, SERVABLE_STATE eServableState, bool bRevivable, int nCurServerPlayerCount)
        {
            ServerInfoMgr refServerInfoMgr = m_machineInfoMgr.GetServerInfoMgr(strMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            ServerInfo refServerInfo = refServerInfoMgr.Find(strServerName);

            if (null == refServerInfo)
            {
                return;
            }

            refServerInfo.SetProcessState(eProcessState);
            refServerInfo.SetServableState(eServableState);
            refServerInfo.bRevivable     = bRevivable;
            refServerInfo.CurPlayerCount = nCurServerPlayerCount;

            m_refView.refTreeViewCntroller.SetServerIcon(strMachineName, strServerName, eProcessState, eServableState, bRevivable);

            if (refServerInfo.GetServerType() == SERVER_TYPE.SERVER_GAME)
            {
                m_refView.refTreeViewCntroller.UpdateServerNodeExpansionInfo(strMachineName, strServerName, nCurServerPlayerCount);
            }

            if (m_refView.refTreeViewCntroller.IsSelectedServerNode() == false)
            {
                return;
            }

            string strSelectedMachineName;
            string strSelectedServerName;

            m_refView.refTreeViewCntroller.GetSelectedMachineName(out strSelectedMachineName);
            m_refView.refTreeViewCntroller.GetSelectedServerName(out strSelectedServerName);

            if (strSelectedMachineName.Length == 0 ||
                strSelectedServerName.Length == 0 ||
                strSelectedMachineName.Equals(strMachineName) == false ||
                strSelectedServerName.Equals(strServerName) == false)
            {
                return;
            }

            UpdateView_SelectedServerInfo(strMachineName, strServerName);
            m_refView.UpdateButtonEnableState();
        }
Example #7
0
        private void StartServer(string strSelectedMachineName, string strSelectedServerName)
        {
            ServerInfoMgr refServerInfoMgr = m_refModel.refMachineInfoMgr.GetServerInfoMgr(strSelectedMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            ServerInfo refServerInfo = refServerInfoMgr.Find(strSelectedServerName);

            if (null == refServerInfo)
            {
                return;
            }

            if (refServerInfo.GetProcessState() == PROCESS_STATE.STARTING ||
                refServerInfo.GetProcessState() == PROCESS_STATE.RUNNING)
            {
                return;
            }

            m_refModel.StartServer(strSelectedMachineName, strSelectedServerName);
        }