Record Class PacketPayload.ConnectRequest
java.lang.Object
java.lang.Record
com.quietterminal.neon.core.PacketPayload.ConnectRequest
- All Implemented Interfaces:
PacketPayload
- Enclosing interface:
PacketPayload
public static record PacketPayload.ConnectRequest(byte clientVersion, String name, int sessionId, int gameId)
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
ConstructorsConstructorDescriptionConnectRequest(byte clientVersion, String name, int sessionId, int gameId) Creates an instance of aConnectRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyteReturns the value of theclientVersionrecord component.final booleanIndicates whether some other object is "equal to" this one.static PacketPayload.ConnectRequestfromBytes(byte[] data) intgameId()Returns the value of thegameIdrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intReturns the value of thesessionIdrecord component.byte[]toBytes()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectRequest
Creates an instance of aConnectRequestrecord class.- Parameters:
clientVersion- the value for theclientVersionrecord componentname- the value for thenamerecord componentsessionId- the value for thesessionIdrecord componentgameId- the value for thegameIdrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
clientVersion
public byte clientVersion()Returns the value of theclientVersionrecord component.- Returns:
- the value of the
clientVersionrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
sessionId
public int sessionId()Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
gameId
public int gameId()Returns the value of thegameIdrecord component.- Returns:
- the value of the
gameIdrecord component
-