From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/network/WaitList.java | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 NET/worlds/network/WaitList.java (limited to 'NET/worlds/network/WaitList.java') diff --git a/NET/worlds/network/WaitList.java b/NET/worlds/network/WaitList.java new file mode 100644 index 0000000..580a149 --- /dev/null +++ b/NET/worlds/network/WaitList.java @@ -0,0 +1,69 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class WaitList +/* */ { +/* 21 */ private Vector _waitList = new Vector(); +/* */ private Object _parent; +/* */ +/* */ protected WaitList(Object parent) +/* */ { +/* 26 */ this._parent = parent; +/* */ } +/* */ +/* */ protected synchronized void addWaiter(ConnectionWaiter cw) +/* */ { +/* 31 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) { +/* 32 */ System.out.println(this._parent + ": waitForConnection(" + cw + ")"); +/* */ } +/* 34 */ if (this._waitList.indexOf(cw) < 0) +/* 35 */ this._waitList.addElement(cw); +/* */ } +/* */ +/* */ protected synchronized void abortWait(ConnectionWaiter cw) { +/* 39 */ assert (this._waitList.indexOf(cw) != -1); +/* 40 */ this._waitList.removeElement(cw); +/* */ } +/* */ +/* */ protected synchronized void clear() { +/* 44 */ this._waitList = new Vector(); +/* */ } +/* */ +/* */ protected synchronized void notify(boolean connected) +/* */ { +/* 49 */ if (((Galaxy.getDebugLevel() & 0x4000) > 0) && +/* 50 */ (this._waitList.size() > 0)) { +/* 51 */ System.out.println(this._parent + ": notify(" + connected + ")"); +/* */ } +/* 53 */ for (int i = this._waitList.size() - 1; i >= 0; i--) { +/* 54 */ ConnectionWaiter cw = (ConnectionWaiter)this._waitList.elementAt(i); +/* */ +/* 56 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) { +/* 57 */ System.out.println("\tnotifying " + cw); +/* */ } +/* 59 */ cw.connectionCallback(this._parent, connected); +/* 60 */ this._waitList.removeElementAt(i); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WaitList.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file -- cgit v1.2.3