@Override
	public void update(double time_difference) {
		// TODO Auto-generated method stub
		if(host.ip != null){
			clientIP = host.ip;
			clientName = host.clientName;
			Server server = new Server();
		}else{
			clientIP = null;
			clientName =  null;
		}
		
		switch (connection.getStatus()){
		case STATUS_IDLE: 
			if(host.ip != null){
				connection.connect(host.ip.getHostAddress(), tcpConnection.TCP_PORT);	
			}
			break;
		case STATUS_TRAINING: break;
		case STATUS_ALIVE:
			//advance to multiplayer
			main.closeScene();
			main.setScene(new scn.Multiplayer(main,difficulty,connection,1));
			break;
		case STATUS_FAILED:
			//reset host variables; enable button
			host.ip = null;
			host.clientName = null;
			
			if(buttons != null){
				for (lib.ButtonText button : buttons) {
					button.setAvailability(true);
				}
			}
			connection = new tcpConnection(true);
			break;
		}
	}