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

get socket shutdowned on serverside when send a LOOK_AT_INVENTORY_ITEM :(

Recommended Posts

Hi there,

I started to make my own tradebot, spend couple of hours for coding and got it connected to test server ...

And just stuck in the part of "how to get item names". There is no any list with item_ids and associated names available. So i decided to use LOOK_AT_INVENTORY_ITEM protocol message.

(description of that can be found here http://wiki.beplacid.com/EL_Protocol#LOOK_AT_INVENTORY_ITEM)

Unfortunately server shutdowns connection gracefully if i send such message. There is only 2 bytes in this message - {LOOK_AT_INVENTORY_ITEM, Position_of_item_in_the_inventory} ... is this kind of protocol message forbidden ? Are there some prerequisites available ? Is there some protocol flow description available ?

I ran out of ideas, any help would be appreciated.

Share this post


Link to post
Share on other sites

Hi there,

I started to make my own tradebot, spend couple of hours for coding and got it connected to test server ...

And just stuck in the part of "how to get item names". There is no any list with item_ids and associated names available. So i decided to use LOOK_AT_INVENTORY_ITEM protocol message.

(description of that can be found here http://wiki.beplacid.com/EL_Protocol#LOOK_AT_INVENTORY_ITEM)

Unfortunately server shutdowns connection gracefully if i send such message. There is only 2 bytes in this message - {LOOK_AT_INVENTORY_ITEM, Position_of_item_in_the_inventory} ... is this kind of protocol message forbidden ? Are there some prerequisites available ? Is there some protocol flow description available ?

I ran out of ideas, any help would be appreciated.

Sounds like you've messed up somehow on sending the data. If you violate the protocol, the server will disconnect you with no warning.

Share this post


Link to post
Share on other sites

make sure you use the inv slot as a char/unit8/single byte value

make sure you set the packet length (which is a short, or 2-byte integer value, in little-endian format) to 2

failing that, post the offending code(both look-at and network-send) so people can pick it to pieces ;)

Share this post


Link to post
Share on other sites

Sounds like you've messed up somehow on sending the data. If you violate the protocol, the server will disconnect you with no warning.

 

Sure. I just have no idea in which part ;)

Share this post


Link to post
Share on other sites

make sure you use the inv slot as a char/unit8/single byte value

make sure you set the packet length (which is a short, or 2-byte integer value, in little-endian format) to 2

failing that, post the offending code(both look-at and network-send) so people can pick it to pieces ;)

 

This i found in sources right now:

str[0]=LOOK_AT_INVENTORY_ITEM;
str[1]=item_list[pos].pos;
my_tcp_send(my_socket,str,2);

 

I do the things similar to the above - like described in wiki (http://wiki.beplacid.com/EL_Protocol).

 

LOL ! I found it right in this second - my_tcp_send adds data - length !

 

Thanks a lot ttlanhil ! I'll correct the code after i back from job.

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.

×