summaryrefslogtreecommitdiff
path: root/NET/worlds/console/StatNetRefNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/StatNetRefNode.java')
-rw-r--r--NET/worlds/console/StatNetRefNode.java118
1 files changed, 118 insertions, 0 deletions
diff --git a/NET/worlds/console/StatNetRefNode.java b/NET/worlds/console/StatNetRefNode.java
new file mode 100644
index 0000000..7466a04
--- /dev/null
+++ b/NET/worlds/console/StatNetRefNode.java
@@ -0,0 +1,118 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.core.Std;
+/* */ import NET.worlds.network.NetworkRoom;
+/* */ import NET.worlds.network.WorldServer;
+/* */ import NET.worlds.scape.Pilot;
+/* */ import NET.worlds.scape.Room;
+/* */ import java.awt.List;
+/* */ import java.util.Vector;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class StatNetRefNode
+/* */ extends StatMan
+/* */ implements MainCallback
+/* */ {
+/* 22 */ private static StatNetRefNode _singleInstance = new StatNetRefNode();
+/* */ private int _totBytesSent;
+/* */
+/* 25 */ public static StatNetRefNode getNode() { return _singleInstance; }
+/* */
+/* */ private int _totBytesRcvd;
+/* */ private int _totPacketsSent;
+/* 29 */ private StatNetRefNode() { StatNetNode.getNode().addChild(this); }
+/* */
+/* */
+/* */ public String toString()
+/* */ {
+/* 34 */ return "Drone Referrers to Current Server";
+/* */ }
+/* */
+/* */ private int _totPacketsRcvd;
+/* */ private int _lastTime;
+/* */ private static final int TITLE = 0;
+/* */ private static final int BLANK = 1;
+/* */ public void addBytesSent(int bytesSent)
+/* */ {
+/* 43 */ this._totBytesSent += bytesSent;
+/* */ }
+/* */
+/* */ public void addBytesRcvd(int bytesRcvd) {
+/* 47 */ this._totBytesRcvd += bytesRcvd;
+/* */ }
+/* */
+/* */ public void addPacketsSent(int pktSent) {
+/* 51 */ this._totPacketsSent += pktSent;
+/* */ }
+/* */
+/* */ public void addPacketsRcvd(int pktRcvd) {
+/* 55 */ this._totPacketsRcvd += pktRcvd;
+/* */ }
+/* */
+/* */ void grabList(List list)
+/* */ {
+/* 60 */ super.grabList(list);
+/* 61 */ Main.register(this);
+/* */ }
+/* */
+/* */ void releaseList(boolean terminalCallback)
+/* */ {
+/* 66 */ if (!terminalCallback)
+/* 67 */ Main.unregister(this);
+/* 68 */ super.releaseList(terminalCallback);
+/* */ }
+/* */
+/* */ public void mainCallback() {
+/* 72 */ int thisTime = Std.getFastTime();
+/* 73 */ if (thisTime - this._lastTime > 1000) {
+/* 74 */ updateList();
+/* 75 */ this._lastTime = thisTime;
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ void createList()
+/* */ {
+/* 85 */ this._grabbedList.add("Drones Referring to Current Server:", 0);
+/* 86 */ this._grabbedList.add("", 1);
+/* */
+/* 88 */ Pilot p = Pilot.getActive();
+/* 89 */ Room r = p.getRoom();
+/* 90 */ NetworkRoom netRoom = null;
+/* 91 */ if (r != null)
+/* 92 */ netRoom = r.getNetworkRoom();
+/* 93 */ WorldServer ws = null;
+/* 94 */ if (netRoom != null)
+/* 95 */ ws = netRoom.getServer();
+/* 96 */ if (ws != null) {
+/* 97 */ Vector<String> list = ws.printDroneReferrers();
+/* 98 */ for (int i = list.size() - 1; i >= 0; i--) {
+/* 99 */ String name = (String)list.elementAt(i);
+/* 100 */ this._grabbedList.add(name);
+/* */ }
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */ void updateList()
+/* */ {
+/* 109 */ this._grabbedList.removeAll();
+/* 110 */ createList();
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\StatNetRefNode.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file