public List <Game> GetOwnedGames(string steamId)
        {
            var req      = SteamWebAPI.CustomRequest("IPlayerService", "GetOwnedGames", "v0001", new { steamid = steamId, include_appinfo = 1, include_played_free_games = 1 });
            var response = _HandleResponse <HttpGetOwnedGamesResponse>(req);

            //return response.Response.Games;

            if (response.Response.Games == null)
            {
                return(null);
            }

            //var repo = new MongoRepository<AppDetails>();

            //foreach (var game in response.Response.Games)
            //{
            //    if (!repo.Exists(x => x.AppId == game.Appid))
            //    {
            //        var appDetails = GetAppDetails(game.Appid);
            //        repo.Insert(appDetails);

            //    }


            //}

            return(response.Response.Games);
        }
Beispiel #2
0
        }//end of getAllData

        static void populatePlayerTable(SqlConnection conn, SteamIdentity person)
        {
            //POPULATE PLAYER TABLE
            //define sql command
            string playerStatement = "INSERT INTO Player(steamId, personName, profileURL, lastLogOff) VALUES(@SteamId, @PersonName, @ProfileURL, @LastLogOff)";

            SqlCommand playerCommand = new SqlCommand(playerStatement, conn);

            playerCommand.Parameters.Add("@SteamId", SqlDbType.BigInt);
            playerCommand.Parameters.Add("@PersonName", SqlDbType.VarChar, 30);
            playerCommand.Parameters.Add("@ProfileURL", SqlDbType.VarChar, 75);
            playerCommand.Parameters.Add("@LastLogOff", SqlDbType.DateTime);

            //get the game info on the currently defined player
            var playerInfo = SteamWebAPI.General().ISteamUser().GetPlayerSummaries(person).GetResponse();

            //cycle through the returned data and execute each command
            foreach (var player in playerInfo.Data.Players)
            {
                playerCommand.Parameters["@SteamId"].Value    = person.SteamID;
                playerCommand.Parameters["@PersonName"].Value = player.PersonaName;
                playerCommand.Parameters["@ProfileURL"].Value = player.ProfileUrl;
                playerCommand.Parameters["@LastLogOff"].Value = player.LastLogOff;

                playerCommand.ExecuteNonQuery();
            }
        }
        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);
        }
Beispiel #4
0
        public async Task GetUserBackpackAssets()
        {
            var apiKey  = "API KEY";
            var json    = "SESSION JSON CONTENT";
            var steamId = 76561198000000000;

            // App Id of the App or Game to retrieve backpack assets
            var appId = AppIds.TeamFortress2;

            var webSession   = JsonConvert.DeserializeObject <WebSession>(json);
            var webAccess    = new SteamWebAccess(webSession);
            var webApi       = new SteamWebAPI(apiKey, webAccess);
            var userBackpack = await Backpack.GetBackpack(webApi, new SteamID(webSessionJson), appId);

            var assets = userBackpack.GetAssets();

            foreach (var asset in assets)
            {
                // Do something with asset

                var assetId  = asset.AssetId;
                var amount   = asset.Amount;
                var defIndex = asset.DefinitionIndex;

                var assetDescription = await userBackpack.GetAssetDescription(asset);

                // Do something with assetDescription

                var assetName       = assetDescription.Name;
                var isAssetTradable = assetDescription.IsTradable;
            }
        }
Beispiel #5
0
        public static void FindWordIds()
        {
            var words = Resources.words.Split('\n');

            using (StreamWriter sw = File.AppendText("wordids.txt"))
            {
                MainForm.mf.totalIds.Maximum = words.Length;
                foreach (var word in words)
                {
                    try
                    {
                        if (word.Length >= 3)
                        {
                            var result = SteamWebAPI.General().ISteamUser().ResolveVanityURL(word).GetResponse();
                            if (result.Data.Message == "No match")
                            {
                                sw.WriteLine(word);
                                sw.Flush();
                            }
                        }
                        MainForm.mf.totalIds.Value++;
                    }
                    catch (Exception)
                    {
                        MessageBox.Show(word);
                    }
                }
            }
            if (MessageBox.Show("Complete! Want to open the file?", "Complete!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                File.Open("wordids.txt", FileMode.Open);
            }
        }
        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);
        }
