Package in.dragonbra.javasteam.base
Class ClientMsgProtobuf<BodyType extends com.google.protobuf.GeneratedMessageV3.Builder<BodyType>>
- java.lang.Object
-
- in.dragonbra.javasteam.base.AbstractMsgBase
-
- in.dragonbra.javasteam.base.MsgBase<MsgHdrProtoBuf>
-
- in.dragonbra.javasteam.base.AClientMsgProtobuf
-
- in.dragonbra.javasteam.base.ClientMsgProtobuf<BodyType>
-
- Type Parameters:
BodyType- The body type of this message.
- All Implemented Interfaces:
IClientMsg
public class ClientMsgProtobuf<BodyType extends com.google.protobuf.GeneratedMessageV3.Builder<BodyType>> extends AClientMsgProtobuf
Represents a protobuf backed client message.
-
-
Field Summary
-
Fields inherited from class in.dragonbra.javasteam.base.AbstractMsgBase
payload
-
-
Constructor Summary
Constructors Constructor Description ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketMsg msg)Initializes a new instance of theClientMsgProtobufclass.ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketMsg msg, int payloadReserve)Initializes a new instance of theClientMsgProtobufclass.ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg)Initializes a new instance of theClientMsgProtobufclass.ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, int payloadReserve)Initializes a new instance of theClientMsgProtobufclass.ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, MsgBase<MsgHdrProtoBuf> msg)Initializes a new instance of theClientMsgProtobufclass.ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, MsgBase<MsgHdrProtoBuf> msg, int payloadReserve)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()byte[]serialize()serializes this client message instance to a byte array.voidsetBody(BodyType _body)Sets the body of this message.-
Methods inherited from class in.dragonbra.javasteam.base.AClientMsgProtobuf
getMsgType, getProtoHeader, getSessionID, getSourceJobID, getSteamID, getTargetJobID, isProto, setSessionID, setSourceJobID, setSteamID, setTargetJobID
-
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
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketMsg 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.
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, IPacketMsg msg, int payloadReserve)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.payloadReserve- The number of bytes to initialize the payload capacity to.
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg)Initializes a new instance of theClientMsgProtobufclass. This is a client send constructor.- Parameters:
clazz- the type of the bodyeMsg- The network message type this client message represents.
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, int payloadReserve)Initializes a new instance of theClientMsgProtobufclass. 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.
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, MsgBase<MsgHdrProtoBuf> msg)Initializes a new instance of theClientMsgProtobufclass. 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.
-
ClientMsgProtobuf
public ClientMsgProtobuf(java.lang.Class<? extends com.google.protobuf.AbstractMessage> clazz, EMsg eMsg, MsgBase<MsgHdrProtoBuf> msg, int payloadReserve)Initializes a new instance of theClientMsgProtobufclass. 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
-
getBody
public BodyType getBody()
- Returns:
- the body structure of this message.
-
setBody
public void setBody(BodyType _body)
Sets the body of this message.- Parameters:
_body- the body structure of this message.
-
serialize
public byte[] serialize()
Description copied from interface:IClientMsgserializes this client message instance to a byte array.- Specified by:
serializein interfaceIClientMsg- Overrides:
serializein classAClientMsgProtobuf- Returns:
- Data representing a client message.
-
deserialize
public void deserialize(byte[] data)
Description copied from interface:IClientMsgInitializes this client message by deserializing the specified data.- Specified by:
deserializein interfaceIClientMsg- Overrides:
deserializein classAClientMsgProtobuf- Parameters:
data- The data representing a client message.
-
-