Ejemplo 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();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        static void file_Changed(string path)
        {
            DCLogger.LogInfo(string.Format("Config file changed..[{0}]", path));
            cs.Reload();
            foreach (string key in clients.Keys)
            {
                string    clientId   = key.Split(':')[0];
                string    configName = key.Split(':')[1];
                ClientCfg cc         = getClientCfg(configName);
                if (!cc.Equals(clients[key].Cfg))
                {
                    DCClient oldClt = clients[key];

                    DCClient client = new DCClient_Star(cc, clientId);
                    clients[key] = client;

                    //innerCtrl.Send(oldClt.guid, Global.DC_CTRL_EXIT);
                    //System.Threading.Thread.Sleep(100);
                    oldClt.Dispose();
                    oldClt = null;
                }
            }
        }
Ejemplo n.º 3
0
 public string GetString(string sectionName, string keyName)
 {
     source.Reload();
     return(source.Configs[sectionName].Get(keyName));
 }
Ejemplo n.º 4
0
 public void Set(string sectionName, string keyName, object value)
 {
     source.Configs[sectionName].Set(keyName, value);
     source.Save();
     source.Reload();
 }