public void joinGame(final String adr) {

		client = null;
		TimerTask acceptLoop = new TimerTask() {
			@Override
			public void run() {
				System.out.println("connecting...");
				try {
					client = new Socket(adr, 7227);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					delegate.connectionFailed(e.getLocalizedMessage());
					this.cancel();
					return;
				}
				System.out.println("Connected!");
				
			
				byte[] byteHeader = new byte[5];
				
				
				
				try {
					while(client.getInputStream().available() <5){};
					client.getInputStream().read(byteHeader, 0, 5);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					delegate.connectionFailed(e.getLocalizedMessage());
					this.cancel();
					return;
				}
				int len = Integer.parseInt(new String(byteHeader));
				
				byte[] levelData = new byte[len];
				try {
					
					while(client.getInputStream().available() <len){};
					client.getInputStream().read(levelData, 0, len);
					
				} catch (IOException e) {
					// TODO Auto-generated catch block
					delegate.connectionFailed(e.getLocalizedMessage());
					this.cancel();
					return;
				}
				String levelPaths = new String(levelData);
				String[] paths = levelPaths.split("'");
				delegate.setLevel("./lvl/" +paths[1],"./lvl/" + paths[0]);
				
				this.cancel();
				init();
				// TODO Auto-generated method stub
			}

		};

		Timer timer = new Timer();
		timer.schedule(acceptLoop, 0, 1000);

	}