mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
@@ -41,9 +41,11 @@ namespace ArchiSteamFarm {
|
||||
|
||||
internal sealed class NotificationsCallback : CallbackMsg {
|
||||
internal sealed class Notification {
|
||||
internal enum ENotificationType {
|
||||
internal enum ENotificationType : uint {
|
||||
Unknown = 0,
|
||||
Trading = 1,
|
||||
// Only custom below, different than ones available as user_notification_type
|
||||
Items = 514
|
||||
}
|
||||
|
||||
internal ENotificationType NotificationType { get; set; }
|
||||
@@ -65,6 +67,17 @@ namespace ArchiSteamFarm {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
internal NotificationsCallback(JobID jobID, CMsgClientItemAnnouncements msg) {
|
||||
JobID = jobID;
|
||||
|
||||
if (msg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notifications = new List<Notification>();
|
||||
Notifications.Add(new Notification { NotificationType = Notification.ENotificationType.Items });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class OfflineMessageCallback : CallbackMsg {
|
||||
@@ -233,6 +246,9 @@ namespace ArchiSteamFarm {
|
||||
case EMsg.ClientFSOfflineMessageNotification:
|
||||
HandleFSOfflineMessageNotification(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientItemAnnouncements:
|
||||
HandleItemAnnouncements(packetMsg);
|
||||
break;
|
||||
case EMsg.ClientPurchaseResponse:
|
||||
HandlePurchaseResponse(packetMsg);
|
||||
break;
|
||||
@@ -251,6 +267,15 @@ namespace ArchiSteamFarm {
|
||||
Client.PostCallback(new OfflineMessageCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandleItemAnnouncements(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var response = new ClientMsgProtobuf<CMsgClientItemAnnouncements>(packetMsg);
|
||||
Client.PostCallback(new NotificationsCallback(packetMsg.TargetJobID, response.Body));
|
||||
}
|
||||
|
||||
private void HandlePurchaseResponse(IPacketMsg packetMsg) {
|
||||
if (packetMsg == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user