package NET.worlds.network; import NET.worlds.core.IniFile; class SMState { private int _state; private WorldServer _ws; private static int _debugLevel; static { try { _debugLevel = Integer.parseInt(IniFile.gamma().getIniString("netdebug", "0")); } catch (NumberFormatException var1) { _debugLevel = 0; } } public SMState(WorldServer ws, int state) { this._state = state; this._ws = ws; } public int getState() { return this._state; } public synchronized void setState(int state) { if ((_debugLevel & 8) > 0) { synchronized (System.out) { System.out.println(this._ws + ": *** new state: " + state); if ((_debugLevel & 16) > 0) { try { throw new InterruptedException(); } catch (InterruptedException var4) { var4.printStackTrace(System.out); System.out.println("******************************"); } } } } this._state = state; this.notifyAll(); } public synchronized void waitForState(int state) throws InfiniteWaitException { while (this._state != state) { try { this.wait(); } catch (InterruptedException var3) { assert false; } if (this._state == -1) { throw new InfiniteWaitException(); } } } }