mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Ship items together with their IDs
This commit is contained in:
@@ -44,18 +44,17 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal EResult Result { get; private set; }
|
||||
internal EPurchaseResult PurchaseResult { get; private set; }
|
||||
internal KeyValue ReceiptInfo { get; private set; }
|
||||
internal HashSet<string> Items { get; private set; } = new HashSet<string>();
|
||||
internal KeyValue ReceiptInfo { get; private set; } = new KeyValue();
|
||||
internal Dictionary<uint, string> Items { get; private set; } = new Dictionary<uint, string>();
|
||||
|
||||
internal PurchaseResponseCallback(CMsgClientPurchaseResponse body) {
|
||||
Result = (EResult) body.eresult;
|
||||
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());
|
||||
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
var purchaseResult = callback.PurchaseResult;
|
||||
var items = callback.Items;
|
||||
SendMessageToUser(SteamMasterID, "Status: " + purchaseResult + " | Items: " + string.Join(", ", 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