Пример #1
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());
                }
            }
        }
Пример #2
0
        public void Update(float fDelta)
        {
            if (m_timeRegulator.IsReady(fDelta) == false)
            {
                return;
            }

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

            for (; node != null; node = node.Next)
            {
                if (false == node.Value.IsConnected)
                {
                    continue;
                }

                ServerInfoMgr refServerInfoMgr = node.Value.ServerInfoMgr;
                string[]      arrServerNames;
                refServerInfoMgr.GetAllServerName(out arrServerNames);

                if (arrServerNames.Length == 0)
                {
                    continue;
                }

                m_refCommandSender.SendRequestServerInfo(node.Value.m_nSessionID, arrServerNames);
            }
        }
Пример #3
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);
            }
        }
Пример #4
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]);
            }
        }
Пример #5
0
        private bool OnGetServerListRes(NetCommand command)
        {
            byte nServerCount;

            if (command.ReadByte(out nServerCount) == false)
            {
                return(false);
            }

            TRANS_SERVERLISTNODE[] arrServerListNode = new TRANS_SERVERLISTNODE[nServerCount];
            for (int i = 0; i < nServerCount; ++i)
            {
                if (command.ReadString(out arrServerListNode[i].strServerName) == false)
                {
                    return(false);
                }
                if (command.ReadByte(out arrServerListNode[i].nServerType) == false)
                {
                    return(false);
                }
                if (command.ReadInt32(out arrServerListNode[i].nWorldID) == false)
                {
                    return(false);
                }
                if (command.ReadInt32(out arrServerListNode[i].nServerID) == false)
                {
                    return(false);
                }
            }

            UInt64 nSessionID = command.SessionID;

            MachineInfo refMachineInfo = m_refServerMonitorClient.refMachineInfoMgr.Find(nSessionID);

            if (null == refMachineInfo)
            {
                return(false);
            }

            m_refServerMonitorClient.ClearServerInfo(refMachineInfo.GetName());
            for (int i = 0; i < nServerCount; ++i)
            {
                m_refServerMonitorClient.AddServerInfo(refMachineInfo.GetName(), ref arrServerListNode[i]);
            }


            ServerInfoMgr refServerInfoMgr = m_refServerMonitorClient.refMachineInfoMgr.GetServerInfoMgr(refMachineInfo.GetName());

            string[] arrServerNames;
            refServerInfoMgr.GetAllServerName(out arrServerNames);
            m_refCommandSender.SendRequestServerInfo(nSessionID, arrServerNames);
            return(true);
        }