Skip to content

Commit

Permalink
2.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Razviar committed Oct 11, 2021
1 parent 9523d42 commit 81e2154
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
25 changes: 13 additions & 12 deletions src/GetData2/MTGAProGetData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
{
Expand All @@ -47,17 +47,17 @@ private void GetHoldOnPapa()
Thread.Sleep(30000);
ourPapaInstance = FindObjectOfType<PAPA>();

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)
{
Expand All @@ -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}");
}
}

Expand All @@ -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);
Expand Down Expand Up @@ -161,6 +162,6 @@ private void InventoryChangeHandler(ClientInventoryUpdateReportItem obj)
}
}


}
}
2 changes: 1 addition & 1 deletion src/app/do-path-ops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}
Binary file modified src/our-active-win/GetData2.dll
Binary file not shown.

0 comments on commit 81e2154

Please sign in to comment.