blaze

package
v0.0.0-...-de25ef5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntList    SubType = 0
	StringList         = 1
	StructList         = 3
	TripleList         = 9
	FloatList          = 10
)

Variables

View Source
var CommandNames = map[uint32]string{}/* 186 elements not displayed */
View Source
var ComponentNames = map[uint16]string{
	0x1:    "Authentication Component",
	0x3:    "Example Component",
	0x4:    "Game Manager Component",
	0x5:    "Redirect Component",
	0x6:    "Play Groups Component",
	0x7:    "Stats Component",
	0x9:    "Util Component",
	0xA:    "Census Data Component",
	0xB:    "Clubs Component",
	0xC:    "Game Report Legacy Component",
	0xD:    "League Component",
	0xE:    "Mail Component",
	0xF:    "Messaging Component",
	0x14:   "Locker Component",
	0x15:   "Rooms Component",
	0x17:   "Tournaments Component",
	0x18:   "Commerce Info Component",
	0x19:   "Association Lists Component",
	0x1B:   "GPS Content Controller Component",
	0x1C:   "Game Reporting Component",
	0x7D0:  "Dynamic Filter Component",
	0x801:  "RSP Component",
	0x7802: "User Sessions Component",
}
View Source
var NotificationNames = map[uint32]string{

	0x0004000A: "NotifyMatchmakingFailed",
	0x0004000C: "NotifyMatchmakingAsyncStatus",
	0x0004000F: "NotifyGameCreated",
	0x00040010: "NotifyGameRemoved",
	0x00040014: "NotifyGameSetup",
	0x00040015: "NotifyPlayerJoining",
	0x00040016: "NotifyJoiningPlayerInitiateConnections",
	0x00040017: "NotifyPlayerJoiningQueue",
	0x00040018: "NotifyPlayerPromotedFromQueue",
	0x00040019: "NotifyPlayerClaimingReservation",
	0x0004001E: "NotifyPlayerJoinCompleted",
	0x00040028: "NotifyPlayerRemoved",
	0x0004003C: "NotifyHostMigrationFinished",
	0x00040046: "NotifyHostMigrationStart",
	0x00040047: "NotifyPlatformHostInitialized",
	0x00040050: "NotifyGameAttribChange",
	0x0004005A: "NotifyPlayerAttribChange",
	0x0004005F: "NotifyPlayerCustomDataChange",
	0x00040064: "NotifyGameStateChange",
	0x0004006E: "NotifyGameSettingsChange",
	0x0004006F: "NotifyGameCapacityChange",
	0x00040070: "NotifyGameReset",
	0x00040071: "NotifyGameReportingIdChange",
	0x00040073: "NotifyGameSessionUpdated",
	0x00040074: "NotifyGamePlayerStateChange",
	0x00040075: "NotifyGamePlayerTeamChange",
	0x00040076: "NotifyGameTeamIdChange",
	0x00040077: "NotifyProcessQueue",
	0x00040078: "NotifyPresenceModeChanged",
	0x00040079: "NotifyGamePlayerQueuePositionChange",
	0x000400C9: "NotifyGameListUpdate",
	0x000400CA: "NotifyAdminListChange",
	0x000400DC: "NotifyCreateDynamicDedicatedServerGame",
	0x000400E6: "NotifyGameNameChange",
}

Functions

func LabelToTag

func LabelToTag(label string) uint32

func NewConnection

func NewConnection(conn net.Conn)

func ReadPair

func ReadPair(buf *PacketBuff) Pair

func ReadTriple

func ReadTriple(buf *PacketBuff) Triple

func TagToLabel

func TagToLabel(tag uint32) string

func WriteTdf

func WriteTdf[T Tdf](buf *PacketBuff, value T)

Types

type BlobTdf

type BlobTdf struct {
	Data []byte
	TdfImpl
}

func NewBlob

func NewBlob(label string, data []byte) BlobTdf

func (BlobTdf) GetHead

func (t BlobTdf) GetHead() TdfImpl

func (BlobTdf) Write

func (t BlobTdf) Write(buf *PacketBuff)

type Connection

type Connection struct {
	*PacketBuff
	net.Conn
}

type FloatTdf

type FloatTdf struct {
	Value float64
	TdfImpl
}

func NewFloat

func NewFloat(label string, value float64) FloatTdf

