![]() |
Latency?
I've wondered how to do this, and there doesnt appear to be any functions in gscript which return a ping or a latency value, so it appears i'd have to do it manually.
What would I have to do to get a function that returns a latency value? I was thinking along the lines of timing a file request through a for with a sleep .001 in it, and once the request is completed, the for would end and return the value. Not sure if this'd work with gscript though, as I think file requests are cached and I intend to use this alot. |
I'm pretty sure it's possible - but how, I'm afraid I can't help you there.
Reason I think it's possible is that Atrius has it (bottom right), it reads it from a client.string (or maybe a clientr.string, I can't remember). How they did it though I don't know. Although yeah, it's possible. |
You could try using timevar2, sending a triggeraction to the serverside, and comparing the timevars when it returns.
There used to be a decent Free script on graal.net I think Cybnext or someone made it. |
|
All that for a latency script? Wow. That'd be smaller in gs2, definately. I'll get working on coding my own function, and i'll post it when i'm done
|
That script is horribly formatted :x
Could probably have the same effect with something like: PHP Code:
|
Yes Okiesmokie script looks best, you can also type this.name instead of "WEAPONNAME" to make it easy to use.
Such pings are not very accurate though, since the scripts are only executed each 0.05 seconds on clientside (50 milliseconds), so you will never get higher or lower ping. But it is planned that we add a pinging funtion to clientside and serverside, to detect if something is too slow, to compare servers etc. The client will need to be modified to answer the ping immediatelly though. |
Quote:
Or to save space, just write 'name' instead of 'this.name'! :D |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 07:23 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.