summaryrefslogtreecommitdiff
path: root/NET/worlds/network/SMState.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/network/SMState.java')
-rw-r--r--NET/worlds/network/SMState.java93
1 files changed, 93 insertions, 0 deletions
diff --git a/NET/worlds/network/SMState.java b/NET/worlds/network/SMState.java
new file mode 100644
index 0000000..946c77d
--- /dev/null
+++ b/NET/worlds/network/SMState.java
@@ -0,0 +1,93 @@
+/* */ package NET.worlds.network;
+/* */
+/* */ import NET.worlds.core.IniFile;
+/* */ import java.io.PrintStream;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class SMState
+/* */ {
+/* */ private int _state;
+/* */ private WorldServer _ws;
+/* */ private static int _debugLevel;
+/* */
+/* */ static
+/* */ {
+/* */ try
+/* */ {
+/* 28 */ _debugLevel = Integer.parseInt(IniFile.gamma().getIniString(
+/* 29 */ "netdebug", "0"));
+/* */ } catch (NumberFormatException e) {
+/* 31 */ _debugLevel = 0;
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */ public SMState(WorldServer ws, int state)
+/* */ {
+/* 39 */ this._state = state;
+/* 40 */ this._ws = ws;
+/* */ }
+/* */
+/* */ public int getState() {
+/* 44 */ return this._state;
+/* */ }
+/* */
+/* */ public synchronized void setState(int state)
+/* */ {
+/* 49 */ if ((_debugLevel & 0x8) > 0) {
+/* 50 */ synchronized (System.out) {
+/* 51 */ System.out.println(this._ws + ": *** new state: " + state);
+/* 52 */ if ((_debugLevel & 0x10) > 0)
+/* */ try {
+/* 54 */ throw new InterruptedException();
+/* */ } catch (InterruptedException e) {
+/* 56 */ e.printStackTrace(System.out);
+/* 57 */ System.out
+/* 58 */ .println("******************************");
+/* */ }
+/* */ }
+/* */ }
+/* 62 */ this._state = state;
+/* 63 */ notifyAll();
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public synchronized void waitForState(int state)
+/* */ throws InfiniteWaitException
+/* */ {
+/* 74 */ while (this._state != state) {
+/* */ try {
+/* 76 */ wait();
+/* */ }
+/* */ catch (InterruptedException e)
+/* */ {
+/* 80 */ if (!$assertionsDisabled) throw new AssertionError();
+/* */ }
+/* 82 */ if (this._state == -1) {
+/* 83 */ throw new InfiniteWaitException();
+/* */ }
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\SMState.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file