steamcm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDispatchLayer

func MakeDispatchLayer(handlers ...Handler) *dispatchLayer

func NewDispatchLayer

func NewDispatchLayer(dispatchMap map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error)) *dispatchLayer

func NewEncryptedLayer

func NewEncryptedLayer(universe steamlang.EUniverse) *encryptedLayer

func NewFuture

func NewFuture[T any]() *future[T]

func NewLayerStack

func NewLayerStack(bottom Layer, top Layer) *layerStack

func NewPacketLayer

func NewPacketLayer() *packetLayer

func NewSessionLayer

func NewSessionLayer() *sessionLayer

func NewTCPLayer

func NewTCPLayer() *tcpLayer

Types

type Connection

type Connection interface {
	SendPacket(*steammsg.Packet) error
	GetNextJobId() steam.JobId
	RegisterJob(steam.JobId, func(any))
}

type Encrypter

type Encrypter interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

func NewEncrypter

func NewEncrypter(key []byte, secret []byte) Encrypter

type Event

type Event struct {
	Type    EventType
	Payload any
}

func MakeEvent

func MakeEvent(etype EventType, payload any) Event

func (*Event) WithPayload

func (event *Event) WithPayload(payload any) Event

type EventCallback

type EventCallback struct {
	JobId   steam.JobId
	Payload any
}

type EventChannelEncrypted

type EventChannelEncrypted struct{}

type EventDataReceived

type EventDataReceived struct {
	Data []byte
}

type EventDataToSend

type EventDataToSend struct {
	Data []byte
}

type EventPacketReceived

type EventPacketReceived struct {
	Packet *steammsg.Packet
}

type EventPacketTosend

type EventPacketTosend struct {
	Packet *steammsg.Packet
}

type EventType

type EventType = uint
const (
	EventType_Incoming EventType = 0
	EventType_Outgoing EventType = 1
	EventType_State    EventType = 2
)

type Handler

type Handler interface {
	Register(map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))
}

type Layer

type Layer interface {
	ProcessIncoming([]Event) ([]Event, error)
	ProcessOutgoing([]Event) ([]Event, error)
}

func MakeLayerStack

func MakeLayerStack(layers ...Layer) Layer

type PICSRequest

type PICSRequest struct {
	ID          uint32
	AccessToken uint64
}

type ServerRecord

type ServerRecord struct {
	Host string
	Port uint16
	Load uint32
}

type Servers

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

func NewServers

func NewServers() *Servers

func (*Servers) PickServer

func (s *Servers) PickServer() *ServerRecord

func (*Servers) Records

func (s *Servers) Records() []*ServerRecord

func (*Servers) Update

func (s *Servers) Update() error

type SteamAppsHandler

type SteamAppsHandler struct{}

func NewAppsHandler

func NewAppsHandler() *SteamAppsHandler

func (*SteamAppsHandler) GetCDNAuthToken

func (handler *SteamAppsHandler) GetCDNAuthToken(conn Connection, appId uint32, depotId uint32, serverHostname string) (*steampb.CMsgClientGetCDNAuthTokenResponse, error)

func (*SteamAppsHandler) GetDepotDecryptionKey

func (handler *SteamAppsHandler) GetDepotDecryptionKey(conn Connection, depotId uint32, appId uint32) (*steampb.CMsgClientGetDepotDecryptionKeyResponse, error)

func (*SteamAppsHandler) PICSGetAccessTokens

func (handler *SteamAppsHandler) PICSGetAccessTokens(conn Connection, apps []PICSRequest, packages []PICSRequest) (*steampb.CMsgClientPICSAccessTokenResponse, error)

func (*SteamAppsHandler) PICSGetProductInfo

func (handler *SteamAppsHandler) PICSGetProductInfo(conn Connection, apps []PICSRequest, packages []PICSRequest, onlyMetaData bool) (*steampb.CMsgClientPICSProductInfoResponse, error)

func (*SteamAppsHandler) Register

func (handler *SteamAppsHandler) Register(handlers map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))

func (*SteamAppsHandler) RequestFreeLicense

func (handler *SteamAppsHandler) RequestFreeLicense(conn Connection, appIds []uint32) (*steampb.CMsgClientRequestFreeLicenseResponse, error)

type SteamBaseHandler

type SteamBaseHandler struct {
}

func NewSteamBaseHandler

func NewSteamBaseHandler() *SteamBaseHandler

func (*SteamBaseHandler) Register

func (handler *SteamBaseHandler) Register(handlers map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))

type SteamConnection

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

func NewSteamConnection

func NewSteamConnection(handlers ...Handler) *SteamConnection

func (*SteamConnection) Connect

func (conn *SteamConnection) Connect() error

func (*SteamConnection) GetNextJobId

func (conn *SteamConnection) GetNextJobId() steam.JobId

func (*SteamConnection) RegisterJob

func (conn *SteamConnection) RegisterJob(jobId steam.JobId, callback func(any))

func (*SteamConnection) SendPacket

func (conn *SteamConnection) SendPacket(packet *steammsg.Packet) error

func (*SteamConnection) WaitReady

func (conn *SteamConnection) WaitReady(timeout time.Duration) error

type SteamContentHandler

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

func NewSteamContentHandler

func NewSteamContentHandler(unifiedMessage *SteamUnifiedMessageHandler) *SteamContentHandler

func (*SteamContentHandler) GetCDNAuthToken

func (handler *SteamContentHandler) GetCDNAuthToken(conn Connection, appId uint32, depotId uint32, cdnHostname string) (string, error)

func (*SteamContentHandler) GetManifestRequestCode

func (handler *SteamContentHandler) GetManifestRequestCode(conn Connection, depotId uint32, appId uint32, manifestId uint64, branch string) (uint64, error)

func (*SteamContentHandler) GetServersForSteamPipe

func (handler *SteamContentHandler) GetServersForSteamPipe(conn Connection, cellId uint32) ([]*steampb.CContentServerDirectory_ServerInfo, error)

func (*SteamContentHandler) Register

func (handler *SteamContentHandler) Register(_ map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))

type SteamUnifiedMessageHandler

type SteamUnifiedMessageHandler struct{}

func NewSteamUnifiedMessageHandler

func NewSteamUnifiedMessageHandler() *SteamUnifiedMessageHandler

func (*SteamUnifiedMessageHandler) Register

func (handler *SteamUnifiedMessageHandler) Register(handlers map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))

func (*SteamUnifiedMessageHandler) SendMessage

func (handler *SteamUnifiedMessageHandler) SendMessage(conn Connection, name string, body any) (*steamUnifiedMessageResponse, error)

func (*SteamUnifiedMessageHandler) SendNotification

func (handler *SteamUnifiedMessageHandler) SendNotification(conn Connection, name string, body any) error

type SteamUserHandler

type SteamUserHandler struct{}

func NewUserHandler

func NewUserHandler() *SteamUserHandler

func (*SteamUserHandler) LogInAnonymously

func (handler *SteamUserHandler) LogInAnonymously(conn Connection) (*steampb.CMsgClientLogonResponse, error)

func (*SteamUserHandler) Register

func (handler *SteamUserHandler) Register(handlers map[steamlang.EMsg]func(*steammsg.Packet) ([]Event, error))

Jump to

Keyboard shortcuts

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