Jump to content

Recommended Posts

Posted

What I am trying to do is in my hud I am trying to display some information. I have tried:

 

 

private String getPingInformation()

{

NetHandlerPlayClient handler = this.mc.thePlayer.sendQueue;

List list = new ArrayList(handler.func_175106_d());

Iterator iterator = list.iterator();

 

while (iterator.hasNext())

{

NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) iterator.next();

EnumChatFormatting enumchatformatting;

if (networkplayerinfo.getResponseTime() <= 0) enumchatformatting = EnumChatFormatting.RED;

else if (networkplayerinfo.getResponseTime() < 150) enumchatformatting = EnumChatFormatting.GREEN;

else if (networkplayerinfo.getResponseTime() < 300) enumchatformatting = EnumChatFormatting.YELLOW;

else if (networkplayerinfo.getResponseTime() < 600) enumchatformatting = EnumChatFormatting.GOLD;

else if (networkplayerinfo.getResponseTime() < 1000) enumchatformatting = EnumChatFormatting.RED;

else enumchatformatting = EnumChatFormatting.DARK_RED;

return "Ping: " + enumchatformatting + (networkplayerinfo.getResponseTime() <= 0 ? "Unavailable" : networkplayerinfo.getResponseTime());

}

 

return "Ping: Unavailable";

}

 

 

and it sometimes works, but most of the time it returns 0.

Posted

Maybe, but I would also expect the ping to update every so often, but it seems the stay at the same number for long periods of time.

EDIT: What happens it when I join a server the ping will be a single number for about 5-10 seconds, then goto 0, then a random time later will be another number, and continuously do that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.