Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Added mobile auth support + trade confirmations#853

Merged
Jessecar96 merged 5 commits intoJessecar96:masterfrom
waylaidwanderer:master
Dec 3, 2015
Merged

Added mobile auth support + trade confirmations#853
Jessecar96 merged 5 commits intoJessecar96:masterfrom
waylaidwanderer:master

Conversation

@waylaidwanderer
Copy link

Features:

  • mobile auth support
  • trade offer confirmations
  • live trade confirmations

AppVeyor will likely fail to build this after merging. Needs some pre-build commands added in "/settings/build" URL:

  • Set "Visual Studio solution or project file" to SteamBot.sln
  • In "Before build script", add
    git submodule update --init --recursive and nuget restore SteamAuth\SteamAuth\SteamAuth.sln

Have a look and feel free to test (confirmed working on my SteamTradeOffersBot fork).

Fixes #847.

@geel9
Copy link
Contributor

geel9 commented Dec 2, 2015

I don't think that linking an account should be part of SteamBot. You should use a tool like the Steam Desktop Authenticator and then import the maFile.

@waylaidwanderer
Copy link
Author

Why force the user to download two separate things when they can just use SteamBot alone? The auth files are saved to the authfiles folder, named {username}.auth, which has exactly the same content as maFile.

@geel9
Copy link
Contributor

geel9 commented Dec 2, 2015

Because it's out of scope. SteamBot doesn't register accounts for you either.

@waylaidwanderer
Copy link
Author

That sounds like it'd be against TOS to automate it, but this isn't the same thing. SteamAuth allows for delinking IIRC, so it shouldn't be a problem if the user doesn't want to use SteamBot for authing his bot account anymore.

I suppose we should get some more opinions on this issue. I think it's more useful/convenient this way, but I'm not against removing the function.

@waylaidwanderer waylaidwanderer force-pushed the master branch 2 times, most recently from c66fb4f to 3b79be7 Compare December 2, 2015 21:48
@geel9
Copy link
Contributor

geel9 commented Dec 2, 2015

On trade confirmations you need to handle the WGTokenInvalidException from the latest version of SteamAuth. Ideally you'd set the SteamGuardAccount.Session.SteamLogin and SteamGuardAccount.Session.SteamLoginSecure properties to the bot's own SteamLogin and SteamLoginSecure cookies before doing confirmation-related tasks.

@waylaidwanderer
Copy link
Author

Ok, I'll undo the last commit and redo it.

Edit: done.

@waylaidwanderer
Copy link
Author

That's everything, I think. Mobile auth support, trade offer confirmations, live trade confirmations. Ready for testing/merging, pending further feedback.

@waylaidwanderer waylaidwanderer changed the title Added mobile auth support Added mobile auth support + trade confirmations Dec 2, 2015
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ಠ_ಠ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uuurm, yeah.
internal monologue aaaaaaaaarrrgggh
On 2 Dec 2015 11:08 p.m., "BlueRaja" notifications@github.com wrote:

In SteamBot/Bot.cs
#853 (comment):

  •    {
    
  •        consoleInput = input;
    
  •    }
    
  •    public string WaitForInput()
    
  •    {
    
  •        consoleInput = null;
    
  •        while (true)
    
  •        {
    
  •            if (consoleInput != null)
    
  •            {
    
  •                return consoleInput;
    
  •            }
    
  •            Thread.Sleep(5);
    
  •        }
    
  •    }
    

ಠ_ಠ


Reply to this email directly or view it on GitHub
https://github.com/Jessecar96/SteamBot/pull/853/files#r46490574.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably switch to using ResetEvents wait intervals than
Thread.Sleep should we not?
On 2 Dec 2015 11:16 p.m., "Joel" notifications@github.com wrote:

In SteamBot/Bot.cs
#853 (comment):

  •    {
    
  •        consoleInput = input;
    
  •    }
    
  •    public string WaitForInput()
    
  •    {
    
  •        consoleInput = null;
    
  •        while (true)
    
  •        {
    
  •            if (consoleInput != null)
    
  •            {
    
  •                return consoleInput;
    
  •            }
    
  •            Thread.Sleep(5);
    
  •        }
    
  •    }
    

No different than this:
https://github.com/Jessecar96/SteamBot/blob/master/SteamBot/Bot.cs#L942


Reply to this email directly or view it on GitHub
https://github.com/Jessecar96/SteamBot/pull/853/files#r46491479.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to make a pull request later if you feel it's necessary, but I think it's important that we get mobile auth working with SteamBot ASAP first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, we can review that later and possibly the other place it occurs in
the code base after, if its that important.
On 2 Dec 2015 11:20 p.m., "Joel" notifications@github.com wrote:

In SteamBot/Bot.cs
#853 (comment):

  •    {
    
  •        consoleInput = input;
    
  •    }
    
  •    public string WaitForInput()
    
  •    {
    
  •        consoleInput = null;
    
  •        while (true)
    
  •        {
    
  •            if (consoleInput != null)
    
  •            {
    
  •                return consoleInput;
    
  •            }
    
  •            Thread.Sleep(5);
    
  •        }
    
  •    }
    

Feel free to make a pull request later if you feel it's necessary, but I
think it's important that we get mobile auth working with SteamBot ASAP
first.


Reply to this email directly or view it on GitHub
https://github.com/Jessecar96/SteamBot/pull/853/files#r46491992.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, donchu bring me into this @waylaidwanderer . I wrote it that way because I needed to get rid of the winform dependency in half an hour and I think we can agree sir that a GUI is worse than a sleeping thread that can't do anything useful anyway :(

Then again, I guess that's a perfectly valid argument for you too. Hm. Still though it's good people are paying attention to what really matters about this PR.

@Jessecar96
Copy link
Owner

SteamBot should definitely have the ability to link mobile authenticators.
As soon as someone else tests this it needs to be merged asap.

@BlueRaja
Copy link
Collaborator

BlueRaja commented Dec 3, 2015

Code looks good. I'm not a fan of using submodules, but we can fix that later. (@geel9, would you be able to push SteamAuth to NuGet?)

However I will not be able to test this before the end of the week. Could someone else?

@waylaidwanderer
Copy link
Author

I just tested this on linux using mono, used the command exec [index] linkauth and got an error about some mono Crypto library before the bot manager crashed. Possibly a problem with SteamAuth using BouncyCastle. Can someone reproduce this?

@ChanceSD
Copy link

ChanceSD commented Dec 3, 2015

Tried to use this but after typing the input command with the steam guard code, just nothing happened.
Not sure what's wrong here.

@waylaidwanderer
Copy link
Author

Index starts at 0 for your first bot.

Make sure you're doing "exec 0 linkauth" then "input 0 XXXXX" once it prompts you for the code.

@ChanceSD
Copy link

ChanceSD commented Dec 3, 2015

I'm aware of that, your method SendInput seems to have 0 references, maybe that's the issue?

@waylaidwanderer
Copy link
Author

My bad, I missed that when I was copy-pasting stuff over. Just pushed a commit to fix it.

@bartico6
Copy link
Contributor

bartico6 commented Dec 3, 2015

Don't you think using "ConfirmAllMobileConfirmations" is a bit unsafe? I have no idea how the confirmation ID is linked to the trade id though... Unable to automate imo without the solution you used...

@ChanceSD
Copy link

ChanceSD commented Dec 3, 2015

Alright, now everything seems to be working fine. It's good to be merged in my opinion.

@WildCard65
Copy link
Contributor

@hydracore Your issue is this: SteamRE/SteamKit#200

@GreYzZ
Copy link

GreYzZ commented Dec 3, 2015

@waylaidwanderer
why is the steam auth folder empty if I download the zip?

@RafalNiewinski
Copy link

@GreYzZ
Because it is attached as git submodule and should be downloaded separately.
However, I recommend you use git.

@GreYzZ
Copy link

GreYzZ commented Dec 3, 2015

@RafalNiewinski
can you explain how to do this, sorry I'm not very used on github.
Or can you send me the bot with submodule integrated?

@aleksamagicka
Copy link
Contributor

  1. Download waylaid's Steam Bot repository and geel9's SteamAuth. Extract SteamAuth to the appropriate folder.
  2. Download Github for desktop and click the button near an URL that GitHub gives you on repository home page. Github app will open, ask you where to clone the repository and you can enjoy Steam Bot!
  3. Use git via command line.

Which is easier to do is up to you. 👍

@Jessecar96
Copy link
Owner

Merging, everything seems alright here.

Jessecar96 added a commit that referenced this pull request Dec 3, 2015
Added mobile auth support + trade confirmations
@Jessecar96 Jessecar96 merged commit 9d864c1 into Jessecar96:master Dec 3, 2015
@waylaidwanderer
Copy link
Author

