Documentation
¶
Overview ¶
Package update provides functions for serializing and deserializing SMSG_UPDATE_OBJECT. update also contains structures and functions pertaining to movement packets, which can be encoded inside of SMSG_UPDATE_OBJECT. SMSG_UPDATE_OBJECT notifies the game client of incremental state changes, or updates, to in-world objects. The structure of this packet varies extremely across protocol revisions, so this package incorporates several descriptor packages for storing fields.
Index ¶
- Constants
- Variables
- func EncodeMoveSpline(version vsn.Build, out io.Writer, ms *MoveSpline) error
- func EncodeMovementInfo(version vsn.Build, out io.Writer, mi *MovementInfo) error
- func SetAuraFlag(flagarray *Value, index int, value AuraFlags) error
- func WriteBitmask(mask *Bitmask, descriptor *Descriptor, writer io.Writer) error
- type AlignPad
- type AuraFlags
- type BitPad
- type Bitmask
- type BlockData
- type BlockType
- type BlockTypeDescriptor
- type BytePad
- type ChunkPad
- type CreateBlock
- type Decoder
- func (decoder *Decoder) DecodeBlockType() (BlockType, error)
- func (decoder *Decoder) DecodeCreateBlock() (*CreateBlock, error)
- func (dec *Decoder) DecodeDeleteObjectsBlock() (*DeleteObjectsBlock, error)
- func (decoder *Decoder) DecodeGUID() (guid.GUID, error)
- func (decoder *Decoder) DecodeMovementBlock() (*MovementBlock, error)
- func (decoder *Decoder) DecodeValuesBlockData(valuesBlock *ValuesBlock) error
- func (decoder *Decoder) IsCreateBlock() bool
- func (decoder *Decoder) MoreBlocks() bool
- func (decoder *Decoder) NextBlock() (BlockType, error)
- type DeleteObjectsBlock
- type Descriptor
- type DescriptorOptions
- type Destroy
- type Encoder
- type FieldRef
- type FieldTag
- type FlyState
- type ForceSpeedChange
- type ItemFlag
- type ItemFlags
- type MoveFlagDescriptor
- type MoveFlags
- type MoveSpline
- type MovementBlock
- type MovementInfo
- type MovementPacket
- type SetActiveMover
- type SetSheathe
- type SetStandState
- type SetWeaponMode
- type SpeedList
- type SpeedOpcodePair
- type SpeedType
- type Speeds
- type SplineFlagDescriptor
- type SplineFlags
- type SplineSpeedChange
- type StandState
- type Target
- type UpdateFlagDescriptor
- type UpdateFlags
- type Value
- func (v *Value) Byte() uint8
- func (v *Value) Field(name string) *Value
- func (v *Value) FieldIndex(n int) *Value
- func (v *Value) FieldNames() []string
- func (v *Value) Find(field string) *Value
- func (v *Value) GUID() guid.GUID
- func (v *Value) Index(index int) *Value
- func (v *Value) Int32() int32
- func (v *Value) Len() int
- func (v *Value) SetBit(value bool)
- func (v *Value) SetByte(value uint8)
- func (v *Value) SetFloat32(value float32)
- func (v *Value) SetGUID(value guid.GUID)
- func (v *Value) SetInt16(value int16)
- func (v *Value) SetInt32(value int32)
- func (v *Value) SetUint16(value uint16)
- func (v *Value) SetUint32(value uint32)
- func (v *Value) Uint32() uint32
- type ValuesBlock
- func (vb *ValuesBlock) ClearChanges()
- func (vb *ValuesBlock) ClearChangesAndUnlock()
- func (v *ValuesBlock) Copy() *ValuesBlock
- func (vb *ValuesBlock) Get(name string) *Value
- func (vb *ValuesBlock) SetBit(glob string, value bool)
- func (vb *ValuesBlock) SetByte(glob string, value uint8)
- func (vb *ValuesBlock) SetFloat32(glob string, value float32)
- func (vb *ValuesBlock) SetGUID(glob string, value guid.GUID)
- func (vb *ValuesBlock) SetInt32(glob string, value int32)
- func (vb *ValuesBlock) SetUint32(glob string, nvalue uint32)
- func (vb *ValuesBlock) Type() BlockType
- func (vb *ValuesBlock) Value() *Value
- func (valuesBlock *ValuesBlock) WriteData(e *Encoder, viewMask VisibilityFlags, create bool) error
- type ValuesDecoder
- func (valdec *ValuesDecoder) BytePos() int
- func (valdec *ValuesDecoder) Decode(field reflect.Value, name string) error
- func (valdec *ValuesDecoder) FillCurrentChunk()
- func (valdec *ValuesDecoder) Fwd(n uint32)
- func (valdec *ValuesDecoder) FwdBits(n uint32)
- func (valdec *ValuesDecoder) FwdBytes(n uint32)
- func (valdec *ValuesDecoder) ReadBit(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadByte(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadFloat32(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadGUID(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadInt32(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadUint16(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadUint32(to reflect.Value) error
- func (valdec *ValuesDecoder) ReadUint64(to reflect.Value) error
- type ValuesEncoder
- type VisibilityFlags
Constants ¶
const ( DescriptorOptionClassicGUIDs = 1 << iota DescriptorOptionHasHasTransport DescriptorOptionAlpha )
Variables ¶
var ( UpdateFlagDescriptors = map[vsn.BuildRange]UpdateFlagDescriptor{ vsn.Range(0, 5875): { UpdateFlagSelf: 0x0001, UpdateFlagTransport: 0x0002, UpdateFlagHasAttackingTarget: 0x0004, UpdateFlagHighGUID: 0x0008, UpdateFlagAll: 0x0010, UpdateFlagLiving: 0x0020, UpdateFlagHasPosition: 0x0040, }, vsn.Range(6180, 12340): { UpdateFlagSelf: 0x0001, UpdateFlagTransport: 0x0002, UpdateFlagHasAttackingTarget: 0x0004, UpdateFlagLowGUID: 0x0008, UpdateFlagHighGUID: 0x0010, UpdateFlagLiving: 0x0020, UpdateFlagHasPosition: 0x0040, UpdateFlagVehicle: 0x0080, UpdateFlagPosition: 0x0100, UpdateFlagRotation: 0x0200, }, } MoveFlagDescriptors = map[vsn.BuildRange]MoveFlagDescriptor{ vsn.Range(0, 3368): { MoveFlagForward: 0x1, MoveFlagBackward: 0x2, MoveFlagStrafeLeft: 0x4, MoveFlagStrafeRight: 0x8, MoveFlagTurnLeft: 0x10, MoveFlagTurnRight: 0x20, MoveFlagPitchUp: 0x40, MoveFlagPitchDown: 0x80, MoveFlagWalkMode: 0x100, MoveFlagTimeValid: 0x200, MoveFlagImmobilized: 0x400, MoveFlagDontCollide: 0x800, MoveFlagRedirected: 0x1000, MoveFlagRoot: 0x2000, MoveFlagFalling: 0x4000, MoveFlagFallingFar: 0x8000, MoveFlagPendingStop: 0x10000, MoveFlagPendingUnstrafe: 0x20000, MoveFlagPendingFall: 0x40000, MoveFlagPendingForward: 0x80000, MoveFlagPendingBackward: 0x100000, MoveFlagPendingStrLeft: 0x200000, MoveFlagPendingStrRight: 0x400000, MoveFlagMoved: 0x800000, MoveFlagSliding: 0x1000000, MoveFlagSwimming: 0x2000000, MoveFlagSplineEnabled: 0x4000000, }, vsn.Range(vsn.V1_12_1, 6005): { MoveFlagForward: 0x00000001, MoveFlagBackward: 0x00000002, MoveFlagStrafeLeft: 0x00000004, MoveFlagStrafeRight: 0x00000008, MoveFlagTurnLeft: 0x00000010, MoveFlagTurnRight: 0x00000020, MoveFlagPitchUp: 0x00000040, MoveFlagPitchDown: 0x00000080, MoveFlagWalkMode: 0x00000100, MoveFlagLevitating: 0x00000400, MoveFlagFlying: 0x00000800, MoveFlagFalling: 0x00002000, MoveFlagFallingFar: 0x00004000, MoveFlagSwimming: 0x00200000, MoveFlagSplineEnabled: 0x00400000, MoveFlagCanFly: 0x00800000, MoveFlagFlyingOld: 0x01000000, MoveFlagOnTransport: 0x02000000, MoveFlagSplineElevation: 0x04000000, MoveFlagRoot: 0x08000000, MoveFlagWaterwalking: 0x10000000, MoveFlagSafeFall: 0x20000000, MoveFlagHover: 0x40000000, }, vsn.Range(vsn.V2_0_1, vsn.V2_4_3): { MoveFlagForward: 0x00000001, MoveFlagBackward: 0x00000002, MoveFlagStrafeLeft: 0x00000004, MoveFlagStrafeRight: 0x00000008, MoveFlagTurnLeft: 0x00000010, MoveFlagTurnRight: 0x00000020, MoveFlagPitchUp: 0x00000040, MoveFlagPitchDown: 0x00000080, MoveFlagWalkMode: 0x00000100, MoveFlagOnTransport: 0x00000200, MoveFlagLevitating: 0x00000400, MoveFlagRoot: 0x00000800, MoveFlagFalling: 0x00001000, MoveFlagFallingFar: 0x00004000, MoveFlagSwimming: 0x00200000, MoveFlagAscending: 0x00400000, MoveFlagCanFly: 0x00800000, MoveFlagFlyingOld: 0x01000000, MoveFlagFlying: 0x02000000, MoveFlagSplineElevation: 0x04000000, MoveFlagSplineEnabled: 0x08000000, MoveFlagWaterwalking: 0x10000000, MoveFlagSafeFall: 0x20000000, MoveFlagHover: 0x40000000, }, vsn.Range(vsn.V3_0_2, vsn.V3_3_5a): { MoveFlagForward: 0x00000001, MoveFlagBackward: 0x00000002, MoveFlagStrafeLeft: 0x00000004, MoveFlagStrafeRight: 0x00000008, MoveFlagTurnLeft: 0x00000010, MoveFlagTurnRight: 0x00000020, MoveFlagPitchUp: 0x00000040, MoveFlagPitchDown: 0x00000080, MoveFlagWalkMode: 0x00000100, MoveFlagOnTransport: 0x00000200, MoveFlagLevitating: 0x00000400, MoveFlagRoot: 0x00000800, MoveFlagFalling: 0x00001000, MoveFlagFallingFar: 0x00004000, MoveFlagSwimming: 0x00200000, MoveFlagAscending: 0x00400000, MoveFlagCanFly: 0x00800000, MoveFlagFlyingOld: 0x01000000, MoveFlagFlying: 0x02000000, MoveFlagSplineElevation: 0x04000000, MoveFlagSplineEnabled: 0x08000000, MoveFlagWaterwalking: 0x10000000, MoveFlagSafeFall: 0x20000000, MoveFlagHover: 0x40000000, MoveFlagNoStrafe: 0x10000000, MoveFlagFullSpeedTurning: 0x800000000, MoveFlagFullSpeedPitching: 0x1000000000, MoveFlagAllowPitching: 0x2000000000, MoveFlagInterpolateMovement: 0x40000000000, MoveFlagInterpolateTurning: 0x80000000000, MoveFlagInterpolatePitching: 0x100000000000, }, } SpeedLists = map[vsn.BuildRange][]SpeedType{ vsn.Range(0, vsn.Alpha): { Walk, Run, Swim, Turn, }, vsn.Range(vsn.V1_12_1, 6005): { Walk, Run, RunBackward, Swim, SwimBackward, Turn, }, vsn.Range(vsn.V2_0_1, vsn.V2_4_3): { Walk, Run, RunBackward, Swim, SwimBackward, Flight, FlightBackward, Turn, }, vsn.Range(vsn.V3_0_2, vsn.Max): { Walk, Run, RunBackward, Swim, SwimBackward, Flight, FlightBackward, Turn, Pitch, }, } )
var BlockTypeDescriptors = map[vsn.BuildRange]BlockTypeDescriptor{ {0, 3368}: { Values: 0, Movement: 1, CreateObject: 2, SpawnObject: 2, DeleteFarObjects: 3, DeleteNearObjects: 4, }, {5875, 6005}: { Values: 0, Movement: 1, CreateObject: 2, SpawnObject: 3, DeleteFarObjects: 4, DeleteNearObjects: 5, }, {8606, vsn.Max}: { Values: 0, Movement: 1, CreateObject: 2, SpawnObject: 3, DeleteFarObjects: 4, DeleteNearObjects: 5, }, }
var (
Descriptors = map[vsn.BuildRange]*Descriptor{}
)
var (
ErrNotAStruct = errors.New("update: not a struct")
)
var ItemFlagLookup = map[string]ItemFlag{}
var ItemFlagNames = map[ItemFlag]string{}/* 107 elements not displayed */
var (
MaxBlockCount uint32 = 2048
)
var ( SpeedCodes = map[SpeedType]SpeedOpcodePair{ Walk: {packet.SMSG_FORCE_WALK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_WALK_SPEED}, Run: {packet.SMSG_FORCE_RUN_SPEED_CHANGE, packet.SMSG_SPLINE_SET_RUN_SPEED}, RunBackward: {packet.SMSG_FORCE_RUN_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_RUN_BACK_SPEED}, Swim: {packet.SMSG_FORCE_SWIM_SPEED_CHANGE, packet.SMSG_SPLINE_SET_SWIM_SPEED}, SwimBackward: {packet.SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_SWIM_BACK_SPEED}, Turn: {packet.SMSG_FORCE_TURN_RATE_CHANGE, packet.SMSG_SPLINE_SET_TURN_RATE}, Flight: {packet.SMSG_FORCE_FLIGHT_SPEED_CHANGE, packet.SMSG_SPLINE_SET_FLIGHT_SPEED}, FlightBackward: {packet.SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, packet.SMSG_SPLINE_SET_FLIGHT_BACK_SPEED}, } )
var ( SplineFlagDescriptors = map[vsn.BuildRange]SplineFlagDescriptor{ {0, 5875}: { SplineDone: 0x00000001, SplineFalling: 0x00000002, SplineFlying: 0x00000200, SplineNoSpline: 0x00000400, SplineFinalPoint: 0x00010000, SplineFinalTarget: 0x00020000, SplineFinalAngle: 0x00040000, SplineCyclic: 0x00100000, SplineEnterCycle: 0x00200000, SplineFrozen: 0x00400000, }, {vsn.V2_0_1, vsn.V3_3_5a}: { SplineDone: 0x00000100, SplineFalling: 0x00000200, SplineNoSpline: 0x00000400, SplineParabolic: 0x00000800, SplineWalkmode: 0x00001000, SplineFlying: 0x00002000, SplineOrientationFixed: 0x00004000, SplineFinalPoint: 0x00008000, SplineFinalTarget: 0x00010000, SplineFinalAngle: 0x00020000, SplineCatmullrom: 0x00040000, SplineCyclic: 0x00080000, SplineEnterCycle: 0x00100000, SplineAnimation: 0x00200000, SplineFrozen: 0x00400000, SplineBoardVehicle: 0x00800000, SplineExitVehicle: 0x01000000, SplineOrientationInverted: 0x08000000, }, } )
Functions ¶
func EncodeMoveSpline ¶
func EncodeMovementInfo ¶
func WriteBitmask ¶
func WriteBitmask(mask *Bitmask, descriptor *Descriptor, writer io.Writer) error
Types ¶
type AlignPad ¶
type AlignPad struct{}
AlignPad is equivalent to ChunkPad except it always is included and encoded as zero.
type BitPad ¶
type BitPad struct{}
BitPad will move the bit offset 1 forward. If a detected value is 1 at this location, it will not return an error.
type Bitmask ¶
type Bitmask []uint32
Bitmask stores a bit-packed list of boolean values.
func NewBitmask ¶
func NewBitmask() *Bitmask
func ReadBitmask ¶
func ReadBitmask(descriptor *Descriptor, reader io.Reader) (*Bitmask, error)
type BlockData ¶
type BlockData interface {
Type() BlockType
WriteData(*Encoder, VisibilityFlags, bool) error
}
type BlockTypeDescriptor ¶
type BytePad ¶
type BytePad struct{}
BytePad will move the bit offset 1 byte (8 bits) forward, or to the next byte. In other words, it will re-align your bit stream to the next offset divisible by 8.
type ChunkPad ¶
type ChunkPad struct{}
ChunkPad will move the chunk offset 1 forward. If the decoder detects an enabled value at a ChunkPad's offset, it will return an error.
type CreateBlock ¶
type CreateBlock struct {
BlockType BlockType
ObjectType guid.TypeID
MovementBlock *MovementBlock
ValuesBlock *ValuesBlock
}
CreateBlock is sent when the server notifies the client of a new game object. (Player, Unit, Item, etc.) It contains with it a MovementBlock and a ValuesBlock, which are later updated as individual blocks.
func (*CreateBlock) Type ¶
func (cb *CreateBlock) Type() BlockType
func (*CreateBlock) WriteData ¶
func (cb *CreateBlock) WriteData(e *Encoder, mask VisibilityFlags, create bool) error
type Decoder ¶
type Decoder struct {
*Descriptor
Build vsn.Build
HasTransport bool
Map uint16
SmoothDeleteStartIndex uint16
BlockCount uint32
CurrentBlockIndex uint32
CurrentBlockType BlockType
Reader io.Reader
}
Decoder decodes an SMSG_UPDATE_OBJECT input stream into various sub-structures.
func NewDecoder ¶
Start chewing up blocks.
func (*Decoder) DecodeBlockType ¶
DecodeBlockType decodes the BlockType. This function tries to resolve differences between protocol revisions.
func (*Decoder) DecodeCreateBlock ¶
func (decoder *Decoder) DecodeCreateBlock() (*CreateBlock, error)
func (*Decoder) DecodeDeleteObjectsBlock ¶
func (dec *Decoder) DecodeDeleteObjectsBlock() (*DeleteObjectsBlock, error)
func (*Decoder) DecodeMovementBlock ¶
func (decoder *Decoder) DecodeMovementBlock() (*MovementBlock, error)
only supports 5875 so far
func (*Decoder) DecodeValuesBlockData ¶
func (decoder *Decoder) DecodeValuesBlockData(valuesBlock *ValuesBlock) error
func (*Decoder) IsCreateBlock ¶
func (*Decoder) MoreBlocks ¶
if true, more blocks lie ahead for us to eat
type DeleteObjectsBlock ¶
func (*DeleteObjectsBlock) Type ¶
func (f *DeleteObjectsBlock) Type() BlockType
func (*DeleteObjectsBlock) WriteAll ¶
func (f *DeleteObjectsBlock) WriteAll(e *Encoder) error
type Descriptor ¶
type Descriptor struct {
DescriptorOptions
ObjectDescriptors map[guid.TypeMask]reflect.Type
}
Descriptor describes all the info about a particular version's SMSG_UPDATE_OBJECT structure. Descriptor's underlying Types are backed by a Go structure However,
func GetDescriptor ¶
func GetDescriptor(build vsn.Build) *Descriptor
type DescriptorOptions ¶
type DescriptorOptions uint32
type Encoder ¶
type Encoder struct {
io.Writer
Build vsn.Build
Descriptor *Descriptor
// contains filtered or unexported fields
}
func NewEncoder ¶
func (*Encoder) EncodeBlockType ¶
type ForceSpeedChange ¶
func (*ForceSpeedChange) Encode ¶
func (fs *ForceSpeedChange) Encode(build vsn.Build, out *packet.WorldPacket) (err error)
type ItemFlag ¶
type ItemFlag uint32
const ( ItemFlagNoPickup ItemFlag = iota ItemFlagConjured ItemFlagHasLoot ItemFlagHeroicTooltip ItemFlagDeprecated ItemFlagNoUserDestroy ItemFlagPlayerCast ItemFlagNoEquipCooldown ItemFlagMultiLootQuest ItemFlagIsWrapper ItemFlagUsesResources ItemFlagMultiDrop ItemFlagItemPurchaseRecord ItemFlagPetition ItemFlagHasText ItemFlagNoDisenchant ItemFlagRealDuration ItemFlagNoCreator ItemFlagIsProspectable ItemFlagUniqueEquippable ItemFlagIgnoreForAuras ItemFlagIgnoreDefaultArenaRestrictions ItemFlagNoDurabilityLoss ItemFlagUseWhenShapeshifted ItemFlagHasQuestGlow ItemFlagHideUnusableRecipe ItemFlagNotUseableInArena ItemFlagBindsToAccount ItemFlagNoReagentCost ItemFlagIsMillable ItemFlagReportToGuildChat ItemFlagNoProgressiveLoot ItemFlagFactionHorde ItemFlagFactionAlliance ItemFlagDontIgnoreBuyPrice ItemFlagClassifyAsCaster ItemFlagClassifyAsPhysical ItemFlagEveryoneCanRollNeed ItemFlagNoTradeBindOnAcquire ItemFlagCanTradeBindOnAcquire ItemFlagCanOnlyRollGreed ItemFlagCasterWeapon ItemFlagDeleteOnLogin ItemFlagInternalItem ItemFlagNoVendorValue ItemFlagShowBeforeDiscovered ItemFlagOverrideGoldCost ItemFlagIgnoreDefaultRatedBgRestrictions ItemFlagNotUsableInRatedBg ItemFlagBnetAccountTradeOk ItemFlagConfirmBeforeUse ItemFlagReevaluateBondingOnTransform ItemFlagNoTransformOnChargeDepletion ItemFlagNoAlterItemVisual ItemFlagNoSourceForItemVisual ItemFlagIgnoreQualityForItemVisualSource ItemFlagNoDurability ItemFlagRoleTank ItemFlagRoleHealer ItemFlagRoleDamage ItemFlagCanDropInChallengeMode ItemFlagNeverStackInLootUi ItemFlagDisenchantToLootTable ItemFlagUsedInATradeskill ItemFlagDontDestroyOnQuestAccept ItemFlagItemCanBeUpgraded ItemFlagUpgradeFromItemOverridesDropUpgrade ItemFlagAlwaysFfaInLoot ItemFlagHideUpgradeLevelsIfNotUpgraded ItemFlagUpdateInteractions ItemFlagUpdateDoesntLeaveProgressiveWinHistory ItemFlagIgnoreItemHistoryTracker ItemFlagIgnoreItemLevelCapInPvp ItemFlagDisplayAsHeirloom ItemFlagSkipUseCheckOnPickup ItemFlagObsolete ItemFlagDontDisplayInGuildNews ItemFlagPvpTournamentGear ItemFlagRequiresStackChangeLog ItemFlagUnusedFlag ItemFlagHideNameSuffix ItemFlagPushLoot ItemFlagDontReportLootLogToParty ItemFlagAlwaysAllowDualWield ItemFlagObliteratable ItemFlagActsAsTransmogHiddenVisualOption ItemFlagExpireOnWeeklyReset ItemFlagDoesntShowUpInTransmogUntilCollected ItemFlagCanStoreEnchants ItemFlagHideQuestItemFromObjectTooltip ItemFlagDoNotToast ItemFlagIgnoreCreationContextForProgressiveWinHistory ItemFlagForceAllSpecsForItemHistory ItemFlagSaveOnConsume ItemFlagContainerSavesPlayerData ItemFlagNoVoidStorage ItemFlagHandleOnUseEffectImmediately ItemFlagAlwaysShowItemLevelInTooltip ItemFlagShowsGenerationWithRandomStats ItemFlagActivateOnEquipEffectsWhenTransmogrified ItemFlagEnforceTransmogWithChildItem ItemFlagScrapable ItemFlagBypassRepRequirementsForTransmog ItemFlagDisplayOnlyOnDefinedRaces ItemFlagRegulatedCommodity ItemFlagCreateLootImmediately ItemFlagGenerateLootSpecItem ItemFlagEnd )
type ItemFlags ¶
type ItemFlags struct {
Bitmask Bitmask
}
func (*ItemFlags) DecodeWord ¶
func (*ItemFlags) EncodeWord ¶
type MoveFlagDescriptor ¶
type MoveFlags ¶
type MoveFlags uint64
const ( MoveFlagForward MoveFlags = 1 << iota MoveFlagBackward MoveFlagStrafeLeft MoveFlagStrafeRight MoveFlagTurnLeft MoveFlagTurnRight MoveFlagPitchUp MoveFlagPitchDown MoveFlagWalkMode MoveFlagLevitating MoveFlagFlying MoveFlagFalling MoveFlagFallingFar MoveFlagSwimming MoveFlagSplineEnabled MoveFlagCanFly MoveFlagFlyingOld MoveFlagOnTransport MoveFlagSplineElevation MoveFlagRoot MoveFlagWaterwalking MoveFlagSafeFall MoveFlagHover // Alpha MoveFlagTimeValid MoveFlagImmobilized MoveFlagDontCollide MoveFlagRedirected MoveFlagPendingStop MoveFlagPendingUnstrafe MoveFlagPendingFall MoveFlagPendingForward MoveFlagPendingBackward MoveFlagPendingStrLeft MoveFlagPendingStrRight MoveFlagMoved MoveFlagSliding // TBC MoveFlagAscending // WOTLK MoveFlagNoStrafe MoveFlagFullSpeedTurning MoveFlagFullSpeedPitching MoveFlagAllowPitching MoveFlagInterpolateMovement MoveFlagInterpolateTurning MoveFlagInterpolatePitching )
type MoveSpline ¶
type MoveSpline struct {
Flags SplineFlags
Facing tempest.C3Vector
FacingTarget guid.GUID
FacingAngle float32
TimePassed int32
Duration int32
ID uint32
DurationMod float32
DurationModNext float32
VerticalAcceleration float32
EffectStartTime int32
Spline []tempest.C3Vector
SplineMode uint8
Endpoint tempest.C3Vector
}
func DecodeMoveSpline ¶
type MovementBlock ¶
type MovementBlock struct {
ID guid.GUID
UpdateFlags UpdateFlags
Info *MovementInfo
Speeds Speeds
Spline *MoveSpline
Position tempest.C4Vector
All uint32
LowGUID uint32
HighGUID uint32
Victim guid.GUID
WorldTime uint32
VehicleID uint32
VehicleRotation float32
Rotation tempest.C4Quaternion
Player bool
}
func (*MovementBlock) Type ¶
func (mBlock *MovementBlock) Type() BlockType
func (*MovementBlock) WriteData ¶
func (mb *MovementBlock) WriteData(e *Encoder, mask VisibilityFlags, create bool) error
type MovementInfo ¶
type MovementInfo struct {
Flags MoveFlags
Time uint32
Position tempest.C4Vector
TransportGUID guid.GUID
TransportPosition tempest.C4Vector
TransportTime uint32
TransportSeat int8
TransportInterpolateTime uint32
Pitch float32
FallTime uint32
FallVelocity float32
FallSin float32
FallCos float32
FallXYSpeed float32
SplineElevation float32
}
func DecodeMovementInfo ¶
type MovementPacket ¶
func (*MovementPacket) Decode ¶
func (mp *MovementPacket) Decode(build vsn.Build, in *packet.WorldPacket) error
func (*MovementPacket) Encode ¶
func (mp *MovementPacket) Encode(build vsn.Build, out *packet.WorldPacket) error
type SetActiveMover ¶
func (*SetActiveMover) Decode ¶
func (sam *SetActiveMover) Decode(build vsn.Build, in *packet.WorldPacket) (err error)
func (*SetActiveMover) Encode ¶
func (sam *SetActiveMover) Encode(build vsn.Build, out *packet.WorldPacket) (err error)
type SetSheathe ¶
type SetSheathe struct {
Mode uint32
}
func (*SetSheathe) Decode ¶
func (swm *SetSheathe) Decode(build vsn.Build, in *packet.WorldPacket) error
func (*SetSheathe) Encode ¶
func (swm *SetSheathe) Encode(build vsn.Build, out *packet.WorldPacket) error
type SetStandState ¶
type SetStandState struct {
State StandState
}
func (*SetStandState) Decode ¶
func (sss *SetStandState) Decode(build vsn.Build, in *packet.WorldPacket) (err error)
func (*SetStandState) Encode ¶
func (sss *SetStandState) Encode(build vsn.Build, out *packet.WorldPacket) (err error)
type SetWeaponMode ¶
type SetWeaponMode struct {
Mode uint32
}
func (*SetWeaponMode) Decode ¶
func (swm *SetWeaponMode) Decode(build vsn.Build, in *packet.WorldPacket) error
func (*SetWeaponMode) Encode ¶
func (swm *SetWeaponMode) Encode(build vsn.Build, out *packet.WorldPacket) error
type SpeedOpcodePair ¶
type SplineFlagDescriptor ¶
type SplineFlagDescriptor map[SplineFlags]uint32
type SplineFlags ¶
type SplineFlags uint32
const ( SplineNone SplineFlags = 1 << iota // x00-xFF(first byte) used as animation Ids storage in pair with Animation flag SplineDone SplineFalling // Affects elevation computation, can't be combined with Parabolic flag SplineNoSpline SplineParabolic // Affects elevation computation, can't be combined with Falling flag SplineCanSwim SplineFlying // Smooth movement(Catmullrom interpolation mode), flying animation SplineOrientationFixed // Model ori = 0x00008000, SplineFinalTarget SplineFinalPoint SplineFinalAngle SplineCatmullrom // Used Catmullrom interpolation mode SplineCyclic // Movement by cycled spline SplineEnterCycle // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done SplineAnimation // Plays animation after some time passed SplineFrozen // Will never arrive SplineTransportEnter SplineTransportExit SplineBackward SplineWalkmode SplineBoardVehicle SplineExitVehicle SplineOrientationInverted )
type SplineSpeedChange ¶
func (*SplineSpeedChange) Encode ¶
func (ss *SplineSpeedChange) Encode(build vsn.Build, out *packet.WorldPacket) (err error)
type StandState ¶
type StandState uint8
const ( StateStand StandState = iota StateSit StateSitChair StateSleep StateSitLowChair StateSitMediumChair StateSitHighChair StateDead StateKneel StateCustom )
type UpdateFlagDescriptor ¶
type UpdateFlagDescriptor map[UpdateFlags]uint32
map serverside storage codes to per-version client codes
type UpdateFlags ¶
type UpdateFlags uint32
const ( UpdateFlagNone UpdateFlags = 1 << iota UpdateFlagSelf UpdateFlagTransport UpdateFlagHasAttackingTarget UpdateFlagLowGUID UpdateFlagHighGUID UpdateFlagAll UpdateFlagLiving UpdateFlagHasPosition UpdateFlagVehicle UpdateFlagPosition UpdateFlagRotation )
func (UpdateFlags) String ¶
func (uf UpdateFlags) String() string
type Value ¶
type Value struct {
Block *ValuesBlock
Bitmask *Bitmask
ChangeMaskOffset uint32
Value reflect.Value
}
func (*Value) FieldIndex ¶
Take a value with an already computed base changemask offset, building until the index is reached
func (*Value) FieldNames ¶
Returns a list of fields contained within a Struct value.
func (*Value) SetFloat32 ¶
type ValuesBlock ¶
type ValuesBlock struct {
sync.Mutex
TypeMask guid.TypeMask
// Descriptor describes the exact structure of a particular version's SMSG_UPDATE_OBJECT.
Descriptor *Descriptor
// Points to chunks that have been updated
ChangeMask *Bitmask
// StorageDescriptor is the version and type-specific structure. Descriptors can be found in packages labelled d<build number>
// Write your own descriptors to support a lesser known version if there is a change in SMSG_UPDATE_OBJECT
StorageDescriptor reflect.Value
}
ValuesBlock acts a wrapper container for reflection-based update field storage and serialization
func NewValuesBlock ¶
func (*ValuesBlock) ClearChanges ¶
func (vb *ValuesBlock) ClearChanges()
func (*ValuesBlock) ClearChangesAndUnlock ¶
func (vb *ValuesBlock) ClearChangesAndUnlock()
func (*ValuesBlock) Copy ¶
func (v *ValuesBlock) Copy() *ValuesBlock
ValuesBlock data is copied into a new region of memory where it can be changed without ruining the original, at the cost of GC
func (*ValuesBlock) Get ¶
func (vb *ValuesBlock) Get(name string) *Value
func (*ValuesBlock) SetBit ¶
func (vb *ValuesBlock) SetBit(glob string, value bool)
func (*ValuesBlock) SetByte ¶
func (vb *ValuesBlock) SetByte(glob string, value uint8)
func (*ValuesBlock) SetFloat32 ¶
func (vb *ValuesBlock) SetFloat32(glob string, value float32)
func (*ValuesBlock) SetInt32 ¶
func (vb *ValuesBlock) SetInt32(glob string, value int32)
func (*ValuesBlock) SetUint32 ¶
func (vb *ValuesBlock) SetUint32(glob string, nvalue uint32)
func (*ValuesBlock) Type ¶
func (vb *ValuesBlock) Type() BlockType
func (*ValuesBlock) Value ¶
func (vb *ValuesBlock) Value() *Value
func (*ValuesBlock) WriteData ¶
func (valuesBlock *ValuesBlock) WriteData(e *Encoder, viewMask VisibilityFlags, create bool) error
type ValuesDecoder ¶
type ValuesDecoder struct {
Decoder *Decoder
CurrentBitmask *Bitmask
CurrentChunk [4]byte
ChunkPos, BitPos uint32
}
func (*ValuesDecoder) BytePos ¶
func (valdec *ValuesDecoder) BytePos() int
func (*ValuesDecoder) Decode ¶
func (valdec *ValuesDecoder) Decode(field reflect.Value, name string) error
func (*ValuesDecoder) FillCurrentChunk ¶
func (valdec *ValuesDecoder) FillCurrentChunk()
func (*ValuesDecoder) Fwd ¶
func (valdec *ValuesDecoder) Fwd(n uint32)
Fwd the decoder's chunk offset forward by n chunks
func (*ValuesDecoder) FwdBits ¶
func (valdec *ValuesDecoder) FwdBits(n uint32)
FwdBits move the decoder's bit offset by n bits
func (*ValuesDecoder) FwdBytes ¶
func (valdec *ValuesDecoder) FwdBytes(n uint32)
FwdBits move the decoder's byte offset by n bytes
func (*ValuesDecoder) ReadFloat32 ¶
func (valdec *ValuesDecoder) ReadFloat32(to reflect.Value) error
func (*ValuesDecoder) ReadUint16 ¶
func (valdec *ValuesDecoder) ReadUint16(to reflect.Value) error
func (*ValuesDecoder) ReadUint32 ¶
func (valdec *ValuesDecoder) ReadUint32(to reflect.Value) error
func (*ValuesDecoder) ReadUint64 ¶
func (valdec *ValuesDecoder) ReadUint64(to reflect.Value) error
type ValuesEncoder ¶
type ValuesEncoder struct {
Encoder *Encoder
ViewMask VisibilityFlags
Create bool
ValuesBlock *ValuesBlock
CurrentBitmask *Bitmask
ChunkPos uint32
BitPos uint32
NextChunk [4]byte
// WritePos: the current chunk position being recorded to the stream.
WritePos uint32
}
func (*ValuesEncoder) ChunkCount ¶
func (ve *ValuesEncoder) ChunkCount(mask *Bitmask) int
func (*ValuesEncoder) EncodeValue ¶
func (*ValuesEncoder) SetCreateBits ¶
func (valenc *ValuesEncoder) SetCreateBits() error
type VisibilityFlags ¶
type VisibilityFlags uint32
const ( None VisibilityFlags = 0 Owner VisibilityFlags = 0x01 PartyMember VisibilityFlags = 0x02 UnitAll VisibilityFlags = 0x04 Empath VisibilityFlags = 0x08 )
Source Files
¶
- active_mover.go
- alpha.go
- auraflags.go
- blocktype_descriptors.go
- blocktype_string.go
- create_block.go
- decode.go
- delete_objects_block.go
- descriptor.go
- doc.go
- dump.go
- encode.go
- field.go
- itemflags.go
- movement.go
- movement_spline.go
- padding_types.go
- set_weapon_mode.go
- speed_change.go
- speedtype_string.go
- standstate.go
- target.go
- util.go
- values_block.go
- values_decoder.go
- values_encoder.go
- values_storage.go
- x_gen_cpp.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Descriptor module for version 12340 3.3.5a (WotLK)
|
Descriptor module for version 12340 3.3.5a (WotLK) |
|
Descriptor module for version 3368 (Alpha)
|
Descriptor module for version 3368 (Alpha) |
|
Descriptor module for protocol 5875 1.12.1 (Vanilla)
|
Descriptor module for protocol 5875 1.12.1 (Vanilla) |
|
Descriptor module for version 8606 2.4.3 (TBC)
|
Descriptor module for version 8606 2.4.3 (TBC) |
|
This package imports all the official object update descriptors.
|
This package imports all the official object update descriptors. |