@Override
	public void serialize(IoBuffer buf) {
		IoBufferUtils.putRS2String(buf, NameUtils.formatName(name));
		IoBufferUtils.putRS2String(buf, password);
		buf.put((byte) rights.toInteger());
		buf.put((byte) (members ? 1 : 0));
		buf.putShort((short) getLocation().getX());
		buf.putShort((short) getLocation().getY());
		buf.put((byte) getLocation().getZ());
		final int[] look = appearance.getLook();
		for (int i = 0; i < 13; i++) {
			buf.put((byte) look[i]);
		}
		for (int i = 0; i < Equipment.SIZE; i++) {
			final Item item = equipment.get(i);
			if (item == null) {
				buf.putShort((short) 65535);
			} else {
				buf.putShort((short) item.getId());
				buf.putInt(item.getCount());
			}
		}
		for (int i = 0; i < Skills.SKILL_COUNT; i++) {
			buf.put((byte) skills.getLevel(i));
			buf.putDouble(skills.getExperience(i));
		}
		for (int i = 0; i < Inventory.SIZE; i++) {
			final Item item = inventory.get(i);
			if (item == null) {
				buf.putShort((short) 65535);
			} else {
				buf.putShort((short) item.getId());
				buf.putInt(item.getCount());
			}
		}
		for (int i = 0; i < Bank.SIZE; i++) {
			final Item item = bank.get(i);
			if (item == null) {
				buf.putShort((short) 65535);
			} else {
				buf.putShort((short) item.getId());
				buf.putInt(item.getCount());
			}
		}
	}