@Override public void update(Connection c) { int state = c.getState(); World w = currentWorld.getWorld(); if (state == Connection.STATE_DISCONNECTED) { notifyStatusListeners( Messages.getInstance() .getString("T_CONNECTION_LOST", c.getRemoteAddress().toString())); // $NON-NLS-1$ w.removeAgent(c.getInCorridor()); w.removeAgent(c.getOutCorridor()); removeConnection(c); } else if (state == Connection.STATE_CONNECTED) { w.addAgent(c.getInCorridor(), null); w.addAgent(c.getOutCorridor(), null); notifyStatusListeners( Messages.getInstance() .getString( "T_CONNECTION_STABLISHED", c.getRemoteAddress().toString())); // $NON-NLS-1$ } }