diff --git a/package.json b/package.json index 9aecbe1..29bb105 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mtgaprotracker", "productName": "mtgaprotracker", - "version": "2.2.6", + "version": "2.2.7", "description": "MTG Arena Pro Tracker", "main": "./.webpack/main", "scripts": { diff --git a/src/GetData2/MTGAProGetData.cs b/src/GetData2/MTGAProGetData.cs index 4a8821a..f8f33c3 100644 --- a/src/GetData2/MTGAProGetData.cs +++ b/src/GetData2/MTGAProGetData.cs @@ -15,8 +15,8 @@ public class LogElement public class MTGAProGetData : MonoBehaviour { private static PAPA ourPapaInstance = null; - private static bool gotInitialData=false; - + private static bool gotInitialData = false; + private static readonly UnityCrossThreadLogger MTGAProLogger = new UnityCrossThreadLogger("MTGA.Pro Logger"); public void Start() { try @@ -28,9 +28,9 @@ public void Start() { rString += ((char)(RNG.Next(1, 26) + 64)).ToString().ToLower(); } - Debug.Log($"[MTGA.Pro Logger] Unique Log Identifier: {rString}"); + MTGAProLogger.Debug($" Unique Log Identifier: {rString}"); Task task = new Task(() => GetHoldOnPapa()); - task.Start(); + task.Start(); } catch (Exception e) { @@ -47,17 +47,17 @@ private void GetHoldOnPapa() Thread.Sleep(30000); ourPapaInstance = FindObjectOfType(); - if (!gotInitialData && ourPapaInstance != null && ourPapaInstance.AccountClient!=null && ourPapaInstance.AccountClient.AccountInformation != null && ourPapaInstance.InventoryManager != null && ourPapaInstance.InventoryManager.Cards != null && ourPapaInstance.InventoryManager.Cards.Count > 0) + if (!gotInitialData && ourPapaInstance != null && ourPapaInstance.AccountClient != null && ourPapaInstance.AccountClient.AccountInformation != null && ourPapaInstance.InventoryManager != null && ourPapaInstance.InventoryManager.Cards != null && ourPapaInstance.InventoryManager.Cards.Count > 0) { GetInitialData(); return; } - else if(!gotInitialData) + else if (!gotInitialData) { ourPapaInstance = null; GetHoldOnPapa(); } - + } catch (Exception e) { @@ -74,11 +74,11 @@ private void WriteToLog(string indicator, object report) Payload = report, timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds().ToString() }; - Debug.Log($"[MTGA.Pro Logger] **{indicator}** {JsonConvert.SerializeObject(logElem)}"); + MTGAProLogger.Debug($" **{indicator}** {JsonConvert.SerializeObject(logElem)}"); } catch (Exception e) { - Debug.Log($"[MTGA.Pro Logger] **WriteToLogError** {e}"); + MTGAProLogger.Debug($" **WriteToLogError** {e}"); } } @@ -87,13 +87,14 @@ private void GetInitialData() try { + gotInitialData = true; ourPapaInstance.InventoryManager.UnsubscribeFromAll(InventoryChangeHandler); ourPapaInstance.InventoryManager.SubscribeToAll(InventoryChangeHandler); ourPapaInstance.AccountClient.LoginStateChanged += AccountClient_LoginStateChanged; - + InventoryManager inventory = ourPapaInstance.InventoryManager; - + WriteToLog("Userdata", new { userId = ourPapaInstance.AccountClient.AccountInformation.AccountID, screenName = ourPapaInstance.AccountClient.AccountInformation.DisplayName }); WriteToLog("Collection", inventory.Cards); WriteToLog("InventoryContent", inventory.Inventory); @@ -161,6 +162,6 @@ private void InventoryChangeHandler(ClientInventoryUpdateReportItem obj) } } - + } } diff --git a/src/app/do-path-ops.ts b/src/app/do-path-ops.ts index 6599f18..38d9f53 100644 --- a/src/app/do-path-ops.ts +++ b/src/app/do-path-ops.ts @@ -26,6 +26,6 @@ export function doMtgaPathOps(): void { } if (settingsStore.get().uploads && mtgaPath !== undefined) { uploadCardData(['data_loc_', 'data_cards_'], [mtgaPath, 'Downloads', 'Data']); - uploadCardData(['loc_Events_', 'loc_Decks_'], [mtgaPath, 'Downloads', 'Loc']); + uploadCardData(['loc_Events_', 'loc_Decks_', 'loc_Internal_'], [mtgaPath, 'Downloads', 'Loc']); } } diff --git a/src/our-active-win/GetData2.dll b/src/our-active-win/GetData2.dll index b3bcdbe..4a1f80e 100644 Binary files a/src/our-active-win/GetData2.dll and b/src/our-active-win/GetData2.dll differ