/** * 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. * * * @author GWLPR Template Updater */ public final class P395_InstanceLoadDistrictInfoAction extends GenericAction { private int charAgent; private short mapID; private byte isExplorable; private int districtAndRegion; private byte language; private byte isObserver; public short getHeader() { return 395; } public void setCharAgent(int newValue) { charAgent = newValue; } public void setMapID(short newValue) { mapID = newValue; } public void setisExplorable(byte newValue) { isExplorable = newValue; } public void setDistrictAndRegion(int newValue) { districtAndRegion = newValue; } public void setLanguage(byte newValue) { language = newValue; } public void setisObserver(byte newValue) { isObserver = newValue; } private int getSize() { return 15; } @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()); buffer.putInt(charAgent); buffer.putShort(mapID); buffer.put(isExplorable); buffer.putInt(districtAndRegion); buffer.put(language); buffer.put(isObserver); } catch (BufferOverflowException e) { return false; } setBuffer(buffer); return true; } }