Exemplo n.º 1
0
        public static void Start(this WatcherComponent self, int createScenes = 0)
        {
            string[] localIP        = NetworkHelper.GetAddressIPs();
            var      processConfigs = StartProcessConfigCategory.Instance.GetAll();

            foreach (StartProcessConfig startProcessConfig in processConfigs.Values)
            {
                if (!WatcherHelper.IsThisMachine(startProcessConfig.InnerIP, localIP))
                {
                    continue;
                }
                Process process = WatcherHelper.StartProcess(startProcessConfig.Id, createScenes);
                self.Processes.Add(startProcessConfig.Id, process);
            }
        }
Exemplo n.º 2
0
        public static StartMachineConfig GetThisMachineConfig()
        {
            string[]           localIP            = NetworkHelper.GetAddressIPs();
            StartMachineConfig startMachineConfig = null;

            foreach (StartMachineConfig config in StartMachineConfigCategory.Instance.GetAll().Values)
            {
                if (!WatcherHelper.IsThisMachine(config.InnerIP, localIP))
                {
                    continue;
                }
                startMachineConfig = config;
                break;
            }

            if (startMachineConfig == null)
            {
                throw new Exception("not found this machine ip config!");
            }

            return(startMachineConfig);
        }