[Problem] Cannot read the ChangeDirection

07/14/2010 16:26 Basser#1
Patch 5165.
[table="head"]Offset | Type | Value
0 | ushort | Length [0x24]
2 | ushort | Type [0x271A]
20 | byte | Direction [206]
This Direction is wrong, I keep receiving the same direction, but it should be below 8 in all cases.
It doesn't even change, whichever direction I pick.
Anyone has ideas.
Also don't tell me I should do this: Input[22] % 8 because this will give me a Direction below 8, but the same one every time.

Unbelievable I'm having trouble with changing the direction o_o
07/14/2010 19:15 pro4never#2
Which patch are you using? I know that for newer ones the structure changed. I tried using the wiki when I was doing mob directions for my proxy and was super confused lol.

I'd strongly suggest simply printing out or writing to a text file when you receive it from the client, then see which offset is changing, confirm it's under 8 and go with that. I'm positive you'll find it easily enough.

<edit>

Wow... if I was any less blind I'd have noticed that you said 5165. gimme 2 sec
07/14/2010 21:02 -impulse-#3
Quote:
Originally Posted by Basser View Post
Patch 5165.
[table="head"]Offset | Type | Value
0 | ushort | Length [0x24]
2 | ushort | Type [0x271A]
20 | byte | Direction [206]
This Direction is wrong, I keep receiving the same direction, but it should be below 8 in all cases.
It doesn't even change, whichever direction I pick.
Anyone has ideas.
Also don't tell me I should do this: Input[22] % 8 because this will give me a Direction below 8, but the same one every time.

Unbelievable I'm having trouble with changing the direction o_o
Then do

for(int count = 0; count < Length; count++)
if(Buffer[count] < 8)
Console.WriteLine(count + "~" + Buffer[count]);

Try more than once and make sure you know the number for the direction you just changed to, then take out all possibilities till you found the right offset.

btw, count "~" + buffer[count] <-> offset ~ value
07/14/2010 21:44 kinshi88#4
Try a byte at offset 22.
It's what I use, but mind you its a bit newer =P

Edit:
And if that doesn't work, just dump the packet
07/14/2010 22:23 -impulse-#5
Quote:
Originally Posted by kinshi88 View Post
Try a byte at offset 22.
It's what I use, but mind you its a bit newer =P

Edit:
And if that doesn't work, just dump the packet
OR do what I already said which works 100%.
07/14/2010 22:25 kinshi88#6
Quote:
Originally Posted by -impulse- View Post
OR do what I already said which works 100%.
But that's ugly =P
07/14/2010 22:32 -impulse-#7
Quote:
Originally Posted by kinshi88 View Post
But that's ugly =P
Well, that's the fastest way and it works very well in most cases.

Idk what people use, but that's what I use and if someone has a better, faster method, please don't hesitate to tell me.

Ah, about my method being ugly, I don't care if it's ugly or pretty, all I care is about the results.
07/14/2010 22:33 kinshi88#8
Quote:
Originally Posted by -impulse- View Post
Well, that's the fastest way and it works very well in most cases.

Idk what people use, but that's what I use and if someone has a better, faster method, please don't hesitate to tell me.

Ah, about my method being ugly, I don't care if it's ugly or pretty, all I care is about the results.
<3

I like pretty code =P
07/14/2010 22:35 -impulse-#9
Quote:
Originally Posted by kinshi88 View Post
<3

I like pretty code =P
Pretty code doesn't always mean good results. <3
07/14/2010 22:40 kinshi88#10
Quote:
Originally Posted by -impulse- View Post
Pretty code doesn't always mean good results. <3
In the long run it does; easier debugging, easy to understand, and pretty code is usually damn efficient =P
07/14/2010 22:46 -impulse-#11
Quote:
Originally Posted by kinshi88 View Post
In the long run it does; easier debugging, easy to understand, and pretty code is usually damn efficient =P
Hmm this thing is not for 'long run', it was all for finding an offset, which by my guess is a pretty short run.

Anyway, I agree with you, on long run I use pretty code too <3
07/14/2010 22:56 Korvacs#12
Just do 3 or 4 general data packet dumps and post them here in hex.

Edit:

Direction is stored at offset 22 in 5165.
07/14/2010 22:57 kinshi88#13
Quote:
Originally Posted by -impulse- View Post
Hmm this thing is not for 'long run', it was all for finding an offset, which by my guess is a pretty short run.

Anyway, I agree with you, on long run I use pretty code too <3
Yush

<3
07/14/2010 23:21 InfamousGeek#14
Quote:
Originally Posted by kinshi88 View Post
Yush

<3
Not commenting on the immaturity readen so far. However, 'pretty code' or clean code as I prefer to call it is indeed easier for debugging and organization is one of the steps to write a successfull source, not necessarily. Though commenting on other programmer's coding style is totally wrong, everybody prefers his own methods and 'programming style'.
07/15/2010 00:14 kinshi88#15
Quote:
Originally Posted by InfamousGeek View Post
Not commenting on the immaturity readen so far. However, 'pretty code' or clean code as I prefer to call it is indeed easier for debugging and organization is one of the steps to write a successfull source, not necessarily. Though commenting on other programmer's coding style is totally wrong, everybody prefers his own methods and 'programming style'.
Yeah, I was just stating my opinion =P