Jump to content
Eternal Lands Official Forums
Sign in to follow this  
CeruleanBlaze

Server's response to a login request

Recommended Posts

And figure out why my bot gets disconnected from the server straight away :)

I just get to witness the sparkles from the login and then the bot is gone.

I know i'm so close! I want to get playing with all the data the server has sent me (stat list, inventory, etc) but I need to get a persistent connection first.

My first guess would be responding to one of the following the server is sending me:

YOU_ARE

SYNC_CLOCK

NEW_MINUTE

Which would lead me on to think i'd have to do something heartbeat related. I'm already sending the heartbeat packet every 25 seconds as someone said further up.

I'm doubting I need to send anything else as the only data that elbot sends to the server is the login - doesn't even respond to PING_REQUEST - and it stays logged on without problem.

 

People I spoke to are right, IRC bots are definitely easier :)

Edited by CeruleanBlaze

Share this post


Link to post
Share on other sites

Oh really? I made an EL bot without any problems - and that was before I had any documentation on the protocol (no source, no protocol.h, nothing), where as when I wanted to write an IRC bot I never got further than reading the protocol docs.

 

If you get kicked off immidiately, it usually means that you sent a malformed packet. That makes the server drop the connection. There isn't any advanced challenge-response thing going on, no packets need a reply, and the only required packets are the login packet and heartbeat.

 

Check the last packet your bot sends before the connection is dropped, as that's probably the one that's wrong.

Share this post


Link to post
Share on other sites

What language did you use to make the bot? I'm fairly confident that I would have no problems if I was using C and the SDL network stuff.

 

Malformed packets probably is the case, yet where? Here is my login packet:

"\x8c\x12\x00Chocolate xxxxxxx\x00"

Looks okay to me, and that should be all I need, right? I don't even need to send a heartbeat in the beginning (at least elbot doesn't).

 

I've responded to ping requests by sending the whole packet back, so that won't be the problem unless the packets are being corrupted along the way. I get the same result if I do not respond to PING_REQUEST as elbot does.

Share this post


Link to post
Share on other sites

You said you saw the bot appear and disappear immidiately in game. That only happens if the login packet is accepted - in other words, the login packet is ok. It must be a different packet you send that is wrong.

 

How about the ping packet you send back? How do you know it's correct, when elbot doesn't do it? Maybe that's why the server rejects...

 

And yes, I used C.

Share this post


Link to post
Share on other sites

Like I said, I tried ignoring the PING_REQUEST and sending nothing but the login - I get logged in then disappear instantly.

Another thing that is odd is that I have to try running the bot around 7-10 times before I even get LOG_IN_OK - all the other times I get LOG_IN_NOT_OK from the server.

:huh:

Share this post


Link to post
Share on other sites

Make sure you got the size right. If the size is too big, the server will expect more data than you send. If it's too low, the last bytes will look like a new packet, which doesn't match the protocol at all.

 

I don't know if the number of x'es in the example above matches the length of you password, but if they do, the size looks wrong. (I'm at work, so I can't compare it to my own code).

Share this post


Link to post
Share on other sites
\x8c\x12\x00Chocolate xxxxxxx\x00

0x12 = 18

the length of a message is the length of protocol byte (1) and length of data. So ur login strings length is 19.

 

it looks like ur using python. take a look at the module struct if u dont use that already.

Share this post


Link to post
Share on other sites
Another thing that is odd is that I have to try running the bot around 7-10 times before I even get LOG_IN_OK - all the other times I get LOG_IN_NOT_OK from the server.

The same thing happens to me too... After a LOG_IN_OK, my bot works fine though...

Share this post


Link to post
Share on other sites

You guys need to check what you send to the server. It's not supposed to be like that, my bot never needs several tries to log in.

Share this post


Link to post
Share on other sites

ROFL...went to try if my (python) bot gave trouble on the test server.

 

No, it logs in in one try. The funny thing is that there's another bot there that PM's anyone coming in. Garn (my bot), being in the early stages of development answers every PM with another PM. To which testmonkey (whose is that?) replied. To which Garn replied, to which...etc.

Share this post


Link to post
Share on other sites

:)

take a look at the module struct if u dont use that already.

Yes, I am using the struct module but I didn't know the length of message included the first byte.

Anyways, it works perfectly now - stays logged in and logs in with one try.

 

Thank you all for your help, greatly appreciated :angry:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×