예제 #1
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[3];
     Setting[0]   = new StringSetting("Words that doesn't change between captcha requests :", "Some words used for requesting captcha", "Example : You need to enter a captcha.");
     Setting[1]   = new StringSetting("Captcha request pattern :", "Captcha request, replace the captcha by %captcha%", "Example : You need to enter a captcha, please send %captcha% in the chat in order to connect.");
     Setting[2]   = new StringSetting("Command used to send the captcha :", "If you need to do '/captcha 123' to send the captcha, just enter '/captcha' below. Leave blank if no command.", "");
 }
예제 #2
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[3];
     Setting[0]   = new StringSetting("Authorized Users", "The bot will only hear to those users. (split with space)", "");
     Setting[1]   = new StringSetting("Trigger Keywords", "Keywords the bot should react to (You can also use phrases). (split with comma)", "");
     Setting[2]   = new StringSetting("Trigger Macro", "Macro name that will get triggered", "");
 }
예제 #3
0
 private void InitPresets(StringSetting set, SkinPreset[] sets)
 {
     currentSet = set;
     presets    = new List <SkinPreset>();
     if (sets != null)
     {
         for (int i = 0; i < sets.Length; i++)
         {
             presets.Add(sets[i]);
         }
     }
     skinSelection = -1;
     for (int i = 0; i < presets.Count; i++)
     {
         if (presets[i].Name.Equals(set.Value))
         {
             skinSelection = i;
             break;
         }
     }
     presetLabels = new string[presets.Count];
     for (int i = 0; i < presetLabels.Length; i++)
     {
         presetLabels[i] = presets[i].Name;
     }
     newSetName = locale["set"] + " " + (presets.Count + 1).ToString();
 }
예제 #4
0
        protected IStringSetting GetStringSetting(int key, string defaultValue)
        {
            var setting = new StringSetting(this.data.StringValues, key, defaultValue);

            this.settings.Add(setting);
            return(setting);
        }
