Cache the client status packet.
This commit is contained in:
parent
b946e376c7
commit
9e2eda672d
@ -49,7 +49,7 @@ public class ServerConnection extends GenericConnection implements Server
|
|||||||
PacketStream stream = new PacketStream( socket.getInputStream(), socket.getOutputStream() );
|
PacketStream stream = new PacketStream( socket.getInputStream(), socket.getOutputStream() );
|
||||||
|
|
||||||
stream.write( handshake );
|
stream.write( handshake );
|
||||||
stream.write( new PacketCDClientStatus( (byte) 0 ) );
|
stream.write( PacketCDClientStatus.CLIENT_LOGIN );
|
||||||
stream.readPacket();
|
stream.readPacket();
|
||||||
|
|
||||||
byte[] loginResponse = stream.readPacket();
|
byte[] loginResponse = stream.readPacket();
|
||||||
|
@ -64,7 +64,7 @@ public abstract class DefinedPacket implements DataInput, DataOutput
|
|||||||
*/
|
*/
|
||||||
public byte[] getPacket()
|
public byte[] getPacket()
|
||||||
{
|
{
|
||||||
return packet == null ? out.toByteArray() : packet;
|
return packet == null ? packet = out.toByteArray() : packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -8,6 +8,8 @@ import lombok.ToString;
|
|||||||
public class PacketCDClientStatus extends DefinedPacket
|
public class PacketCDClientStatus extends DefinedPacket
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static PacketCDClientStatus CLIENT_LOGIN = new PacketCDClientStatus( (byte) 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sent from the client to the server upon respawn,
|
* Sent from the client to the server upon respawn,
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user