Пример #1
0
        private List <AbsolutePath> LoadUniverses()
        {
            var ret = new List <AbsolutePath>();

            SteamConfig.ReadAllLines().Do(l =>
            {
                if (!l.ContainsCaseInsensitive("BaseInstallFolder_"))
                {
                    return;
                }
                var s    = new AbsolutePath(GetVdfValue(l));
                var path = new RelativePath("steamapps").RelativeTo(s);

                if (!path.Exists)
                {
                    Utils.Log($"Directory {path} does not exist, skipping");
                    return;
                }

                ret.Add(path);
                Utils.Log($"Steam Library found at {path}");
            });

            Utils.Log($"Total number of Steam Libraries found: {ret.Count}");

            // Default path in the Steam folder isn't in the configs
            var defaultPath = new RelativePath("steamapps").RelativeTo(SteamPath);

            if (defaultPath.Exists)
            {
                ret.Add(defaultPath);
            }

            return(ret);
        }
Пример #2
0
        public static string BuildLoginQuery(SteamConfig cfg)
        {
            var param = new Dictionary <string, string>()
            {
                { "openid.mode", "checkid_setup" },
                { "openid.return_to", cfg.OAuthReturn },
                { "openid.realm", cfg.OAuthReturn },
                { "openid.ns", "http://specs.openid.net/auth/2.0" },
                { "openid.ns.sreg", "http://openid.net/extensions/sreg/1.1" },
                { "openid.claimed_id", "http://specs.openid.net/auth/2.0/identifier_select" },
                { "openid.identity", "http://specs.openid.net/auth/2.0/identifier_select" }
            };

            return(cfg.OAuthUri + "?" + string.Join("&", param.Select(kvp => kvp.Key + "=" + HttpUtility.UrlEncode(kvp.Value))));
        }
Пример #3
0
 public SteamLogin(SteamConfig cfg)
 {
     this.cfg = cfg;
 }