mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Add support for activated games names
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
|
||||
using SteamKit2;
|
||||
using SteamKit2.Internal;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal sealed class ArchiHandler : ClientMsgHandler {
|
||||
@@ -42,14 +44,21 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal EResult Result { get; private set; }
|
||||
internal EPurchaseResult PurchaseResult { get; private set; }
|
||||
internal int ErrorCode { get; private set; }
|
||||
internal byte[] ReceiptInfo { get; private set; }
|
||||
internal KeyValue ReceiptInfo { get; private set; }
|
||||
internal HashSet<string> Items { get; private set; } = new HashSet<string>();
|
||||
|
||||
internal PurchaseResponseCallback(CMsgClientPurchaseResponse body) {
|
||||
Result = (EResult) body.eresult;
|
||||
ErrorCode = body.purchase_result_details;
|
||||
ReceiptInfo = body.purchase_receipt_info;
|
||||
PurchaseResult = (EPurchaseResult) ErrorCode;
|
||||
PurchaseResult = (EPurchaseResult) body.purchase_result_details;
|
||||
|
||||
ReceiptInfo = new KeyValue();
|
||||
using (MemoryStream ms = new MemoryStream(body.purchase_receipt_info)) {
|
||||
if (ReceiptInfo.TryReadAsBinary(ms)) {
|
||||
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) {
|
||||
Items.Add(lineItem["ItemDescription"].AsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -594,7 +594,8 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
var purchaseResult = callback.PurchaseResult;
|
||||
SendMessageToUser(SteamMasterID, "Status: " + purchaseResult);
|
||||
var items = callback.Items;
|
||||
SendMessageToUser(SteamMasterID, "Status: " + purchaseResult + " | Items: " + string.Join(", ", items));
|
||||
|
||||
if (purchaseResult == ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK) {
|
||||
await CardsFarmer.StartFarming().ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user