/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.core.Std; /* */ import java.awt.List; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class StatNetMUNode /* */ extends StatMan /* */ implements MainCallback /* */ { /* 19 */ private static StatNetMUNode _singleInstance = new StatNetMUNode(); /* */ private int _totBytesSent; /* */ /* 22 */ public static StatNetMUNode getNode() { return _singleInstance; } /* */ /* */ private StatNetMUNode() /* */ { /* 26 */ StatNetNode.getNode().addChild(this); /* */ } /* */ /* */ public String toString() /* */ { /* 31 */ return "Multiuser Server Connections"; /* */ } /* */ /* */ private int _totBytesRcvd; /* */ private int _totPacketsSent; /* */ private int _totPacketsRcvd; /* */ private int _lastTime; /* */ private static final int TITLE = 0; /* */ public void addBytesSent(int bytesSent) { /* 40 */ this._totBytesSent += bytesSent; /* */ } /* */ /* */ public void addBytesRcvd(int bytesRcvd) { /* 44 */ this._totBytesRcvd += bytesRcvd; /* */ } /* */ /* */ public void addPacketsSent(int pktSent) { /* 48 */ this._totPacketsSent += pktSent; /* */ } /* */ /* */ public void addPacketsRcvd(int pktRcvd) { /* 52 */ this._totPacketsRcvd += pktRcvd; /* */ } /* */ /* */ void grabList(List list) /* */ { /* 57 */ super.grabList(list); /* 58 */ Main.register(this); /* */ } /* */ /* */ void releaseList(boolean terminalCallback) /* */ { /* 63 */ if (!terminalCallback) /* 64 */ Main.unregister(this); /* 65 */ super.releaseList(terminalCallback); /* */ } /* */ /* */ public void mainCallback() { /* 69 */ int thisTime = Std.getFastTime(); /* 70 */ if (thisTime - this._lastTime > 1000) { /* 71 */ updateList(); /* 72 */ this._lastTime = thisTime; /* */ } /* */ } /* */ /* */ /* */ private static final int BLANK1 = 1; /* */ /* */ private static final int TOTBYTESSENT = 2; /* */ private static final int TOTBYTESRCVD = 3; /* */ private static final int BLANK2 = 4; /* */ private static final int TOTPKTSSENT = 5; /* */ private static final int TOTPKTSRCVD = 6; /* */ void createList() /* */ { /* 86 */ this._grabbedList.add("Overall Multiuser Server Network Statistics:", /* 87 */ 0); /* 88 */ this._grabbedList.add("", 1); /* 89 */ this._grabbedList.add(" Total bytes sent: " + this._totBytesSent + /* 90 */ " bytes", 2); /* 91 */ this._grabbedList.add("Total bytes received: " + this._totBytesRcvd + /* 92 */ " bytes", 3); /* 93 */ this._grabbedList.add("", 4); /* 94 */ this._grabbedList.add(" Total packets sent: " + this._totPacketsSent + /* 95 */ " packets", 5); /* 96 */ this._grabbedList.add("Total packets received: " + this._totPacketsRcvd + /* 97 */ " packets", 6); /* */ } /* */ /* */ void updateList() /* */ { /* 102 */ this._grabbedList.replaceItem(" Total bytes sent: " + this._totBytesSent + /* 103 */ " bytes", 2); /* 104 */ this._grabbedList.replaceItem("Total bytes received: " + this._totBytesRcvd + /* 105 */ " bytes", 3); /* 106 */ this._grabbedList.replaceItem(" Total packets sent: " + this._totPacketsSent + /* 107 */ " packets", 5); /* 108 */ this._grabbedList.replaceItem("Total packets received: " + this._totPacketsRcvd + /* 109 */ " packets", 6); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\StatNetMUNode.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */