Class Payload
This class represents a parsed SeString payload.
Inheritance
Inherited Members
Namespace: Dalamud.Game.Text.SeStringHandling
Assembly: Dalamud.dll
Syntax
public abstract class Payload
Fields
| Improve this Doc View SourceEND_BYTE
The end byte of a payload.
Declaration
protected const byte END_BYTE = 3
Field Value
| Type | Description |
|---|---|
| System.Byte |
START_BYTE
The start byte of a payload.
Declaration
protected const byte START_BYTE = 2
Field Value
| Type | Description |
|---|---|
| System.Byte |
Properties
| Improve this Doc View SourceDataResolver
Gets the Lumina instance to use for any necessary data lookups.
Declaration
public DataManager DataResolver { get; }
Property Value
| Type | Description |
|---|---|
| DataManager |
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; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Type
Gets the type of this payload.
Declaration
public abstract PayloadType Type { get; }
Property Value
| Type | Description |
|---|---|
| PayloadType |
Methods
| Improve this Doc View SourceDecode(BinaryReader)
Decodes a binary representation of a payload into its corresponding nice object payload.
Declaration
public static Payload Decode(BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.BinaryReader | reader | A reader positioned at the start of the payload, and containing at least one entire payload. |
Returns
| Type | Description |
|---|---|
| Payload | The constructed Payload-derived object that was decoded from the binary data. |
DecodeImpl(BinaryReader, Int64)
Decodes a byte stream from the game into a payload object.
Declaration
protected abstract void DecodeImpl(BinaryReader reader, long endOfStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.BinaryReader | reader | A BinaryReader containing at least all the data for this payload. |
| System.Int64 | endOfStream | The location holding the end of the data for this payload. |
Encode(Boolean)
Encode this payload object into a byte[] useable in-game for things like the chat log.
Declaration
public byte[] Encode(bool force = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | force | If true, ignores any cached value and forcibly reencodes the payload from its internal representation. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | A byte[] suitable for use with in-game handlers such as the chat log. |
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
| Type | Description |
|---|---|
| System.Byte[] | Encoded binary payload data suitable for use with in-game handlers. |
GetInteger(BinaryReader)
Retrieve the packed integer from SE's native data format.
Declaration
protected static uint GetInteger(BinaryReader input)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.BinaryReader | input | The BinaryReader instance. |
Returns
| Type | Description |
|---|---|
| System.UInt32 | An integer. |
GetPackedIntegers(BinaryReader)
From a binary packed integer, get the high and low bytes.
Declaration
protected static (uint High, uint Low) GetPackedIntegers(BinaryReader input)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.BinaryReader | input | The BinaryReader instance. |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<System.UInt32, System.UInt32> | The high and low bytes. |
MakeInteger(UInt32)
Create a packed integer in Se's native data format.
Declaration
protected static byte[] MakeInteger(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | value | The value to pack. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | A packed integer. |
MakePackedInteger(UInt32, UInt32)
Create a packed integer from the given high and low bytes.
Declaration
protected static byte[] MakePackedInteger(uint high, uint low)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | high | The high order bytes. |
| System.UInt32 | low | The low order bytes. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | A packed integer. |