datatypes

package
v3.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ChatFromOpcode          = 0x64
	ChatOpcode              = 0x65
	ChatFromXWorldOpcode    = 0x6F
	FreeCompanyResultOpcode = 0x12C
	ChatXWorldOpcode        = 0x72
)

Opcodes that define the datatypes of incoming network blocks for chat

View Source
const (
	ChatToOpcode           = 0x64
	EgressChatOpcode       = 0x65
	EgressChatXWorldOpcode = 0x6d
)

Opcodes that define the datatypes of outgoing network blocks for chat

View Source
const (
	EgressClientTriggerOpcode = 0x1BE // Updated for 6.38

	EgressChatZoneOpcode = 0x1F2 // Updated for 6.38

	EgressMovementOpcode         = 0x25F // Updated for 6.38
	EgressInstanceMovementOpcode = 0x1A0 // Updated for 6.38

	EgressPerformOpcode    = UndefinedOpcode
	EgressCraftEventOpcode = UndefinedOpcode
)

Opcodes that define the datatypes of outgoing (to server) network blocks

View Source
const (
	EffectResultOpcode  = 0x3B5 // Updated for 6.38
	InitZoneOpcode      = 0x1FE // Updated for 6.38
	ControlOpcode       = 0x2C2 // Updated for 6.38
	ControlSelfOpcode   = 0x256 // Updated for 6.38
	ControlTargetOpcode = 0x1B8 // Updated for 6.38
	RemoveEntityOpcode  = 0x3A2 // Updated for 6.38
	UpdateHPMPTPOpcode  = 0x268 // Updated for 6.38

	ChatZoneOpcode = 0x1E4 // Updated for 6.38

	UpdateStatusesOpcode       = 0x317 // Updated for 6.38
	UpdateStatusesEurekaOpcode = 0x23B // Updated for 6.38
	UpdateStatusesBossOpcode   = 0xC8  // Updated for 6.38

	ActionOpcode      = 0xFB  // Updated for 6.38
	AoEAction8Opcode  = 0x2EF // Updated for 6.38
	AoEAction16Opcode = 0x3C6 // Updated for 6.38
	AoEAction24Opcode = 0x97  // Updated for 6.38
	AoEAction32Opcode = 0x24B // Updated for 6.38

	ObjectSpawnOpcode = 0x2D1 // Updated for 6.38
	PlayerSpawnOpcode = 0x94  // Updated for 6.38
	NPCSpawnOpcode    = 0x269 // Updated for 6.38
	NPCSpawn2Opcode   = 0x196 // Updated for 6.38

	MovementOpcode = 0x25B // Updated for 6.38
	SetPosOpcode   = 0x2F0 // Updated for 6.38

	CastingOpcode = 0x15F // Updated for 6.38

	HateRankingOpcode = 0xE5 // Updated for 6.38
	HateListOpcode    = 0x99 // Updated for 6.38

	PlayerStatsOpcode = 0x2D8 // Updated for 6.38

	EquipChangeOpcode = 0x2E2 // Updated for 6.38

	EventPlayOpcode    = 0x284 // Updated for 6.38
	EventPlay4Opcode   = 0xE2  // Updated for 6.38
	EventPlay8Opcode   = 0x2C1 // Updated for 6.38
	EventPlay16Opcode  = 0x7F  // Updated for 6.38
	EventPlay32Opcode  = 0xD3  // Updated for 6.38
	EventPlay64Opcode  = 0xC1  // Updated for 6.38
	EventPlay128Opcode = 0x29D // Updated for 6.38
	EventPlay255Opcode = 0x326 // Updated for 6.38

	MountOpcode = 0x2DF // Updated for 6.38

	WeatherChangeOpcode = 0x17A // Updated for 6.38

	PrepareZoningOpcode = 0x267 // Updated for 6.38

	GaugeOpcode = 0x136 // Updated for 6.38

	WaymarkOpcode         = 0x354 // Updated for 6.38
	PerformOpcode         = 0xB3  // Updated for 6.38
	XWorldPartyListOpcode = UndefinedOpcode
)

Opcodes that define the datatypes of incoming (from server) network blocks

View Source
const CraftingEventID = 0xA0001
View Source
const UndefinedOpcode = 0xFFFF

Variables

This section is empty.

Functions

func MarshalCraftState added in v3.47.0

func MarshalCraftState(cs *CraftState) ([]uint32, error)

func NewBlockData

func NewBlockData(opcode uint16, isOut bool) xivnet.BlockData

NewBlockData is a factory for BlockData that uses the opcode to determine which BlockData to create

func NewChatBlockData added in v3.8.1

func NewChatBlockData(opcode uint16, isOut bool) xivnet.BlockData

NewChatBlockData is a factory for BlockData that uses the opcode to determine which Chat BlockData to create

func ParseBlock

func ParseBlock(block *xivnet.Block, isOut bool) (*xivnet.Block, error)

