Paper/src/main/java/net/minecraft/server/Packet2Handshake.java

47 Zeilen
1.2 KiB
Java

2012-07-29 09:33:13 +02:00
package net.minecraft.server;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException; // CraftBukkit
public class Packet2Handshake extends Packet {
private int a;
private String b;
public String c; // CraftBukkit private -> public
public int d; // CraftBukkit private -> public
2012-07-29 09:33:13 +02:00
public Packet2Handshake() {}
public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit - throws IOException
this.a = datainputstream.readByte();
this.b = a(datainputstream, 16);
this.c = a(datainputstream, 255);
this.d = datainputstream.readInt();
}
public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException
dataoutputstream.writeByte(this.a);
a(this.b, dataoutputstream);
a(this.c, dataoutputstream);
dataoutputstream.writeInt(this.d);
}
2012-12-20 05:03:52 +01:00
public void handle(Connection connection) {
connection.a(this);
2012-07-29 09:33:13 +02:00
}
public int a() {
return 3 + 2 * this.b.length();
}
public int d() {
return this.a;
}
public String f() {
return this.b;
}
}