DoctorMcKay / node-steam-tradeoffer-manager

Simple and sane Steam trade offer management
https://dev.doctormckay.com/forum/9-node-steam-tradeoffer-manager/
MIT License
517 stars 134 forks source link

Wrong method always returns an error #71

Closed arnaspecelis closed 8 years ago

arnaspecelis commented 8 years ago

Hello. I'm trying to receive partner inventory.

var offer = manager.createOffer(row.steamid);
                        offer.loadPartnerInventory(730, 2, function(err, callback, curr){
                            console.log(err);
                            console.log(callback);
                            console.log(curr);
                        });

but instead of result it prints me error:

/var/www/laravel/node_modules/mysql/lib/protocol/Parser.js:78
        throw err;
        ^

TypeError: input.match is not a function

manager version: steam-tradeoffer-manager@1.16.2

scholtzm commented 8 years ago

Looks like MySQL error unrelated to STOM.

arnaspecelis commented 8 years ago

its kind a weird because row.steam id is steam id. (76561198097022450)

arnaspecelis commented 8 years ago
/var/www/laravel/node_modules/mysql/lib/protocol/Parser.js:78
        throw err;
        ^

TypeError: input.match is not a function
    at new SteamID (/var/www/laravel/node_modules/steamid/index.js:72:22)
    at new TradeOffer (/var/www/laravel/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:163:18)
    at TradeOfferManager.createOffer (/var/www/laravel/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:10:14)
    at Query._callback (/var/www/laravel/node_engine.js:143:45)
    at Query.Sequence.end (/var/www/laravel/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
    at Query._handleFinalResultPacket (/var/www/laravel/node_modules/mysql/lib/protocol/sequences/Query.js:144:8)
    at Query.OkPacket (/var/www/laravel/node_modules/mysql/lib/protocol/sequences/Query.js:78:10)
    at Protocol._parsePacket (/var/www/laravel/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/var/www/laravel/node_modules/mysql/lib/protocol/Parser.js:73:12)
    at Protocol.write (/var/www/laravel/node_modules/mysql/lib/protocol/Protocol.js:39:16)
arnaspecelis commented 8 years ago

and when deleting mysql connection it prints error:

/var/www/laravel/node_modules/steamid/index.js:72
    if((matches = input.match(/^STEAM_([0-5]):([0-1]):([0-9]+)$/))) {
                        ^

TypeError: input.match is not a function
scholtzm commented 8 years ago

Only guessing here, row.steamid is not a String, hence it fails here.

arnaspecelis commented 8 years ago

Thanks, it was helpfull :+1: but I'm facing new error right there - it says that steam profile is private but it isn't. Is it means that I have to include players token somehow?

connorlurring commented 8 years ago

@arnaspecelis if you get their trade link you can retrieve the token using trade_link.substring(trade_link.indexOf("token=") + 6) where trade_link is the string of their trade link.

DoctorMcKay commented 8 years ago

You can't load private inventories, regardless of whether or not you have a token.