Beispiel #7
0
        public async Task CreateANewTradeOffer()
        {
            var apiKey         = "API KEY";
            var json           = "SESSION JSON CONTENT";
            var partnerSteamId = 76561198000000000;

            var webSession        = JsonConvert.DeserializeObject <WebSession>(json);
            var webAccess         = new SteamWebAccess(webSession);
            var webApi            = new SteamWebAPI(apiKey, webAccess);
            var tradeOfferManager = new TradeOfferManager(webApi, webAccess, TradeOfferOptions.Default);

            if (!await tradeOfferManager.ValidateAccess(new SteamID(partnerSteamId)))
            {
                // Can't propose a trade offer to this user
                // Maybe inventory is private
                return;
            }

            // Get partner inventory
            var partnerInventory = await tradeOfferManager.GetPartnerInventory(new SteamID(partnerSteamId));

            // Get all partner dota2 assets
            var partnerDota2Assets = await partnerInventory.GetAssets(AppIds.DotA2);

            // We don't want to give any asset xD
            var ourAssets = new Asset[0];

            var newTradeOfferItemsList = new NewTradeOfferItemsList(ourAssets, partnerDota2Assets.Cast <Asset>().ToArray());
            var tradeOfferMessage      = "Give me your Dota2 items";
            var sentTradeOfferId       = await tradeOfferManager.Send(new SteamID(partnerSteamId), newTradeOfferItemsList, tradeOfferMessage);

            // We can also get the trade offer
            var sentTradeOffer = await tradeOfferManager.GetTradeOffer(sentTradeOfferId);
        }
        public BanType GetBanType(long steamId)
        {
            SteamIdentity        identity       = SteamIdentity.FromSteamID(steamId);
            GetPlayerBansBuilder summaryBuilder = SteamWebAPI.General().ISteamUser().GetPlayerBans(identity);

            try
            {
                GetPlayerBansResponse response = summaryBuilder.GetResponse();
                if (response != null && response.Players != null)
                {
                    GetPlayerBansResponsePlayer player = response.Players.FirstOrDefault();
                    if (player != null)
                    {
                        if (player.VACBanned)
                        {
                            // Ignore MW2/3 vac bans
                            bool hasMw2OrMw3 = HasMw2OrMw3(steamId);
                            return(hasMw2OrMw3 ? BanType.None : BanType.VAC);
                        }
                        else if (player.CommunityBanned)
                        {
                            return(BanType.Community);
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            return(BanType.None);
        }
Beispiel #9
0
        static void populateGameOwnedTable(SqlConnection conn, SteamIdentity person)
        {
            //POPULATE GameOwned TABLE
            //define sql command

            string gameOwnedStatement = "INSERT INTO GameOwned(steamId, gameId, playTimeTwoWeek, playTimeForever) VALUES(@SteamId, @GameId, @PlayTimeTwoWeek, @PlayTimeForever)";

            SqlCommand gameOwnedCommand = new SqlCommand(gameOwnedStatement, conn);

            gameOwnedCommand.Parameters.Add("@SteamId", SqlDbType.BigInt);
            gameOwnedCommand.Parameters.Add("@GameId", SqlDbType.Int);
            gameOwnedCommand.Parameters.Add("@PlayTimeTwoWeek", SqlDbType.Int);
            gameOwnedCommand.Parameters.Add("@PlayTimeForever", SqlDbType.Int);

            //get all the games owned
            var gameOwnedInfo = SteamWebAPI.General().IPlayerService().GetOwnedGames(person).GetResponse();

            //cycle through the returned data and execute each command
            foreach (var gameOwned in gameOwnedInfo.Data.Games)
            {
                gameOwnedCommand.Parameters["@SteamId"].Value         = person.SteamID;
                gameOwnedCommand.Parameters["@GameId"].Value          = gameOwned.AppID;
                gameOwnedCommand.Parameters["@PlayTimeTwoWeek"].Value = gameOwned.PlayTime2Weeks.TotalMinutes;
                gameOwnedCommand.Parameters["@PlayTimeForever"].Value = gameOwned.PlayTimeTotal.TotalMinutes;

                gameOwnedCommand.ExecuteNonQuery();
            }
        }
Beispiel #10
0
        }         //end main function

        static void getAllData(SqlConnection conn)
        {
            SteamWebAPI.SetGlobalKey("00E30769A6BA27CB7804374A82DBD737");

            //create steam identity
            SteamIdentity[] steamID = new SteamIdentity[] { SteamIdentity.FromSteamID(76561198047886273), //colin
                                                            SteamIdentity.FromSteamID(76561198065588383), //brenden
                                                            SteamIdentity.FromSteamID(76561198018133285), //john
                                                            SteamIdentity.FromSteamID(76561197983072534),
                                                            SteamIdentity.FromSteamID(76561197996591065),
                                                            SteamIdentity.FromSteamID(76561197999979429),
                                                            SteamIdentity.FromSteamID(76561198009844144) };
            populateGameTable(conn);
            foreach (var player in steamID)
            {
                populatePlayerTable(conn, player);
                populateGameOwnedTable(conn, player);
                populateAchievementTable(conn, player);
                populateAchievementOwnedTable(conn, player);
                populateFriendsHaveTable(conn, player);
            }

            //close sql connection and exit
            conn.Close();
            Console.WriteLine("press enter to exit");
            Console.ReadLine();
        }//end of getAllData
Beispiel #11
0
        // GET api/values
        public IEnumerable <string> Get()
        {
            SteamWebAPI.SetGlobalKey("0");
            var    list  = SteamWebAPI.General().ISteamApps().GetAppList().GetResponse();
            string list2 = ""; // TODO: stworzyć listę, która pobiera te pierdoły w taki sposób w jaki pobierane są w tej fajoskiej bibliotece, np. PortableSteamExtension.GetAppDetails().GetResponse();

            return(list.Data.Apps.Select(x => x.AppID.ToString() + " - " + x.Name.ToString()));
        }
        public List <Game> GetRecentGames(string steamId)
        {
            var req = SteamWebAPI.CustomRequest("IPlayerService", "GetRecentlyPlayedGames", "v0001", new { steamid = steamId });

            var response = _HandleResponse <HttpRecentlyPlayedGames>(req);

            return(response.Response.Games);
        }
Beispiel #13
0
        public static void testFunction(string _parameter, Channel _channel, DiscordClient _client, User _user)
        {
            var    steamIdentity   = SteamIdentity.FromSteamID(Convert.ToInt64(_parameter));
            string steamUserVanity = SteamWebAPI.General().ISteamUser().ResolveVanityURL(_parameter).GetResponseString();
            string friendsList     = SteamWebAPI.General().ISteamUser().GetFriendList(steamIdentity, RelationshipType.Friend).GetResponseString(RequestFormat.XML);

            _channel.SendMessage(steamUserVanity);
            _channel.SendMessage("Steam ID: " + friendsList);
        }
Beispiel #14
0
        public IHttpActionResult GetRecentGames(string steamId)
        {
            var req = SteamWebAPI.CustomRequest("IPlayerService", "GetRecentlyPlayedGames", "v0001", new { steamid = steamId });

            var responseString = req.GetResponseString(RequestFormat.JSON);


            return(Ok(responseString));
        }
Beispiel #15
0
        public IHttpActionResult GetAllGames()
        {
            var req = SteamWebAPI.CustomRequest("ISteamApps", "GetAppList", "v2", new { });

            var responseString = req.GetResponseString(RequestFormat.JSON);


            return(Ok(responseString));
        }
Beispiel #16
0
 public TradeOfferManager(
     SteamWebAPI steamWebAPI,
     SteamWebAccess steamWebAccess,
     TradeOfferOptions tradeOfferOptions)
 {
     SteamWebAccess     = steamWebAccess ?? throw new ArgumentNullException(nameof(steamWebAccess));
     SteamWebAPI        = steamWebAPI ?? throw new ArgumentNullException(nameof(steamWebAPI));
     _tradeOfferOptions = tradeOfferOptions ?? TradeOfferOptions.Default;
 }
        public List <Player> GetFriends(string steamId)
        {
            var req      = SteamWebAPI.CustomRequest("ISteamuser", "GetFriendList", "v0001", new { steamId = steamId, relationship = "friend" });
            var response = _HandleResponse <HttpFriendListResponse>(req);


            var steamIds = response.Friendslist.Friends.Select(x => x.Steamid).ToArray();
            var users    = GetUsers(steamIds);

            return(users);
        }
Beispiel #18
0
 public static void FindNumberIds(int count)
 {
     if (count == 2)
     {
         using (StreamWriter sw = File.AppendText("2numberids.txt"))
         {
             MainForm.mf.totalIds.Maximum = 26 * 26;
             for (int i = 0; i <= 9; i++)
             {
                 for (int j = 0; j <= 9; j++)
                 {
                     var result = SteamWebAPI.General().ISteamUser().ResolveVanityURL($"{i}{j}").GetResponse();
                     if (result.Data.Message == "No match")
                     {
                         sw.WriteLine($"{i}{j}");
                         sw.Flush();
                     }
                     MainForm.mf.totalIds.Value++;
                 }
             }
         }
         if (MessageBox.Show("Complete! Want to open the file?", "Complete!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             File.Open("2numberids.txt", FileMode.Open);
         }
     }
     else if (count == 3)
     {
         using (StreamWriter sw = File.AppendText("3numberids.txt"))
         {
             MainForm.mf.totalIds.Maximum = 26 * 26 * 26;
             for (int i = 0; i <= 9; i++)
             {
                 for (int j = 0; j <= 9; j++)
                 {
                     for (int k = 0; k <= 9; k++)
                     {
                         var result = SteamWebAPI.General().ISteamUser().ResolveVanityURL($"{i}{j}{k}").GetResponse();
                         if (result.Data.Message == "No match")
                         {
                             sw.WriteLine($"{i}{j}{k}");
                             sw.Flush();
                         }
                         MainForm.mf.totalIds.Value++;
                     }
                 }
             }
         }
         if (MessageBox.Show("Complete! Want to open the file?", "Complete!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             File.Open("3numberids.txt", FileMode.Open);
         }
     }
 }
Beispiel #19
0
 private Backpack(
     long appId,
     SteamID steamId,
     GetPlayerItemsResult getPlayerItemsResult,
     SteamWebAPI steamWebAPI)
 {
     AppId              = appId;
     SteamId            = steamId;
     _playerItemsResult = getPlayerItemsResult ?? throw new ArgumentNullException(nameof(getPlayerItemsResult));
     _steamWebAPI       = steamWebAPI ?? throw new ArgumentNullException(nameof(steamWebAPI));
 }
Beispiel #20
0
 public void downloadSteamAppList(bool force)
 {
     if (!File.Exists("./steamapps.txt") || force)
     {
         var          ret    = SteamWebAPI.General().ISteamApps().GetAppList().GetResponse();
         StreamWriter stream = File.CreateText("./steamapps.txt");
         foreach (var app in ret.Data.Apps)
         {
             stream.WriteLine(app.AppID + "=" + app.Name);
         }
     }
 }
 private User CreateUser(long steamID64, SprayContext db, SteamWebAPI.SteamAPISession.User player)
 {
     //Add the user if they're new
     User user = new User
     {
         SteamId = steamID64,
         NickName = player.nickname,
         AvatarURI = player.avatarUrl,
         LastUpdated = DateTime.Now
     };
     db.Users.Add(user);
     return user;
 }
        public string GetSteamId(string username)
        {
            var req = SteamWebAPI.CustomRequest("ISteamUser", "ResolveVanityURL", "v0001", new { vanityurl = username });

            var result = _HandleResponse <HttpGetVanityUrlResponse>(req);

            if (result == null || result.Response.SteamId == null)
            {
                throw new Exception("Unable to convert to Valid SteamID");
            }


            return(result.Response.SteamId);
        }
        public List <Player> GetUsers(string[] steamIds)
        {
            var sSteamIds = "";
            var t         = steamIds.ToString();

            foreach (var id in steamIds)
            {
                sSteamIds += id + ",";
            }
            var req      = SteamWebAPI.CustomRequest("ISteamUser", "GetPlayerSummaries", "v0002", new { steamids = sSteamIds });
            var response = _HandleResponse <HttpUserResponse>(req);

            return(response.Response.Players.ToList());
        }
Beispiel #24
0
        public static void Init(long steamID)
        {
            if (steamID == 0)
            {
                IsSteamProfile = false;
                return;
            }

            SteamWebAPI.SetGlobalKey("1E5E3956484C372C2D9AE6D58EFA4F69");
            var appListResponse = SteamWebAPI.General().ISteamApps().GetAppList().GetResponse();

            AppList = appListResponse.Data.Apps;
            SteamID = steamID;
            User    = SteamIdentity.FromSteamID(steamID);
        }
Beispiel #25
0
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services
            _RegisterConsumers();
            // Web API routes
            config.MapHttpAttributeRoutes();
            config.EnableCors(new EnableCorsAttribute("*", "*", "*"));


            SteamWebAPI.SetGlobalKey("5F88169B0962B766917B9766FE1B1372");
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
        }
Beispiel #26
0
        public async Task ManageTradeOffers()
        {
            var apiKey = "API KEY";
            var json   = "SESSION JSON CONTENT";

            var webSession        = JsonConvert.DeserializeObject <WebSession>(json);
            var webAccess         = new SteamWebAccess(webSession);
            var webApi            = new SteamWebAPI(apiKey, webAccess);
            var tradeOfferManager = new TradeOfferManager(webApi, webAccess, TradeOfferOptions.Default);

            tradeOfferManager.TradeOfferReceived += (sender, args) =>
            {
                // Received new trade offer
                // Accept it right away if it is a gift
                if (!args.TradeOffer.IsOurOffer && args.TradeOffer.OurAssets.Length == 0)
                {
                    await tradeOfferManager.Accept(args.TradeOffer);
                }
            };

            tradeOfferManager.TradeOfferInEscrow += (sender, args) =>
            {
                // A trade offer is in escrow
                // If escrow is longer than 10 days, decline or cancel

                var escrowDuration = await tradeOfferManager.GetEscrowDuration(args.TradeOffer);

                if (escrowDuration.MyEscrowDuration > TimeSpan.FromDays(10))
                {
                    if (args.TradeOffer.IsOurOffer)
                    {
                        await tradeOfferManager.Cancel(args.TradeOffer);
                    }
                    else
                    {
                        await tradeOfferManager.Decline(args.TradeOffer);
                    }
                }
            };

            tradeOfferManager.StartPolling();

            // Wait for the end of program

            tradeOfferManager.Dispose();
        }
Beispiel #27
0
        public static List <Game> GetOwnedGames()
        {
            List <Game> gamesList = new List <Game>();

            var gameListResponse = SteamWebAPI.General().IPlayerService().GetOwnedGames(User).GetResponse();
            List <GetOwnedGamesResponseGame> gameList = gameListResponse.Data.Games;

            foreach (GetOwnedGamesResponseGame g in gameList)
            {
                var game = AppList.Find(x => x.AppID == g.AppID);
                if (game != null)
                {
                    gamesList.Add(new Game(g.AppID, game.Name));
                }
            }

            return(gamesList);
        }
Beispiel #28
0
        public List <string> getFriends(long steamID)
        {
            SteamWebAPI.SetGlobalKey("2E063F9BD27D3C9AED847FAB0D876E01");
            var name    = SteamIdentity.FromSteamID(steamID);
            var game    = SteamWebAPI.General().ISteamUser().GetFriendList(name, RelationshipType.All).GetResponse();
            var friends = SteamWebAPI.General().ISteamUser().GetFriendList(name, RelationshipType.All).GetResponse();

            List <string> result = new List <String>();

            List <String> friendNames = new List <string>();

            foreach (var friend in friends.Data.Friends)
            {
                var level = SteamWebAPI.General().IPlayerService().GetSteamLevel(friend.Identity).GetResponse();
                result.Add(friend.Identity.SteamID + " is level: " + level.Data.PlayerLevel.ToString());
            }
            return(result);
        }
Beispiel #29
0
        public static void Init(long steamID)
        {
            WC = new WebClient()
            {
                Encoding = Encoding.UTF8
            };
            if (steamID == 0)
            {
                IsSteamProfile = false;
                return;
            }

            SteamWebAPI.SetGlobalKey(GlobalKey);
            SetSteamUser(steamID);

            var json         = WC.DownloadString($"https://api.steampowered.com/ISteamApps/GetAppList/v2?key={GlobalKey}&language=en-us&format=json");
            var parsedObject = JObject.Parse(json);

            AppList = JsonConvert.DeserializeObject <List <App> >(parsedObject["applist"]["apps"].ToString());
        }
Beispiel #30
0
        public static async Task <SteamID> GetSteamIdFromUserVanityName(SteamWebAPI steamWebAPI, string vanityName)
        {
            var result = await steamWebAPI.RequestObject <SteamWebAPIResponse <ResolveVanityUrlResponse> >(
                "ISteamUser",
                SteamWebAccessRequestMethod.Get,
                "ResolveVanityURL",
                "v1",
                new
            {
                vanityurl = vanityName
            }
                ).ConfigureAwait(false);

            if (result?.Response?.Success == ResolveVanityUrlResponseStatus.Success)
            {
                return(new SteamID(result.Response.SteamId));
            }

            throw new Exception(result?.Response?.Message);
        }
Beispiel #31
0
        static void populateAchievementOwnedTable(SqlConnection conn, SteamIdentity person)
        {
            //POPULATE ACHIEVEMENT OWNED TABLE
            //define sql command
            string achievementStatement = "INSERT INTO AchievementOwned(playerId, gameId, name) VALUES(@PlayerId, @GameId, @Name)";

            SqlCommand achievementCommand = new SqlCommand(achievementStatement, conn);

            achievementCommand.Parameters.Add("@PlayerId", SqlDbType.BigInt);
            achievementCommand.Parameters.Add("@GameId", SqlDbType.Int);
            achievementCommand.Parameters.Add("@Name", SqlDbType.VarChar, 50);
            //get all the games owned
            var gameOwnedInfo = SteamWebAPI.General().IPlayerService().GetOwnedGames(person).GetResponse();

            //cycle through the returned data and execute each command
            foreach (var gameOwned in gameOwnedInfo.Data.Games)
            {
                //get the achievement info on the currently defined player
                var achievementInfo = SteamWebAPI.General().ISteamUserStats().GetPlayerAchievements(gameOwned.AppID, person).GetResponse();

                //the try for see if there Achievements
                try
                {
                    //cycle through the returned data and execute each command
                    foreach (var achievement in achievementInfo.Data.Achievements)
                    {
                        achievementCommand.Parameters["@PlayerId"].Value = person.SteamID;
                        achievementCommand.Parameters["@GameId"].Value   = gameOwned.AppID;
                        achievementCommand.Parameters["@Name"].Value     = achievement.APIName;


                        achievementCommand.ExecuteNonQuery();
                    }
                }
                catch
                {
                    //Console.WriteLine("can't");
                }
            }
        }
 //We take in an api in case we're gonna use steam for Dota 2
 public MainApplication(string GameName, SteamWebAPI.SteamAPISession api = null)
 {
     InitializeComponent();
     game = GetGame(GameName);
     Game.ValueChangedArgs.ValueChanged += WhenValueChanged;
 }