예제 #5
0
        /// <summary>
        /// Sets a string-valued setting.
        /// </summary>
        /// <param name="Key">Key name.</param>
        /// <param name="Value">New value.</param>
        /// <returns>If the setting was saved (true). If the setting existed, and had the same value, false is returned.</returns>
        public static async Task <bool> SetAsync(string Key, string Value)
        {
            await synchObject.BeginWrite();

            try
            {
                StringSetting Setting = await Database.FindFirstDeleteRest <StringSetting>(new FilterFieldEqualTo("Key", Key));

                if (Setting is null)
                {
                    Setting = new StringSetting(Key, Value);
                    await Database.Insert(Setting);

                    return(true);
                }
                else
                {
                    if (Setting.Value != Value)
                    {
                        Setting.Value = Value;
                        await Database.Update(Setting);

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            finally
            {
                await synchObject.EndWrite();
            }
        }
예제 #6
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[3];
     Setting[0]   = new StringSetting("Message once a player joins", "Use %new_player% for the name of the player", "Welcome %new_player%");
     Setting[1]   = new NumberSetting("Min delay", "The minimum amount of time the bot has to wait before sending another message. (seconds)", 4, 1, 120, 1);
     Setting[2]   = new NumberSetting("Chance", "Chance that a new person will be greeted.", 100, 1, 100, 1);
 }
예제 #7
0
        private void UpdateDisplay()
        {
            StringBuilder sb = new StringBuilder();

            var items = SettingsCollection.Where(e => e.IsModified);

            foreach (var item in items)
            {
                sb.Append(item.Label.ToUpper());

                if (item is StringSetting)
                {
                    StringSetting ss = item as StringSetting;
                    sb.Append(": ");
                    sb.Append(ss.TextValue);
                }
                else
                {
                    BooleanSetting bs = item as BooleanSetting;
                    if (bs.IsChecked)
                    {
                        sb.Append(": Checked");
                    }
                    else
                    {
                        sb.Append(": Unchecked");
                    }
                }
                sb.Append(Environment.NewLine);
            }

            Display = sb.ToString();
        }
예제 #8
0
        /// <summary>
        /// Sets a string-valued setting.
        /// </summary>
        /// <param name="Key">Key name.</param>
        /// <param name="Value">New value.</param>
        /// <returns>If the setting was saved (true). If the setting existed, and had the same value, false is returned.</returns>
        public static async Task <bool> SetAsync(string Key, string Value)
        {
            using (Semaphore Semaphore = await Semaphores.BeginWrite("setting:" + Key))
            {
                StringSetting Setting = await Database.FindFirstDeleteRest <StringSetting>(new FilterFieldEqualTo("Key", Key));

                if (Setting is null)
                {
                    Setting = new StringSetting(Key, Value);
                    await Database.Insert(Setting);

                    return(true);
                }
                else
                {
                    if (Setting.Value != Value)
                    {
                        Setting.Value = Value;
                        await Database.Update(Setting);

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
        }
예제 #9
0
        /// <summary>
        /// Appends a <paramref name="setting"/> in the form <code>SettingName = SettingValue</code>.
        /// The setting will be written only if the value is different from the default value in the
        /// corresponding <paramref name="parameter"/>.
        /// </summary>
        /// <param name="setting"></param>
        /// <param name="parameter"></param>
        public LoliCodeWriter AppendSetting(BlockSetting setting, BlockParameter parameter = null,
                                            int spaces = 2, bool printDefaults = false)
        {
            if (parameter == null)
            {
                AppendLine($"{setting.Name} = {GetSettingValue(setting)}", spaces);
                return(this);
            }

            var isDefaultValue = setting.FixedSetting switch
            {
                StringSetting x => x.Value == (parameter as StringParameter).DefaultValue,
                IntSetting x => x.Value == (parameter as IntParameter).DefaultValue,
                FloatSetting x => x.Value == (parameter as FloatParameter).DefaultValue,
                BoolSetting x => x.Value == (parameter as BoolParameter).DefaultValue,
                ByteArraySetting x => Compare(x.Value, (parameter as ByteArrayParameter).DefaultValue),
                ListOfStringsSetting x => Compare(x.Value, (parameter as ListOfStringsParameter).DefaultValue),
                DictionaryOfStringsSetting x =>
                Compare(x.Value?.Keys, (parameter as DictionaryOfStringsParameter).DefaultValue?.Keys) &&
                Compare(x.Value?.Values, (parameter as DictionaryOfStringsParameter).DefaultValue?.Values),
                EnumSetting x => x.Value == (parameter as EnumParameter).DefaultValue,
                _ => throw new NotImplementedException(),
            };

            if (setting.InputMode != SettingInputMode.Fixed || !isDefaultValue || printDefaults)
            {
                AppendLine($"{parameter.Name} = {GetSettingValue(setting)}", spaces);
            }

            return(this);
        }
예제 #10
0
        /// <summary>
        /// Sets a string-valued setting.
        /// </summary>
        /// <param name="Key">Key name.</param>
        /// <param name="Value">New value.</param>
        /// <returns>If the setting was saved (true). If the setting existed, and had the same value, false is returned.</returns>
        public static async Task <bool> SetAsync(string Key, string Value)
        {
            foreach (StringSetting Setting in await Database.Find <StringSetting>(new FilterFieldEqualTo("Key", Key)))
            {
                if (Setting.Value != Value)
                {
                    Setting.Value = Value;
                    await Database.Update(Setting);

                    //Log.Informational("Setting updated.", Key, new KeyValuePair<string, object>("Value", Value));
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            StringSetting NewSetting = new StringSetting(Key, Value);
            await Database.Insert(NewSetting);

            //Log.Informational("Setting created.", Key, new KeyValuePair<string, object>("Value", Value));

            return(true);
        }
예제 #11
0
 protected override void OnPanelDisable()
 {
     skinTypeSelection = null;
     left       = null;
     right      = null;
     rect       = null;
     currentSet = null;
 }
예제 #12
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[5];
     Setting[0]   = new StringSetting("Start x y z", "", "0 0 0");
     Setting[1]   = new StringSetting("End x y z", "", "0 0 0");
     Setting[2]   = new ComboSetting("Mode", null, new string[] { "Fast", "Accurate" }, 1);
     Setting[3]   = new BoolSetting("Sand walking", "Can the bot walk on sand (might cause it falling off with multiple bots)", false);
     Setting[4]   = new BoolSetting("No movement", "Should the bot place all the sand from the spot it is in?", false);
 }
예제 #13
0
        public IFontManager GetFontManager(ISettings settings)
        {
            string defaultFontName  = "SourceCodePro-Regular";
            int    defaultSize      = 14;
            var    _currentFontName = new StringSetting("CurrentFontName", defaultFontName, settings);
            var    _currentFontSize = new IntSetting("CurrentFontSize", defaultSize, settings);

            return(new FontManager(_currentFontName, _currentFontSize));
        }
예제 #14
0
        /// <summary>
        /// Sets a string-valued setting.
        /// </summary>
        /// <param name="Key">Key name.</param>
        /// <param name="Value">New value.</param>
        /// <returns>If the setting was saved (true). If the setting existed, and had the same value, false is returned.</returns>
        public static async Task <bool> SetAsync(string Key, string Value)
        {
            using (Semaphore Semaphore = await Semaphores.BeginWrite("setting:" + Key))
            {
                StringSetting Setting = await Database.FindFirstDeleteRest <StringSetting>(new FilterFieldEqualTo("Key", Key));

                return(await SetAsyncLocked(Key, Value, Setting));
            }
        }
예제 #15
0
        private Uri Discover()
        {
            string sharerIdentity = this.subscription.SharerIdentity;
            Uri    result;

            using (AutodiscoverClient autodiscoverClient = new AutodiscoverClient())
            {
                autodiscoverClient.RequestedServerVersion = DefaultBinding_Autodiscover.Exchange2010RequestedServerVersion;
                autodiscoverClient.Authenticator          = this.CreateAuthenticator(Offer.Autodiscover);
                autodiscoverClient.Proxy     = this.WebProxy;
                autodiscoverClient.UserAgent = "ExchangeSharingSync";
                ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 1351, "Discover", "f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\Sharing\\SharingEngine.cs");
                string[] autodiscoverTrustedHosters = topologyConfigurationSession.GetAutodiscoverTrustedHosters();
                if (autodiscoverTrustedHosters != null)
                {
                    autodiscoverClient.AllowedHostnames.AddRange(autodiscoverTrustedHosters);
                }
                UserSettings userSettings = SharingEngine.SingleGetUserSettings.Discover(autodiscoverClient, sharerIdentity);
                if (userSettings.IsSettingError("ExternalEwsUrl"))
                {
                    SharingEngine.Tracer.TraceError <UserSettings>((long)this.GetHashCode(), "ExternalEwsUrl not present in response: {0}", userSettings);
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                UserSetting setting = userSettings.GetSetting("ExternalEwsUrl");
                if (setting == null)
                {
                    SharingEngine.Tracer.TraceError <UserSettings>((long)this.GetHashCode(), "ExternalEwsUrl not present in response: {0}", userSettings);
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                StringSetting stringSetting = setting as StringSetting;
                if (stringSetting == null)
                {
                    SharingEngine.Tracer.TraceError <Type>((long)this.GetHashCode(), "Unexpected type for ExternalEwsUrl in response. Type is {0}", setting.GetType());
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                if (string.IsNullOrEmpty(stringSetting.Value))
                {
                    SharingEngine.Tracer.TraceError((long)this.GetHashCode(), "Empty value returned for ExternalEwsUrl in response.");
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                if (!Uri.IsWellFormedUriString(stringSetting.Value, UriKind.Absolute))
                {
                    SharingEngine.Tracer.TraceError <string>((long)this.GetHashCode(), "Value returned for ExternalEwsUrl is not well-formed URL: {0}", stringSetting.Value);
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                Uri uri = new Uri(EwsWsSecurityUrl.Fix(stringSetting.Value));
                if (uri.Scheme != Uri.UriSchemeHttps)
                {
                    SharingEngine.Tracer.TraceError <string>((long)this.GetHashCode(), "Response has non-HTTPS ExternalEwsUrl: {0}", stringSetting.Value);
                    throw new AutodiscoverException(Strings.UnexpectedUserResponses, userSettings);
                }
                SharingEngine.Tracer.TraceDebug <Uri>((long)this.GetHashCode(), "Received valid response: {0}", uri);
                result = uri;
            }
            return(result);
        }
예제 #16
0
        public void Awake()
        {
            _wrapper  = transform.Find("Wrapper");
            _formView = _wrapper.transform.Find("CreateServerFormView");

            _addToBrowserSetting = CreateToggle("Add to Server Browser", AddToBrowserValue, OnAddToBrowserChange);
            _serverNameSetting   = CreateTextInput("Server Name", ServerNameValue, OnServerNameChange);

            _firstEnable = true;
        }
예제 #17
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[6];
     Setting[0]   = new StringSetting("Start x y z", "", "0 0 0");
     Setting[1]   = new StringSetting("End x y z", "", "0 0 0");
     Setting[2]   = new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", "");
     Setting[3]   = new ComboSetting("Speed mode", null, new string[] { "Accurate", "Fast" }, 0);
     Setting[4]   = new StringSetting("Ignore ids", "What blocks should be ignored.", "");
     Setting[5]   = new ComboSetting("Path mode", null, new string[] { "Advanced (mining & building)", "Basic" }, 0);
 }
예제 #18
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[7];
     Setting[0]   = new StringSetting("Owner name/uuid", "Player that the bots will follow.", "");
     Setting[1]   = new NumberSetting("Clicks per second", "How fast should the bot attack?", 5, 1, 60, 1);
     Setting[2]   = new NumberSetting("Miss rate", "How often does the bot miss?", 15, 0, 100, 1);
     Setting[3]   = new StringSetting("Friendly name(s)/uuid(s)", "Uuids of the user that own't be hit. Split by spaces'", "");
     Setting[4]   = new BoolSetting("Auto equip best armor?", "Should the bot auto equip the best armor it has?", true);
     Setting[5]   = new BoolSetting("Equip best weapon?", "Should the best item be auto equiped?", true);
     Setting[6]   = new ComboSetting("Mode", null, new string[] { "Passive", "Aggressive" }, 0);
 }
        public override GameObject CreateObject(Transform parent)
        {
            FormattedFloatListSettingsValueController baseSetting = MonoBehaviour.Instantiate(Resources.FindObjectsOfTypeAll <FormattedFloatListSettingsValueController>().First(x => (x.name == "VRRenderingScale")), parent, false);

            baseSetting.name = "BSMLStringSetting";

            GameObject gameObject = baseSetting.gameObject;

            gameObject.SetActive(false);

            MonoBehaviour.Destroy(baseSetting);
            StringSetting stringSetting = gameObject.AddComponent <StringSetting>();
            Transform     valuePick     = gameObject.transform.Find("ValuePicker");

            MonoBehaviour.Destroy(valuePick.GetComponent <StepValuePicker>());
            Button decButton = valuePick.GetComponentsInChildren <Button>().First();

            decButton.enabled      = false;
            decButton.interactable = true;
            GameObject.Destroy(decButton.transform.Find("Icon").gameObject);
            stringSetting.text          = valuePick.GetComponentsInChildren <TextMeshProUGUI>().First();
            stringSetting.text.richText = true;
            stringSetting.editButton    = valuePick.GetComponentsInChildren <Button>().Last();
            stringSetting.boundingBox   = valuePick as RectTransform;

            TextMeshProUGUI text = gameObject.GetComponentInChildren <TextMeshProUGUI>();

            text.text = "Default Text";
            gameObject.AddComponent <ExternalComponents>().components.Add(text);
            MonoBehaviour.Destroy(text.GetComponent <LocalizedTextMeshProUGUI>());

            gameObject.GetComponent <LayoutElement>().preferredWidth = 90;
            stringSetting.text.alignment          = TextAlignmentOptions.MidlineRight;
            stringSetting.text.enableWordWrapping = false;
            RectTransform textTransform = stringSetting.text.transform as RectTransform;

            textTransform.anchorMin        = new Vector2(0, 0);
            textTransform.anchorMax        = new Vector2(1, 1);
            textTransform.anchoredPosition = new Vector2(-6, 0);

            Image icon = stringSetting.editButton.transform.Find("Icon").GetComponent <Image>();

            icon.name   = "EditIcon";
            icon.sprite = Utilities.EditIcon;
            icon.rectTransform.sizeDelta          = new Vector2(4, 4);
            stringSetting.editButton.interactable = true;

            (stringSetting.editButton.transform as RectTransform).anchorMin = new Vector2(0, 0);

            stringSetting.modalKeyboard = base.CreateObject(gameObject.transform).GetComponent <ModalKeyboard>();

            gameObject.SetActive(true);
            return(gameObject);
        }
예제 #20
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[8];
     Setting[0]   = new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", "");
     Setting[1]   = new BoolSetting("Diamond ore", "", true);
     Setting[2]   = new BoolSetting("Emerald ore", "", true);
     Setting[3]   = new BoolSetting("Iron ore", "", true);
     Setting[4]   = new BoolSetting("Gold ore", "", true);
     Setting[5]   = new BoolSetting("Redstone ore", "", false);
     Setting[6]   = new BoolSetting("Lapis Lazuli ore", "", false);
     Setting[7]   = new BoolSetting("Coal ore", "", false);
 }
예제 #21
0
        private static StringSetting ParseStringSetting(string line, string prefix)
        {
            var result = new StringSetting();

            if (BeginsWith(line, prefix))
            {
                string text = line.Substring(prefix.Length);
                result.IsValid = true;
                result.Value   = text;
            }
            return(result);
        }
예제 #22
0
 /// <summary>
 /// Initializes the settings in the category.
 /// </summary>
 protected override void InitializeSettings()
 {
     Port = CreateString("Port", "port")
            .SetDescription("The network port to communicate on.")
            .SetDefault("2873")
            .SetApplyType(SettingApplyType.Immediate);
     LoggerMod.Instance.OnPortChanged(Port.Value);
     Port.Changed += (sender, e) => LoggerMod.Instance.OnPortChanged(Port.Value);
     //this.TestSetting1 = this.CreateNumeric<float>("Test Setting 1", 1f, 10f, 1f)
     //    .SetDescription("A test setting that does nothing.")
     //    .SetDisplayFormatter(x => x.ToString("F1"))
     //    .SetDefault(2f);
 }
예제 #23
0
        [Test] public void SetStringTest()
        {
            StringSetting setting = new StringSetting("Test", "String", "Default");

            setting.Load();
            Assert.AreEqual("Default", (string)setting.Value);
            setting = new StringSetting("Test", "String", "");
            setting.Load();
            Assert.AreEqual("", (string)setting.Value);
            setting = new StringSetting("Test", "String");
            setting.Load();
            Assert.AreEqual(null, (string)setting.Value);
        }
예제 #24
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[10];
     Setting[0]   = new NumberSetting("Height", "Height level that the bots should mine at", 12, 1, 256);
     Setting[1]   = new ComboSetting("Pattern", "", new[] { PATTERNS[0].GetName(), PATTERNS[1].GetName(), PATTERNS[2].GetName() }, 1);
     Setting[2]   = new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", "");
     Setting[3]   = new BoolSetting("Diamond ore", "", true);
     Setting[4]   = new BoolSetting("Emerald ore", "", true);
     Setting[5]   = new BoolSetting("Iron ore", "", true);
     Setting[6]   = new BoolSetting("Gold ore", "", true);
     Setting[7]   = new BoolSetting("Redstone ore", "", false);
     Setting[8]   = new BoolSetting("Lapis Lazuli ore", "", false);
     Setting[9]   = new BoolSetting("Coal ore", "", false);
 }
예제 #25
0
파일: Config.cs 프로젝트: haefele/Mileage
 static Config()
 {
     LicensePath          = new StringSetting("Mileage/LicensePath", string.Empty);
     EnableDefaultMetrics = new BoolSetting("Mileage/EnableDefaultMetrics", false);
     CompressResponses    = new BoolSetting("Mileage/CompressResponses", true);
     EnableDebugRequestResponseLogging = new BoolSetting("Mileage/EnableDebugRequestResponseLogging", false);
     FormatResponses       = new BoolSetting("Mileage/FormatResponses", false);
     RavenHttpServerPort   = new IntSetting("Mileage/RavenHttpServerPort", 8000);
     RavenName             = new StringSetting("Mileage/RavenName", "Mileage");
     EnableRavenHttpServer = new BoolSetting("Mileage/EnableRavenHttpServer", false);
     Addresses             = new UriListSetting("Mileage/Addresses", new List <Uri>()
     {
         new Uri("http://localhost")
     }, "|");
 }
예제 #26
0
 public override void OnLoad(int version, int subversion, int buildversion)
 {
     this.Setting = new IPluginSetting[11];
     Setting[0]   = new StringSetting("User or Channel ID", "Enable developer mode: Settings->Appearance->Developer mode. Copy id: right click channel and click 'Copy ID'.", "");
     Setting[1]   = new BoolSetting("Local notifications", "", true);
     Setting[2]   = new BoolSetting("Explosion notifications", "", true);
     Setting[3]   = new BoolSetting("Wither notifications", "", true);
     Setting[4]   = new BoolSetting("Creeper notifications", "", true);
     Setting[5]   = new BoolSetting("Player notifications", "", true);
     Setting[6]   = new StringSetting("Friendly uuid(s)/name(s)", "Uuids/name(s) split by space.", "");
     Setting[7]   = new StringSetting("Lamp coordinates", "Coordinates in the [X Y Z] format, split by a space", "[-1 -1 -1] [0 0 0] [1 1 1]");
     Setting[8]   = new ComboSetting("Mode", "Notification mode", new [] { "none", "@everyone", "@everyone + tts" }, 1);
     Setting[9]   = new LinkSetting("Add bot", "Adds the bot to your discord channel (you must have administrator permissions).", "https://discordapp.com/oauth2/authorize?client_id=299708378236583939&scope=bot&permissions=6152");
     Setting[10]  = new BoolSetting("Detect falling blocks", "Should the bot detected falling sand and falling tnt", true);
 }
예제 #27
0
        protected virtual bool TryGetExchangeRpcUrlFromAutodiscoverSettings(SmtpAddress remoteIdentity, SecurityTokenService securityTokenService, DelegationTokenRequest autoDiscoveryTokenRequest, Uri autoDiscoveryEndpoint, out Uri exchangeRpcUrl)
        {
            exchangeRpcUrl = null;
            FedOrgCredentials credentials = new FedOrgCredentials(autoDiscoveryTokenRequest, securityTokenService);
            bool result;

            using (AutoDiscoverUserSettingsClient autoDiscoverUserSettingsClient = AutoDiscoverUserSettingsClient.CreateInstance(DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, this.storeSession.MailboxOwner.MailboxInfo.OrganizationId.ToADSessionSettings(), 250, "TryGetExchangeRpcUrlFromAutodiscoverSettings", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\ExchangePrincipal\\RemoteMailboxProperties.cs"), credentials, remoteIdentity, autoDiscoveryEndpoint, RemoteMailboxProperties.AutodiscoveryRequestedSettings))
            {
                autoDiscoverUserSettingsClient.AnchorMailbox = this.storeSession.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString();
                UserSettings  userSettings  = autoDiscoverUserSettingsClient.Discover();
                StringSetting stringSetting = userSettings.GetSetting(RemoteMailboxProperties.AutodiscoveryRequestedSettings[0]) as StringSetting;
                result = (stringSetting != null && Uri.TryCreate(stringSetting.Value, UriKind.Absolute, out exchangeRpcUrl));
            }
            return(result);
        }
예제 #28
0
        public void SettingTestStringToString()
        {
            string       expextedString = "mySetting=Hello";
            const string value          = "Hello";
            var          setting        = new StringSetting()
            {
                Category           = "none",
                Description        = "none",
                HumanReadableName  = "Test setting",
                IdentificationName = "mySetting",
                Value = value
            };

            Assert.AreEqual(expextedString, setting.ToString());
        }
예제 #29
0
        public void SettingTestStringFloat()
        {
            const string value   = "555,44";
            var          setting = new StringSetting()
            {
                Category           = "none",
                Description        = "none",
                HumanReadableName  = "Test setting",
                IdentificationName = "mySetting",
                Value = value
            };

            float convSetting = (float)setting;

            Assert.AreEqual(555.44f, convSetting);
        }
예제 #30
0
        public void SettingTestStringString()
        {
            const string value   = "Hello";
            var          setting = new StringSetting()
            {
                Category           = "none",
                Description        = "none",
                HumanReadableName  = "Test setting",
                IdentificationName = "mySetting",
                Value = value
            };

            string convSetting = (string)setting;

            Assert.AreEqual(value, convSetting);
        }
예제 #31
0
		public void Setup(int defaultMaxNumberOfItemsToIndexInSingleBatch, int defaultInitialNumberOfItemsToIndexInSingleBatch)
		{
			MaxPageSize =
				new IntegerSettingWithMin(settings["Raven/MaxPageSize"], 1024, 10);
			MemoryCacheLimitMegabytes =
				new IntegerSetting(settings["Raven/MemoryCacheLimitMegabytes"], GetDefaultMemoryCacheLimitMegabytes);
			MemoryCacheExpiration =
				new TimeSpanSetting(settings["Raven/MemoryCacheExpiration"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromSeconds);
			MemoryCacheLimitPercentage =
				new IntegerSetting(settings["Raven/MemoryCacheLimitPercentage"], 0 /* auto size */);
			MemoryCacheLimitCheckInterval =
				new TimeSpanSetting(settings["Raven/MemoryCacheLimitCheckInterval"], MemoryCache.Default.PollingInterval,
				                    TimeSpanArgumentType.FromParse);
			MaxIndexingRunLatency =
				new TimeSpanSetting(settings["Raven/MaxIndexingRunLatency"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxNumberOfItemsToIndexInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToIndexInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			AvailableMemoryForRaisingIndexBatchSizeLimit =
				new IntegerSetting(settings["Raven/AvailableMemoryForRaisingIndexBatchSizeLimit"],
				                   Math.Min(768, MemoryStatistics.TotalPhysicalMemory/2));
			MaxNumberOfItemsToReduceInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToReduceInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch/2, 128);
			NumberOfItemsToExecuteReduceInSingleStep =
				new IntegerSetting(settings["Raven/NumberOfItemsToExecuteReduceInSingleStep"], 1024);
			MaxNumberOfParallelIndexTasks =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfParallelIndexTasks"], Environment.ProcessorCount, 1);
			TempIndexPromotionMinimumQueryCount =
				new IntegerSetting(settings["Raven/TempIndexPromotionMinimumQueryCount"], 100);
			TempIndexPromotionThreshold =
				new IntegerSetting(settings["Raven/TempIndexPromotionThreshold"], 60000 /* once a minute */);
			TempIndexCleanupPeriod =
				new TimeSpanSetting(settings["Raven/TempIndexCleanupPeriod"], TimeSpan.FromMinutes(10),
				                    TimeSpanArgumentType.FromSeconds);
			TempIndexCleanupThreshold =
				new TimeSpanSetting(settings["Raven/TempIndexCleanupThreshold"], TimeSpan.FromMinutes(20),
				                    TimeSpanArgumentType.FromSeconds);
			TempIndexInMemoryMaxMb =
				new MultipliedIntegerSetting(new IntegerSettingWithMin(settings["Raven/TempIndexInMemoryMaxMB"], 25, 1), 1024*1024);
			RunInMemory =
				new BooleanSetting(settings["Raven/RunInMemory"], false);
			CreateTemporaryIndexesForAdHocQueriesIfNeeded =
				new BooleanSetting(settings["Raven/CreateTemporaryIndexesForAdHocQueriesIfNeeded"], true);
			ResetIndexOnUncleanShutdown =
				new BooleanSetting(settings["Raven/ResetIndexOnUncleanShutdown"], false);
			DataDir =
				new StringSetting(settings["Raven/DataDir"], @"~\Data");
			IndexStoragePath =
				new StringSetting(settings["Raven/IndexStoragePath"], (string) null);
			HostName =
				new StringSetting(settings["Raven/HostName"], (string) null);
			Port =
				new StringSetting(settings["Raven/HttpCompression"], (string) null);
			HttpCompression =
				new BooleanSetting(settings["Raven/HttpCompression"], true);
			AccessControlAllowOrigin =
				new StringSetting(settings["Raven/AccessControlAllowOrigin"], (string) null);
			AccessControlMaxAge =
				new StringSetting(settings["Raven/AccessControlMaxAge"], "1728000" /* 20 days */);
			AccessControlAllowMethods =
				new StringSetting(settings["Raven/AccessControlAllowMethods"], "PUT,PATCH,GET,DELETE,POST");
			AccessControlRequestHeaders =
				new StringSetting(settings["Raven/AccessControlRequestHeaders"], (string) null);
			RedirectStudioUrl =
				new StringSetting(settings["Raven/RedirectStudioUrl"], (string) null);
			DisableDocumentPreFetchingForIndexing =
				new BooleanSetting(settings["Raven/DisableDocumentPreFetchingForIndexing"], false);
			WebDir =
				new StringSetting(settings["Raven/WebDir"], GetDefaultWebDir);
			PluginsDirectory =
				new StringSetting(settings["Raven/PluginsDirectory"], @"~\Plugins");
			TaskScheduler =
				new StringSetting(settings["Raven/TaskScheduler"], (string) null);
			AllowLocalAccessWithoutAuthorization =
				new BooleanSetting(settings["Raven/AllowLocalAccessWithoutAuthorization"], false);
		}
		public void Setup(int defaultMaxNumberOfItemsToIndexInSingleBatch, int defaultInitialNumberOfItemsToIndexInSingleBatch)
		{

			PrefetchingDurationLimit = new IntegerSetting(settings[Constants.RavenPrefetchingDurationLimit], Constants.DefaultPrefetchingDurationLimit);

            BulkImportBatchTimeout = new TimeSpanSetting(settings[Constants.BulkImportBatchTimeout], TimeSpan.FromMilliseconds(Constants.BulkImportDefaultTimeoutInMs), TimeSpanArgumentType.FromParse);

			MaxConcurrentServerRequests = new IntegerSetting(settings[Constants.MaxConcurrentServerRequests], 512);

			MaxConcurrentMultiGetRequests = new IntegerSetting(settings[Constants.MaxConcurrentMultiGetRequests], 192);

			MemoryLimitForProcessing = new IntegerSetting(settings[Constants.MemoryLimitForProcessing] ?? settings[Constants.MemoryLimitForProcessing_BackwardCompatibility],
                // we allow 1 GB by default, or up to 75% of available memory on startup, if less than that is available
                Math.Min(1024, (int)(MemoryStatistics.AvailableMemory * 0.75))); 

			MaxPageSize =
				new IntegerSettingWithMin(settings["Raven/MaxPageSize"], 1024, 10);
			MemoryCacheLimitMegabytes =
				new IntegerSetting(settings["Raven/MemoryCacheLimitMegabytes"], GetDefaultMemoryCacheLimitMegabytes);
			MemoryCacheExpiration =
				new TimeSpanSetting(settings["Raven/MemoryCacheExpiration"], TimeSpan.FromMinutes(60),
				                    TimeSpanArgumentType.FromSeconds);
			MemoryCacheLimitPercentage =
				new IntegerSetting(settings["Raven/MemoryCacheLimitPercentage"], 0 /* auto size */);
			MemoryCacheLimitCheckInterval =
				new TimeSpanSetting(settings["Raven/MemoryCacheLimitCheckInterval"], MemoryCache.Default.PollingInterval,
				                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsSyncronousWaitTime =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsSyncronousWaitTime"], TimeSpan.FromSeconds(3),
                                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsOnIndexingMaxAge =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsOnIndexingMaxAge"], TimeSpan.FromMinutes(10),
                                    TimeSpanArgumentType.FromParse);
			
			
			MaxProcessingRunLatency =
				new TimeSpanSetting(settings["Raven/MaxProcessingRunLatency"] ?? settings["Raven/MaxIndexingRunLatency"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxIndexWritesBeforeRecreate =
				new IntegerSetting(settings["Raven/MaxIndexWritesBeforeRecreate"], 256 * 1024);
			MaxSimpleIndexOutputsPerDocument = 
				new IntegerSetting(settings["Raven/MaxSimpleIndexOutputsPerDocument"], 15);

			MaxMapReduceIndexOutputsPerDocument =
				new IntegerSetting(settings["Raven/MaxMapReduceIndexOutputsPerDocument"], 50);

			MaxNumberOfItemsToProcessInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToProcessInSingleBatch"] ?? settings["Raven/MaxNumberOfItemsToIndexInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			AvailableMemoryForRaisingBatchSizeLimit =
				new IntegerSetting(settings["Raven/AvailableMemoryForRaisingBatchSizeLimit"] ?? settings["Raven/AvailableMemoryForRaisingIndexBatchSizeLimit"],
				                   Math.Min(768, MemoryStatistics.TotalPhysicalMemory/2));
			MaxNumberOfItemsToReduceInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToReduceInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch/2, 128);
			NumberOfItemsToExecuteReduceInSingleStep =
				new IntegerSetting(settings["Raven/NumberOfItemsToExecuteReduceInSingleStep"], 1024);
			MaxNumberOfParallelProcessingTasks =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfParallelProcessingTasks"] ?? settings["Raven/MaxNumberOfParallelIndexTasks"], Environment.ProcessorCount, 1);

			NewIndexInMemoryMaxMb =
				new MultipliedIntegerSetting(new IntegerSettingWithMin(settings["Raven/NewIndexInMemoryMaxMB"], 64, 1), 1024*1024);
			RunInMemory =
				new BooleanSetting(settings["Raven/RunInMemory"], false);
			CreateAutoIndexesForAdHocQueriesIfNeeded =
				new BooleanSetting(settings["Raven/CreateAutoIndexesForAdHocQueriesIfNeeded"], true);
			ResetIndexOnUncleanShutdown =
				new BooleanSetting(settings["Raven/ResetIndexOnUncleanShutdown"], false);
			DisableInMemoryIndexing =
				new BooleanSetting(settings["Raven/DisableInMemoryIndexing"], false);
			DataDir =
				new StringSetting(settings["Raven/DataDir"], @"~\Data");
			IndexStoragePath =
				new StringSetting(settings["Raven/IndexStoragePath"], (string)null);
			CountersDataDir =
				new StringSetting(settings["Raven/Counters/DataDir"], @"~\Data\Counters");
			
			HostName =
				new StringSetting(settings["Raven/HostName"], (string) null);
			Port =
				new StringSetting(settings["Raven/Port"], "*");
			HttpCompression =
				new BooleanSetting(settings["Raven/HttpCompression"], true);
			AccessControlAllowOrigin =
				new StringSetting(settings["Raven/AccessControlAllowOrigin"], (string) null);
			AccessControlMaxAge =
				new StringSetting(settings["Raven/AccessControlMaxAge"], "1728000" /* 20 days */);
			AccessControlAllowMethods =
				new StringSetting(settings["Raven/AccessControlAllowMethods"], "PUT,PATCH,GET,DELETE,POST");
			AccessControlRequestHeaders =
				new StringSetting(settings["Raven/AccessControlRequestHeaders"], (string) null);
			RedirectStudioUrl =
				new StringSetting(settings["Raven/RedirectStudioUrl"], (string) null);
			DisableDocumentPreFetching =
				new BooleanSetting(settings["Raven/DisableDocumentPreFetching"] ?? settings["Raven/DisableDocumentPreFetchingForIndexing"], false);
			MaxNumberOfItemsToPreFetch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToPreFetch"]?? settings["Raven/MaxNumberOfItemsToPreFetchForIndexing"],
										  defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			WebDir =
				new StringSetting(settings["Raven/WebDir"], GetDefaultWebDir);
			PluginsDirectory =
				new StringSetting(settings["Raven/PluginsDirectory"], @"~\Plugins");
			CompiledIndexCacheDirectory =
				new StringSetting(settings["Raven/CompiledIndexCacheDirectory"], @"~\Raven\CompiledIndexCache");
			TaskScheduler =
				new StringSetting(settings["Raven/TaskScheduler"], (string) null);
			AllowLocalAccessWithoutAuthorization =
				new BooleanSetting(settings["Raven/AllowLocalAccessWithoutAuthorization"], false);
			MaxIndexCommitPointStoreTimeInterval =
				new TimeSpanSetting(settings["Raven/MaxIndexCommitPointStoreTimeInterval"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxNumberOfStoredCommitPoints =
				new IntegerSetting(settings["Raven/MaxNumberOfStoredCommitPoints"], 5);
			MinIndexingTimeIntervalToStoreCommitPoint =
				new TimeSpanSetting(settings["Raven/MinIndexingTimeIntervalToStoreCommitPoint"], TimeSpan.FromMinutes(1),
				                    TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeRunningIdleIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningIdleIndexes"], TimeSpan.FromMinutes(10), TimeSpanArgumentType.FromParse);

			DatbaseOperationTimeout = new TimeSpanSetting(settings["Raven/DatabaseOperationTimeout"], TimeSpan.FromMinutes(5), TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeMarkingAutoIndexAsIdle = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingAutoIndexAsIdle"], TimeSpan.FromHours(1), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeMarkingIdleIndexAsAbandoned = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingIdleIndexAsAbandoned"], TimeSpan.FromHours(72), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeRunningAbandonedIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningAbandonedIndexes"], TimeSpan.FromHours(3), TimeSpanArgumentType.FromParse);

			DisableClusterDiscovery = new BooleanSetting(settings["Raven/DisableClusterDiscovery"], false);

			ServerName = new StringSetting(settings["Raven/ServerName"], (string)null);

			MaxStepsForScript = new IntegerSetting(settings["Raven/MaxStepsForScript"], 10*1000);
			AdditionalStepsForScriptBasedOnDocumentSize = new IntegerSetting(settings["Raven/AdditionalStepsForScriptBasedOnDocumentSize"], 5);

			MaxRecentTouchesToRemember = new IntegerSetting(settings["Raven/MaxRecentTouchesToRemember"], 1024);

			Prefetcher.FetchingDocumentsFromDiskTimeoutInSeconds = new IntegerSetting(settings["Raven/Prefetcher/FetchingDocumentsFromDiskTimeout"], 5);
			Prefetcher.MaximumSizeAllowedToFetchFromStorageInMb = new IntegerSetting(settings["Raven/Prefetcher/MaximumSizeAllowedToFetchFromStorage"], 256);

            Voron.MaxBufferPoolSize = new IntegerSetting(settings["Raven/Voron/MaxBufferPoolSize"], 4);
			Voron.InitialFileSize = new NullableIntegerSetting(settings["Raven/Voron/InitialFileSize"], (int?)null);
			Voron.MaxScratchBufferSize = new IntegerSetting(settings["Raven/Voron/MaxScratchBufferSize"], 512);
			Voron.AllowIncrementalBackups = new BooleanSetting(settings["Raven/Voron/AllowIncrementalBackups"], false);
			Voron.TempPath = new StringSetting(settings["Raven/Voron/TempPath"], (string) null);

			Replication.FetchingFromDiskTimeoutInSeconds = new IntegerSetting(settings["Raven/Replication/FetchingFromDiskTimeout"], 30);
			Replication.ReplicationRequestTimeoutInMilliseconds = new IntegerSetting(settings["Raven/Replication/ReplicationRequestTimeout"], 60 * 1000);

            FileSystem.MaximumSynchronizationInterval = new TimeSpanSetting(settings["Raven/FileSystem/MaximumSynchronizationInterval"], TimeSpan.FromSeconds(60), TimeSpanArgumentType.FromParse);
			FileSystem.IndexStoragePath = new StringSetting(settings["Raven/FileSystem/IndexStoragePath"], (string)null);
			FileSystem.DataDir = new StringSetting(settings["Raven/FileSystem/DataDir"], @"~\Data\FileSystem");
			FileSystem.DefaultStorageTypeName = new StringSetting(settings["Raven/FileSystem/Storage"], InMemoryRavenConfiguration.VoronTypeName);

			Encryption.UseFips = new BooleanSetting(settings["Raven/Encryption/FIPS"], false);
			Encryption.EncryptionKeyBitsPreference = new IntegerSetting(settings[Constants.EncryptionKeyBitsPreferenceSetting], Constants.DefaultKeySizeToUseInActualEncryptionInBits);
			Encryption.UseSsl = new BooleanSetting(settings["Raven/UseSsl"], false);

			DefaultStorageTypeName = new StringSetting(settings["Raven/StorageTypeName"] ?? settings["Raven/StorageEngine"], InMemoryRavenConfiguration.VoronTypeName);

			FlushIndexToDiskSizeInMb = new IntegerSetting(settings["Raven/Indexing/FlushIndexToDiskSizeInMb"], 5);
			JournalsStoragePath = new StringSetting(settings["Raven/Esent/LogsPath"] ?? settings[Constants.RavenTxJournalPath], (string)null);

			TombstoneRetentionTime = new TimeSpanSetting(settings["Raven/TombstoneRetentionTime"], TimeSpan.FromDays(14), TimeSpanArgumentType.FromParse);
		}
예제 #33
0
        public void Setup(int defaultMaxNumberOfItemsToIndexInSingleBatch, int defaultInitialNumberOfItemsToIndexInSingleBatch)
        {
            //1024 is Lucene.net default - so if the setting is not set it will be the same as not touching Lucene's settings at all
            MaxClauseCount = new IntegerSetting(settings[Constants.MaxClauseCount], 1024);

            AllowScriptsToAdjustNumberOfSteps = new BooleanSetting(settings[Constants.AllowScriptsToAdjustNumberOfSteps], false);

            IndexAndTransformerReplicationLatencyInSec = new IntegerSetting(settings[Constants.RavenIndexAndTransformerReplicationLatencyInSec], Constants.DefaultRavenIndexAndTransformerReplicationLatencyInSec);

            PrefetchingDurationLimit = new IntegerSetting(settings[Constants.RavenPrefetchingDurationLimit], Constants.DefaultPrefetchingDurationLimit);

            BulkImportBatchTimeout = new TimeSpanSetting(settings[Constants.BulkImportBatchTimeout], TimeSpan.FromMilliseconds(Constants.BulkImportDefaultTimeoutInMs), TimeSpanArgumentType.FromParse);

            MaxConcurrentServerRequests = new IntegerSetting(settings[Constants.MaxConcurrentServerRequests], 512);

            MaxConcurrentRequestsForDatabaseDuringLoad = new IntegerSetting(settings[Constants.MaxConcurrentRequestsForDatabaseDuringLoad], 50);

            MaxSecondsForTaskToWaitForDatabaseToLoad = new IntegerSetting(settings[Constants.MaxSecondsForTaskToWaitForDatabaseToLoad], 5);

            MaxConcurrentMultiGetRequests = new IntegerSetting(settings[Constants.MaxConcurrentMultiGetRequests], 192);

            MemoryLimitForProcessing = new IntegerSetting(settings[Constants.MemoryLimitForProcessing] ?? settings[Constants.MemoryLimitForProcessing_BackwardCompatibility],
                // we allow 1 GB by default, or up to 75% of available memory on startup, if less than that is available
                Math.Min(1024, (int)(MemoryStatistics.AvailableMemoryInMb * 0.75)));

            MaxPageSize =
                new IntegerSettingWithMin(settings["Raven/MaxPageSize"], 1024, 10);

            MemoryCacheLimitMegabytes =
                new IntegerSetting(settings["Raven/MemoryCacheLimitMegabytes"], GetDefaultMemoryCacheLimitMegabytes);
            MemoryCacheExpiration =
                new TimeSpanSetting(settings["Raven/MemoryCacheExpiration"], TimeSpan.FromMinutes(60),
                                    TimeSpanArgumentType.FromSeconds);
            MemoryCacheLimitPercentage =
                new IntegerSetting(settings["Raven/MemoryCacheLimitPercentage"], 0 /* auto size */);
            MemoryCacheLimitCheckInterval =
                new TimeSpanSetting(settings["Raven/MemoryCacheLimitCheckInterval"], MemoryCache.Default.PollingInterval,
                                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsSyncronousWaitTime =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsSyncronousWaitTime"], TimeSpan.FromSeconds(3),
                                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsOnIndexingMaxAge =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsOnIndexingMaxAge"], TimeSpan.FromMinutes(10),
                                    TimeSpanArgumentType.FromParse);


            MaxProcessingRunLatency =
                new TimeSpanSetting(settings["Raven/MaxProcessingRunLatency"] ?? settings["Raven/MaxIndexingRunLatency"], TimeSpan.FromMinutes(5),
                                    TimeSpanArgumentType.FromParse);
            MaxIndexWritesBeforeRecreate =
                new IntegerSetting(settings["Raven/MaxIndexWritesBeforeRecreate"], 256 * 1024);
            MaxSimpleIndexOutputsPerDocument =
                new IntegerSetting(settings["Raven/MaxSimpleIndexOutputsPerDocument"], 15);

            MaxMapReduceIndexOutputsPerDocument =
                new IntegerSetting(settings["Raven/MaxMapReduceIndexOutputsPerDocument"], 50);

            MaxNumberOfItemsToProcessInSingleBatch =
                new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToProcessInSingleBatch"] ?? settings["Raven/MaxNumberOfItemsToIndexInSingleBatch"],
                                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
            AvailableMemoryForRaisingBatchSizeLimit =
                new IntegerSetting(settings["Raven/AvailableMemoryForRaisingBatchSizeLimit"] ?? settings["Raven/AvailableMemoryForRaisingIndexBatchSizeLimit"],
                                   Math.Min(768, MemoryStatistics.TotalPhysicalMemory / 2));
            MaxNumberOfItemsToReduceInSingleBatch =
                new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToReduceInSingleBatch"],
                                          defaultMaxNumberOfItemsToIndexInSingleBatch / 2, 128);
            NumberOfItemsToExecuteReduceInSingleStep =
                new IntegerSetting(settings["Raven/NumberOfItemsToExecuteReduceInSingleStep"], 1024);
            MaxNumberOfParallelProcessingTasks =
                new IntegerSettingWithMin(settings["Raven/MaxNumberOfParallelProcessingTasks"] ?? settings["Raven/MaxNumberOfParallelIndexTasks"], Environment.ProcessorCount, 1);

            NewIndexInMemoryMaxTime =
                new TimeSpanSetting(settings["Raven/NewIndexInMemoryMaxTime"], TimeSpan.FromMinutes(15), TimeSpanArgumentType.FromParse);
            NewIndexInMemoryMaxMb =
                new MultipliedIntegerSetting(new IntegerSettingWithMin(settings["Raven/NewIndexInMemoryMaxMB"], 64, 1), 1024 * 1024);
            RunInMemory =
                new BooleanSetting(settings[Constants.RunInMemory], false);
            CreateAutoIndexesForAdHocQueriesIfNeeded =
                new BooleanSetting(settings["Raven/CreateAutoIndexesForAdHocQueriesIfNeeded"], true);
            ResetIndexOnUncleanShutdown =
                new BooleanSetting(settings["Raven/ResetIndexOnUncleanShutdown"], false);
            DisableInMemoryIndexing =
                new BooleanSetting(settings["Raven/DisableInMemoryIndexing"], false);
            WorkingDir =
                new StringSetting(settings["Raven/WorkingDir"], @"~\");
            DataDir =
                new StringSetting(settings["Raven/DataDir"], @"~\Databases\System");
            IndexStoragePath =
                new StringSetting(settings["Raven/IndexStoragePath"], (string)null);
            CountersDataDir =
                new StringSetting(settings["Raven/Counters/DataDir"], @"~\Data\Counters");

            HostName =
                new StringSetting(settings["Raven/HostName"], (string)null);
            Port =
                new StringSetting(settings["Raven/Port"], "*");
            ExposeConfigOverTheWire =
                new StringSetting(settings[Constants.ExposeConfigOverTheWire], "Open");
            HttpCompression =
                new BooleanSetting(settings["Raven/HttpCompression"], true);
            AccessControlAllowOrigin =
                new StringSetting(settings["Raven/AccessControlAllowOrigin"], (string)null);
            AccessControlMaxAge =
                new StringSetting(settings["Raven/AccessControlMaxAge"], "1728000" /* 20 days */);
            AccessControlAllowMethods =
                new StringSetting(settings["Raven/AccessControlAllowMethods"], "PUT,PATCH,GET,DELETE,POST");
            AccessControlRequestHeaders =
                new StringSetting(settings["Raven/AccessControlRequestHeaders"], (string)null);
            RedirectStudioUrl =
                new StringSetting(settings["Raven/RedirectStudioUrl"], (string)null);
            DisableDocumentPreFetching =
                new BooleanSetting(settings["Raven/DisableDocumentPreFetching"] ?? settings["Raven/DisableDocumentPreFetchingForIndexing"], false);
            MaxNumberOfItemsToPreFetch =
                new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToPreFetch"] ?? settings["Raven/MaxNumberOfItemsToPreFetchForIndexing"],
                                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
            WebDir =
                new StringSetting(settings["Raven/WebDir"], GetDefaultWebDir);
            PluginsDirectory =
                new StringSetting(settings["Raven/PluginsDirectory"], @"~\Plugins");
            AssembliesDirectory =
                new StringSetting(settings["Raven/AssembliesDirectory"], @"~\Assemblies");
            EmbeddedFilesDirectory =
                new StringSetting(settings["Raven/EmbeddedFilesDirectory"], (string)null);
            CompiledIndexCacheDirectory =
                new StringSetting(settings["Raven/CompiledIndexCacheDirectory"], @"~\CompiledIndexCache");
            TaskScheduler =
                new StringSetting(settings["Raven/TaskScheduler"], (string)null);
            AllowLocalAccessWithoutAuthorization =
                new BooleanSetting(settings["Raven/AllowLocalAccessWithoutAuthorization"], false);
            RejectClientsModeEnabled =
                new BooleanSetting(settings[Constants.RejectClientsModeEnabled], false);

            MaxIndexCommitPointStoreTimeInterval =
                new TimeSpanSetting(settings["Raven/MaxIndexCommitPointStoreTimeInterval"], TimeSpan.FromMinutes(5),
                                    TimeSpanArgumentType.FromParse);
            MaxNumberOfStoredCommitPoints =
                new IntegerSetting(settings["Raven/MaxNumberOfStoredCommitPoints"], 5);
            MinIndexingTimeIntervalToStoreCommitPoint =
                new TimeSpanSetting(settings["Raven/MinIndexingTimeIntervalToStoreCommitPoint"], TimeSpan.FromMinutes(1),
                                    TimeSpanArgumentType.FromParse);

            TimeToWaitBeforeRunningIdleIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningIdleIndexes"], TimeSpan.FromMinutes(10), TimeSpanArgumentType.FromParse);

            DatbaseOperationTimeout = new TimeSpanSetting(settings["Raven/DatabaseOperationTimeout"], TimeSpan.FromMinutes(5), TimeSpanArgumentType.FromParse);

            TimeToWaitBeforeMarkingAutoIndexAsIdle = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingAutoIndexAsIdle"], TimeSpan.FromHours(1), TimeSpanArgumentType.FromParse);

            TimeToWaitBeforeMarkingIdleIndexAsAbandoned = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingIdleIndexAsAbandoned"], TimeSpan.FromHours(72), TimeSpanArgumentType.FromParse);

            TimeToWaitBeforeRunningAbandonedIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningAbandonedIndexes"], TimeSpan.FromHours(3), TimeSpanArgumentType.FromParse);

            DisableClusterDiscovery = new BooleanSetting(settings["Raven/DisableClusterDiscovery"], false);

            TurnOffDiscoveryClient = new BooleanSetting(settings["Raven/TurnOffDiscoveryClient"], false);

            ServerName = new StringSetting(settings["Raven/ServerName"], (string)null);

            MaxStepsForScript = new IntegerSetting(settings["Raven/MaxStepsForScript"], 10 * 1000);
            AdditionalStepsForScriptBasedOnDocumentSize = new IntegerSetting(settings["Raven/AdditionalStepsForScriptBasedOnDocumentSize"], 5);

            MaxRecentTouchesToRemember = new IntegerSetting(settings["Raven/MaxRecentTouchesToRemember"], 1024);

            Prefetcher.FetchingDocumentsFromDiskTimeoutInSeconds = new IntegerSetting(settings["Raven/Prefetcher/FetchingDocumentsFromDiskTimeout"], 5);
            Prefetcher.MaximumSizeAllowedToFetchFromStorageInMb = new IntegerSetting(settings["Raven/Prefetcher/MaximumSizeAllowedToFetchFromStorage"], 256);

            Voron.MaxBufferPoolSize = new IntegerSetting(settings[Constants.Voron.MaxBufferPoolSize], 4);
            Voron.InitialFileSize = new NullableIntegerSetting(settings[Constants.Voron.InitialFileSize], (int?)null);
            Voron.MaxScratchBufferSize = new IntegerSetting(settings[Constants.Voron.MaxScratchBufferSize], 6144);

            var maxScratchBufferSize = Voron.MaxScratchBufferSize.Value;
            var scratchBufferSizeNotificationThreshold = -1;
            if (maxScratchBufferSize > 1024)
                scratchBufferSizeNotificationThreshold = 1024;
            else if (maxScratchBufferSize > 512)
                scratchBufferSizeNotificationThreshold = 512;
            Voron.ScratchBufferSizeNotificationThreshold = new IntegerSetting(settings[Constants.Voron.ScratchBufferSizeNotificationThreshold], scratchBufferSizeNotificationThreshold);

            Voron.AllowIncrementalBackups = new BooleanSetting(settings[Constants.Voron.AllowIncrementalBackups], false);
            Voron.AllowOn32Bits = new BooleanSetting(settings[Constants.Voron.AllowOn32Bits], false);
            Voron.TempPath = new StringSetting(settings[Constants.Voron.TempPath], (string)null);

            var txJournalPath = settings[Constants.RavenTxJournalPath];
            var esentLogsPath = settings[Constants.RavenEsentLogsPath];

            Voron.JournalsStoragePath = new StringSetting(string.IsNullOrEmpty(txJournalPath) ? esentLogsPath : txJournalPath, (string)null);

            Esent.JournalsStoragePath = new StringSetting(string.IsNullOrEmpty(esentLogsPath) ? txJournalPath : esentLogsPath, (string)null);

            var defaultCacheSize = Environment.Is64BitProcess ? Math.Min(1024, (MemoryStatistics.TotalPhysicalMemory / 4)) : 256;
            Esent.CacheSizeMax = new IntegerSetting(settings[Constants.Esent.CacheSizeMax], defaultCacheSize);
            Esent.MaxVerPages = new IntegerSetting(settings[Constants.Esent.MaxVerPages], 512);
            Esent.PreferredVerPages = new IntegerSetting(settings[Constants.Esent.PreferredVerPages], 472);
            Esent.DbExtensionSize = new IntegerSetting(settings[Constants.Esent.DbExtensionSize], 8);
            Esent.LogFileSize = new IntegerSetting(settings[Constants.Esent.LogFileSize], 64);
            Esent.LogBuffers = new IntegerSetting(settings[Constants.Esent.LogBuffers], 8192);
            Esent.MaxCursors = new IntegerSetting(settings[Constants.Esent.MaxCursors], 2048);
            Esent.CircularLog = new BooleanSetting(settings[Constants.Esent.CircularLog], true);

            Replication.FetchingFromDiskTimeoutInSeconds = new IntegerSetting(settings["Raven/Replication/FetchingFromDiskTimeout"], 30);
            Replication.ReplicationRequestTimeoutInMilliseconds = new IntegerSetting(settings["Raven/Replication/ReplicationRequestTimeout"], 60 * 1000);
            Replication.ForceReplicationRequestBuffering = new BooleanSetting(settings["Raven/Replication/ForceReplicationRequestBuffering"], false);
            Replication.MaxNumberOfItemsToReceiveInSingleBatch = new NullableIntegerSettingWithMin(settings["Raven/Replication/MaxNumberOfItemsToReceiveInSingleBatch"], (int?)null, 512);

            FileSystem.MaximumSynchronizationInterval = new TimeSpanSetting(settings[Constants.FileSystem.MaximumSynchronizationInterval], TimeSpan.FromSeconds(60), TimeSpanArgumentType.FromParse);
            FileSystem.IndexStoragePath = new StringSetting(settings[Constants.FileSystem.IndexStorageDirectory], string.Empty);
            FileSystem.DataDir = new StringSetting(settings[Constants.FileSystem.DataDirectory], @"~\FileSystems");
            FileSystem.DefaultStorageTypeName = new StringSetting(settings[Constants.FileSystem.Storage], string.Empty);
            FileSystem.PreventSchemaUpdate = new BooleanSetting(settings[Constants.FileSystem.PreventSchemaUpdate], false);
            Encryption.UseFips = new BooleanSetting(settings["Raven/Encryption/FIPS"], false);
            Encryption.EncryptionKeyBitsPreference = new IntegerSetting(settings[Constants.EncryptionKeyBitsPreferenceSetting], Constants.DefaultKeySizeToUseInActualEncryptionInBits);
            Encryption.UseSsl = new BooleanSetting(settings["Raven/UseSsl"], false);

            Indexing.MaxNumberOfItemsToProcessInTestIndexes = new IntegerSetting(settings[Constants.MaxNumberOfItemsToProcessInTestIndexes], 512);
            Indexing.DisableIndexingFreeSpaceThreshold = new IntegerSetting(settings[Constants.Indexing.DisableIndexingFreeSpaceThreshold], 2048);
            Indexing.DisableMapReduceInMemoryTracking = new BooleanSetting(settings[Constants.Indexing.DisableMapReduceInMemoryTracking], false);

            DefaultStorageTypeName = new StringSetting(settings["Raven/StorageTypeName"] ?? settings["Raven/StorageEngine"], string.Empty);

            FlushIndexToDiskSizeInMb = new IntegerSetting(settings["Raven/Indexing/FlushIndexToDiskSizeInMb"], 5);

            TombstoneRetentionTime = new TimeSpanSetting(settings["Raven/TombstoneRetentionTime"], TimeSpan.FromDays(14), TimeSpanArgumentType.FromParse);

            ImplicitFetchFieldsFromDocumentMode = new EnumSetting<ImplicitFetchFieldsMode>(settings["Raven/ImplicitFetchFieldsFromDocumentMode"], ImplicitFetchFieldsMode.Enabled);

            if (settings["Raven/MaxServicePointIdleTime"] != null)
                ServicePointManager.MaxServicePointIdleTime = Convert.ToInt32(settings["Raven/MaxServicePointIdleTime"]);

            WebSockets.InitialBufferPoolSize = new IntegerSetting(settings["Raven/WebSockets/InitialBufferPoolSize"], 128 * 1024);

            MaxConcurrentResourceLoads = new IntegerSetting(settings[Constants.RavenMaxConcurrentResourceLoads], 8);
            ConcurrentResourceLoadTimeout = new TimeSpanSetting(settings[Constants.ConcurrentResourceLoadTimeout],
                TimeSpan.FromSeconds(15),
                TimeSpanArgumentType.FromParse);

            CacheDocumentsInMemory = new BooleanSetting(settings["Raven/CacheDocumentsInMemory"], true);
        }
		public void Setup(int defaultMaxNumberOfItemsToIndexInSingleBatch, int defaultInitialNumberOfItemsToIndexInSingleBatch)
		{
			MaxPageSize =
				new IntegerSettingWithMin(settings["Raven/MaxPageSize"], 1024, 10);
			MemoryCacheLimitMegabytes =
				new IntegerSetting(settings["Raven/MemoryCacheLimitMegabytes"], GetDefaultMemoryCacheLimitMegabytes);
			MemoryCacheExpiration =
				new TimeSpanSetting(settings["Raven/MemoryCacheExpiration"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromSeconds);
			MemoryCacheLimitPercentage =
				new IntegerSetting(settings["Raven/MemoryCacheLimitPercentage"], 0 /* auto size */);
			MemoryCacheLimitCheckInterval =
				new TimeSpanSetting(settings["Raven/MemoryCacheLimitCheckInterval"], MemoryCache.Default.PollingInterval,
				                    TimeSpanArgumentType.FromParse);
			MaxIndexingRunLatency =
				new TimeSpanSetting(settings["Raven/MaxIndexingRunLatency"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxIndexWritesBeforeRecreate =
				new IntegerSetting(settings["Raven/MaxIndexWritesBeforeRecreate"], 256 * 1024);

			MaxNumberOfItemsToIndexInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToIndexInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			AvailableMemoryForRaisingIndexBatchSizeLimit =
				new IntegerSetting(settings["Raven/AvailableMemoryForRaisingIndexBatchSizeLimit"],
				                   Math.Min(768, MemoryStatistics.TotalPhysicalMemory/2));
			MaxNumberOfItemsToReduceInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToReduceInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch/2, 128);
			NumberOfItemsToExecuteReduceInSingleStep =
				new IntegerSetting(settings["Raven/NumberOfItemsToExecuteReduceInSingleStep"], 1024);
			MaxNumberOfParallelIndexTasks =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfParallelIndexTasks"], Environment.ProcessorCount, 1);

			NewIndexInMemoryMaxMb =
				new MultipliedIntegerSetting(new IntegerSettingWithMin(settings["Raven/NewIndexInMemoryMaxMB"], 64, 1), 1024*1024);
			RunInMemory =
				new BooleanSetting(settings["Raven/RunInMemory"], false);
			CreateAutoIndexesForAdHocQueriesIfNeeded =
				new BooleanSetting(settings["Raven/CreateAutoIndexesForAdHocQueriesIfNeeded"], true);
			ResetIndexOnUncleanShutdown =
				new BooleanSetting(settings["Raven/ResetIndexOnUncleanShutdown"], false);
			DataDir =
				new StringSetting(settings["Raven/DataDir"], @"~\Data");
			IndexStoragePath =
				new StringSetting(settings["Raven/IndexStoragePath"], (string) null);
			HostName =
				new StringSetting(settings["Raven/HostName"], (string) null);
			Port =
				new StringSetting(settings["Raven/Port"], (string) null);
			UseSsl = 
				new BooleanSetting(settings["Raven/UseSsl"], false);
			HttpCompression =
				new BooleanSetting(settings["Raven/HttpCompression"], true);
			AccessControlAllowOrigin =
				new StringSetting(settings["Raven/AccessControlAllowOrigin"], (string) null);
			AccessControlMaxAge =
				new StringSetting(settings["Raven/AccessControlMaxAge"], "1728000" /* 20 days */);
			AccessControlAllowMethods =
				new StringSetting(settings["Raven/AccessControlAllowMethods"], "PUT,PATCH,GET,DELETE,POST");
			AccessControlRequestHeaders =
				new StringSetting(settings["Raven/AccessControlRequestHeaders"], (string) null);
			RedirectStudioUrl =
				new StringSetting(settings["Raven/RedirectStudioUrl"], (string) null);
			DisableDocumentPreFetchingForIndexing =
				new BooleanSetting(settings["Raven/DisableDocumentPreFetchingForIndexing"], false);
			MaxNumberOfItemsToPreFetchForIndexing =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToPreFetchForIndexing"],
										  defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			WebDir =
				new StringSetting(settings["Raven/WebDir"], GetDefaultWebDir);
			PluginsDirectory =
				new StringSetting(settings["Raven/PluginsDirectory"], @"~\Plugins");
			CompiledIndexCacheDirectory =
				new StringSetting(settings["Raven/CompiledIndexCacheDirectory"], @"~\Raven\CompiledIndexCache");
			TaskScheduler =
				new StringSetting(settings["Raven/TaskScheduler"], (string) null);
			AllowLocalAccessWithoutAuthorization =
				new BooleanSetting(settings["Raven/AllowLocalAccessWithoutAuthorization"], false);
			MaxIndexCommitPointStoreTimeInterval =
				new TimeSpanSetting(settings["Raven/MaxIndexCommitPointStoreTimeInterval"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxNumberOfStoredCommitPoints =
				new IntegerSetting(settings["Raven/MaxNumberOfStoredCommitPoints"], 5);
			MinIndexingTimeIntervalToStoreCommitPoint =
				new TimeSpanSetting(settings["Raven/MinIndexingTimeIntervalToStoreCommitPoint"], TimeSpan.FromMinutes(1),
				                    TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeRunningIdleIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningIdleIndexes"], TimeSpan.FromMinutes(10), TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeMarkingAutoIndexAsIdle = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingAutoIndexAsIdle"], TimeSpan.FromHours(1), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeMarkingIdleIndexAsAbandoned = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingIdleIndexAsAbandoned"], TimeSpan.FromHours(72), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeRunningAbandonedIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningAbandonedIndexes"], TimeSpan.FromHours(3), TimeSpanArgumentType.FromParse);

			DisableClusterDiscovery = new BooleanSetting(settings["Raven/DisableClusterDiscovery"], false);

			ClusterName = new StringSetting(settings["Raven/ClusterName"], (string)null);
			ServerName = new StringSetting(settings["Raven/ServerName"], (string)null);

			MaxStepsForScript = new IntegerSetting(settings["Raven/MaxStepsForScript"], 10*1000);
			AdditionalStepsForScriptBasedOnDocumentSize = new IntegerSetting(settings["Raven/AdditionalStepsForScriptBasedOnDocumentSize"], 5);
		}
예제 #35
0
 public static void SetSetting( StringSetting key, string value )
 {
    PlayerPrefs.SetString( Enum.GetName( key.GetType(), key ), value );
    PlayerPrefs.Save();
 }
예제 #36
0
		public void Setup(int defaultMaxNumberOfItemsToIndexInSingleBatch, int defaultInitialNumberOfItemsToIndexInSingleBatch)
		{
			MaxConcurrentServerRequests = new IntegerSetting(settings[Constants.MaxConcurrentServerRequests], 512);

			MaxConcurrentMultiGetRequests = new IntegerSetting(settings[Constants.MaxConcurrentMultiGetRequests], 192);

			MemoryLimitForIndexing = new IntegerSetting(settings[Constants.MemoryLimitForIndexing],
                // we allow 1 GB by default, or up to 75% of available memory on startup, if less than that is available
                Math.Min(1024, (int)(MemoryStatistics.AvailableMemory * 0.75))); 

		    EncryptionKeyBitsPreference = new IntegerSetting(settings[Constants.EncryptionKeyBitsPreferenceSetting],
		        Constants.DefaultKeySizeToUseInActualEncryptionInBits);
			MaxPageSize =
				new IntegerSettingWithMin(settings["Raven/MaxPageSize"], 1024, 10);
			MemoryCacheLimitMegabytes =
				new IntegerSetting(settings["Raven/MemoryCacheLimitMegabytes"], GetDefaultMemoryCacheLimitMegabytes);
			MemoryCacheExpiration =
				new TimeSpanSetting(settings["Raven/MemoryCacheExpiration"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromSeconds);
			MemoryCacheLimitPercentage =
				new IntegerSetting(settings["Raven/MemoryCacheLimitPercentage"], 0 /* auto size */);
			MemoryCacheLimitCheckInterval =
				new TimeSpanSetting(settings["Raven/MemoryCacheLimitCheckInterval"], MemoryCache.Default.PollingInterval,
				                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsSyncronousWaitTime =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsSyncronousWaitTime"], TimeSpan.FromSeconds(3),
                                    TimeSpanArgumentType.FromParse);

            PrewarmFacetsOnIndexingMaxAge =
                new TimeSpanSetting(settings["Raven/PrewarmFacetsOnIndexingMaxAge"], TimeSpan.FromMinutes(10),
                                    TimeSpanArgumentType.FromParse);
			
			
			MaxIndexingRunLatency =
				new TimeSpanSetting(settings["Raven/MaxIndexingRunLatency"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxIndexWritesBeforeRecreate =
				new IntegerSetting(settings["Raven/MaxIndexWritesBeforeRecreate"], 256 * 1024);
			PreventAutomaticSuggestionCreation =
				new BooleanSetting(settings["Raven/PreventAutomaticSuggestionCreation"], false);
			DisablePerformanceCounters =
				new BooleanSetting(settings["Raven/DisablePerformanceCounters"], false);

			MaxNumberOfItemsToIndexInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToIndexInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			AvailableMemoryForRaisingIndexBatchSizeLimit =
				new IntegerSetting(settings["Raven/AvailableMemoryForRaisingIndexBatchSizeLimit"],
				                   Math.Min(768, MemoryStatistics.TotalPhysicalMemory/2));
			MaxNumberOfItemsToReduceInSingleBatch =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToReduceInSingleBatch"],
				                          defaultMaxNumberOfItemsToIndexInSingleBatch/2, 128);
			NumberOfItemsToExecuteReduceInSingleStep =
				new IntegerSetting(settings["Raven/NumberOfItemsToExecuteReduceInSingleStep"], 1024);
			MaxNumberOfParallelIndexTasks =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfParallelIndexTasks"], Environment.ProcessorCount, 1);

			NewIndexInMemoryMaxMb =
				new MultipliedIntegerSetting(new IntegerSettingWithMin(settings["Raven/NewIndexInMemoryMaxMB"], 64, 1), 1024*1024);
			RunInMemory =
				new BooleanSetting(settings["Raven/RunInMemory"], false);
			CreateAutoIndexesForAdHocQueriesIfNeeded =
				new BooleanSetting(settings["Raven/CreateAutoIndexesForAdHocQueriesIfNeeded"], true);
			ResetIndexOnUncleanShutdown =
				new BooleanSetting(settings["Raven/ResetIndexOnUncleanShutdown"], false);
			DisableInMemoryIndexing =
				new BooleanSetting(settings["Raven/DisableInMemoryIndexing"], false);
			DataDir =
				new StringSetting(settings["Raven/DataDir"], @"~\Data");
			IndexStoragePath =
				new StringSetting(settings["Raven/IndexStoragePath"], (string) null);
			HostName =
				new StringSetting(settings["Raven/HostName"], (string) null);
			Port =
				new StringSetting(settings["Raven/Port"], (string) null);
			UseSsl = 
				new BooleanSetting(settings["Raven/UseSsl"], false);
			HttpCompression =
				new BooleanSetting(settings["Raven/HttpCompression"], true);
			AccessControlAllowOrigin =
				new StringSetting(settings["Raven/AccessControlAllowOrigin"], (string) null);
			AccessControlMaxAge =
				new StringSetting(settings["Raven/AccessControlMaxAge"], "1728000" /* 20 days */);
			AccessControlAllowMethods =
				new StringSetting(settings["Raven/AccessControlAllowMethods"], "PUT,PATCH,GET,DELETE,POST");
			AccessControlRequestHeaders =
				new StringSetting(settings["Raven/AccessControlRequestHeaders"], (string) null);
			RedirectStudioUrl =
				new StringSetting(settings["Raven/RedirectStudioUrl"], (string) null);
			DisableDocumentPreFetchingForIndexing =
				new BooleanSetting(settings["Raven/DisableDocumentPreFetchingForIndexing"], false);
			MaxNumberOfItemsToPreFetchForIndexing =
				new IntegerSettingWithMin(settings["Raven/MaxNumberOfItemsToPreFetchForIndexing"],
										  defaultMaxNumberOfItemsToIndexInSingleBatch, 128);
			WebDir =
				new StringSetting(settings["Raven/WebDir"], GetDefaultWebDir);
			PluginsDirectory =
				new StringSetting(settings["Raven/PluginsDirectory"], @"~\Plugins");
			CompiledIndexCacheDirectory =
				new StringSetting(settings["Raven/CompiledIndexCacheDirectory"], @"~\Raven\CompiledIndexCache");
			TaskScheduler =
				new StringSetting(settings["Raven/TaskScheduler"], (string) null);
			AllowLocalAccessWithoutAuthorization =
				new BooleanSetting(settings["Raven/AllowLocalAccessWithoutAuthorization"], false);
			MaxIndexCommitPointStoreTimeInterval =
				new TimeSpanSetting(settings["Raven/MaxIndexCommitPointStoreTimeInterval"], TimeSpan.FromMinutes(5),
				                    TimeSpanArgumentType.FromParse);
			MaxNumberOfStoredCommitPoints =
				new IntegerSetting(settings["Raven/MaxNumberOfStoredCommitPoints"], 5);
			MinIndexingTimeIntervalToStoreCommitPoint =
				new TimeSpanSetting(settings["Raven/MinIndexingTimeIntervalToStoreCommitPoint"], TimeSpan.FromMinutes(1),
				                    TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeRunningIdleIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningIdleIndexes"], TimeSpan.FromMinutes(10), TimeSpanArgumentType.FromParse);

			DatbaseOperationTimeout = new TimeSpanSetting(settings["Raven/DatbaseOperationTimeout"], TimeSpan.FromMinutes(5), TimeSpanArgumentType.FromParse);
            
			TimeToWaitBeforeMarkingAutoIndexAsIdle = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingAutoIndexAsIdle"], TimeSpan.FromHours(1), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeMarkingIdleIndexAsAbandoned = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeMarkingIdleIndexAsAbandoned"], TimeSpan.FromHours(72), TimeSpanArgumentType.FromParse);

			TimeToWaitBeforeRunningAbandonedIndexes = new TimeSpanSetting(settings["Raven/TimeToWaitBeforeRunningAbandonedIndexes"], TimeSpan.FromHours(3), TimeSpanArgumentType.FromParse);

			DisableClusterDiscovery = new BooleanSetting(settings["Raven/DisableClusterDiscovery"], false);

			ClusterName = new StringSetting(settings["Raven/ClusterName"], (string)null);
			ServerName = new StringSetting(settings["Raven/ServerName"], (string)null);

			MaxStepsForScript = new IntegerSetting(settings["Raven/MaxStepsForScript"], 10*1000);
			AdditionalStepsForScriptBasedOnDocumentSize = new IntegerSetting(settings["Raven/AdditionalStepsForScriptBasedOnDocumentSize"], 5);

			MaxRecentTouchesToRemember = new IntegerSetting(settings["Raven/MaxRecentTouchesToRemember"], 1024);

			FetchingDocumentsFromDiskTimeoutInSeconds = new IntegerSetting(settings["Raven/Prefetcher/FetchingDocumentsFromDiskTimeout"], 5);

			MaximumSizeAllowedToFetchFromStorageInMb = new IntegerSetting(settings["Raven/Prefetcher/MaximumSizeAllowedToFetchFromStorage"], 256);
		}
예제 #37
0
 public static string GetSetting( StringSetting key )
 {
    DebugHelper.Log( "Key Name", Enum.GetName( key.GetType(), key ) );
    DebugHelper.Log( "Value", PlayerPrefs.GetString( Enum.GetName( key.GetType(), key ) ) );
    return PlayerPrefs.GetString( Enum.GetName( key.GetType(), key ) );
 }