private void decodeLobbyLogin(InputStream buffer) {

		int clientRev = buffer.readInt();
		int rsaBlockSize = buffer.readShort(); // RSA block size
		int rsaHeaderKey = buffer.readByte(); // RSA header key
		System.out.println(" " + rsaBlockSize + " " + rsaHeaderKey + " "
				+ clientRev);

		int[] loginKeys = new int[4];
		for (int data = 0; data < 4; data++) {
			loginKeys[data] = buffer.readInt();
		}
		buffer.readLong();
		String pass = buffer.readString();
		@SuppressWarnings("unused")
		long serverSeed = buffer.readLong();
		@SuppressWarnings("unused")
		long clientSeed = buffer.readLong();

		buffer.decodeXTEA(loginKeys, buffer.getOffset(), buffer.getLength());
		String name = buffer.readString();
		boolean isHD = buffer.readByte() == 1;
		boolean isResizable = buffer.readByte() == 1;
		System.out.println("  Is resizable? " + isResizable);
		for (int i = 0; i < 24; i++)
			buffer.readByte();
		String settings = buffer.readString();

		@SuppressWarnings("unused")
		int unknown = buffer.readInt();
		int[] crcValues = new int[35];
		for (int i = 0; i < crcValues.length; i++)
			crcValues[i] = buffer.readInt();
		System.out.println(name + ", " + pass);
		Player player;

		if (!SerializableFilesManager.containsPlayer(name)) {
			player = new Player(name);
			player.setPassword(pass);

			// session.getLoginPackets().sendClientPacket(2);
			// return;
		} else {
			player = SerializableFilesManager.loadPlayer(name);
			if (player == null) {
				session.getLoginPackets().sendClientPacket(20);
				return;
			}
			if (!player.getPassword().equals(pass)) {
				session.getLoginPackets().sendClientPacket(3);
				return;
			}
		}
		if (player.isPermBanned()
				|| (player.getBanned() > System.currentTimeMillis()))
			session.getLoginPackets().sendClientPacket(4);
		else {
			player.init(session, name);
			session.getLoginPackets().sendLobbyDetails(player);// sendLoginDetails(player);
			session.setDecoder(3, player);
			session.setEncoder(2, player);
			SerializableFilesManager.savePlayer(player);

			// player.start();
		}
	}