summaryrefslogtreecommitdiff
path: root/NET/worlds/console/StatNetMUNode.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/StatNetMUNode.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/StatNetMUNode.java')
-rw-r--r--NET/worlds/console/StatNetMUNode.java117
1 files changed, 117 insertions, 0 deletions
diff --git a/NET/worlds/console/StatNetMUNode.java b/NET/worlds/console/StatNetMUNode.java
new file mode 100644
index 0000000..ede89ea
--- /dev/null
+++ b/NET/worlds/console/StatNetMUNode.java
@@ -0,0 +1,117 @@
+/* */ 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
+ */ \ No newline at end of file