@Override
	public void readData(byte[] data) {

		String gameData = new String(data);
		String[] parts = gameData.split("\\@");

		String gameState = parts[0];
		String[] properties = gameState.split("\\'");
		// System.out.println("gamestate: " + gameState);
		Tank player1;
		Tank player2;

		if (level != null && level.getPlayers().size() > 1) {
			GameState state = GameState.getInstance();
			int score1 = Integer.parseInt(properties[2]);
			int score2 = Integer.parseInt(properties[0]);
			int life1 = Integer.parseInt(properties[3]);
			int life2 = Integer.parseInt(properties[1]);

			Gun gun1 = Gun.valueOf(properties[4]);
			Gun gun2 = Gun.valueOf(properties[5]);

			String nick1 = properties[6];
			String nick2 = properties[7];
			boolean gameOver = false;
			if(!state.isHost())
			gameOver = Boolean.parseBoolean(properties[8]);
			
			if(gameOver){
				state.setGameOver(gameOver);
				resetSockets();
				return;
			}
			
				
			
			if (!state.isHost()) {

				player2 = GameState.getInstance().players.get(1);
				player2.setScore(score1);
				player2.setLife(life2);
				player2.setCurrentWeapon(gun2);
				state.setPlayer1Nick(nick2);

			} else {
				player2 = GameState.getInstance().players.get(0);
				player2.setScore(score1);
				player2.setLife(life1);
				player2.setCurrentWeapon(gun1);
				state.setPlayer2Nick(nick1);
			}

			// state.setPlayers(level.getPlayers());

		}

		if (data.length > 0 && parts.length>0) {

			onlineLevel.catchResponse(parts[1]);

		}

	}