Ship items together with their IDs

This commit is contained in:
JustArchi
2015-11-01 16:53:08 +01:00
parent f3aee0c34f
commit 5b3c730d51
2 changed files with 4 additions and 5 deletions

View File

@@ -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());
}
}
}

View File

@@ -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);