network

package
v0.0.0-...-e5a3c4b Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIZE_READ_TYPE = 0
	BODY_READ_TYPE = 1
	READ_DELAY     = 0 // time.Microsecond * 50
)
View Source
const READ_SIZE_RETRY = 3

Variables

This section is empty.

Functions

func DecodeDelphiTime

func DecodeDelphiTime(double float64) time.Time

func DecodeUtf16

func DecodeUtf16(inputBytes []byte) string

func Float64frombytes

func Float64frombytes(bytes []byte) float64

func NewBoolPacket

func NewBoolPacket(packetNum uint16, args ...interface{}) *boolPacket

func NewBuffBarInfo

func NewBuffBarInfo() *scGetBuffBarInfoPacket

func NewByteArrayPacket

func NewByteArrayPacket(packetNum uint16, args ...interface{}) *byteArrayPacket

func NewBytePacket

func NewBytePacket(packetNum uint16, args ...interface{}) *bytePacket

func NewClientTargetInfoPacket

func NewClientTargetInfoPacket() *scClientTargetInfoPacket

Needs testing

func NewFloatPacket

func NewFloatPacket(packetNum uint16, args ...interface{}) *floatPacket

func NewGetExtInfoPacket

func NewGetExtInfoPacket() *scGetExtInfoPacket

func NewGetGumpInfoPacket

func NewGetGumpInfoPacket(args ...interface{}) *scGetGumpInfoPacket

func NewGetMapCellPacket

func NewGetMapCellPacket(args ...interface{}) *scGetMapCellPacket

Needs testing

func NewGetMultisPacket

func NewGetMultisPacket(args ...interface{}) *getMultisPacket

func NewGetShopListPacket

func NewGetShopListPacket() *scGetShopListPacket

Needs testing

func NewGetStaticTilesArrayPacket

func NewGetStaticTilesArrayPacket(args ...interface{}) *scGetStaticTilesArrayPacket

Needs testing

func NewInt8Packet

func NewInt8Packet(packetNum uint16, args ...interface{}) *int8Packet

func NewIntPacket

func NewIntPacket(packetNum uint16, args ...interface{}) *intPacket

func NewIsWorldCellPassablePacket

func NewIsWorldCellPassablePacket(args ...interface{}) *isWorldCellPassablePacket

func NewPoint2DPacket

func NewPoint2DPacket(packetNum uint16, args ...interface{}) *scPoint2DPacket

func NewReadStaticsXYPacket

func NewReadStaticsXYPacket(args ...interface{}) *readStaticsXYPacket

func NewReciever

func NewReciever(conn *net.TCPConn, mws *[]func(readBuff []byte) []byte, debug bool)

func NewSender

func NewSender(conn *net.TCPConn, pl *[]ScPacketData)

func NewStealthClientInfoPacket

func NewStealthClientInfoPacket() *stealthClientInfoPacket

func NewStringPacket

func NewStringPacket(packetNum uint16, args ...interface{}) *stringPacket

func NewTimePacket

func NewTimePacket(packetNum uint16, args ...interface{}) *timePacket

func NewUint16Packet

func NewUint16Packet(packetNum uint16, args ...interface{}) *uint16Packet

func NewUint32ArrayPacket

func NewUint32ArrayPacket(packetNum uint16, args ...interface{}) *uint32ArrayPacket

func NewUint32Packet

func NewUint32Packet(packetNum uint16, args ...interface{}) *uint32Packet

func NewVoidPacket

func NewVoidPacket(packetNum uint16, args ...interface{}) *voidPacket

Types

type Composer

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

func NewComposer

func NewComposer(e *Encoder) *Composer

func (*Composer) GetBytesToSend

func (c *Composer) GetBytesToSend() []byte

func (*Composer) SetDatabytes

func (c *Composer) SetDatabytes(d []interface{})

func (*Composer) SetHeader

func (c *Composer) SetHeader(pNum uint16)

func (*Composer) SetPacketId

func (c *Composer) SetPacketId()

type Encoder

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

func NewEncoder

func NewEncoder(endian binary.ByteOrder) *Encoder

func (*Encoder) TransformData

func (e *Encoder) TransformData(dataBytes *[]byte, data []interface{})

func (*Encoder) TransformType

func (e *Encoder) TransformType(dataBytes *[]byte, v interface{})

type Receiver

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

type ScPacketData

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

func (*ScPacketData) Send

func (p *ScPacketData) Send()

type Sender

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

func GetInstance

func GetInstance() *Sender

func (*Sender) Send

func (s *Sender) Send(spd *ScPacketData)

Default sender func that writes to connection

Jump to

Keyboard shortcuts

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