Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to verify username #7

Closed
scottie opened this issue Apr 8, 2013 · 22 comments
Closed

Failed to verify username #7

scottie opened this issue Apr 8, 2013 · 22 comments

Comments

@scottie
Copy link

scottie commented Apr 8, 2013

Love what you are doing.

I have proxy pointed to a live online server and the bot is pointed to the proxy.
It connects but i get the failed to verify username error, i get this even if i set the option --username to my username or without the option.

Running on linux.

Command to start bot:
python bot.py --botemail user@gmail.com --botpass mypassword --log2file --serverhost localhost --serverport 1338 --botname MYNAME --use_encryption

Command to start proxy:
python proxy.py --serverhost SERVERIP --serverport 25565 --log2file --proxyport 1338

Bot:
03:22:19.982493 [CORE EVENT] Server kicked me out with message: Failed to verify username!
03:22:19.982831 [WORLD] Shutdown

Proxy:
03:22:19.151932 [SERVER] Starting encryption
03:22:19.152027 [CLIENT] Starting encryption
03:22:19.152735 [CLIENT] id 205 client statuses
status: 0
03:22:19.981817 [SERVER] id 255 disconnect/kick
message: Failed to verify username!
03:22:19.984072 [CLIENT] Lost connection from client: Connection was closed cleanly.

What can do, not really sure how to move on or how to fix this.
Im sure everything is correct in the command line im using to load both applications.
Is this common?

edit:

To clarify, i can connect to the server normally without the message using both normal and custom clients.
My accounts are paid online accounts.

@lukleh
Copy link
Owner

lukleh commented Apr 8, 2013

Thanks :)

The bot is running by default in offline mode, so you need to use --onlinemode argument. this implies --use_encryption so you can use it instead of it.

I need to rewrite the readme to make things more clear. if you have an idea what can be written better I would be happy for pull request (or at least suggestion)

@scottie
Copy link
Author

scottie commented Apr 9, 2013

sorry to leave that out of the command i posted, i also did try that, to verify i just did try again.

"14:14:18.403985 [CORE EVENT] Server kicked me out with message: Failed to verify username!"

Honestly it was clear in the readme, i just forgot to mention in initial post i did try it with that :(

command i just tried:
python bot.py --botemail blahblah@gmail.com --botpass PASSWORD --log2file --serverhost localhost --serverport 1338 --botname consolecowboy --onlinemode

response:
14:16:58.462782 [CORE EVENT] USE_ENCRYPTION is True, doing encryption.
14:16:58.465519 [PROTOCOL] doing online authentication
14:16:59.204151 [PROTOCOL] responce from http://session.minecraft.net: OK
14:16:59.818661 [CORE EVENT] Server kicked me out with message: Failed to verify username!
14:16:59.833410 [WORLD] Shutdown

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

Ok, I think I got it. One has to also specify --botname, which is the name associated with your online account.
That is confusing, because in official client you just use you email.

Long story short, I've change the code to take the username from login.minecraft response so one does not need to use --botname in online mode.

commit soon

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

fix commited

@scottie
Copy link
Author

scottie commented Apr 9, 2013

I will clone new code thanks kindly, i did use --botname in my startup command that was what my username is (consolecowboy), so im still confused maybe i was using what i thought my username was but maybe my username is something different on mojang. Sounds like a good code change anyway to be honest.

@scottie
Copy link
Author

scottie commented Apr 9, 2013

hmm no im getting the exact same problem,
still confused i didnt think i was doing anything wrong in the original post, but still that code change you did recently was probably for the best in the long run anyway, but i still seem to be getting the same problem.

:(

Client:
18:33:49.749931 [PROTOCOL] doing online authentication
18:33:50.656667 [PROTOCOL] responce from http://session.minecraft.net: OK
18:33:57.941630 [CORE EVENT] Server kicked me out with message: Failed to verify username!
18:33:57.942027 [WORLD] Shutdown

Proxy:
18:36:06.553754 [CLIENT] id 205 client statuses
status: 0
18:36:09.719521 [SERVER] id 255 disconnect/kick
message: Failed to verify username!
18:36:09.757598 [CLIENT] Lost connection from client: Connection was closed cleanly.

command used:
python bot.py --botemail EMAIL --botpass PASSWORD --log2file --serverhost localhost --serverport 6969 --onlinemode

I have proxy running also, this command points to the mc proxy, and proxy points to the server i want to connect to.
(i removed --botname as per your update)

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

true...

i tested it with online server and python bot.py --onlinemode --botemail EMAIL --botpass PASS
and it works, so hard to say what is going wrong

try to post the whole log

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

get the latest code (4701ab6) , run it and post the log please

@scottie
Copy link
Author

scottie commented Apr 9, 2013

No worrys,

here are the logs.
running with latest snapshot

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

and one question that I did not (and should) ask, does the bot run on the server without the proxy? and what proxy are you using?

@lukleh
Copy link
Owner

lukleh commented Apr 9, 2013

you are using my proxy! :D

well that explains.... I did not implemented proxy for online mode and from what I know it is not even possible (or at least hard).
I intended the proxy just for debugging packet sequences and other developer stuff

@scottie
Copy link
Author

scottie commented Apr 9, 2013

ok it works without the proxy, i was using the proxy that came with the bot.
LOL, so sorry to waist your time, i intended to write a plugin or at least play with the pathing see if i can get it do do something usefull like farm, etc, i code in python so was hoping to use the proxy to see the packet dumps but i can just use that on offline mode to get the information i need.

Thanks again,
Hopefully i can help out :)

@wtfaremyinitials
Copy link

If you still want to know, I know why you can't connect to an onlinemode server with a proxy.

@lukleh
Copy link
Owner

lukleh commented Apr 28, 2013

sure, post it!

@SnoFox
Copy link

SnoFox commented Apr 28, 2013

And now we all wait on @wtfaremyinitials's post ... I was about to start using the proxy on an online, production mode server to look for oddities in our plugins, but if it doesn't work on online mode, that's ... Unfortunate.

@lukleh
Copy link
Owner

lukleh commented Apr 28, 2013

If there is demand on that I can try to investigate further.

@lukleh lukleh closed this as completed Apr 30, 2013
@wtfaremyinitials
Copy link

First off sorry it took me so long to get back to you.... I have bene extremely busy. Anyway the reason the proxy doesn't work is that when a minecraft client wants to connect to an online mode server it sends the servers address along with a few other things up to the minecraft session servers. The issue is that if you are connecting to "localhost:25566" you send that to mojang instead of whatever the proxy is sending your connection to. As a result of that when the end server makes a request to the minecraft session servers asking if the user trying to connect is a vaild user, they don't get anything because your client never tells the minecraft session servers what the end server is. If that didn't make any sense, I'd be happy to try to re-word it.

@SnoFox
Copy link

SnoFox commented May 4, 2013

It looks like the solution (that doesn't involve client mods) is to login, then fire up the proxy and have the proxy login to Mojang again. On connect, the proxy should send to Mojang "I'm SnoFox and I'm connecting to mc.example.com:25565" (even though the real client is connecting to localhost:25565).

@wtfaremyinitials
Copy link

Exactly.

@lukleh
Copy link
Owner

lukleh commented May 4, 2013

Ok, so do we have a reproducible and tested solution? Even partial for now....

@wtfaremyinitials
Copy link

Not written, no. But I can throw a beta version together later if needed.

@lukleh
Copy link
Owner

lukleh commented May 5, 2013

Sure, anything that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants