Package in.dragonbra.javasteam.base
Class Msg<BodyType extends ISteamSerializableMessage>
- java.lang.Object
-
- in.dragonbra.javasteam.base.AbstractMsgBase
-
- in.dragonbra.javasteam.base.MsgBase<MsgHdr>
-
- in.dragonbra.javasteam.base.Msg<BodyType>
-
- All Implemented Interfaces:
IClientMsg
public class Msg<BodyType extends ISteamSerializableMessage> extends MsgBase<MsgHdr>
Represents a struct backed message without session or client info.
-
-
Field Summary
-
Fields inherited from class in.dragonbra.javasteam.base.AbstractMsgBase
payload
-
-
Constructor Summary
Constructors Constructor Description Msg(java.lang.Class<? extends BodyType> bodyType)Initializes a new instance of theMsgclass.Msg(java.lang.Class<? extends BodyType> bodyType, int payloadReserve)Initializes a new instance of theMsgclass.Msg(java.lang.Class<? extends BodyType> bodyType, IPacketMsg msg)Initializes a new instance of theMsgclass.Msg(java.lang.Class<? extends BodyType> bodyType, MsgBase<MsgHdr> msg)Initializes a new instance of theMsgclass.Msg(java.lang.Class<? extends BodyType> bodyType, MsgBase<MsgHdr> msg, int payloadReserve)Initializes a new instance of theMsgclass.
-
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()EMsggetMsgType()Gets the network message type of this client message.intgetSessionID()Gets the session id for this client message.JobIDgetSourceJobID()Gets the source job id for this client message.SteamIDgetSteamID()Gets theSteamIDfor 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.voidsetSessionID(int sessionID)Sets the session id for this client message.voidsetSourceJobID(JobID jobID)Sets the source job id for this client message.voidsetSteamID(SteamID steamID)Sets theSteamIDfor 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
-
Msg
public Msg(java.lang.Class<? extends BodyType> bodyType)
Initializes a new instance of theMsgclass.- Parameters:
bodyType- body type
-
Msg
public Msg(java.lang.Class<? extends BodyType> bodyType, int payloadReserve)
Initializes a new instance of theMsgclass.- Parameters:
bodyType- body typepayloadReserve- The number of bytes to initialize the payload capacity to.
-
Msg
public Msg(java.lang.Class<? extends BodyType> bodyType, MsgBase<MsgHdr> msg)
Initializes a new instance of theMsgclass. This a reply constructor.- Parameters:
bodyType- body typemsg- The message that this instance is a reply for.
-
Msg
public Msg(java.lang.Class<? extends BodyType> bodyType, MsgBase<MsgHdr> msg, int payloadReserve)
Initializes a new instance of theMsgclass. This a reply constructor.- Parameters:
bodyType- body typemsg- The message that this instance is a reply for.payloadReserve- The number of bytes to initialize the payload capacity to.
-
Msg
public Msg(java.lang.Class<? extends BodyType> bodyType, IPacketMsg msg)
Initializes a new instance of theMsgclass. This a receive constructor.- Parameters:
bodyType- body typemsg- The packet message to build this client message from.
-
-
Method Detail
-
isProto
public boolean isProto()
Description copied from interface:IClientMsgGets a value indicating whether this client message is protobuf backed.- Returns:
- true if this instance is protobuf backed; otherwise, false.
-
getMsgType
public EMsg getMsgType()
Description copied from interface:IClientMsgGets the network message type of this client message.- Returns:
- The message type.
-
getSessionID
public int getSessionID()
Description copied from interface:IClientMsgGets the session id for this client message.- Returns:
- The session id.
-
setSessionID
public void setSessionID(int sessionID)
Description copied from interface:IClientMsgSets the session id for this client message.- Parameters:
sessionID- The session id.
-
getSteamID
public SteamID getSteamID()
Description copied from interface:IClientMsgGets theSteamIDfor this client message.- Returns:
- The
SteamID.
-
setSteamID
public void setSteamID(SteamID steamID)
Description copied from interface:IClientMsgSets theSteamIDfor this client message.- Parameters:
steamID- TheSteamID.
-
getTargetJobID
public JobID getTargetJobID()
Description copied from interface:IClientMsgGets the target job id for this client message.- Returns:
- The target job id.
-
setTargetJobID
public void setTargetJobID(JobID jobID)
Description copied from interface:IClientMsgSets the target job id for this client message.- Parameters:
jobID- The target job id.
-
getSourceJobID
public JobID getSourceJobID()
Description copied from interface:IClientMsgGets the source job id for this client message.- Returns:
- The source job id.
-
setSourceJobID
public void setSourceJobID(JobID jobID)
Description copied from interface:IClientMsgSets the source job id for this client message.- Parameters:
jobID- The source job id.
-
serialize
public byte[] serialize()
Description copied from interface:IClientMsgserializes this client message instance to a byte array.- 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.- Parameters:
data- The data representing a client message.
-
getBody
public BodyType getBody()
-
-