Advertisement
Guest User

Untitled

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