示例#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
        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);
        }
示例#3
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;
        }
示例#4
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);
            }
        }
示例#5
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);
            }
        }
        public void Update(float fDelta)
        {
            if (false == m_rgltUpdate.IsReady(fDelta))
            {
                return;
            }

            bool bIsBad      = false;
            bool bIsChangine = false;

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

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

                ServerInfoMgr refServerInfoMgr = refMachineInfo.ServerInfoMgr;

                LinkedListNode <ServerInfo> nodeServerInfo = refServerInfoMgr.ServerInfoList.First;
                for (; nodeServerInfo != null; nodeServerInfo = nodeServerInfo.Next)
                {
                    ServerInfo refServerInfo = nodeServerInfo.Value;

                    if (PROCESS_STATE.DIED == refServerInfo.GetProcessState() ||
                        PROCESS_STATE.NOUPDATE == refServerInfo.GetProcessState() ||
                        PROCESS_STATE.TERMINATING == refServerInfo.GetProcessState() ||
                        PROCESS_STATE.TERMINATED == refServerInfo.GetProcessState()
                        )
                    {
                        bIsBad = true;
                    }

                    if (PROCESS_STATE.STARTING == refServerInfo.GetProcessState() ||
                        (PROCESS_STATE.RUNNING == refServerInfo.GetProcessState() &&
                         SERVABLE_STATE.INACTIVE == refServerInfo.GetServableState())
                        )
                    {
                        bIsChangine = true;
                    }
                }
            }

            if (bIsBad)
            {
                SetIcon(TRAY_ICON_TYPE.BAD);
                return;
            }
            if (!bIsBad && bIsChangine)
            {
                SetIcon(TRAY_ICON_TYPE.CHANGING);
                return;
            }
            SetIcon(TRAY_ICON_TYPE.FINE);
        }
示例#7
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]);
            }
        }
示例#8
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);
        }
示例#9
0
        public bool Refresh()
        {
            LinkedListNode <MachineInfo> node = m_machineInfoMgr.MachineInfoList.First;

            for (; node != null; node = node.Next)
            {
                ServerInfoMgr refServerInfoMgr = node.Value.ServerInfoMgr;
                refServerInfoMgr.Clear();

                m_commandSender.SendRequestServerList(node.Value.m_nSessionID);
            }
            return(true);
        }
示例#10
0
        public void ClearServerInfo(string strMachineName)
        {
            ServerInfoMgr refServerInfoMgr = m_machineInfoMgr.GetServerInfoMgr(strMachineName);

            if (null == refServerInfoMgr)
            {
                return;
            }

            refServerInfoMgr.Clear();

            m_refView.refTreeViewCntroller.ClearServerNodes(strMachineName);
        }
示例#11
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();
        }
示例#12
0
        public void AddServerInfo(string strMachineName, ref TRANS_SERVERLISTNODE refServerListNode)
        {
            ServerInfoMgr refServerInfoMgr = m_machineInfoMgr.GetServerInfoMgr(strMachineName);

            if (refServerInfoMgr == null)
            {
                return;
            }

            refServerInfoMgr.AddServerInfo(ref refServerListNode);

            m_refView.refTreeViewCntroller.AddServerNode(strMachineName,
                                                         refServerListNode.strServerName);
        }
示例#13
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);
        }
示例#14
0
        public int GetMachinePlayerCount(string strMachineName)
        {
            MachineInfo machineInfo = Find(strMachineName);

            if (machineInfo == null)
            {
                return(0);
            }

            int nPlayerCount = 0;

            ServerInfoMgr refServerInfoMgr = machineInfo.ServerInfoMgr;

            if (refServerInfoMgr.HasMasterServer() == true)
            {
                nPlayerCount = refServerInfoMgr.GetAllGameServerPlayerCount();
            }
            else
            {
                nPlayerCount = refServerInfoMgr.GetAllServerPlayerCount();
            }

            return(nPlayerCount);
        }