public final class Msg<T extends ISteamSerializableMessage> extends MsgBase<MsgHdr>
Modifier and Type | Field and Description |
---|---|
private T |
body
The structure body of the message.
|
header, sessionID, sourceJobID, steamID, targetJobID
Constructor and Description |
---|
Msg(Class<T> clazz) |
Msg(Class<T> clazz,
int payloadReserve)
Initializes a new instance of the
Msg class. |
Msg(IPacketMsg msg,
Class<T> clazz)
Initializes a new instance of the
Msg class. |
Msg(MsgBase<MsgHdr> msg,
Class<T> clazz,
int payloadReserve)
Initializes a new instance of the
Msg class. |
Modifier and Type | Method and Description |
---|---|
void |
deSerialize(byte[] data)
Initializes this client message by deserializing the specified data.
|
EMsg |
getMsgType()
Gets the network message type of this client message.
|
int |
getSessionID()
Gets the session id for this client message.
|
JobID |
getSourceJobID()
Gets or sets the target job id for this client message.
|
SteamID |
getSteamID()
Gets the
SteamID for this client message. |
JobID |
getTargetJobID()
Gets or sets the target job id for this client message.
|
boolean |
isProto()
Gets a value indicating whether this client message is protobuf backed.
|
byte[] |
serialize()
serializes this client message instance to a byte array.
|
void |
setSessionID(int sessionID)
Sets the session id for this client message.
|
void |
setSourceJobID(JobID jobID)
Sets the target job id for this client message.
|
void |
setSteamID(SteamID steamID)
Sets the
SteamID for this client message. |
void |
setTargetJobID(JobID jobID)
Sets the target job id for this client message.
|
private T extends ISteamSerializableMessage body
public Msg(Class<T> clazz, int payloadReserve)
Msg
class.
This is a client send constructor.payloadReserve
- The number of bytes to initialize the payload capacity to.public Msg(MsgBase<MsgHdr> msg, Class<T> clazz, int payloadReserve)
Msg
class.
This a reply constructor.msg
- The message that this instance is a reply for.payloadReserve
- The number of bytes to initialize the payload capacity to.public Msg(IPacketMsg msg, Class<T> clazz)
Msg
class.
This is a recieve constructor.msg
- The packet message to build this client message from.public boolean isProto()
public EMsg getMsgType()
public int getSessionID()
public void setSessionID(int sessionID)
public JobID getTargetJobID()
public void setTargetJobID(JobID jobID)
public JobID getSourceJobID()
public void setSourceJobID(JobID jobID)
public byte[] serialize() throws IOException
serialize
in interface IClientMsg
serialize
in class MsgBase<MsgHdr>
IOException
public void deSerialize(byte[] data) throws IOException
deSerialize
in interface IClientMsg
deSerialize
in class MsgBase<MsgHdr>
data
- The data representing a client message.IOException
Copyright © 2012. All Rights Reserved.