sgkoishi / PackTracker

Plugin for HearthstoneDeckTracker
MIT License
22 stars 1 forks source link

Packs support #16

Open sgkoishi opened 3 years ago

sgkoishi commented 3 years ago

Currently, the HDT's pack opening event does not support mass opening, catch-up and merc packs (and likely won't). Even worse, it is broken for regular packs as well.

I really want to keep track of my packs, even if it requires modding
Modding violates the TOS, I KNOW HOW AND DO WANT TO CONTINUE ```csharp [HarmonyPostfix] [HarmonyPatch(typeof(Networking.ConnectAPI), "GetOpenedBooster")] public static void GetOpenedBooster(ref PegasusUtil.BoosterContent __result) { Console.WriteLine($"IsCatchupPack: {__result.IsCatchupPack}"); Console.WriteLine($"PacksOpened: {__result.PacksOpened}"); Console.WriteLine($"IsMpo: {__result.IsMpo}"); Console.WriteLine($"MassPackOpeningEnabled: {__result.MassPackOpeningEnabled}"); foreach (var i in __result.List) { Console.WriteLine($"CardId: {GameUtils.TranslateDbIdToCardId(i.CardDef.Asset)}"); Console.WriteLine($"Premium: {i.CardDef.Premium}"); Console.WriteLine($"Time: {new DateTime(i.InsertDate.Year, i.InsertDate.Month, i.InsertDate.Day, i.InsertDate.Hours, i.InsertDate.Min, i.InsertDate.Sec):yyyyMMddHHmmss}"); } } ```