Record Class PacketPayload.SessionConfig
java.lang.Object
java.lang.Record
com.quietterminal.neon.core.PacketPayload.SessionConfig
- All Implemented Interfaces:
PacketPayload
- Enclosing interface:
PacketPayload
public static record PacketPayload.SessionConfig(byte version, short tickRate, short maxPacketSize)
extends Record
implements PacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface PacketPayload
PacketPayload.Ack, PacketPayload.ConnectAccept, PacketPayload.ConnectDeny, PacketPayload.ConnectRequest, PacketPayload.DisconnectNotice, PacketPayload.GamePacket, PacketPayload.HostRegister, PacketPayload.PacketTypeEntry, PacketPayload.PacketTypeRegistry, PacketPayload.Ping, PacketPayload.Pong, PacketPayload.ReconnectRequest, PacketPayload.SessionConfig -
Field Summary
Fields inherited from interface PacketPayload
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH, MAX_PACKET_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionSessionConfig(byte version, short tickRate, short maxPacketSize) Creates an instance of aSessionConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static PacketPayload.SessionConfigfromBytes(byte[] data) final inthashCode()Returns a hash code value for this object.shortReturns the value of themaxPacketSizerecord component.shorttickRate()Returns the value of thetickRaterecord component.byte[]toBytes()final StringtoString()Returns a string representation of this record class.byteversion()Returns the value of theversionrecord component.
-
Constructor Details
-
SessionConfig
public SessionConfig(byte version, short tickRate, short maxPacketSize) Creates an instance of aSessionConfigrecord class.- Parameters:
version- the value for theversionrecord componenttickRate- the value for thetickRaterecord componentmaxPacketSize- the value for themaxPacketSizerecord component
-
-
Method Details
-
toBytes
public byte[] toBytes()- Specified by:
toBytesin interfacePacketPayload
-
fromBytes
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
version
public byte version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
tickRate
public short tickRate()Returns the value of thetickRaterecord component.- Returns:
- the value of the
tickRaterecord component
-
maxPacketSize
public short maxPacketSize()Returns the value of themaxPacketSizerecord component.- Returns:
- the value of the
maxPacketSizerecord component
-