Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 64 lines 1.6 kB view raw
1package net.minecraft.server; 2 3import java.io.DataInputStream; 4import java.io.DataOutputStream; 5import java.io.IOException; 6 7public class Packet1Login extends Packet { 8 9 public int a; 10 public String name; 11 public long c; 12 public byte d; 13 14 public Packet1Login() { 15 } 16 17 public Packet1Login(String s, int i, long j, byte b0) { 18 this.name = s; 19 this.a = i; 20 this.c = j; 21 this.d = b0; 22 } 23 24 public void a(DataInputStream datainputstream) throws IOException { 25 this.a = this.pvn = datainputstream.readInt(); 26 // uberbukkit start 27 if (this.pvn >= 11) { 28 this.name = a(datainputstream, 16); 29 } else { 30 this.name = datainputstream.readUTF(); 31 datainputstream.readUTF(); 32 } 33 34 if (this.pvn >= 3) { 35 this.c = datainputstream.readLong(); 36 this.d = datainputstream.readByte(); 37 } 38 // uberbukkit end 39 } 40 41 public void a(DataOutputStream dataoutputstream) throws IOException { 42 dataoutputstream.writeInt(this.a); 43 // uberbukkit 44 if (this.pvn >= 11) { 45 a(this.name, dataoutputstream); 46 } else { 47 dataoutputstream.writeUTF(this.name); 48 dataoutputstream.writeUTF(""); 49 } 50 51 if (this.pvn >= 3) { 52 dataoutputstream.writeLong(this.c); 53 dataoutputstream.writeByte(this.d); 54 } 55 } 56 57 public void a(NetHandler nethandler) { 58 nethandler.a(this); 59 } 60 61 public int a() { 62 return 4 + this.name.length() + 4 + (this.pvn >= 3 ? 5 : 0); // uberbukkit 63 } 64}