Advertisement
Guest User

HelloPacket

a guest
Mar 5th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.72 KB | None | 0 0
  1. package realmrelay.packets.client;
  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 HelloPacket extends Packet
  11. {
  12.     public String buildVersion;
  13.     public int gameId;
  14.     public String guid;
  15.     public int randomInt1;
  16.     public String password;
  17.     public int randomInt2;
  18.     public String secret;
  19.     public int keyTime;
  20.     public byte[] key = new byte[0];
  21.     public String obf1;
  22.     public String obf2;
  23.     public String obf3;
  24.     public String obf4;
  25.     public String obf5;
  26.     public String obf6;
  27.     public String obf7;
  28.  
  29.     @Override
  30.     public void parseFromInput(DataInput in) throws IOException
  31.     {
  32.     this.buildVersion = in.readUTF();
  33.     this.gameId = in.readInt();
  34.     this.guid = in.readUTF();
  35.     this.randomInt1 = in.readInt();
  36.     this.password = in.readUTF();
  37.     this.randomInt2 = in.readInt();
  38.     this.secret = in.readUTF();
  39.     this.keyTime = in.readInt();
  40.     this.key = new byte[in.readShort()];
  41.     in.readFully(this.key);
  42.     this.obf1 = in.readUTF();
  43.     this.obf2 = in.readUTF();
  44.     this.obf3 = in.readUTF();
  45.     this.obf4 = in.readUTF();
  46.     this.obf5 = in.readUTF();
  47.     this.obf6 = in.readUTF();
  48.     this.obf7 = in.readUTF();
  49.     }
  50.  
  51.     @Override
  52.    
  53.     public void writeToOutput(DataOutput out) throws IOException {
  54.     out.writeUTF(this.buildVersion);
  55.     out.writeInt(this.gameId);
  56.     out.writeUTF(this.guid);
  57.     out.writeInt(randomInt1);
  58.     out.writeUTF(this.password);
  59.     out.writeInt(randomInt2);
  60.     out.writeUTF(this.secret);
  61.     out.writeInt(this.keyTime);
  62.     out.writeShort(this.key.length);
  63.     out.write(this.key);
  64.     out.writeUTF(this.obf1);
  65.     out.writeUTF(this.obf2);
  66.     out.writeUTF(this.obf3);
  67.     out.writeUTF(this.obf4);
  68.     out.writeUTF(this.obf5);
  69.     out.writeUTF(this.obf6);
  70.     out.writeUTF(this.obf7);
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement