Skip to content

Commit

Permalink
ашчуы
Browse files Browse the repository at this point in the history
  • Loading branch information
Razviar committed Nov 1, 2021
1 parent 62e8124 commit 963e387
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/GetData2/MTGAProGetData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,23 @@ private void GetHoldOnPapa()
gotUniqueID = true;
}

if (!gotLoginData && WrapperController.Instance != null && WrapperController.Instance.AccountClient != null && WrapperController.Instance.AccountClient.AccountInformation != null)
if (!gotLoginData && WrapperController.Instance != null && WrapperController.Instance.AccountClient != null && WrapperController.Instance.AccountClient.AccountInformation != null && WrapperController.Instance.AccountClient.AccountInformation.AccountID != null && WrapperController.Instance.UnityCrossThreadLogger != null)
{
PrintAccountInfo();
}

if (!gotInventoryData && WrapperController.Instance != null && WrapperController.Instance.InventoryManager != null && WrapperController.Instance.InventoryManager.Cards != null && WrapperController.Instance.InventoryManager.Cards.Count > 0)
if (!gotInventoryData && WrapperController.Instance != null && WrapperController.Instance.InventoryManager != null && WrapperController.Instance.InventoryManager.Cards != null && WrapperController.Instance.InventoryManager.Cards.Count > 0 && WrapperController.Instance.UnityCrossThreadLogger != null)
{
GetInventoryData();
}

if (!gotRankInfo && PAPA.Legacy.CombinedRankInfo != null)
if (!gotRankInfo && PAPA.Legacy.CombinedRankInfo != null && WrapperController.Instance.UnityCrossThreadLogger != null)
{
PrintCombinedRankInfo();
}


if (gotInventoryData && gotLoginData && gotRankInfo)
if (gotUniqueID && gotInventoryData && gotLoginData && gotRankInfo)
{
return;
}
Expand All @@ -122,11 +122,11 @@ private void WriteToLog(string indicator, object report)
Payload = report,
timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds().ToString()
};
string hashCheck = JsonConvert.SerializeObject(report);
if (!dataWrittenHashes.Contains(CreateMD5(hashCheck)) && WrapperController.Instance != null && WrapperController.Instance.UnityCrossThreadLogger != null)
string hashMD5 = CreateMD5(JsonConvert.SerializeObject(report));
if (!dataWrittenHashes.Contains(hashMD5) && WrapperController.Instance != null && WrapperController.Instance.UnityCrossThreadLogger != null)
{
dataWrittenHashes.Add(hashCheck);
WrapperController.Instance.UnityCrossThreadLogger.Debug($" **{indicator}** {JsonConvert.SerializeObject(logElem)}");
dataWrittenHashes.Add(hashMD5);
}
}
catch (Exception e)
Expand Down Expand Up @@ -155,9 +155,9 @@ private void PrintAccountInfo()
{
try
{
gotLoginData = true;
WrapperController.Instance.AccountClient.LoginStateChanged += AccountClient_LoginStateChanged;
WriteToLog("Userdata", new { userId = WrapperController.Instance.AccountClient.AccountInformation.AccountID, screenName = WrapperController.Instance.AccountClient.AccountInformation.DisplayName });
WrapperController.Instance.AccountClient.LoginStateChanged += AccountClient_LoginStateChanged;
gotLoginData = true;
}
catch (Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/log-parser/getusercredentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export async function getUserCredentials(
reject(
HasInjection
? 'Awaiting User ID. It will take up to 30s.'
: 'Awaiting User ID. Please switch into MTGA window.'
: 'Awaiting User ID. Switch into MTGA window and wait about 30s'
);
}
stream.close();
Expand Down
Binary file modified src/our-active-win/GetData2.dll
Binary file not shown.

0 comments on commit 963e387

Please sign in to comment.