Fix trades with non-steam items

This commit is contained in:
JustArchi
2016-06-10 01:16:05 +02:00
parent 378a87bc86
commit 1a6c5a3cff
2 changed files with 19 additions and 4 deletions

View File

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

View File

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