ParseBlock takes in raw, unparsed blocks and returns a parsed block if possible. isOut toggles whether we should parse this block as an outgoing block (sent packet) or as an incoming block (recv'd packet)

func UnmarshalBlockBytes

func UnmarshalBlockBytes(data []byte, block xivnet.BlockData) error

UnmarshalBlockBytes converts raw bytes to this block data struct

Types

type Action

type Action struct {
	ActionHeader

	Effects ActionEffects

	U9  uint32
	U10 uint16

	TargetID2   uint32 // Target of effects
	EffectFlags uint32
	U12         uint32
}

Action defines the data array for an ability block

func (Action) IsBlockData

func (Action) IsBlockData()

type ActionEffect

type ActionEffect struct {
	Type        byte
	HitSeverity byte
	P3          byte
	Percentage  byte
	// Total Damage = 65535 * Multiplier * (Flags & 0x40) + Damage
	Multiplier byte
	Flags      byte // (Flags & 0xA0) means attacker receives damage instead
	Damage     uint16
}

ActionEffect defines the data array for an effect that resulted from the action

type ActionEffects

type ActionEffects [8]ActionEffect

ActionEffects defines a block of 8 action effects

type ActionHeader

type ActionHeader struct {
	TargetID          uint32 // Target of actions
	U1                uint32
	ActionIDName      uint32 // Action as shown in battle log
	GlobalCounter     uint32
	AnimationLockTime float32
	UnkID1            uint32
	HiddenAnimation   uint16
	Direction         uint16 // Quantized direction 0x0000 ~ 0xFFFF, NWSE <=> 0,0x4000,0x8000,0xC000
	ActionID          uint16 // The animation of the action
	Variation         byte
	EffectDisplayType byte

	U6a         byte
	NumAffected byte
	U6b         uint16
	U7          uint32
	U8          uint16
}

ActionHeader defines the header for an action packet. This is common for single target or multi-target action packets.

type AoEAction16

type AoEAction16 struct {
	ActionHeader

	EffectsList [16]ActionEffects

	U9  uint32
	U10 uint16

	Targets [16]uint64

	Position PackedPosition
	U11      uint16
	U12      uint32
}

AoEAction16 defines the data array for an AoE action block

func (AoEAction16) IsBlockData

func (AoEAction16) IsBlockData()

type AoEAction24

type AoEAction24 struct {
	ActionHeader

	EffectsList [24]ActionEffects

	U9  uint32
	U10 uint16

	Targets [24]uint64

	Position PackedPosition
	U11      uint16
	U12      uint32
}

AoEAction24 defines the data array for an AoE action block

func (AoEAction24) IsBlockData

func (AoEAction24) IsBlockData()

type AoEAction32

type AoEAction32 struct {
	ActionHeader

	EffectsList [32]ActionEffects

	U9  uint32
	U10 uint16

	Targets [32]uint64

	Position PackedPosition
	U11      uint16
	U12      uint32
}

AoEAction32 defines the data array for an AoE action block

func (AoEAction32) IsBlockData

func (AoEAction32) IsBlockData()

type AoEAction8

type AoEAction8 struct {
	ActionHeader

	EffectsList [8]ActionEffects

	U9  uint32
	U10 uint16

	Targets [8]uint64

	Position PackedPosition
	U11      uint16
	U12      uint32
}

AoEAction8 defines the data array for an AoE action block

func (AoEAction8) IsBlockData

func (AoEAction8) IsBlockData()

type BlockUnmarshaler

type BlockUnmarshaler interface {
	UnmarshalBytes(data []byte) error
}

type Casting

type Casting struct {
	ActionIDName uint16
	U1           uint16
	ActionID     uint32
	CastTime     float32
	TargetID     uint32
	Direction    uint16 // Quantized direction 0x0000 ~ 0xFFFF, NWSE <=> 0,0x4000,0x8000,0xC000
	U2           uint16
	UnkID1       uint32
	Position     PackedPosition
	U3           uint16
}

Casting defines the data array for a casting block

func (Casting) IsBlockData

func (Casting) IsBlockData()

type Chat added in v3.8.1

type Chat struct {
	ChannelID          uint64
	SpeakerCharacterID uint64
	SpeakerEntityID    uint32
	WorldID            uint16
	Flags              uint8
	SpeakerName        EntityName
	Message            ChatMessage
	Pad                uint8
}

Chat defines the data array for a server chat block

func (Chat) IsBlockData added in v3.8.1

func (Chat) IsBlockData()

type ChatFrom added in v3.8.1

type ChatFrom struct {
	FromCharacterID uint64
	WorldID         uint16
	Flags           uint8
	FromName        EntityName
	Message         ChatMessage

	Pad  uint8
	Pad2 uint32
}

ChatFrom defines the data array for a private chat block

func (ChatFrom) IsBlockData added in v3.8.1

func (ChatFrom) IsBlockData()

type ChatFromXWorld added in v3.8.2

type ChatFromXWorld struct {
	FromCharacterID uint64
	WorldID         uint16
	U1              uint16
	U2              uint32
	FromEntityID    uint32
	WorldID2        uint16
	U3              uint16
	Flags           uint8
	FromName        EntityName
	Message         ChatMessage

	Pad  uint8
	Pad2 uint32
	Pad3 uint16
}

ChatFromXWorld defines the data array for a private chat block cross world

func (ChatFromXWorld) IsBlockData added in v3.8.2

func (ChatFromXWorld) IsBlockData()

type ChatMessage added in v3.8.1

type ChatMessage [1024]byte

func StringToChatMessage added in v3.8.1

func StringToChatMessage(s string) ChatMessage

StringToChatMessage converts a string to an chat message data

func (ChatMessage) MarshalJSON added in v3.8.1

func (e ChatMessage) MarshalJSON() ([]byte, error)

MarshalJSON writes the string representation of the chat message to JSON

func (ChatMessage) String added in v3.8.1

func (e ChatMessage) String() string

String returns the string represenation of the entity name data

func (*ChatMessage) UnmarshalJSON added in v3.8.1

func (e *ChatMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON converts the string representation of the chat message to the data structure

type ChatTo added in v3.8.1

type ChatTo struct {
	ToCharacterID uint64
	ChannelID     uint64
	WorldID       uint16
	Flags         uint8
	ToName        EntityName
	Message       ChatMessage

	Pad  uint8
	Pad2 uint32
}

ChatTo defines the data array for a private chat block

func (ChatTo) IsBlockData added in v3.8.1

func (ChatTo) IsBlockData()

type ChatXWorld added in v3.8.1

type ChatXWorld struct {
	ChannelID          uint64
	SpeakerCharacterID uint64
	SpeakerEntityID    uint32
	WorldID            uint16
	WorldID2           uint16
	Flags              uint8
	SpeakerName        EntityName
	Message            ChatMessage

	Pad [7]uint8
}

Chat defines the data array for a server chat block for cross-world chat Seems to only be used for cross-world linkshells

func (ChatXWorld) IsBlockData added in v3.8.1

func (ChatXWorld) IsBlockData()

type ChatZone added in v3.8.1

type ChatZone struct {
	CharacterID uint64
	EntityID    uint32
	WorldID     uint16
	Type        uint16
	SpeakerName EntityName
	Message     ChatMessage
}

ChatZone defines the data array for a zone chat block

func (ChatZone) IsBlockData added in v3.8.1

func (ChatZone) IsBlockData()

type ChocoboInfo added in v3.20.0

type ChocoboInfo struct {
	Head  byte
	Body  byte
	Feet  byte
	Color byte
}

ChocoboInfo enumerates the fields for chocobo information

type Control added in v3.3.0

type Control struct {
	Type uint16
	Pad1 uint16
	P1   uint32
	P2   uint32
	P3   uint32
	P4   uint32
	Pad2 uint32
}

Control defines the data array for a notify block

func (Control) IsBlockData added in v3.3.0

func (Control) IsBlockData()

type ControlSelf added in v3.3.0

type ControlSelf struct {
	Type uint16
	Pad1 uint16
	P1   uint32
	P2   uint32
	P3   uint32
	P4   uint32
	P5   uint32
	P6   uint32
	Pad2 uint32
}

ControlSelf defines the data array for a notify3 block

func (ControlSelf) IsBlockData added in v3.3.0

func (ControlSelf) IsBlockData()

type ControlTarget added in v3.3.0

type ControlTarget struct {
	Type     uint16
	Pad1     uint16
	P1       uint32
	P2       uint32
	P3       uint32
	P4       uint32
	Pad2     uint32
	TargetID uint32 // 0xE0000000 means deselect target
	U1       uint32
}

ControlTarget defines the data array for a notify4 block

func (ControlTarget) IsBlockData added in v3.3.0

func (ControlTarget) IsBlockData()

type CraftState

type CraftState struct {
	U1                uint32
	U3                uint32
	U4                uint32
	CraftAction       uint32
	U2                uint32
	StepNum           uint32
	Progress          uint32
	ProgressDelta     int32
	Quality           uint32
	QualityDelta      int32
	HQChance          uint32
	Durability        uint32
	DurabilityDelta   int32
	CurrentCondition  uint32
	PreviousCondition uint32
	U5                uint32
	Flags             uint32
	U6                [15]uint32
}

func UnmarshalCraftState added in v3.47.0

func UnmarshalCraftState(ep IEventPlay) (*CraftState, error)

type EffectResult added in v3.1.0

type EffectResult struct {
	U1             uint32
	GlobalSequence uint32
	ActorID        uint32

	CurrentHP uint32
	MaxHP     uint32
	CurrentMP uint16

	Pad2     byte
	ClassJob byte

	Pad3  byte
	Count byte

	U4      uint16
	Entries [4]EffectResultEntry
	U5      uint32
}

EffectResult defines the data array for an effect result.

func (EffectResult) IsBlockData added in v3.1.0

func (EffectResult) IsBlockData()

type EffectResultEntry added in v3.1.0

type EffectResultEntry struct {
	Index    byte // Position of status effect
	U6       byte
	EffectID uint16
	Param    uint16
	U7       uint16
	Duration float32
	ActorID  uint32
}

EffectResultEntry is an entry of EffectResult

type EgressChat added in v3.8.1

type EgressChat struct {
	ChannelID uint64
	Message   ChatMessage
}

func (EgressChat) IsBlockData added in v3.8.1

func (EgressChat) IsBlockData()

type EgressChatPosition added in v3.8.1

type EgressChatPosition struct {
	EntityID  uint32
	X, Y, Z   float32
	Direction float32
}

type EgressChatXWorld added in v3.8.1

type EgressChatXWorld struct {
	ChannelID uint64
	Flags     uint8
	Message   ChatMessage

	Pad [7]uint8
}

EgressChatXWorld defines the data array for a server chat block for cross-world chat

func (EgressChatXWorld) IsBlockData added in v3.8.1

func (EgressChatXWorld) IsBlockData()

type EgressChatZone added in v3.8.1

type EgressChatZone struct {
	ClientTime uint32
	Position   EgressChatPosition
	Type       uint16
	Message    ChatMessage
	Pad1       uint16
	Pad2       uint32
}

func (EgressChatZone) IsBlockData added in v3.8.1

func (EgressChatZone) IsBlockData()

type EgressClientTrigger

type EgressClientTrigger struct {
	Type uint16 // 3 means P1 is target
	U1   uint16
	P1   uint32
	P2   uint32
	P3   uint32
	P4   uint32
	P5   uint32
	P6   uint32
	P7   uint32
}

EgressClientTrigger defines the data array for an ClientTrigger block

func (EgressClientTrigger) IsBlockData

func (EgressClientTrigger) IsBlockData()

type EgressCraftEvent added in v3.1.0

type EgressCraftEvent struct {
	EventID, U2, U3 uint32
	Ingredients     [9]uint32
	U4              [21]uint32
	Amounts         [9]byte
	U5              [3]byte
	U6              [30]uint32
}

EgressCraftEvent defines the data array for an crafting event Name subject to change

func (EgressCraftEvent) IsBlockData added in v3.1.0

func (EgressCraftEvent) IsBlockData()

type EgressInstanceMovement

type EgressInstanceMovement struct {
	Direction float32 // 0 is South. Range [-pi,pi] <=> Counterclockwise from North
	U1        [5]uint32
	X         float32
	Y         float32
	Z         float32
	U2        uint32
}

EgressInstanceMovement defines the data array for a outgoing movement block inside an instance

func (EgressInstanceMovement) IsBlockData

func (EgressInstanceMovement) IsBlockData()

type EgressMovement

type EgressMovement struct {
	Direction float32 // 0 is South. Range [-pi,pi] <=> Counterclockwise from North
	U1        uint32
	X         float32
	Y         float32
	Z         float32
	U2        uint32
}

EgressMovement defines the data array for an outgoing movement block

func (EgressMovement) IsBlockData

func (EgressMovement) IsBlockData()

type EntityName

type EntityName [32]byte

EntityName is the storage structure for a UTF-8 entity name

func StringToEntityName

func StringToEntityName(s string) EntityName

StringToEntityName converts a string to an entity name data

func (EntityName) MarshalJSON

func (e EntityName) MarshalJSON() ([]byte, error)

MarshalJSON writes the string representation of the entity name to JSON

func (EntityName) String

func (e EntityName) String() string

String returns the string represenation of the entity name data

func (*EntityName) UnmarshalJSON

func (e *EntityName) UnmarshalJSON(data []byte) error

UnmarshalJSON converts the string representation of the entity name to the data structure

type EquipChange

type EquipChange struct {
	WeaponMain WeaponGear
	WeaponSub  WeaponGear
	U1a        byte
	ClassJob   byte
	Level      byte
	U1d        byte
	Head       Gear
	Body       Gear
	Hand       Gear
	Leg        Gear
	Foot       Gear
	Ear        Gear
	Neck       Gear
	Wrist      Gear
	Ring1      Gear
	Ring2      Gear
	U2         uint32
}

EquipChange defines the data array for a equip change block

func (EquipChange) IsBlockData

func (EquipChange) IsBlockData()

type EventPlay

type EventPlay struct {
	EventPlayHeader
	Data [2]uint32
}

EventPlay defines the data array for an event play block Note: This requires an EventStart block.

func (*EventPlay) EventData added in v3.47.0

func (e *EventPlay) EventData() []uint32

func (*EventPlay) Header added in v3.47.0

func (e *EventPlay) Header() *EventPlayHeader

func (EventPlay) IsBlockData

func (EventPlay) IsBlockData()

type EventPlay128 added in v3.47.0

type EventPlay128 struct {
	EventPlayHeader
	Data [128]uint32
}

EventPlay128 defines the data array for an event play block

func (*EventPlay128) EventData added in v3.47.0

func (e *EventPlay128) EventData() []uint32

func (*EventPlay128) Header added in v3.47.0

func (e *EventPlay128) Header() *EventPlayHeader

func (EventPlay128) IsBlockData added in v3.47.0

func (EventPlay128) IsBlockData()

type EventPlay16 added in v3.47.0

type EventPlay16 struct {
	EventPlayHeader
	Data [16]uint32
}

EventPlay16 defines the data array for an event play block

func (*EventPlay16) EventData added in v3.47.0

func (e *EventPlay16) EventData() []uint32

func (*EventPlay16) Header added in v3.47.0

func (e *EventPlay16) Header() *EventPlayHeader

func (EventPlay16) IsBlockData added in v3.47.0

func (EventPlay16) IsBlockData()

type EventPlay255 added in v3.47.0

type EventPlay255 struct {
	EventPlayHeader
	Data [255]uint32
}

EventPlay255 defines the data array for an event play block

func (*EventPlay255) EventData added in v3.47.0

func (e *EventPlay255) EventData() []uint32

func (*EventPlay255) Header added in v3.47.0

func (e *EventPlay255) Header() *EventPlayHeader

func (EventPlay255) IsBlockData added in v3.47.0

func (EventPlay255) IsBlockData()

type EventPlay32 added in v3.5.0

type EventPlay32 struct {
	EventPlayHeader
	Data [32]uint32
}

EventPlay32 defines the data array for an event play block

func (*EventPlay32) EventData added in v3.47.0

func (e *EventPlay32) EventData() []uint32

func (*EventPlay32) Header added in v3.47.0

func (e *EventPlay32) Header() *EventPlayHeader

func (EventPlay32) IsBlockData added in v3.5.0

func (EventPlay32) IsBlockData()

type EventPlay4 added in v3.5.0

type EventPlay4 struct {
	EventPlayHeader
	Data [4]uint32
}

EventPlay4 defines the data array for an event play block Note: This requires an EventStart block.

func (*EventPlay4) EventData added in v3.47.0

func (e *EventPlay4) EventData() []uint32

func (*EventPlay4) Header added in v3.47.0

func (e *EventPlay4) Header() *EventPlayHeader

func (EventPlay4) IsBlockData added in v3.5.0

func (EventPlay4) IsBlockData()

type EventPlay64 added in v3.47.0

type EventPlay64 struct {
	EventPlayHeader
	Data [64]uint32
}

EventPlay64 defines the data array for an event play block

func (*EventPlay64) EventData added in v3.47.0

func (e *EventPlay64) EventData() []uint32

func (*EventPlay64) Header added in v3.47.0

func (e *EventPlay64) Header() *EventPlayHeader

func (EventPlay64) IsBlockData added in v3.47.0

func (EventPlay64) IsBlockData()

type EventPlay8 added in v3.47.0

type EventPlay8 struct {
	EventPlayHeader
	Data [8]uint32
}

EventPlay8 defines the data array for an event play block

func (*EventPlay8) EventData added in v3.47.0

func (e *EventPlay8) EventData() []uint32

func (*EventPlay8) Header added in v3.47.0

func (e *EventPlay8) Header() *EventPlayHeader

func (EventPlay8) IsBlockData added in v3.47.0

func (EventPlay8) IsBlockData()

type EventPlayHeader added in v3.5.0

type EventPlayHeader struct {
	ActorID    uint64
	EventID    uint32 // 0xA0001 for crafting
	Scene      uint16
	Pad1       uint16
	Flags      uint32
	P1         uint32
	ParamCount byte
	Pad2       [3]byte
	P2         uint32
}

type FCName added in v3.8.1

type FCName [46]byte

FCName is the storage structure for a UTF-8 FC name

func StringToFCName added in v3.8.1

func StringToFCName(s string) FCName

StringToFCName converts a string to FC name data

func (FCName) MarshalJSON added in v3.8.1

func (e FCName) MarshalJSON() ([]byte, error)

MarshalJSON writes the string representation of the FC name to JSON

func (FCName) String added in v3.8.1

func (e FCName) String() string

String returns the string represenation of the FC name data

func (*FCName) UnmarshalJSON added in v3.8.1

func (e *FCName) UnmarshalJSON(data []byte) error

UnmarshalJSON converts the string representation of the FC name to the data structure

type FCTag

type FCTag [6]byte

FCTag is the storage structure for a UTF-8 FC tag

func StringToFCTag

func StringToFCTag(s string) FCTag

StringToFCTag converts a string to FC tag data

func (FCTag) MarshalJSON

func (e FCTag) MarshalJSON() ([]byte, error)

MarshalJSON writes the string representation of the FC tag to JSON

func (FCTag) String

func (e FCTag) String() string

String returns the string represenation of the FC tag data

func (*FCTag) UnmarshalJSON

func (e *FCTag) UnmarshalJSON(data []byte) error

UnmarshalJSON converts the string representation of the FC tag to the data structure

type FreeCompanyResult added in v3.8.1

type FreeCompanyResult struct {
	FreeCompanyID     uint64
	TargetCharacterID uint64
	Type              uint32
	Result            uint32
	UpdateStatus      byte
	Identity          byte
	FreeCompanyName   FCName
	TargetName        EntityName
}

FreeCompanyResult defines the data array for a free company event block.

func (FreeCompanyResult) IsBlockData added in v3.8.1

func (FreeCompanyResult) IsBlockData()

type Gauge

type Gauge struct {
	ClassJob  byte
	Duration2 uint16 // In millseconds. Indicates duration of gauge 3. (Enochian)
	Duration  uint16 // In milliseconds. Indicates duration of gauge 0.
	Gauge0    int8   // Main gauge. Negative number can mean umbral ice for instance.
	Gauge1    int8   // For example, umbral hearts lives in this gauge
	Gauge2    byte   // Enochian is set via bitfields in this gauge.
	U1        uint32
	U2        uint32
}

Gauge defines the data array for an add status effect block

func (Gauge) IsBlockData

func (Gauge) IsBlockData()

type Gear

type Gear struct {
	ModelID uint16
	Variant uint8
	Dye     uint8
}

Gear defines the data struct for a normal gear

type HateEntry

type HateEntry struct {
	EnemyID uint32 // OwnerID is the entity that has enmity against the Actor
	HatePct byte   // HatePct is how close to aggro aggro this mob (100% is aggro)
	U1      byte   // U1 and U2 are leftovers from reuse of the HateRanking struct
	U2      uint16
}

HateEntry defines the a full hate list entry

type HateList

type HateList struct {
	Count   byte
	U1      byte
	U2      uint16
	Entries [32]HateEntry
	Pad     uint32
}

HateList defines the data array for a hate list

func (HateList) IsBlockData

func (HateList) IsBlockData()

type HateRanking

type HateRanking struct {
	Count   byte
	U1      byte
	U2      uint16
	Entries [8]HateRankingEntry
	Pad     uint32
}

HateRanking defines the data array for the enmity list for the current target

func (HateRanking) IsBlockData

func (HateRanking) IsBlockData()

type HateRankingEntry

type HateRankingEntry struct {
	ActorID uint32 // ActorID is the entity towards which the threat is directed
	HatePct byte   // HatePct is the percentage of enmity relative to the person with aggro on the current target
	Pad1    byte
	Pad2    uint16
}

HateRankingEntry defines a single hate entry for the current target

type IEventPlay added in v3.47.0

type IEventPlay interface {
	Header() *EventPlayHeader
	EventData() []uint32
}

IEventPlay defines the interface for the event play packets

type InitZone

type InitZone struct {
	U1a             uint16
	TerritoryTypeID uint16
	U1b             uint16
	U2              uint16

	U3, U4             uint32
	WeatherID, Bitmask byte
	U5b                uint16

	U6 [12]uint32

	X, Y, Z float32

	U7 [6]uint32
}

InitZone defines the data array for a map change block

func (InitZone) IsBlockData

func (InitZone) IsBlockData()

type Marker

type Marker struct {
	Type byte
	U1   byte
	U2   uint16
	U3   uint32
	X    float32
	Y    float32
	Z    float32
	U4   uint32
}

Marker defines the data array for a place marker block

func (Marker) IsBlockData

func (Marker) IsBlockData()

type ModelInfo

type ModelInfo struct {
	Race                byte // 2 Elezen, 3 Lalafell, 4 Miqo'te, 5 Roe, 6 Au Ra, else Hyur
	Gender              byte // 0 is male, 1 is female
	BodyType            byte // CHANGE AT OWN RISK
	Height              byte // Scale from 0-100
	Tribe               byte
	Face                byte
	Hairstyle           byte
	HairHighlight       byte // 8th bit toggles highlight
	SkinTone            byte
	OddEyeColor         byte
	HairColor           byte
	HairHighlightColor  byte
	FacialFeatures      byte // Race specific toggles. i.e. 6th bit toggles right limbal ring. 7th bit toggles left limbal ring.
	FacialFeaturesColor byte
	Eyebrows            byte
	EyeColor            byte
	EyeShape            byte
	Nose                byte
	Jaw                 byte
	Mouth               byte // Bitfield toggles light/dark/none lip color
	LipColor            byte
	TailLength          byte // Scale from 1-100
	TailType            byte
	BustSize            byte // Scale from 1-100
	FacePaintType       byte
	FacePaintColor      byte
}

ModelInfo enumerates all of the different options for customizing the character model

type Mount

type Mount struct {
	ID    uint16
	Color byte
	U1    byte
	U2    byte
	U3    uint32 // Highly likely to be a Gear
	U4    uint32 // Highly likely to be a Gear
	U5    uint32 // Highly likely to be a Gear
}

Mount defines the data array for a getting on mount block

func (Mount) IsBlockData

func (Mount) IsBlockData()

type Movement

type Movement struct {
	HeadRotation    uint8 // Doesn't seem to do anything though? Retained to not break anything.
	Direction       uint8 // Quantized direction 0x00~0xFF. NWSE <=> 0,0x40,0x80,0xC0
	AnimationType   uint8
	AnimationState  uint8
	AnimationSpeed  uint8
	UnknownRotation uint8
	Position        PackedPosition
	U3              uint32
}

Movement defines the data array for a movement block

func (Movement) IsBlockData

func (Movement) IsBlockData()

type NPCSpawn

type NPCSpawn struct {
	PlayerSpawn
	U31 uint64
}

NPCSpawn defines the data array for a new entity block Notes: GMRank from PlayerSpawn corresponds to MobAggression in this struct

func (NPCSpawn) IsBlockData

func (NPCSpawn) IsBlockData()

type NPCSpawn2

type NPCSpawn2 struct {
	PlayerSpawn
	U31 [47]uint64
}

NPCSpawn2 defines the data array for a new entity block Notes: GMRank from PlayerSpawn corresponds to MobAggression in this struct This packet type is encountered in the wild when spawning Alliance Raid bosses

func (NPCSpawn2) IsBlockData

func (NPCSpawn2) IsBlockData()

type PackedCoord

type PackedCoord uint16

PackedCoord represents a 16 bit packed representation of a float32

func (PackedCoord) Float

func (pc PackedCoord) Float() float32

Float returns the floating point representation of the coord

func (PackedCoord) MarshalJSON

func (pc PackedCoord) MarshalJSON() ([]byte, error)

MarshalJSON marhals the packed coordinate as a floating point value

func (*PackedCoord) SetFloat

func (pc *PackedCoord) SetFloat(coord float32)

SetFloat sets the PackedCoord to the uint16 representation of the floating point coord

func (*PackedCoord) UnmarshalJSON

func (pc *PackedCoord) UnmarshalJSON(data []byte) error

UnmarshalJSON marhals the floating point value as a packed coordinate

type PackedPosition

type PackedPosition struct {
	X, Y, Z PackedCoord
}

PackedPosition defines the data array for position

type Perform

type Perform struct {
	Length byte
	Data   [30]byte
	U1     byte
}

Perform defines the struct for a perform block

func (Perform) IsBlockData

func (Perform) IsBlockData()

type PlayerSpawn

type PlayerSpawn struct {
	Title        uint16
	U1b          uint16
	CurrentWorld uint16
	HomeWorld    uint16

	GMRank       byte
	U3c, U4      byte
	OnlineStatus byte

	Pose          byte
	U5a, U5b, U5c byte

	TargetID   uint64
	U6, U7     uint32
	WeaponMain WeaponGear
	WeaponSub  WeaponGear
	CraftSub   WeaponGear

	U14, U15             uint32
	BNPCBase, BNPCName   uint32
	U18, U19, DirectorID uint32
	OwnerID              uint32
	UnkID3               uint32

	MaxHP, CurrentHP uint32
	DisplayFlags     uint32
	FateID           uint16
	CurrentMP        uint16
	MaxMP            uint16

	U21a       uint16
	ModelChara uint16
	Direction  uint16 // Quantized direction 0x0000 ~ 0xFFFF, NWSE <=> 0,0x4000,0x8000,0xC000
	MountID    uint16
	Minion     uint16
	U25c       uint16
	Index      byte
	State      byte // 0-1 for alive, 2 for dead, 3 for persistent emote
	Emote      byte // Applies for when State is 3
	Type       byte // 1 for player, 2 for NPC, else furniture
	Subtype    byte // 4 for players, 2 pet, 3 companion, 5 mob, 7 minion
	Voice      byte

	U27a      uint16
	EnemyType byte // 0 for friendly, anything else is an enemy
	Level     byte
	ClassJob  byte
	U26d      byte

	U28c uint16

	ChocoboInfo   ChocoboInfo
	StatusLoopVFX byte
	U29           uint32
	U29b          uint16
	U29c          byte

	Statuses [30]StatusEffect

	X float32
	Y float32
	Z float32

	Head  Gear
	Body  Gear
	Hand  Gear
	Leg   Gear
	Foot  Gear
	Ear   Gear
	Neck  Gear
	Wrist Gear
	Ring1 Gear
	Ring2 Gear

	Name EntityName

	Model ModelInfo

	FCTag FCTag
	U30   uint64
}

PlayerSpawn defines the data array for a new entity block

func (PlayerSpawn) IsBlockData

func (PlayerSpawn) IsBlockData()

type PlayerStats added in v3.36.2

type PlayerStats struct {
	Strength            uint32
	Dexterity           uint32
	Vitality            uint32
	Intelligence        uint32
	Mind                uint32
	Piety               uint32
	HP                  uint32
	MP                  uint32
	TP                  uint32
	GP                  uint32
	CP                  uint32
	Delay               uint32
	Tenacity            uint32
	AttackPower         uint32
	Defense             uint32
	DirectHitRate       uint32
	Evasion             uint32
	MagicDefense        uint32
	CriticalHit         uint32
	AttackMagicPotency  uint32
	HealingMagicPotency uint32
	ElementalBonus      uint32
	Determination       uint32
	SkillSpeed          uint32
	SpellSpeed          uint32
	Haste               uint32
	Craftsmanship       uint32
	Control             uint32
	Gathering           uint32
	Perception          uint32

	U1 [26]uint32
}

PlayerStats defines the data array for player stats

func (PlayerStats) IsBlockData added in v3.36.2

func (PlayerStats) IsBlockData()

type PrepareZoning

type PrepareZoning struct {
	U1              uint32
	TerritoryTypeID uint16
	U2              uint16
	U3, U4          uint32
}

PrepareZoning defines the data array for a prepare zoning block

func (PrepareZoning) IsBlockData

func (PrepareZoning) IsBlockData()

type RemoveEntity

type RemoveEntity struct {
	Index byte
	U1    byte
	U2    uint16
	ID    uint32
}

RemoveEntity defines the data array for a remove entity block

func (RemoveEntity) IsBlockData

func (RemoveEntity) IsBlockData()

type SetPos

type SetPos struct {
	Direction   uint16
	WaitForLoad byte
	U1          byte
	U2          uint32
	X           float32
	Y           float32
	Z           float32
	U3          uint32
}

SetPos defines the data array for a movement block

func (SetPos) IsBlockData

func (SetPos) IsBlockData()

type StatusEffect

type StatusEffect struct {
	ID       uint16
	Param    uint16
	Duration float32
	ActorID  uint32
}

StatusEffect represents the data structure for a status effect

type UpdateHPMPTP

type UpdateHPMPTP struct {
	HP  uint32
	MP  uint16
	Pad uint16
}

UpdateHPMPTP defines the data array for a updateHPMPTP block

func (UpdateHPMPTP) IsBlockData

func (UpdateHPMPTP) IsBlockData()

type UpdateStatuses

type UpdateStatuses struct {
	ClassJob  byte
	Level1    byte
	Level     uint16
	CurrentHP uint32
	MaxHP     uint32
	CurrentMP uint16
	MaxMP     uint16
	CurrentTP uint16
	U2        uint16 // 0?

	Statuses [30]StatusEffect

	U3 uint32
}

UpdateStatuses defines the data array for an update statuses block

func (UpdateStatuses) IsBlockData

func (UpdateStatuses) IsBlockData()

type UpdateStatusesBoss added in v3.5.0

type UpdateStatusesBoss struct {
	Statuses2 [30]StatusEffect
	ClassJob  byte
	Level1    byte
	Level     uint16
	CurrentHP uint32
	MaxHP     uint32
	CurrentMP uint16
	MaxMP     uint16
	CurrentTP uint16
	U2        uint16 // 0?

	Statuses [30]StatusEffect

	U3 uint32
}

UpdateStatusesBoss defines the data array for an update statuses block that supports 60 status effects

func (UpdateStatusesBoss) IsBlockData added in v3.5.0

func (UpdateStatusesBoss) IsBlockData()

type UpdateStatusesEureka added in v3.0.2

type UpdateStatusesEureka struct {
	ElementalLevel byte
	U1             [3]byte
	ClassJob       byte
	Level1         byte
	Level          byte
	MaxLevel       byte
	CurrentHP      uint32
	MaxHP          uint32
	CurrentMP      uint16
	MaxMP          uint16
	CurrentTP      uint16
	U2             uint16

	Statuses [30]StatusEffect
}

UpdateStatusesEureka defines the data array for an update statuses block inside Eureka

func (UpdateStatusesEureka) IsBlockData added in v3.0.2

func (UpdateStatusesEureka) IsBlockData()

type WeaponGear

type WeaponGear struct {
	Model1, Model2, Model3, Model4 uint16
}

WeaponGear defines the data struct for a weapon gear

type WeatherChange

type WeatherChange struct {
	ID    byte
	U1    byte
	U2    byte
	U3    byte
	Delay float32
}

WeatherChange defines the data array for a weather change block

func (WeatherChange) IsBlockData

func (WeatherChange) IsBlockData()

type XWorldPartyList

type XWorldPartyList struct {
	PartyLeader uint64
	Entries     [8]XWorldPlayerEntry
}

XWorldPartyList defines the data array for a cross world party list

func (XWorldPartyList) IsBlockData

func (XWorldPartyList) IsBlockData()

type XWorldPlayerEntry

type XWorldPlayerEntry struct {
	PlayerID       uint64
	U1             uint32 // Bitfield, affects the icon in various ways
	U2             uint32
	CharacterID    uint32
	ClientLanguage byte
	U3b            byte
	U3c            uint16
	Level          byte
	U4             byte
	WorldID        uint16
	ClassJob       byte
	U6             byte
	Languages      byte // Bitfield, affects available languages
	GrandCompany   byte
	Name           EntityName
}

XWorldPlayerEntry defines the player entry for a party list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL