quantum-space-buddies/QSB/SaveSync/Patches/GdkPatches.cs
Mister_Nebula 828aeac361 GDK patch
2022-08-18 18:41:36 +01:00

38 lines
1004 B
C#

using HarmonyLib;
using Microsoft.Xbox;
using QSB.Patches;
using QSB.Utility;
using System.Collections.Generic;
using UnityEngine;
namespace QSB.SaveSync.Patches;
[HarmonyPatch(typeof(Gdk))]
internal class GdkPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnModStart;
public override GameVendor PatchVendor => GameVendor.Gamepass;
[HarmonyPrefix]
[HarmonyPatch("QueryBlobsCompleted")]
public static bool QueryBlobsCompleted(int hresult, Dictionary<string, uint> blobs)
{
if (!Gdk.Succeeded(hresult, "Query blobs"))
{
DebugLog.DebugWrite("[GDK] Query blobs failed!");
return false;
}
Debug.Log(string.Format("[GDK] Save system setup complete. Blobs returned: {0}", blobs.Count));
foreach (var keyValuePair in blobs)
{
DebugLog.DebugWrite(keyValuePair.Key);
}
QSBMSStoreProfileManager.SharedInstance.InvokeProfileSignInComplete();
QSBMSStoreProfileManager.SharedInstance.InvokeSaveSetupComplete();
SpinnerUI.Hide();
return false;
}
}