mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Fix trades with non-steam items
This commit is contained in:
@@ -77,7 +77,6 @@ namespace ArchiSteamFarm {
|
||||
|
||||
Notifications = new HashSet<ENotification>();
|
||||
foreach (CMsgClientUserNotifications.Notification notification in msg.notifications) {
|
||||
Logging.LogGenericDebug("Pushed new notification: " + notification.user_notification_type);
|
||||
Notifications.Add((ENotification) notification.user_notification_type);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +89,6 @@ namespace ArchiSteamFarm {
|
||||
JobID = jobID;
|
||||
|
||||
if (msg.count_new_items > 0) {
|
||||
Logging.LogGenericDebug("Pushed new items notification");
|
||||
Notifications = new HashSet<ENotification> { ENotification.Items };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace ArchiSteamFarm {
|
||||
|
||||
int index = hashName.IndexOf('-');
|
||||
if (index < 1) {
|
||||
Logging.LogNullError(nameof(index));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -370,13 +369,18 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
uint appID = 0;
|
||||
Steam.Item.EType type = Steam.Item.EType.Unknown;
|
||||
|
||||
string hashName = description["market_hash_name"].Value;
|
||||
if (!string.IsNullOrEmpty(hashName)) {
|
||||
appID = GetAppIDFromMarketHashName(hashName);
|
||||
}
|
||||
|
||||
if (appID == 0) {
|
||||
appID = (uint) description["appid"].AsUnsignedLong();
|
||||
}
|
||||
|
||||
Steam.Item.EType type = Steam.Item.EType.Unknown;
|
||||
|
||||
string descriptionType = description["type"].Value;
|
||||
if (!string.IsNullOrEmpty(descriptionType)) {
|
||||
type = GetItemType(descriptionType);
|
||||
@@ -539,6 +543,19 @@ namespace ArchiSteamFarm {
|
||||
appID = GetAppIDFromMarketHashName(hashName);
|
||||
}
|
||||
|
||||
if (appID == 0) {
|
||||
string appIDString = description["appid"].ToString();
|
||||
if (string.IsNullOrEmpty(appIDString)) {
|
||||
Logging.LogNullError(nameof(appIDString), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!uint.TryParse(appIDString, out appID)) {
|
||||
Logging.LogNullError(nameof(appID), Bot.BotName);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Steam.Item.EType type = Steam.Item.EType.Unknown;
|
||||
|
||||
string descriptionType = description["type"].ToString();
|
||||
|
||||
Reference in New Issue
Block a user