Esempio n. 1
0
        public CommunicationHelpers(Nini.Config.IConfigSource config, String moduleName, String moduleVersion)
        {
            try {
                Nini.Config.IConfig startupConfig = config.Configs["OpenMetaverseEconomy"];
                m_gatewayEnvironment = startupConfig.GetString("OMBaseEnvironment", "TEST");
                m_initURL            = startupConfig.GetString("OMEconomyInitialize", String.Empty);
                m_gridShortName      = startupConfig.GetString("GridShortName", String.Empty);
                m_gridURL            = config.Configs["GridService"].GetString("GridServerURI", String.Empty);

                if (m_gridShortName == String.Empty || m_initURL == String.Empty)
                {
                    m_log.Error("[" + moduleName + "]: GridShortName or OMEconomyInitialize not set");
                    return;
                }

                                #if DEBUG
                m_log.Debug(String.Format("[OMECONOMY] getGatewayURL({0}, {1}, {2}, {3})", m_initURL, moduleName, moduleVersion, m_gatewayEnvironment));
                                #endif

                Dictionary <string, string> d = new Dictionary <string, string>();
                d.Add("moduleName", moduleName);
                d.Add("moduleVersion", moduleVersion);
                //d.Add("gridShortName", m_gridShortName);
                d.Add("gatewayEnvironment", m_gatewayEnvironment);

                m_gatewayURL = m_initURL;                 //use to obtain the real gatewayURL;
                Dictionary <string, string> response = DoRequestDictionary(d);
                if (response != null)
                {
                    m_gatewayURL = (string)response["gatewayURL"];

                    if (m_gatewayURL != m_initURL && m_gatewayURL != null)
                    {
                        m_log.Info("[" + moduleName + "]: GatewayURL: " + m_gatewayURL);
                    }
                    else
                    {
                        m_log.Error("[" + moduleName + "]: Could not set the GatewayURL - Please restart or contact the module vendor");
                    }
                }
                else
                {
                    m_gatewayURL = null;
                    m_log.Error("[" + moduleName + "]: Could not retrieve GatewayURL");
                }
            } catch (Exception e) {
                m_log.Error("[OMBASE]: " + e);
            }
        }
Esempio n. 2
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Nepritel");
     if (config != null)
     {
         Ohrozeni  = config.GetInt("Ohrozeni");
         Stretnuti = config.GetInt("Stretnuti");
         Utok      = config.GetInt("Utok");
         Obrana    = config.GetInt("Obrana");
         Zivoty    = config.GetInt("Zivoty");
         string   s    = config.GetString("Stiny");
         string[] stin = s.Split(',');
         Stin = new List <MyString>();
         foreach (string ss in stin)
         {
             MyString ms = new MyString();
             ms.String = ss;
             Stin.Add(ms);
         }
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
Esempio n. 3
0
 public void Load(Nini.Config.IConfigSource source)
 {
     if (source.Configs.Contains("Druhy"))
     {
         Nini.Config.IConfig config = source.Configs["Druhy"];
         string   s  = config.GetString("Všechny druhy");
         string[] ss = s.Split(',');
         foreach (string sss in ss)
         {
             druhy.Add(sss);
         }
     }
 }
Esempio n. 4
0
        public void Initialize(ConfigSettings settings)
        {
            _settings = settings;

            Nini.Config.IConfig netConfig = settings.SettingsFile["Network"];
            if (netConfig != null && netConfig.Contains("asset_server_url"))
            {
                string url = netConfig.GetString("asset_server_url");
                this.SetupConnections(url);
            }
            else
            {
                throw new Exception("Network/asset_server_url is a required setting");
            }
        }
Esempio n. 5
0
 public override EReturn Load(Nini.Config.IConfig config)
 {
     base.Load(config);
     //Nini.Config.IConfig config = GetConfig(source, "Zrada");
     if (config != null)
     {
         string          s       = config.GetString("Stin");
         string[]        stin    = s.Split(',');
         List <MyString> mujList = new List <MyString>();
         foreach (string ss in stin)
         {
             MyString ms = new MyString();
             ms.String = ss;
             mujList.Add(ms);
         }
         Stin = mujList;
         return(EReturn.NoError);
     }
     else
     {
         return(EReturn.Error);
     }
 }
 public string GetString(string key, string defaultValue)
 {
     return(config.GetString(key, defaultValue));
 }