nosoop / SteamTrade-Java

An unofficial trading library for Valve's Steam Community service.
12 stars 2 forks source link

Steam Mobile Authenticator #6

Open DevCubeHD opened 8 years ago

DevCubeHD commented 8 years ago

How does the lib handle with it?

nosoop commented 8 years ago

It's not covered under one of my existing cases, so it'll probably fire off the TradeListener.onError() method callback. It should finish the trade (as far as when you'd see the "please confirm in Steam Mobile Authenticator" message interactively), assuming the internal trade API hasn't changed over the years. The library doesn't do SMA trade confirmations, though.

According to Steam's economy_trade.js file, it'll probably return a value of 6.

See the following excerpt:

if ( rgNewTradeStatus.trade_status == 1 ||rgNewTradeStatus.trade_status == 6 )
{
    // we're done here
    Tutorial.OnCompletedTutorial();
    StopWatchingForUnload();
    if ( rgNewTradeStatus.trade_status == 6 )
    {
        window.location = 'https://steamcommunity.com/my/tradeoffers/view/' + rgNewTradeStatus.tradeid + '?partner=' + g_ulTradePartnerSteamID;
    }
    else
    {
        window.location = 'https://steamcommunity.com/trade/' + rgNewTradeStatus.tradeid + '/receipt/';
    }
    return;
}

The trade status is handled at this point in the TradeSession class.

DevCubeHD commented 8 years ago

Okay sorry for late answer.. :) means the steammobile auth thing needs to be included by the devs themselves?

nosoop commented 8 years ago

If using this project as part of an automatic trade service (that is, a trading bot), then yes; the developer of the bot will need to add support for mobile confirmations. If using it interactively, then treating that particular error code as a notification should suffice.

I don't know of any existing Steam Mobile Authenticator functionality library in Java, but a similar project in C# is geel9's SteamAuth.