Quote:
Originally Posted by kevin_owner
Could you print or output the x and y section with hex as format so you know which byte it read. You probably forgot to read a byte somewhere so that's why i'm asking what the values are.
|
Here is my latest Chardata packets from H& 3013
first i found my charid in packet and after select this codes.
im sure 4d69 constantinple sectors
Code:
d9331a00 // my char ID
4d // X sector
69 // Y sector
d8a5e043 // X Float ?
207dff40 // Z Float ?
2a37b544 // Y float ?
468d // Angle ?
Up for more info.
Guys comon... i must get correct ingame coordinates

d8a5e043 : here is X float. if i convert it to single or double, getting huge value

which way correct for converting.
4D : converted to 75
69 : converted to 105. up to here everything is fine.
im stuck on converting floats...
EDIT //
Finally i solved.
incorrect conversion on x,y,z floats
solution is simple :
0080a643 : here is x float my char. reverse and used a function for converting hex to single type.
Here is my function for convertin to single:
Code:
Private Function ConvertHexToSingle(ByVal hexValue As String) As Single
Try
Dim iInputIndex As Integer = 0
Dim iOutputIndex As Integer = 0
Dim bArray(3) As Byte
For iInputIndex = 0 To hexValue.Length - 1 Step 2
bArray(iOutputIndex) = Byte.Parse(hexValue.Chars(iInputIndex) & hexValue.Chars(iInputIndex + 1), Globalization.NumberStyles.HexNumber)
iOutputIndex += 1
Next
Array.Reverse(bArray)
Return BitConverter.ToSingle(bArray, 0)
Catch ex As Exception
Throw New FormatException("The supplied hex value is either empty or in an incorrect format. Use the following format: 00000000", ex)
End Try
End Function
i repeat this parts for all x y and z floats. and success
Thanks a lot who is answerd my post.
best regards