/** * For copyright information see the LICENSE document. */ /** * Auto-generated by PacketCodeGen, on 2012-09-28 */ package com.gamerevision.gwlpr.actions.loginserver.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 P003_StreamTerminatorAction extends GenericAction { private int loginCount; private int errorCode; public short getHeader() { return 3; } public void setLoginCount(int newValue) { loginCount = newValue; } public void setErrorCode(int newValue) { errorCode = newValue; } private int getSize() { return 10; } @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(loginCount); buffer.putInt(errorCode); } catch (BufferOverflowException e) { return false; } setBuffer(buffer); return true; } }