Exemplo n.º 1
0
        protected override void Activate()
        {
            YamlNode config      = ConfigurationService.GetConfig(ConfigPath.CLIENT_RESOURCES);
            string   stringValue = config.GetStringValue("maximumAvailableDiskSpace");
            string   str3        = config.GetStringValue("expirationDelay");
            string   str4        = config.GetStringValue("compressionEnabled");

            DiskCaching.Enabled = Convert.ToBoolean(config.GetStringValue("caching"));
            DiskCaching.MaximumAvailableDiskSpace = Convert.ToInt64(stringValue);
            DiskCaching.ExpirationDelay           = Convert.ToInt32(str3);
            DiskCaching.CompressionEnambled       = Convert.ToBoolean(str4);
        }
Exemplo n.º 2
0
        private void ParseConfig()
        {
            YamlNode childNode = ConfigurationService.GetConfig(this.hintsConfig).GetChildNode("battleHints");

            this.hints = childNode.GetChildListValues("collection");
            for (int i = 0; i < this.hints.Count; i++)
            {
                char[] trimChars = new char[] { '\n' };
                this.hints[i] = this.hints[i].TrimEnd(trimChars);
            }
            this.updateTimeInSec = int.Parse(childNode.GetStringValue("updateTimeInSec"));
        }
Exemplo n.º 3
0
 public static int Calculate(string path)
 {
     path = path.Replace(@"\", "/");
     if (path.StartsWith("/", StringComparison.Ordinal))
     {
         path = path.Substring(1);
     }
     if (path.EndsWith("/", StringComparison.Ordinal))
     {
         path = path.Substring(0, path.Length - 1);
     }
     if (ConfigurationService.HasConfig(path))
     {
         YamlNode config = ConfigurationService.GetConfig(path);
         if (config.HasValue("id"))
         {
             return(int.Parse(config.GetStringValue("id")));
         }
     }
     return(path.GetHashCode());
 }