public void savePlayer(final Player p) {
		final String name = p.getUnformattedName();
		final String pass = p.getHashedPassword();
		final int rights = p.getRights();
		final int x = p.getLocation().getX();
		final int y = p.getLocation().getY();
		final int z = p.getLocation().getZ();
		final int[] looks = p.getLooks().getLooks();
		final int[] colours = p.getLooks().getColours();
		final int gender = p.getLooks().getGender();
		final ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
		buffer.writeShort(x);
		buffer.writeShort(y);
		buffer.writeByte(z);
		for(int i : looks) {
			buffer.writeByte(i);
		}
		for(int i : colours) {
			buffer.writeByte(i);
		}
		buffer.writeByte(gender);
		for(int i = 0; i < Levels.MAX_SKILLS; i++) {
			buffer.writeByte(p.getLevels().getLevel()[i]);
			buffer.writeInt((int)p.getLevels().getXp()[i]);
		}
		for(int i = 0; i < Equipment.SIZE; i++) {
			Item item = p.getEquipment().getContainer().get(i);
			if(item == null) {
				buffer.writeShort(30000);
			} else {
				buffer.writeShort(item.getItemId());
				buffer.writeInt(item.getItemAmount());
			}
		}
		for(int i = 0; i < 28; i++) {
			Item item = p.getInventory().get(i);
			if(item == null) {
				buffer.writeShort(30000);
			} else {
				buffer.writeShort(item.getItemId());
				buffer.writeInt(item.getItemAmount());
			}
		}
		Runnable r = new Runnable() {
			@Override
			public void run() {
				try {
					DatabaseConnection c = DatabaseManager.getSingleton().getConnection("player-loader");
					PreparedStatement s = c.getStatement("SELECT null FROM players WHERE name = '"+ name + "' limit 1");
					PreparedStatement ps = null;
					ResultSet rs = s.executeQuery();
					if (!rs.next()) {
						ps = c.getStatement("INSERT INTO players (name, password, rights, data) VALUES(?, ?, ?, ?)");
						ps.setString(1, name);
						ps.setString(2, pass);
						ps.setInt(3, rights);
						ps.setBytes(4, buffer.array());
					} else {
						ps = c.getStatement(
						"UPDATE players SET data = ? WHERE name = ?");
						ps.setObject(1, buffer.array());
						ps.setString(2, name);
					}
					ps.executeUpdate();
				} catch(Exception e) {
					e.printStackTrace();
				}
			}
		};
		getWorkerPool().submit(r);
	}