Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Latency finder? (https://forums.graalonline.com/forums/showthread.php?t=74956)

Raeiphon 06-29-2007 01:33 PM

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?

Skyld 06-29-2007 01:36 PM

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.

Twinny 06-29-2007 01:50 PM

Quote:

Originally Posted by Skyld (Post 1323799)
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.

Servers now use sockets but they are still unavailable for scripters =(

Rapidwolve 06-29-2007 03:16 PM

Quote:

Originally Posted by Skyld (Post 1323799)
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.

How does that site get all that information? I've always wondered that.

JkWhoSaysNi 06-29-2007 04:40 PM

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.

coreys 06-30-2007 01:26 AM

Quote:

Originally Posted by Rapidwolve (Post 1323815)
How does that site get all that information? I've always wondered that.

Magic.

Admins 06-30-2007 02:07 AM

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.

Crono 06-30-2007 02:23 AM

Quote:

Originally Posted by Stefan (Post 1324058)
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.

Can't you make alt + 4 also show latency or something? Might as well right?

Raeiphon 06-30-2007 04:29 PM

A scripting function used serverside that would return the player's latency would be lovely.

zokemon 06-30-2007 10:05 PM

Quote:

Originally Posted by Stefan (Post 1324058)
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.

If it would be that easy to add, that would be great!
(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.