private Infos LoadSteamProfile(SteamTrade.SteamWeb steamWeb, SteamID steamID) { if (LastTimeRefreshed == null || (DateTime.Now - LastTimeRefreshed).TotalMinutes > 5) { LastTimeRefreshed = DateTime.Now; string response = steamWeb.Fetch("http://steamcommunity.com/profiles/" + steamID.ConvertToUInt64() + "/?xml=1", "GET"); if (response != String.Empty) { response = response.Replace("\t", "").Replace("\n", "").Replace("\r", "").Trim(); int index = response.IndexOf("<profile>"); if (index != -1) { response = response.Substring(index); XmlSerializer serializer = new XmlSerializer(typeof(Infos)); using (TextReader reader = new StringReader(response)) { backup = (Infos)serializer.Deserialize(reader); return(backup); } } } } return(backup); }
public SteamProfile(SteamTrade.SteamWeb steamWeb, SteamID steamID) { this.steamWeb = steamWeb; this.steamID = steamID; Informations = LoadSteamProfile(steamWeb, this.steamID); }
public SteamProfile(SteamTrade.SteamWeb steamWeb, SteamID steamID) { this.steamWeb = steamWeb; this.steamID = steamID; }