mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Misc
This commit is contained in:
@@ -50,7 +50,11 @@ namespace ArchiSteamFarm {
|
||||
Items = 514
|
||||
}
|
||||
|
||||
internal ENotificationType NotificationType { get; set; }
|
||||
internal readonly ENotificationType NotificationType;
|
||||
|
||||
internal Notification(ENotificationType notificationType) {
|
||||
NotificationType = notificationType;
|
||||
}
|
||||
}
|
||||
|
||||
internal readonly List<Notification> Notifications;
|
||||
@@ -64,9 +68,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
Notifications = new List<Notification>(msg.notifications.Count);
|
||||
foreach (var notification in msg.notifications) {
|
||||
Notifications.Add(new Notification {
|
||||
NotificationType = (Notification.ENotificationType) notification.user_notification_type
|
||||
});
|
||||
Notifications.Add(new Notification((Notification.ENotificationType) notification.user_notification_type));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +81,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
if (msg.count_new_items > 0) {
|
||||
Notifications = new List<Notification>(1) {
|
||||
new Notification { NotificationType = Notification.ENotificationType.Items }
|
||||
new Notification(Notification.ENotificationType.Items)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -102,7 +104,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
internal sealed class PurchaseResponseCallback : CallbackMsg {
|
||||
internal enum EPurchaseResult {
|
||||
internal enum EPurchaseResult : int {
|
||||
Unknown = -1,
|
||||
OK = 0,
|
||||
AlreadyOwned = 9,
|
||||
@@ -128,6 +130,10 @@ namespace ArchiSteamFarm {
|
||||
Result = (EResult) msg.eresult;
|
||||
PurchaseResult = (EPurchaseResult) msg.purchase_result_details;
|
||||
|
||||
if (msg.purchase_receipt_info == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ReceiptInfo = new KeyValue();
|
||||
using (MemoryStream ms = new MemoryStream(msg.purchase_receipt_info)) {
|
||||
if (!ReceiptInfo.TryReadAsBinary(ms)) {
|
||||
|
||||
Reference in New Issue
Block a user