public App() { storeClient = new StoreClient(); storeClientThread = new Thread(StartStoreClientEngine); storeClientThread.Start(); appThread = new Thread(AppHandler); appThread.Start(); }
public Library() { InitializeComponent(); bool firstRun = false; if (App.library == null) { App.library = this; firstRun = true; } if (client == null) { if (Directory.Exists(iconsPath)) { Directory.Delete(iconsPath, true); } Directory.CreateDirectory(iconsPath); } client = App.storeClient; iconsDownloader = new DownloadManager(client.ipAddress, client.downloadIconsPort); originalIcon = GameIcon.Source; gameTextBlockPrefab = XamlWriter.Save(GameListTextTemplate); //string libraryStr = client.RecquestLibrary(); //TextBlock newButton = new TextBlock(); //newButton.Text = "Fortnite"; //newButton.MouseLeftButtonDown += OnGameTextClick; Navbar.SetMode(Controls.NavBar.Modes.Library); GetUserInfo(); Debug.Log("User info: "); Debug.Log("ID: " + userInfo.id); Debug.Log("Username: "******"Token: " + userInfo.token); gamesSPGamesStartIndex = GamesSP.Children.Count; GetGamesList(); if (firstRun) { CheckForUpdates(); } //client.DownloadGame(0, userInfo.token); }
public Store() { InitializeComponent(); bool firstRun = false; if (client == null) { firstRun = true; } client = App.storeClient; originalIcon = GameIcon.Source; gameTextBlockPrefab = XamlWriter.Save(GameListTextTemplate); //string libraryStr = client.RecquestLibrary(); //TextBlock newButton = new TextBlock(); //newButton.Text = "Fortnite"; //newButton.MouseLeftButtonDown += OnGameTextClick; NavBar.SetMode(Controls.NavBar.Modes.Store); gamesSPGamesStartIndex = GamesSP.Children.Count; Library.GetUserInfo(true); GetGamesList(firstRun); CoinsNumberText.Text = Library.userInfo.coins.ToString(); if (CoinsNumberText.Text == "Free") { CoinsNumberText.Text = "0"; } if (minPriceFilter >= 0) { MinimumPriceFilterBox.Text = minPriceFilter.ToString(); } if (maxPriceFilter >= 0) { MaximumPriceFilterBox.Text = maxPriceFilter.ToString(); } //client.DownloadGame(0, userInfo.token); }
public void DownloadThread() { /*if (downloadEngine == null) * { * downloadEngine = new DownloadEngine(StoreClient.createNewClient(ipAddress, port), token); * }*/ while (true) { while (queue.Count == 0) { Thread.Sleep(100); } QueueEntry entry = queue[0]; downloadEngine = new DownloadEngine(StoreClient.createNewClient(ipAddress, port), entry.token); if (entry.type == DownloadTypes.game) { downloadEngine.DownloadGame(entry.id, entry.path, entry.completeFunction); } else if (entry.type == DownloadTypes.icon) { downloadEngine.DownloadIcon(entry.id, entry.path, entry.completeFunction, entry.highResImage); } while (downloadEngine.working) { Thread.Sleep(100); } queue.RemoveAt(0); } }