Skip to main content
Version: 15.x (API 15) [Current]

Class Payload

This class represents a parsed SeString payload.

Assembly: Dalamud.dll​
Declaration
public abstract class Payload

Derived:

Expand

Properties​

Type​

Gets the type of this payload.

Declaration
public abstract PayloadType Type { get; }

Dirty​

Gets or sets a value indicating whether whether this payload has been modified since the last Encode().

Declaration
public bool Dirty { get; protected set; }

Fields​

START_BYTE​

The start byte of a payload.

Declaration
protected const byte START_BYTE = 2

END_BYTE​

The end byte of a payload.

Declaration
protected const byte END_BYTE = 3

Methods​

Decode(BinaryReader)​

Decodes a binary representation of a payload into its corresponding nice object payload.

Declaration
public static Payload Decode(BinaryReader reader)
Returns​

Dalamud.Game.Text.SeStringHandling.Payload: The constructed Payload-derived object that was decoded from the binary data.

Parameters​
TypeNameDescription
System.IO.BinaryReaderreaderA reader positioned at the start of the payload, and containing at least one entire payload.

Encode(bool)​

Encode this payload object into a byte[] useable in-game for things like the chat log.

Declaration
public byte[] Encode(bool force = false)
Returns​

System.Byte[]: A byte[] suitable for use with in-game handlers such as the chat log.

Parameters​
TypeNameDescription
System.BooleanforceIf true, ignores any cached value and forcibly reencodes the payload from its internal representation.

EncodeImpl()​

Encodes the internal state of this payload into a byte[] suitable for sending to in-game handlers such as the chat log.

Declaration
protected abstract byte[] EncodeImpl()
Returns​

System.Byte[]: Encoded binary payload data suitable for use with in-game handlers.

DecodeImpl(BinaryReader, long)​

Decodes a byte stream from the game into a payload object.

Declaration
protected abstract void DecodeImpl(BinaryReader reader, long endOfStream)
Parameters​
TypeNameDescription
System.IO.BinaryReaderreaderA BinaryReader containing at least all the data for this payload.
System.Int64endOfStreamThe location holding the end of the data for this payload.

GetInteger(BinaryReader)​

Retrieve the packed integer from SE's native data format.

Declaration
protected static uint GetInteger(BinaryReader input)
Returns​

System.UInt32: An integer.

Parameters​
TypeNameDescription
System.IO.BinaryReaderinputThe BinaryReader instance.

MakeInteger(uint)​

Create a packed integer in Se's native data format.

Declaration
protected static byte[] MakeInteger(uint value)
Returns​

System.Byte[]: A packed integer.

Parameters​
TypeNameDescription
System.UInt32valueThe value to pack.

GetPackedIntegers(BinaryReader)​

From a binary packed integer, get the high and low bytes.

Declaration
protected static (uint High, uint Low) GetPackedIntegers(BinaryReader input)
Returns​

System.ValueTuple<System.UInt32,System.UInt32>: The high and low bytes.

Parameters​
TypeNameDescription
System.IO.BinaryReaderinputThe BinaryReader instance.

MakePackedInteger(uint, uint)​

Create a packed integer from the given high and low bytes.

Declaration
protected static byte[] MakePackedInteger(uint high, uint low)
Returns​

System.Byte[]: A packed integer.

Parameters​
TypeNameDescription
System.UInt32highThe high order bytes.
System.UInt32lowThe low order bytes.