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() );
|
||||
|
||||
stream.write( handshake );
|
||||
stream.write( new PacketCDClientStatus( (byte) 0 ) );
|
||||
stream.write( PacketCDClientStatus.CLIENT_LOGIN );
|
||||
stream.readPacket();
|
||||
|
||||
byte[] loginResponse = stream.readPacket();
|
||||
|
@ -64,7 +64,7 @@ public abstract class DefinedPacket implements DataInput, DataOutput
|
||||
*/
|
||||
public byte[] getPacket()
|
||||
{
|
||||
return packet == null ? out.toByteArray() : packet;
|
||||
return packet == null ? packet = out.toByteArray() : packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,6 +8,8 @@ import lombok.ToString;
|
||||
public class PacketCDClientStatus extends DefinedPacket
|
||||
{
|
||||
|
||||
public static PacketCDClientStatus CLIENT_LOGIN = new PacketCDClientStatus( (byte) 0 );
|
||||
|
||||
/**
|
||||
* Sent from the client to the server upon respawn,
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user