reqcld reliability
2 replies



14.01.12 07:52:59 pm
Is it safe to presume that I receive client data every time I request it, or do I have to check for packet loss myself?
Furthermore, how is it possible that sometimes the cursor is at a distance of for instance 2413 or 4186 pixels from the player? I strongly doubt it's because of this simple calculation in which nothing should go wrong:
Furthermore, how is it possible that sometimes the cursor is at a distance of for instance 2413 or 4186 pixels from the player? I strongly doubt it's because of this simple calculation in which nothing should go wrong:
Code:
1
math.floor( math.sqrt(((player(id, "x") - x) ^ 2) + ((player(id, "y") - y) ^ 2)) + 0.5 )
yeah, reqcld uses a safe transfer mode. CS2D ensures that the requested data will arrive. so you don't have to care about packet loss.
about the second thing: I don't really know. maybe you didn't request the absolute cursor position? you can request the cursor position with the current map scrolling offset included (absolute cursor position) or just the offset or the position without offset.
about the second thing: I don't really know. maybe you didn't request the absolute cursor position? you can request the cursor position with the current map scrolling offset included (absolute cursor position) or just the offset or the position without offset.
Code:
1
reqcld(id, 2)
fetches the absolute cursor position right?
Well, maybe I should just try
Code:
1
math.floor( math.sqrt(((320 - x) ^ 2) + ((240 - y) ^ 2)) + 0.5 )
along with mode 0



