Advertisement
Guest User

AccountListPacket

a guest
Jul 4th, 2014
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. package realmrelay.packets.server;
  2.  
  3. import java.io.DataInput;
  4. import java.io.DataOutput;
  5. import java.io.IOException;
  6.  
  7. import realmrelay.packets.Packet;
  8.  
  9.  
  10. public class AccountListPacket extends Packet {
  11.    
  12.     public int accountListId;
  13.     public String[] accountIds = new String[0];
  14.         public int lockAction;
  15.  
  16.  
  17. @Override
  18.  
  19.     public void parseFromInput(DataInput in) throws IOException {
  20.         this.accountListId = in.readInt();
  21.         this.accountIds = new String[in.readShort()];
  22.         for (int i = 0; i < this.accountIds.length; i++) {
  23.             this.accountIds[i] = in.readUTF();
  24.         }
  25.                 this.lockAction = in.readInt();
  26.     }
  27.  
  28.  
  29. @Override
  30.  
  31.     public void writeToOutput(DataOutput out) throws IOException {
  32.         out.writeInt(this.accountListId);
  33.         out.writeShort(this.accountIds.length);
  34.         for (String accountId: this.accountIds) {
  35.             out.writeUTF(accountId);
  36.         }
  37.                 out.writeInt(this.lockAction);
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement