Class Payload
This class represents a parsed SeString payload.
Assembly: Dalamud.dll
View Source
public abstract class Payload
Derived:
Expand
Dalamud.Game.Text.SeStringHandling.Payloads.AutoTranslatePayload, Dalamud.Game.Text.SeStringHandling.Payloads.DalamudLinkPayload, Dalamud.Game.Text.SeStringHandling.Payloads.EmphasisItalicPayload, Dalamud.Game.Text.SeStringHandling.Payloads.IconPayload, Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload, Dalamud.Game.Text.SeStringHandling.Payloads.MapLinkPayload, Dalamud.Game.Text.SeStringHandling.Payloads.NewLinePayload, Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload, Dalamud.Game.Text.SeStringHandling.Payloads.PlayerPayload, Dalamud.Game.Text.SeStringHandling.Payloads.QuestPayload, Dalamud.Game.Text.SeStringHandling.Payloads.RawPayload, Dalamud.Game.Text.SeStringHandling.Payloads.SeHyphenPayload, Dalamud.Game.Text.SeStringHandling.Payloads.StatusPayload, Dalamud.Game.Text.SeStringHandling.Payloads.TextPayload, Dalamud.Game.Text.SeStringHandling.Payloads.UIForegroundPayload, Dalamud.Game.Text.SeStringHandling.Payloads.UIGlowPayload
Properties
Type
Gets the type of this payload.
View Source
public abstract PayloadType Type { get; }
Dirty
Gets or sets a value indicating whether whether this payload has been modified since the last Encode().
View Source
public bool Dirty { get; protected set; }
DataResolver
Gets the Lumina instance to use for any necessary data lookups.
View Source
[JsonIgnore]
protected IDataManager DataResolver { get; }
Fields
START_BYTE
The start byte of a payload.
View Source
protected const byte START_BYTE = 2
END_BYTE
The end byte of a payload.
View Source
protected const byte END_BYTE = 3
Methods
Decode(BinaryReader)
Decodes a binary representation of a payload into its corresponding nice object payload.
View Source
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
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | reader | A 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.
View Source
public byte[] Encode(bool force = false)
Returns
System.Byte[]
: A byte[] suitable for use with in-game handlers such as the chat log.
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | force | If 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.
View Source
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.
View Source
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. |
GetInteger(BinaryReader)
Retrieve the packed integer from SE's native data format.
View Source
protected static uint GetInteger(BinaryReader input)
Returns
System.UInt32
: An integer.
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | input | The BinaryReader instance. |
MakeInteger(uint)
Create a packed integer in Se's native data format.
View Source
protected static byte[] MakeInteger(uint value)
Returns
System.Byte[]
: A packed integer.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value to pack. |
GetPackedIntegers(BinaryReader)
From a binary packed integer, get the high and low bytes.
View Source
protected static (uint High, uint Low) GetPackedIntegers(BinaryReader input)
Returns
System.ValueTuple<System.UInt32,System.UInt32>
: The high and low bytes.
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | input | The BinaryReader instance. |
MakePackedInteger(uint, uint)
Create a packed integer from the given high and low bytes.
View Source
protected static byte[] MakePackedInteger(uint high, uint low)
Returns
System.Byte[]
: A packed integer.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | high | The high order bytes. |
System.UInt32 | low | The low order bytes. |