Package in.dragonbra.javasteam.base
Class ClientGCMsgProtobuf<BodyType extends com.google.protobuf.GeneratedMessageV3.Builder<BodyType>>
- java.lang.Object
-
- in.dragonbra.javasteam.base.AbstractMsgBase
-
- in.dragonbra.javasteam.base.GCMsgBase<MsgGCHdrProtoBuf>
-
- in.dragonbra.javasteam.base.ClientGCMsgProtobuf<BodyType>
-
- Type Parameters:
BodyType- The body type of this message.
- All Implemented Interfaces:
IClientGCMsg
public class ClientGCMsgProtobuf<BodyType extends com.google.protobuf.GeneratedMessageV3.Builder<BodyType>> extends GCMsgBase<MsgGCHdrProtoBuf>
Represents a protobuf backed game coordinator message.
-
-
Field Summary
-
Fields inherited from class in.dragonbra.javasteam.base.AbstractMsgBase
payload
-
-
Constructor Summary
Constructors Constructor Description ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg)Initializes a new instance of theClientGCMsgProtobufclass.ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, int payloadReserve)Initializes a new instance of theClientGCMsgProtobufclass.ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, GCMsgBase<MsgGCHdrProtoBuf> msg)Initializes a new instance of theClientGCMsgProtobufclass.ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, GCMsgBase<MsgGCHdrProtoBuf> msg, int payloadReserve)Initializes a new instance of theClientGCMsgProtobufclass.ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketGCMsg msg)Initializes a new instance of theClientMsgProtobufclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeserialize(byte[] data)Initializes this client message by deserializing the specified data.BodyTypegetBody()intgetMsgType()Gets the network message type of this client message.in.dragonbra.javasteam.protobufs.steamclient.SteammessagesBase.CMsgProtoBufHeader.BuildergetProtoHeader()Shorthand accessor for the protobuf header.JobIDgetSourceJobID()Gets the source job id for this client message.JobIDgetTargetJobID()Gets the target job id for this client message.booleanisProto()Gets a value indicating whether this client message is protobuf backed.byte[]serialize()serializes this client message instance to a byte array.voidsetSourceJobID(JobID jobID)Sets the source job id for this client message.voidsetTargetJobID(JobID jobID)Sets the target job id for this client message.-
Methods inherited from class in.dragonbra.javasteam.base.AbstractMsgBase
getPayload, readByte, readBytes, readDouble, readFloat, readInt, readLong, readNullTermString, readNullTermString, readShort, seek, write, write, write, write, write, write, write, write, write, writeNullTermString, writeNullTermString
-
-
-
-
Constructor Detail
-
ClientGCMsgProtobuf
public ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketGCMsg msg)Initializes a new instance of theClientMsgProtobufclass. This is a client send constructor.- Parameters:
clazz- the type of the bodymsg- The network message type this client message represents.
-
ClientGCMsgProtobuf
public ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg)Initializes a new instance of theClientGCMsgProtobufclass. This is a client send constructor.- Parameters:
clazz- the type of the bodyeMsg- The network message type this client message represents.
-
ClientGCMsgProtobuf
public ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, int payloadReserve)Initializes a new instance of theClientGCMsgProtobufclass. This is a client send constructor.- Parameters:
clazz- the type of the bodyeMsg- The network message type this client message represents.payloadReserve- The number of bytes to initialize the payload capacity to.
-
ClientGCMsgProtobuf
public ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, GCMsgBase<MsgGCHdrProtoBuf> msg)Initializes a new instance of theClientGCMsgProtobufclass. This is a reply constructor.- Parameters:
clazz- the type of the bodyeMsg- The network message type this client message represents.msg- The message that this instance is a reply for.
-
ClientGCMsgProtobuf
public ClientGCMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, int eMsg, GCMsgBase<MsgGCHdrProtoBuf> msg, int payloadReserve)Initializes a new instance of theClientGCMsgProtobufclass. This is a reply constructor.- Parameters:
clazz- the type of the bodyeMsg- The network message type this client message represents.msg- The message that this instance is a reply for.payloadReserve- The number of bytes to initialize the payload capacity to.
-
-
Method Detail
-
isProto
public boolean isProto()
Description copied from interface:IClientGCMsgGets a value indicating whether this client message is protobuf backed.- Returns:
- true if this instance is protobuf backed; otherwise, false.
-
getMsgType
public int getMsgType()
Description copied from interface:IClientGCMsgGets the network message type of this client message.- Returns:
- The message type.
-
getTargetJobID
public JobID getTargetJobID()
Description copied from interface:IClientGCMsgGets the target job id for this client message.- Returns:
- The target job id.
-
setTargetJobID
public void setTargetJobID(JobID jobID)
Description copied from interface:IClientGCMsgSets the target job id for this client message.- Parameters:
jobID- The target job id.
-
getSourceJobID
public JobID getSourceJobID()
Description copied from interface:IClientGCMsgGets the source job id for this client message.- Returns:
- The source job id.
-
setSourceJobID
public void setSourceJobID(JobID jobID)
Description copied from interface:IClientGCMsgSets the source job id for this client message.- Parameters:
jobID- The source job id.
-
serialize
public byte[] serialize()
Description copied from interface:IClientGCMsgserializes this client message instance to a byte array.- Returns:
- Data representing a client message.
-
deserialize
public void deserialize(byte[] data)
Description copied from interface:IClientGCMsgInitializes this client message by deserializing the specified data.- Parameters:
data- The data representing a client message.
-
getProtoHeader
public in.dragonbra.javasteam.protobufs.steamclient.SteammessagesBase.CMsgProtoBufHeader.Builder getProtoHeader()
Shorthand accessor for the protobuf header.- Returns:
- the protobuf header
-
getBody
public BodyType getBody()
- Returns:
- the body structure of this message
-
-