Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2007, 01:33 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
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?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #2  
Old 06-29-2007, 01:36 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
__________________
Skyld
Reply With Quote
  #3  
Old 06-29-2007, 01:50 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Skyld View Post
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 =(
Reply With Quote
  #4  
Old 06-29-2007, 03:16 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Skyld View Post
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.
Reply With Quote
  #5  
Old 06-29-2007, 04:40 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
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.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #6  
Old 06-30-2007, 01:26 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Rapidwolve View Post
How does that site get all that information? I've always wondered that.
Magic.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #7  
Old 06-30-2007, 02:07 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #8  
Old 06-30-2007, 02:23 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by Stefan View Post
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?
__________________
Reply With Quote
  #9  
Old 06-30-2007, 04:29 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
A scripting function used serverside that would return the player's latency would be lovely.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #10  
Old 06-30-2007, 10:05 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Stefan View Post
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)
__________________
Do it with a DON!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.