Class WrapperLoginServerEncryptionRequest
java.lang.Object
com.github.retrooper.packetevents.wrapper.PacketWrapper<WrapperLoginServerEncryptionRequest>
com.github.retrooper.packetevents.wrapper.login.server.WrapperLoginServerEncryptionRequest
public class WrapperLoginServerEncryptionRequest
extends PacketWrapper<WrapperLoginServerEncryptionRequest>
This packet is sent by the server to the client if the server is in online mode.
If the server is in offline mode, this packet won't be sent,
encryption won't be enabled and no authentication will be performed.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
PacketWrapper.Reader<T>, PacketWrapper.Writer<T>
-
Field Summary
Fields inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
buffer, bufferLock, clientVersion, serverVersion, user
-
Constructor Summary
ConstructorDescriptionWrapperLoginServerEncryptionRequest
(String serverID, byte[] publicKeyBytes, byte[] verifyToken) WrapperLoginServerEncryptionRequest
(String serverID, byte[] publicKeyBytes, byte[] verifyToken, boolean shouldAuthenticate) WrapperLoginServerEncryptionRequest
(String serverID, PublicKey publicKey, byte[] verifyToken) WrapperLoginServerEncryptionRequest
(String serverID, PublicKey publicKey, byte[] verifyToken, boolean shouldAuthenticate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(WrapperLoginServerEncryptionRequest wrapper) The public key is in DER encoding format.byte[]
This is an empty string on the vanilla client.byte[]
The verify token will be encrypted by the client and sent to the server via theWrapperLoginClientEncryptionResponse
packet.boolean
void
read()
void
setPublicKey
(PublicKey publicKey) void
setPublicKeyBytes
(byte[] publicKeyBytes) void
setServerId
(String serverID) void
setShouldAuthenticate
(boolean shouldAuthenticate) void
setVerifyToken
(byte[] verifyToken) void
write()
Methods inherited from class com.github.retrooper.packetevents.wrapper.PacketWrapper
createUniversalPacketWrapper, getBuffer, getChunkKey, getChunkX, getChunkZ, getClientVersion, getMaxMessageLength, getNativePacketId, getPacketId, getPacketTypeData, getRegistryHolder, getServerVersion, limitValue, prepareForSend, prepareForSend, readArray, readBitSet, readBlockPosition, readBoolean, readByte, readByteArray, readByteArray, readByteArrayOfSize, readBytes, readChatTypeBoundNetwork, readCollection, readComponent, readComponentAsJSON, readComponentAsNBT, readComponentJSON, readContainerId, readDimension, readDouble, readEntityMetadata, readEnum, readEnum, readEnumSet, readEvent, readFilterMask, readFloat, readGameMode, readIdentifier, readIdentifier, readInt, readItemStack, readItemStackModern, readKnownPack, readLastSeenMessages, readLastSeenMessagesEntry, readLastSeenMessagesPacked, readLastSeenMessagesUpdate, readLegacyLastSeenMessagesUpdate, readList, readLong, readLongArray, readLongArray, readMap, readMappedEntity, readMappedEntity, readMappedEntityOrDirect, readMappedEntityOrDirect, readMedium, readMerchantOffer, readMessageSignature, readMessageSignaturePacked, readMultiVersional, readNBT, readNBTRaw, readNode, readNullableVarInt, readOptional, readPresentItemStack, readPublicKey, readPublicProfileKey, readRemainingBytes, readRemoteChatSession, readRotation, readSaltSignature, readShort, readSignatureData, readSignedCommandArguments, readString, readString, readStyle, readTimestamp, readUnlimitedNBT, readUnlimitedNBTRaw, readUnsignedByte, readUnsignedShort, readUUID, readVarInt, readVarIntArray, readVarIntArrayOfSize, readVarLong, readVarShort, readVillagerData, readWorldBlockPosition, resetBuffer, resetByteBuf, setBuffer, setClientVersion, setNativePacketId, setPacketId, setServerVersion, writeArray, writeBitSet, writeBlockPosition, writeBoolean, writeByte, writeByteArray, writeByteArrayOfSize, writeBytes, writeChatTypeBoundNetwork, writeCollection, writeComponent, writeComponentAsJSON, writeComponentAsNBT, writeComponentJSON, writeContainerId, writeDimension, writeDouble, writeEntityMetadata, writeEntityMetadata, writeEnum, writeEnumSet, writeFilterMask, writeFloat, writeGameMode, writeIdentifier, writeIdentifier, writeInt, writeItemStack, writeItemStackModern, writeKnownPack, writeLastMessagesEntry, writeLastSeenMessages, writeLastSeenMessagesPacked, writeLastSeenMessagesUpdate, writeLegacyLastSeenMessagesUpdate, writeList, writeLong, writeLongArray, writeMap, writeMappedEntity, writeMappedEntityOrDirect, writeMedium, writeMerchantOffer, writeMessageSignature, writeMessageSignaturePacked, writeMultiVersional, writeNBT, writeNBTRaw, writeNode, writeNullableVarInt, writeOptional, writePresentItemStack, writePublicKey, writePublicProfileKey, writeRemoteChatSession, writeRotation, writeSaltSignature, writeShort, writeSignatureData, writeSignedCommandArguments, writeString, writeString, writeString, writeStyle, writeTimestamp, writeUUID, writeVarInt, writeVarIntArray, writeVarIntArrayOfSize, writeVarLong, writeVarShort, writeVillagerData, writeWorldBlockPosition
-
Constructor Details
-
WrapperLoginServerEncryptionRequest
-
WrapperLoginServerEncryptionRequest
-
WrapperLoginServerEncryptionRequest
-
WrapperLoginServerEncryptionRequest
public WrapperLoginServerEncryptionRequest(String serverID, byte[] publicKeyBytes, byte[] verifyToken) -
WrapperLoginServerEncryptionRequest
public WrapperLoginServerEncryptionRequest(String serverID, byte[] publicKeyBytes, byte[] verifyToken, boolean shouldAuthenticate)
-
-
Method Details
-
read
public void read()- Overrides:
read
in classPacketWrapper<WrapperLoginServerEncryptionRequest>
-
write
public void write()- Overrides:
write
in classPacketWrapper<WrapperLoginServerEncryptionRequest>
-
copy
- Overrides:
copy
in classPacketWrapper<WrapperLoginServerEncryptionRequest>
-
getServerId
This is an empty string on the vanilla client. (1.7.10 and above)- Returns:
- Server ID
-
setServerId
-
getPublicKeyBytes
public byte[] getPublicKeyBytes() -
setPublicKeyBytes
public void setPublicKeyBytes(byte[] publicKeyBytes) -
getPublicKey
The public key is in DER encoding format. More technically, it is in ASN.1 format. The public key will be encrypted by the client and sent to the server via theWrapperLoginClientEncryptionResponse
packet.- Returns:
- Public key
-
setPublicKey
-
getVerifyToken
public byte[] getVerifyToken()The verify token will be encrypted by the client and sent to the server via theWrapperLoginClientEncryptionResponse
packet.- Returns:
- Verify token
-
setVerifyToken
public void setVerifyToken(byte[] verifyToken) -
isShouldAuthenticate
public boolean isShouldAuthenticate() -
setShouldAuthenticate
public void setShouldAuthenticate(boolean shouldAuthenticate)
-