Alright, I will try not to waste your precious time so if you want to just buzz ahead to what I need assistance with then please scroll down to the (2) section. Background story under (1).
***** 1) I am a hobbyist programmer and I have some basic knowledge of C/C++/Java.
I play on a private server and I bumped into an issue (obviously, as I am posting here). The closest serverType to the server's client is kRO_RagexeRE_2010_11_24a but the client itself was built on 2010-dec-10th or such. Anyway. There is a packet mismatch happening. I am not sure if it's because of the different built dates or if it's some customisation the private server did to discourage botters.
I have found that the culprit is packet 0858. What's happening is, when an actor "moves" into my screen (packet 0856) everything works well and the bot does not choke up. However when the packet is 0858 (stationary actor coming into view range), the bot cannot extract the coordinates properly, it also does not register the first two characters of the name (if player name is "ILoveStuff" then it registers as "oveStuff"). I understand how the function "makeCoordsDir" extracts the info from this packet. I know that the offset of the "coords" for the packet 0858 from kRO_RagexeRE_2010_11_24a.pm is wrong for my server so I want to move it two bytes to the left and I am having trouble understanding how perl unpack works.
I have attached a packet I captured here:
Code: Select all
67 bytes
0> 58 08 43 00 00 XX XX 24 00 96 00 00 00 00 00 00 X.C.. $........
16> 00 00 00 00 00 01 00 DB 04 00 00 00 00 00 00 00 ................
32> 00 8E 12 8E 12 00 00 00 00 00 00 00 00 00 00 00 ................
48> 00 00 00 00 00 36 09 30 05 05 2A 00 00 00 XX XX .....6.0..*...
64> XX XX XX
***** 2) Please don't tell me to go read "http://perldoc.perl.org/functions/pack.html" as I have already done this a number of times and I am still confused as hell.
What confuses me the most is that from kRO_RagexeRE_2010_11_24a.pm (look at packet 0858). The unpack format is stated as this > "v C a4 v3 V v11 a4 a2 v V C2 a3 C2 v2 Z*" and the variables to extract from the packet are listed as this > "len object_type ID walk_speed opt1 opt2 option type hair_style weapon shield lowhead tophead midhead hair_color clothes_color head_dir costume guildID emblemID manner opt3 stance sex coords xSize ySize lv font name"
How does this match up? There are about 30 variables expected, but the format has only 15 identifiers. I am so confused by this. I will be very very grateful if someone can help this noob out with understanding perl unpack a bit better. Specifically how it handles strings (a, A formats in unpack).
If you could spare some time to break down the above 0858 packet unpack format and variables for me then I would be very grateful. If you read (1) and you understand what to fix in the packet definition then please tell me that, I would be over the moon if you did that for me. Thanks.