Пример #1
0
        public void OnConnectedMachine(UInt64 nSessionID, bool bIsSuccess)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(nSessionID);

            if (null == refMachineInfo)
            {
                return;
            }

            if (bIsSuccess == false)
            {
                m_netClient.DeleteClientSession(nSessionID);
                refMachineInfo.SetDisconnected();
                return;
            }

            refMachineInfo.SetConnected();

            m_refView.refTreeViewCntroller.SetMachineIcon(refMachineInfo.GetName(), true);

            m_commandSender.SendCheckCommandVersionReq(nSessionID, CMD.COMMAND_VERSION);

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

            strMsg += "Machine\t: " + refMachineInfo.GetName();
            m_refView.ShowBalloonTip("ServerMonitor", strMsg);
        }
Пример #2
0
        private bool OnGetServerInfoRes(NetCommand command)
        {
            byte nServerCount;

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

            TRANS_SERVERINFONODE[] arrServerInfo = new TRANS_SERVERINFONODE[nServerCount];
            for (int i = 0; i < nServerCount; ++i)
            {
                if (command.ReadString(out arrServerInfo[i].strServerName) == false)
                {
                    return(false);
                }
                if (command.ReadByte(out arrServerInfo[i].nProcessState) == false)
                {
                    return(false);
                }
                if (command.ReadByte(out arrServerInfo[i].nServableState) == false)
                {
                    return(false);
                }
                if (command.ReadBoolean(out arrServerInfo[i].bRevivable) == false)
                {
                    return(false);
                }
                if (command.ReadInt32(out arrServerInfo[i].nCurServerPlayerCount) == false)
                {
                    return(false);
                }
            }

            UInt64 nSessionID = command.SessionID;

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

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

            for (int i = 0; i < nServerCount; ++i)
            {
                string         strServerName         = arrServerInfo[i].strServerName;
                PROCESS_STATE  eProcessState         = (PROCESS_STATE)arrServerInfo[i].nProcessState;
                SERVABLE_STATE eServableState        = (SERVABLE_STATE)arrServerInfo[i].nServableState;
                bool           bRevivable            = arrServerInfo[i].bRevivable;
                int            nCurServerPlayerCount = arrServerInfo[i].nCurServerPlayerCount;

                m_refServerMonitorClient.UpdateServerInfo(refMachineInfo.GetName(), strServerName, eProcessState, eServableState, bRevivable, nCurServerPlayerCount);
            }

            m_refServerMonitorClient.UpdateMachinePlayerCount(refMachineInfo.GetName());

            return(true);
        }
Пример #3
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);
        }
Пример #4
0
        private bool OnCheckCommandVersionRes(NetCommand command)
        {
            bool bSuccess = false;

            if (command.ReadBoolean(out bSuccess) == false)
            {
                return(false);
            }

            if (false == bSuccess)
            {
                MachineInfo refMachineInfo = m_refServerMonitorClient.refMachineInfoMgr.Find(command.SessionID);
                if (null == refMachineInfo)
                {
                    return(false);
                }

                System.Windows.Forms.MessageBox.Show(refMachineInfo.GetName() + " 머신과 커맨드 버젼이 일치하지 않아 종료합니다.");
                System.Windows.Forms.Application.Exit();
                return(true);
            }

            m_refCommandSender.SendRequestServerList(command.SessionID);

            return(true);
        }
Пример #5
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);
        }
Пример #6
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);
        }