func (FloatTdf) GetHead

func (t FloatTdf) GetHead() TdfImpl

func (FloatTdf) Write

func (t FloatTdf) Write(buf *PacketBuff)

type Int64Tdf

type Int64Tdf struct {
	Value int64

	TdfImpl
}

func NewInt64

func NewInt64(label string, value int64) Int64Tdf

func (Int64Tdf) GetHead

func (t Int64Tdf) GetHead() TdfImpl

func (Int64Tdf) Write

func (t Int64Tdf) Write(buf *PacketBuff)

type ListTdf

type ListTdf struct {
	SubType SubType
	Count   int32
	List    *list.List

	TdfImpl
}

func NewList

func NewList(label string, subtype SubType, count int32, list *list.List) ListTdf

func (ListTdf) GetHead

func (t ListTdf) GetHead() TdfImpl

func (ListTdf) Write

func (t ListTdf) Write(buf *PacketBuff)

type Packet

type Packet struct {
	Length    uint16
	Component uint16
	Command   uint16
	Error     uint16
	QType     uint16
	Id        uint16
	ExtLength uint16
	Content   []byte
}

func (*Packet) ReadContent

func (p *Packet) ReadContent() *list.List

func (*Packet) ToDescriptor

func (p *Packet) ToDescriptor() string

type PacketBuff

type PacketBuff struct {
	*bytes.Buffer
}

func (*PacketBuff) EncodePacket

func (b *PacketBuff) EncodePacket(comp uint16, cmd uint16, err uint16, qType uint16, id uint16, content list.List) []byte

func (*PacketBuff) EncodePacketRaw

func (b *PacketBuff) EncodePacketRaw(packet Packet) []byte

func (*PacketBuff) Float64

func (b *PacketBuff) Float64() float64

Float64 reads a float64 from the provided packet buffer using the big endian byte order

func (*PacketBuff) ReadAllPackets

func (b *PacketBuff) ReadAllPackets() *list.List

func (*PacketBuff) ReadBlobTdf

func (b *PacketBuff) ReadBlobTdf(head TdfImpl) BlobTdf

func (*PacketBuff) ReadFloatTdf

func (b *PacketBuff) ReadFloatTdf(head TdfImpl) FloatTdf

func (*PacketBuff) ReadIntTdf

func (b *PacketBuff) ReadIntTdf(head TdfImpl) Int64Tdf

func (*PacketBuff) ReadListTdf

func (b *PacketBuff) ReadListTdf(head TdfImpl) ListTdf

func (*PacketBuff) ReadPacket

func (b *PacketBuff) ReadPacket() *Packet

ReadPacket reads a game packet from the provided packet reader

func (*PacketBuff) ReadPacketHeading

func (b *PacketBuff) ReadPacketHeading() *Packet

ReadPacketHeading reads a game packet from the provided packet reader. but only reads the heading portion of the packet skips over the packet contents.

func (*PacketBuff) ReadPairListTdf

func (b *PacketBuff) ReadPairListTdf(head TdfImpl) PairListTdf

func (*PacketBuff) ReadPairTdf

func (b *PacketBuff) ReadPairTdf(head TdfImpl) PairTdf

func (*PacketBuff) ReadString

func (b *PacketBuff) ReadString() string

ReadString reads a string from the buffer

func (*PacketBuff) ReadStringTdf

func (b *PacketBuff) ReadStringTdf(head TdfImpl) StringTdf

func (*PacketBuff) ReadStructTdf

func (b *PacketBuff) ReadStructTdf(head TdfImpl) StructTdf

func (*PacketBuff) ReadStructValues

func (b *PacketBuff) ReadStructValues() (*list.List, bool)

func (*PacketBuff) ReadTdf

func (b *PacketBuff) ReadTdf() Tdf

func (*PacketBuff) ReadTripleTdf

func (b *PacketBuff) ReadTripleTdf(head TdfImpl) TripleTdf

func (*PacketBuff) ReadUnionTdf

func (b *PacketBuff) ReadUnionTdf(head TdfImpl) UnionTdf

func (*PacketBuff) ReadVarInt

func (b *PacketBuff) ReadVarInt() uint64

ReadVarInt reads a var int from the packet buffer

func (*PacketBuff) ReadVarIntListTdf

func (b *PacketBuff) ReadVarIntListTdf(head TdfImpl) VarIntListTdf

