public TimeSpan IsCsgoInstalled(long steamId) { SteamIdentity identity = SteamIdentity.FromSteamID(steamId); GetOwnedGamesBuilder gamesBuilder = SteamWebAPI.General().IPlayerService().GetOwnedGames(identity); try { GetOwnedGamesResponse response = gamesBuilder.GetResponse(); if (response != null && response.Data != null) { if (response.Data.Games != null) { var csgo = response.Data.Games.FirstOrDefault(x => x.AppID == 730); if (csgo != null) { return(csgo.PlayTimeTotal); } } } } catch (Exception) { } return(TimeSpan.Zero); }
public bool HasMw2OrMw3(long steamId) { SteamIdentity identity = SteamIdentity.FromSteamID(steamId); GetOwnedGamesBuilder gamesBuilder = SteamWebAPI.General().IPlayerService().GetOwnedGames(identity); try { GetOwnedGamesResponse response = gamesBuilder.GetResponse(); if (response != null && response.Data != null) { if (response.Data.Games != null) { var mw2AndMw3 = response.Data.Games.FirstOrDefault(x => x.AppID == 10180 || x.AppID == 42690); if (mw2AndMw3 != null) { return(true); } } } } catch (Exception) { } return(false); }