Okay, so I want to mess around with sending movement packets a little bit. Did some searching and came across this post:
[Only registered and activated users can see links. Click Here To Register...]
but it's a bit confusing to me.
First off, for the origin...
Then the interval, I assume thats just a standard ushort, so using _byteswap_ushort should work fine there? And for the speed.. this should be treated as a float at first for calculation, than converted to a ushort??
And then the counter. Incremented with each packet sent, I get that. But does it start at 0 or 1 for the first packet? And apparently it's in the player struct? So does that have to be incremented before sending the packet or what? And do you have the offset for the counter?
And do you have the current packet ids for move / stop moving?
So in the end, if I'm correct, the packet should be something like this? note vec3_t is just float[3] pretty much.
ushort - packet id (not sure what if its 0000 )
vec3_t - current Origin (bytes x/y/z reversed)
vec3_t - dest Origin (bytes x/y/z reversed)
ushort - interval (500 ms)
ushort - speed (float for calculation, then converted to ushort)
BYTE - movement type
ushort - counter (incremented in the player struct and then copied into the packet)
The post was pretty confusing to me, so any help would be nice lol. Also, forgive me if there's typos, haven't slept yet and its noon here. xD Thanks in advance
[Only registered and activated users can see links. Click Here To Register...]
but it's a bit confusing to me.
First off, for the origin...
The first vec3 origin is your current origin, and the 2nd is the destination right? And you keep updating the first (current) origin every 500 ms? Also, I assume _byteswap_ulong will work fine for reversing the byte order of the origin floats?Quote:
0000<X><Y><Z><X><Y><Z><interval><speed><moveType>< counter>
Then the interval, I assume thats just a standard ushort, so using _byteswap_ushort should work fine there? And for the speed.. this should be treated as a float at first for calculation, than converted to a ushort??
And then the counter. Incremented with each packet sent, I get that. But does it start at 0 or 1 for the first packet? And apparently it's in the player struct? So does that have to be incremented before sending the packet or what? And do you have the offset for the counter?
And do you have the current packet ids for move / stop moving?
So in the end, if I'm correct, the packet should be something like this? note vec3_t is just float[3] pretty much.
ushort - packet id (not sure what if its 0000 )
vec3_t - current Origin (bytes x/y/z reversed)
vec3_t - dest Origin (bytes x/y/z reversed)
ushort - interval (500 ms)
ushort - speed (float for calculation, then converted to ushort)
BYTE - movement type
ushort - counter (incremented in the player struct and then copied into the packet)
The post was pretty confusing to me, so any help would be nice lol. Also, forgive me if there's typos, haven't slept yet and its noon here. xD Thanks in advance