BadRequest for login
Closed this issue · 3 comments
I am getting BadRequest here :
Line 40 in 43ffc6f
I checked with debugger, because as the code executes actual exception is as below :
OGame2.login(self)
File "/home/adam/playground/pyogame2/pyogame2/__init__.py", line 48, in login
if account['server']['number'] == self.server_number:
TypeError: string indices must be integers
This is because account evaluates to string "error : not logged in"
Any idea what might cause BadRequest when trying to POST to API ?
Thanks,
The Ogame Logging Process works like this. After posting your credentials the Ogame Server sends you an PHPSession Token. The request session keeps track of that cookie. Next is to get all your Uni Server number. Then check if you are registered in this Server and compare it with your Name for the Server your provided, to finally get the server language and login link.
the not logged answer from the Ogame usually means that you are not logged in or your credentials your provided dint got accepted by the Server.
Try out supplying it like this
empire = OGame2('Mensa', 'email@email.com', 'Password')
if it dint work can you supply me your server language?
Hi,
Thanks for looking into it.
It seems that fault is on my side. I have created account with Facebook and was trying to set up email /password for normal login and did so in their Support System. Unfortunately I wasn't aware this doesn't link back to Gameforge account.
I have tried logging in with pyogame2 with fresh email/password account and it works.
Maybe you know how to get email /password for accounts that were registered with Facebook ?
EDIT : I found the way to transfer via gifting code. Can close, sorry to bother.
EDIT2 : Oh and of course thanks for putting it all together, works very well, must have taken lots of manual work to map all responses.
ah nice that you can transfer the account from facebook. i will look into it adding the facebook login process but for the moment the GF login is much more easier to implement.
the ogame website is quite well put together. but you see that there are changing stuff on the background to node away from php i guess.