sendtables

package
v0.0.0-...-9ebba78 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sendtables contains sendtable specific magic and should really be better documented (TODO).

Index

Constants

View Source
const (
	SPT_Int int = iota
	SPT_Float
	SPT_Vector
	SPT_VectorXY
	SPT_String
	SPT_Array
	SPT_DataTable
	SPT_Int64
)
View Source
const (
	DT_MaxStringBits   = 9
	DT_MaxStringLength = 1 << DT_MaxStringBits
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	ID          int
	ServerClass *ServerClass
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(id int, serverClass *ServerClass) *Entity

func (*Entity) ApplyUpdate

func (e *Entity) ApplyUpdate(reader *bs.BitReader)

func (*Entity) CollectProperties

func (e *Entity) CollectProperties(ppBase *map[int]PropValue)

func (*Entity) FindProperty

func (e *Entity) FindProperty(name string) *PropertyEntry

FindProperty finds a property on the entity by name.

func (*Entity) Props

func (e *Entity) Props() []PropertyEntry

Props returns all property entries for a entity.

type EntityCreatedEvent

type EntityCreatedEvent struct {
	ServerClass *ServerClass
	Entity      *Entity
}

type EntityCreatedHandler

type EntityCreatedHandler func(EntityCreatedEvent)

type FlattenedPropEntry

type FlattenedPropEntry struct {
	// contains filtered or unexported fields
}

func (FlattenedPropEntry) Name

func (fpe FlattenedPropEntry) Name() string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func (*Parser) ClassBits

func (p *Parser) ClassBits() int

func (*Parser) FindServerClassByName

func (p *Parser) FindServerClassByName(name string) *ServerClass

func (*Parser) ParsePacket

func (p *Parser) ParsePacket(r *bs.BitReader)

func (*Parser) ServerClasses

func (p *Parser) ServerClasses() []*ServerClass

type PropValue

type PropValue struct {
	VectorVal r3.Vector
	IntVal    int
	ArrayVal  []PropValue
	StringVal string
	FloatVal  float32
}

type PropertyEntry

type PropertyEntry struct {
	// contains filtered or unexported fields
}

func NewPropertyEntry

func NewPropertyEntry(entry *FlattenedPropEntry, index int) PropertyEntry

func (*PropertyEntry) Entry

func (pe *PropertyEntry) Entry() *FlattenedPropEntry

func (*PropertyEntry) FirePropertyUpdate

func (pe *PropertyEntry) FirePropertyUpdate(value PropValue)

func (*PropertyEntry) RegisterPropertyUpdateHandler

func (pe *PropertyEntry) RegisterPropertyUpdateHandler(handler PropertyUpdateHandler)

type PropertyUpdateHandler

type PropertyUpdateHandler func(PropValue)

type SendPropertyFlags

type SendPropertyFlags int

SendPropertyFlags contains multiple send property flags.

const (
	SPF_Unsigned SendPropertyFlags = (1 << iota)
	SPF_Coord
	SPF_NoScale
	SPF_RoundDown
	SPF_RoundUp
	SPF_Normal
	SPF_Exclude
	SPF_XYZE
	SPF_InsideArray
	SPF_ProxyAlwaysYes
	SPF_IsVectorElement
	SPF_Collapsible
	SPF_CoordMp
	SPF_CoordMpLowPrecision
	SPF_CoordMpIntegral
	SPF_CellCoord
	SPF_CellCoordLowPrecision
	SPF_CellCoordIntegral
	SPF_ChangesOften
	SPF_VarInt
)

func (SendPropertyFlags) HasFlagSet

func (spf SendPropertyFlags) HasFlagSet(flag SendPropertyFlags) bool

HasFlagSet returns true if the given flag is set

type SendTable

type SendTable struct {
	Name  string
	IsEnd bool
	// contains filtered or unexported fields
}

type SendTableProperty

type SendTableProperty struct {
	Flags            SendPropertyFlags
	Name             string
	DataTableName    string
	LowValue         float32
	HighValue        float32
	NumberOfBits     int
	NumberOfElements int
	Priority         int
	RawType          int
}

type ServerClass

type ServerClass struct {
	ClassID        int
	DataTableID    int
	Name           string
	DTName         string
	FlattenedProps []FlattenedPropEntry
	BaseClasses    []*ServerClass
	// contains filtered or unexported fields
}

func (*ServerClass) FireEntityCreatedEvent

func (sc *ServerClass) FireEntityCreatedEvent(entity *Entity)

func (*ServerClass) RegisterEntityCreatedHandler

func (sc *ServerClass) RegisterEntityCreatedHandler(handler EntityCreatedHandler)

func (*ServerClass) String

func (sc *ServerClass) String() string

Jump to

Keyboard shortcuts

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