/** * For copyright information see the LICENSE document. */ /** * Auto-generated by PacketCodeGen, on 2012-09-28 */ package com.gamerevision.gwlpr.actions.gameserver.stoc; import com.realityshard.shardlet.utils.GenericAction; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * This is an automatically generated ShardletAction. * It resembles the packet template that has been * parsed from our packet templates xml. * * Auto generated * * @author GWLPR Template Updater */ public final class P406_UnknownAction extends GenericAction { private byte[] unknown1; private int unknown2; private byte unknown3; private short unknown4; private byte unknown5; private int unknown6; public short getHeader() { return 406; } public void setUnknown1(byte[] newValue) { unknown1 = newValue; } public void setUnknown2(int newValue) { unknown2 = newValue; } public void setUnknown3(byte newValue) { unknown3 = newValue; } public void setUnknown4(short newValue) { unknown4 = newValue; } public void setUnknown5(byte newValue) { unknown5 = newValue; } public void setUnknown6(int newValue) { unknown6 = newValue; } private int getSize() { int size = 38; if (unknown1 == null) { return 0; } if (unknown1.length != 24) { return 0; } return size; } @Override public boolean serialize() { int size = getSize(); if (size == 0) { return false; } ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); try { buffer.putShort(getHeader()); for (int i = 0; i < 24; i++) { buffer.put(unknown1[i]); } buffer.putInt(unknown2); buffer.put(unknown3); buffer.putShort(unknown4); buffer.put(unknown5); buffer.putInt(unknown6); } catch (BufferOverflowException e) { return false; } setBuffer(buffer); return true; } }