Question Function to get latency?

Discussion in 'Developer Support' started by muttaclien, Aug 3, 2015.

  1. muttaclien

    Joined:
    Jul 18, 2015
    Messages:
    6
    Likes Received:
    0
    Hey, I see server latency is listed in the misc section of developer telemetry panel. Can't seem to find any such function in the runemate jar. Can anyone point me in the right direction? (Or alternatively, what's a convenient tool/plugin for searching jars for functions containing key phrases?)

    Thanks!
     
  2. PhaseCoder

    Joined:
    Jan 1, 2015
    Messages:
    271
    Likes Received:
    26
  3. muttaclien

    Joined:
    Jul 18, 2015
    Messages:
    6
    Likes Received:
    0
    No shit Mr. Sherlock. How do I spider this? Google doesn't have indexed very well.
     
  4. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,549
    Likes Received:
    1,068
  5. muttaclien

    Joined:
    Jul 18, 2015
    Messages:
    6
    Likes Received:
    0
    Hmm, guess I should have phrased more clearly - I'm looking for network latency not framerate latency. The misc section of developer panel shows both network latency and framerate(Ping: 315ms, FPS:50). Ended up just spidering the whole javadocs and grepping for anything containing "ping"|"latency", case insensitive. Nothing came up.
     
  6. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,549
    Likes Received:
    1,068
    Tagging @Cloud because I couldn't find it either.
     
  7. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,521
    Likes Received:
    893
    The reason that it's not currently in the API is because as far as I'm aware the rs client itself doesn't store it's ping. The ping that's displayed in the misc tab is calculated by us by measuring the amount of time it takes to connect to the world you're on. I could make an api method that would return a Future<Integer> for it that would calculate it (since we know the base server and such), but the problem is it would have to be recalculated a lot. You could cache it but ping changes a lot over a running session.
     
  8. Hazard

    Joined:
    Apr 18, 2015
    Messages:
    394
    Likes Received:
    84
    Partially related to this; is it somehow possible to detect the state of the client? For example delay while it's loading etc; the not-very-powerful other botclient has this at Game#clientState()
     
  9. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,521
    Likes Received:
    893
    That feature is very rarely useful for more than simply checking if logged in and is a HUGE pain in the ass to make give consistent values because they change the expected values for each state in each gamepack and it requires mapping them back to more usable states.
     

Share This Page

Loading...