Esempio n. 1
0
        static void file_Changed(string path)
        {
            DCLogger.LogInfo(string.Format("Config file changed..[{0}]", path));
            cs.Reload();
            foreach (IConfig cfg in cs.Configs) //(string key in servers.Keys)
            {
                string configName = cfg.Name;
                if (servers.ContainsKey(configName))
                {
                    ServerCfg sc = getServerCfg(configName);
                    if (!sc.Equals(servers[configName].Cfg))
                    {
                        DCServer oldSrv = servers[configName];

                        DCServer server = new DCServer_Star(configName);
                        servers[configName] = server;

                        oldSrv.StopWork();
                        oldSrv = null;

                        servers[configName].StartWork();
                    }
                }
            }
        }
 internal DCServer_Star(string configName)
 {
     this.configName = configName;
     cfg             = DCServer.getServerCfg(configName);
 }