func (*PacketBuff) UInt16

func (b *PacketBuff) UInt16() uint16

UInt16 reads an uint16 from the provided packet buffer using the big endian byte order

func (*PacketBuff) UInt32

func (b *PacketBuff) UInt32() uint32

UInt32 reads an uint32 from the provided packet buffer using the big endian byte order

func (*PacketBuff) WriteNum

func (b *PacketBuff) WriteNum(value any)

WriteNum takes any number type and writes it to the packet

func (*PacketBuff) WriteString

func (b *PacketBuff) WriteString(value string)

WriteString writes a string to the buffer

func (*PacketBuff) WriteVarInt

func (b *PacketBuff) WriteVarInt(value int64)

WriteVarInt writes a var int to the packet buffer

type PairListTdf

type PairListTdf struct {
	SubTypeA SubType
	SubTypeB SubType
	Count    int32

	ListA *list.List
	ListB *list.List

	TdfImpl
}

func NewPairList

func NewPairList(label string, subtypeA SubType, subtypeB SubType, listA *list.List, listB *list.List, count int32) PairListTdf

func (PairListTdf) GetHead

func (t PairListTdf) GetHead() TdfImpl

func (PairListTdf) Write

func (l PairListTdf) Write(buf *PacketBuff)

type PairTdf

type PairTdf struct {
	Pair
	TdfImpl
}

func NewPair

func NewPair(label string, value Pair) PairTdf

func (PairTdf) GetHead

func (t PairTdf) GetHead() TdfImpl

func (PairTdf) Write

func (t PairTdf) Write(buf *PacketBuff)

type StringTdf

type StringTdf struct {
	Value string
	TdfImpl
}

func NewString

func NewString(label string, value string) StringTdf

func (StringTdf) GetHead

func (t StringTdf) GetHead() TdfImpl

func (StringTdf) Write

func (t StringTdf) Write(buf *PacketBuff)

type StructTdf

type StructTdf struct {
	Values *list.List // List of TdfImpl values
	Start2 bool

	TdfImpl
}

func NewStruct

func NewStruct(label string, values *list.List) StructTdf

func NewStruct2

func NewStruct2(label string, values *list.List) StructTdf

func NewStructStub

func NewStructStub(values *list.List, start2 bool) StructTdf

func (StructTdf) GetHead

func (t StructTdf) GetHead() TdfImpl

func (StructTdf) Write

func (t StructTdf) Write(buf *PacketBuff)

type SubType

type SubType = byte

type Tdf

type Tdf interface {
	Write(buf *PacketBuff)
	GetHead() TdfImpl
}

type TdfImpl

type TdfImpl struct {
	Label string
	Tag   uint32
	Type  TdfType

	Tdf
}

func NewTdf

func NewTdf(label string, t TdfType) TdfImpl

type TdfType

type TdfType byte
const (
	IntType TdfType = iota
	StringType
	BlobType
	StructType
	ListType
	PairListType
	UnionType
	VarIntListType
	PairType
	TripleType
	FloatType

	EmptyType TdfType = 0x7F
)

type TripleTdf

type TripleTdf struct {
	Triple
	TdfImpl
}

func NewTriple

func NewTriple(label string, value Triple) TripleTdf

func (TripleTdf) GetHead

func (t TripleTdf) GetHead() TdfImpl

func (TripleTdf) Write

func (t TripleTdf) Write(buf *PacketBuff)

type UnionTdf

type UnionTdf struct {
	Type    TdfType
	Content Tdf
	TdfImpl
}

func NewUnion

func NewUnion(label string, uType TdfType, value Tdf) UnionTdf

func (UnionTdf) GetHead

func (t UnionTdf) GetHead() TdfImpl

func (UnionTdf) Write

func (t UnionTdf) Write(buf *PacketBuff)

type VarIntListTdf

type VarIntListTdf struct {
	Count int32
	List  *list.List // List of int64
	TdfImpl
}

func NewVarIntList

func NewVarIntList(label string, count int32, list *list.List) VarIntListTdf

func (VarIntListTdf) GetHead

func (t VarIntListTdf) GetHead() TdfImpl

func (VarIntListTdf) Write

func (t VarIntListTdf) Write(buf *PacketBuff)

Jump to

Keyboard shortcuts

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