![]() |
Latency finder?
I'm trying to script a latency finder. I've discussed this with Skyld before - we've established that it's impossible to get an accurate latency check with the current gscript engine so I've resorted to using PHP on a remote server to try it for me.
I'm not too good with PHP, so I presume fsockopen opens a connection from the server to the address, not from the viewer to the address, so using a remote script is rather pointless here. However, I think I could do it with a TSocket in Gscript, but there's one slight problem: How the hell do I get the IP/Ports of an npcserver? |
Normally when using TSocket objects you have to bind to a port. You can find the IP of a given gserver on http://statistics.graal.us/ I guess, and then pick a port number in your script, but I do not think the TSocket functionality is final yet. It may be subject to change; in fact, it might not even be available for all users yet.
I am thinking that a standard HTTP request might be more suited to your purpose, though. |
Quote:
|
Quote:
|
The problem with using an external server is that the latency between the player and the server (or the player and another player) will not be accurately calculated because it will include the latency between the graal server and the web server.
This is the route it's taking Player A requests latency of Player B to graal server player a -> graal server graal server -> player b player b -> graal server graal server -> web server Really you need to do it in a single hop. Now, you could make a connection between the player and the webserver but that will get you the latency between the player and the webserver. Really the only possible way to do it would be to create a socket connection between the player and the server. |
Quote:
|
You want some /ping thing like on RC chat? The server already has the ability to ping the client, but currently there is no script command for it.
|
Quote:
|
A scripting function used serverside that would return the player's latency would be lovely.
|
Quote:
(Hurray for serverside updates not needing a new client) |
| All times are GMT +2. The time now is 04:51 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.