Пример #1
0
        public bool TerminateServer(string strMachineName, string strServerName)
        {
            MachineInfo refMachineInfo = m_machineInfoMgr.Find(strMachineName);

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

            m_commandSender.SendTerminateServer(refMachineInfo.GetSessionID(), strServerName);
            return(true);
        }
        private bool OnCheckCommandVersionRes(NetCommand command)
        {
            bool bSuccess = false;

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

            if (bSuccess == false)
            {
                FileLog.Instance.Write("커맨드 버젼이 일치하지 않아 종료합니다. 새 버젼으로 업데이트가 필요합니다.");
                System.Windows.Forms.Application.Exit();
                return(false);
            }

            if (m_refAutoModeClient.Mode == AUTO_MODE_TYPE.JUST_START)
            {
                if (m_refAutoModeClient.TargetServerName.ToLower().Equals("all"))
                {
                    if (m_refCommandSender.SendStartAllServer(command.SessionID) == false)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (m_refCommandSender.SendStartServer(command.SessionID, m_refAutoModeClient.TargetServerName) == false)
                    {
                        return(false);
                    }
                }
            }
            else if (m_refAutoModeClient.Mode == AUTO_MODE_TYPE.JUST_STOP)
            {
                if (m_refAutoModeClient.TargetServerName.ToLower().Equals("all"))
                {
                    if (m_refCommandSender.SendTerminateAllServer(command.SessionID) == false)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (m_refCommandSender.SendTerminateServer(command.SessionID, m_refAutoModeClient.TargetServerName) == false)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }