/** * For copyright information see the LICENSE document. */ /** * Auto-generated by PacketCodeGen, on 2012-09-28 */ package com.gamerevision.gwlpr.actions.loginserver.ctos; import com.realityshard.shardlet.EventAggregator; import com.realityshard.shardlet.utils.GenericTriggerableAction; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; /** * 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 P001_ComputerUserAction extends GenericTriggerableAction { private char[] userName; private char[] computerName; public short getHeader() { return 1; } public char[] getUserName() { return userName; } public char[] getComputerName() { return computerName; } @Override public boolean deserialize() { ByteBuffer buffer = getBuffer(); int bufferPosition = buffer.position(); try { short prefix_userName = buffer.getShort(); userName = new char[prefix_userName]; for (int i = 0; i < prefix_userName; i++) { userName[i] = buffer.getChar(); } short prefix_computerName = buffer.getShort(); computerName = new char[prefix_computerName]; for (int i = 0; i < prefix_computerName; i++) { computerName[i] = buffer.getChar(); } } catch (BufferUnderflowException e) { buffer.position(bufferPosition); return false; } return true; } @Override public void triggerEvent(EventAggregator aggregator) { aggregator.triggerEvent(this); } }