With version 1.6.5 of Git and later, you can use:

git clone --recursive git://github.com/foo/bar.git
cd bar

For already cloned repos, or older Git versions, just use:

git clone git://github.com/foo/bar.git
cd bar
git submodule update --init --recursive

From StackOverflow

This will download SteamAuth as a submodule.

@doktokto
Copy link

doktokto commented Dec 3, 2015

Maybe will be better to start mobile auth when getting error about TwoAuthCode, not after exec [index] linkauth?

@waylaidwanderer
Copy link
Author

See #855.

@doktokto If you run into EResult.AccountLogonDeniedNeedTwoFactorCode, it means 2FA is already enabled on that account, so you wouldn't be linking an authenticator in that case.

@BestPotatoEU
Copy link

After I clone SteamBot and build the solution I try to run it but I get this error:
Error Metadata file ...\SteamBot\SteamAuth\SteamAuth\bin\Debug\SteamAuth.dll' could not be found

Edit: Whoever runs into this issue: I fixed it by asking a friend of mine to do the cloning for me.
PS. Update all packages to the latest version!

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

@waylaidwanderer I get a generalfailure error after I add my phone number. Am I doing something wrong? Ive tried it over 2-3 days multiple times always get the same error.

@waylaidwanderer
Copy link
Author

@xxbone You might need to figure out what's causing it. Do a Console.WriteLine before each "return LinkResult.GeneralFailure" in SteamAuth's function and see which one it is.

@geel9
Copy link
Contributor

geel9 commented Dec 9, 2015

Or just..debug it?

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

Got it working @waylaidwanderer
I had one more doubt, if I want to use my main acc as a bot, I'd have to link an authenticator to it via steambot, that would lead me to not be able to view the 2FA codes on my mobile. So if I have to do manual trades or logins, how do I go around doing that?

@geel9
Copy link
Contributor

geel9 commented Dec 9, 2015

@xxbone use the Steam Desktop Authenticator

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

Ah great thanks @geel9

@waylaidwanderer
Copy link
Author

@geel9 I find this way easier for people to understand. I know I got really confused when I was trying to figure out how to debug for the first time :P

@waylaidwanderer
Copy link
Author

That said, I'm getting this error when adding my phone number:

{"success":false,"error_text":"Sorry, we couldn't send an SMS to your phone","fatal":true}

It worked for 6 bots in a row and then stopped working for the last 3. There's no limit on how many accounts you can use with 1 number, right? Do you know what the problem is? Should I just try again later?

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

@geel9 using the SDA, after logging in nothing happens. Like literally nothing happens. I've cross checked my password again and again, I don't get a SMS code and the app is doing nothing.

@geel9
Copy link
Contributor

geel9 commented Dec 9, 2015

@waylaidwanderer there's a limit on how many accounts you can add a phone number to within a certain time period (probably 24hr)

@xxbone if the account you're trying to log into already has the authenticator on it, you'll need to copy the authenticator file into the maFiles directory. You'll also need to do some editing of the manifest.json file. If possible, the easiest way to do it all is to unlink the authenticator, add it using the SDA, then copy and rename the .maFile that's generated into your SteamBot directory.

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

@geel9 I did unlink auth from it before adding it to SDA. What im thinking is that it's being caused because of the InvalidPassword error I was getting before after I linked and unlinked auth from the bot and added it to my mobile. I guess I should wait a couple hours?

@waylaidwanderer
Copy link
Author

@geel9 Thanks, I'll try again tomorrow.

@geel9
Copy link
Contributor

geel9 commented Dec 9, 2015

@xxbone I'm not sure why the InvalidPassword error occurs but it seems to be some sort of rate-limiting.

@scholtzm
Copy link
Contributor

scholtzm commented Dec 9, 2015

Yep, they also updated protobufs for this. See the SteamKit repo.

@xxbone
Copy link
Contributor

xxbone commented Dec 9, 2015

Yeah thought so @geel9 Thanks for all the help.
You too @waylaidwanderer

@adlan05
Copy link

adlan05 commented Dec 10, 2015

Guys can someone make a video on how to compile it and run it please.

@aleksamagicka
Copy link
Contributor

https://www.youtube.com/watch?v=7UiaPZNwqsw

TL;DW: Learn to code(C# at least). You need to extend Steam Bot for it to serve any purpose.

Repository owner locked and limited conversation to collaborators Dec 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.