Exemple #1
0
        public bool LoadConfig(out MachineInfo[] arrMachineInfo)
        {
            arrMachineInfo = null;

            XmlDocument oDoc;

            LoadConfigFile(out oDoc);

            XmlElement elementRoot = oDoc.DocumentElement;
            XmlNode    nodeMachine = elementRoot.FirstChild;

            LinkedList <MachineInfo> listMachineInfo = new LinkedList <MachineInfo>();

            while (nodeMachine != null)
            {
                if (nodeMachine.Name.Equals(ConfigConst.ELEMENT_NAME_MACHINE) == true)
                {
                    MachineInfo machineInfo;
                    if (ReadNode_MachineInfo(nodeMachine, out machineInfo) == false)
                    {
                        FileLog.Instance.Write("실패! {0} Element의 속성을 읽지 못했습니다.", ConfigConst.ELEMENT_NAME_MACHINE);
                        return(false);
                    }

                    listMachineInfo.AddLast(machineInfo);

                    XmlNode nodeServerInfo = nodeMachine.FirstChild;
                }

                nodeMachine = nodeMachine.NextSibling;
            }

            arrMachineInfo = new MachineInfo[listMachineInfo.Count];
            LinkedListNode <MachineInfo> nodeMachineInfoList = listMachineInfo.First;

            for (int i = 0; i < listMachineInfo.Count; ++i)
            {
                arrMachineInfo[i]   = nodeMachineInfoList.Value;
                nodeMachineInfoList = nodeMachineInfoList.Next;
            }
            return(true);
        }
Exemple #2
0
        public void OnDisconnectedMachine(UInt64 nSessionID)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(nSessionID);

            if (null == refMachineInfo)
            {
                return;
            }

            refMachineInfo.SetDisconnected();

            m_refView.refTreeViewCntroller.ClearServerNodes(refMachineInfo.GetName());
            m_refView.refTreeViewCntroller.SetMachineIcon(refMachineInfo.GetName(), false);
            m_refView.refTreeViewCntroller.UpdateMachineNodeExpansionInfo(refMachineInfo.GetName(), 0);

            string strMsg = "서버 모니터 연결 끊김\n";

            strMsg += "Machine\t: " + refMachineInfo.GetName();
            m_refView.ShowBalloonTip("ServerMonitor", strMsg);
        }
Exemple #3
0
        public bool ToggleServerRevivable(string strMachineName, string strServerName)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(strMachineName);

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

            ServerInfo refServerInfo = refMachineInfo.ServerInfoMgr.Find(strServerName);

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

            bool bRevivableToSet = !refServerInfo.IsRevivable();

            m_commandSender.SendToggleReviveServer(refMachineInfo.m_nSessionID, strServerName, bRevivableToSet);
            return(true);
        }
Exemple #4
0
        public void ConnectToAllMachines()
        {
            LinkedListNode <MachineInfo> node = m_refMachineInfoMgr.MachineInfoList.First;

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

                if (false == refMachineInfo.IsConnectable)
                {
                    continue;
                }

                UInt64 nSessionID;
                if (m_refNetClient.NewClientSession(refMachineInfo.MachineName, refMachineInfo.IP, refMachineInfo.Port, out nSessionID) == false)
                {
                    continue;
                }

                refMachineInfo.SetRequestConnect(nSessionID);
            }
        }
Exemple #5
0
        public void AddMonitoringLog(string strDateTime, UInt64 nSessionID, string strServerName, int nWorldID, int nServerID, string strLogMessage)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(nSessionID);

            if (null == refMachineInfo)
            {
                return;
            }

            string strLog;

            strLog  = strDateTime;
            strLog += " - ";
            strLog += refMachineInfo.GetName();
            strLog += ", " + strServerName;
            strLog += "(" + nWorldID.ToString();
            strLog += ", ";
            strLog += nServerID.ToString() + ")";
            strLog += ", ";
            strLog += strLogMessage;

            m_refView.refMonitoringLogger.AddLog(strLog);
            m_refView.ShowBalloonTip_ServerInfo(refMachineInfo.GetName(), strServerName, nWorldID, nServerID, strLogMessage);
        }
        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);
        }