protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2016 License: BSD-3-Clause Imports: 9 Imported by: 103

Documentation

Overview

This package includes some basics for the Steam protocol. It defines basic interfaces that are used throughout go-steam: There is IMsg, which is extended by IClientMsg (sent after logging in) and abstracts over the outgoing message types. Both interfaces are implemented by ClientMsgProtobuf and ClientMsg. Msg is like ClientMsg, but it is used for sending messages before logging in.

There is also the concept of a Packet: This is a type for incoming messages where only the header is deserialized. It therefore only contains EMsg data, job information and the remaining data. Its contents can then be read via the Read* methods which read data into a MessageBody - a type which is Serializable and has an EMsg.

In addition, there are extra types for communication with the Game Coordinator (GC) included in the gamecoordinator sub-package. For outgoing messages the IGCMsg interface is used which is implemented by GCMsgProtobuf and GCMsg. Incoming messages are of the GCPacket type and are read like regular Packets.

The actual messages and enums are in the sub-packages steamlang and protobuf, generated from the SteamKit data.

Index

Constants

View Source
const DefaultAvatar = "fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb"
View Source
const EClientPersonaStateFlag_DefaultInfoRequest = EClientPersonaStateFlag_PlayerName |
	EClientPersonaStateFlag_Presence | EClientPersonaStateFlag_SourceID |
	EClientPersonaStateFlag_GameExtraInfo

the default details to request in most situations

Variables

This section is empty.

Functions

func ValidAvatar

func ValidAvatar(avatar string) bool

Types

type ClientMsg

type ClientMsg struct {
	Header  *ExtendedClientMsgHdr
	Body    MessageBody
	Payload []byte
}

Represents a struct backed client message.

func NewClientMsg

func NewClientMsg(body MessageBody, payload []byte) *ClientMsg

func (*ClientMsg) GetMsgType

func (c *ClientMsg) GetMsgType() EMsg

func (*ClientMsg) GetSessionId

func (c *ClientMsg) GetSessionId() int32

func (*ClientMsg) GetSourceJobId

func (c *ClientMsg) GetSourceJobId() JobId

func (*ClientMsg) GetSteamId

func (c *ClientMsg) GetSteamId() SteamId

func (*ClientMsg) GetTargetJobId

func (c *ClientMsg) GetTargetJobId() JobId

func (*ClientMsg) IsProto

func (c *ClientMsg) IsProto() bool

func (*ClientMsg) Serialize

func (c *ClientMsg) Serialize(w io.Writer) error

func (*ClientMsg) SetSessionId

func (c *ClientMsg) SetSessionId(session int32)

func (*ClientMsg) SetSourceJobId

func (c *ClientMsg) SetSourceJobId(job JobId)

func (*ClientMsg) SetSteamId

func (c *ClientMsg) SetSteamId(s SteamId)

func (*ClientMsg) SetTargetJobId

func (c *ClientMsg) SetTargetJobId(job JobId)

type ClientMsgProtobuf

type ClientMsgProtobuf struct {
	Header *MsgHdrProtoBuf
	Body   proto.Message
}

Represents a protobuf backed client message with session data.

func NewClientMsgProtobuf

func NewClientMsgProtobuf(eMsg EMsg, body proto.Message) *ClientMsgProtobuf

func (*ClientMsgProtobuf) GetMsgType

func (c *ClientMsgProtobuf) GetMsgType() EMsg

func (*ClientMsgProtobuf) GetSessionId

func (c *ClientMsgProtobuf) GetSessionId() int32

func (*ClientMsgProtobuf) GetSourceJobId

func (c *ClientMsgProtobuf) GetSourceJobId() JobId

func (*ClientMsgProtobuf) GetSteamId

func (c *ClientMsgProtobuf) GetSteamId() SteamId

func (*ClientMsgProtobuf) GetTargetJobId

func (c *ClientMsgProtobuf) GetTargetJobId() JobId

func (*ClientMsgProtobuf) IsProto

func (c *ClientMsgProtobuf) IsProto() bool

func (*ClientMsgProtobuf) Serialize

func (c *ClientMsgProtobuf) Serialize(w io.Writer) error

func (*ClientMsgProtobuf) SetSessionId

func (c *ClientMsgProtobuf) SetSessionId(session int32)

func (*ClientMsgProtobuf) SetSourceJobId

func (c *ClientMsgProtobuf) SetSourceJobId(job JobId)

func (*ClientMsgProtobuf) SetSteamId

func (c *ClientMsgProtobuf) SetSteamId(s SteamId)

func (*ClientMsgProtobuf) SetTargetJobId

func (c *ClientMsgProtobuf) SetTargetJobId(job JobId)

type Deserializer

type Deserializer interface {
	Deserialize(r io.Reader) error
}

type IClientMsg

type IClientMsg interface {
	IMsg
	GetSessionId() int32
	SetSessionId(int32)
	GetSteamId() SteamId
	SetSteamId(SteamId)
}

Interface for client messages, i.e. messages that are sent after logging in. ClientMsgProtobuf and ClientMsg implement this.

type IMsg

type IMsg interface {
	Serializer
	IsProto() bool
	GetMsgType() EMsg
	GetTargetJobId() JobId
	SetTargetJobId(JobId)
	GetSourceJobId() JobId
	SetSourceJobId(JobId)
}

Interface for all messages, typically outgoing. They can also be created by using the Read* methods in a PacketMsg.

type JobId

type JobId uint64

func (JobId) String

func (j JobId) String() string

type MessageBody

type MessageBody interface {
	Serializable
	GetEMsg() EMsg
}

type Msg

type Msg struct {
	Header  *MsgHdr
	Body    MessageBody
	Payload []byte
}

func NewMsg

func NewMsg(body MessageBody, payload []byte) *Msg

func (*Msg) GetMsgType

func (m *Msg) GetMsgType() EMsg

func (*Msg) GetSourceJobId

func (m *Msg) GetSourceJobId() JobId

func (*Msg) GetTargetJobId

func (m *Msg) GetTargetJobId() JobId

func (*Msg) IsProto

func (m *Msg) IsProto() bool

func (*Msg) Serialize

func (m *Msg) Serialize(w io.Writer) error

func (*Msg) SetSourceJobId

func (m *Msg) SetSourceJobId(job JobId)

func (*Msg) SetTargetJobId

func (m *Msg) SetTargetJobId(job JobId)

type Packet

type Packet struct {
	EMsg        EMsg
	IsProto     bool
	TargetJobId JobId
	SourceJobId JobId
	Data        []byte
}

Represents an incoming, partially unread message.

func NewPacket

func NewPacket(data []byte) (*Packet, error)

func (*Packet) ReadClientMsg

func (p *Packet) ReadClientMsg(body MessageBody) *ClientMsg

func (*Packet) ReadMsg

func (p *Packet) ReadMsg(body MessageBody) *Msg

func (*Packet) ReadProtoMsg

func (p *Packet) ReadProtoMsg(body proto.Message) *ClientMsgProtobuf

func (*Packet) String

func (p *Packet) String() string

type Serializable

type Serializable interface {
	Serializer
	Deserializer
}

type Serializer

type Serializer interface {
	Serialize(w io.Writer) error
}

Directories

Path Synopsis
Contains code generated from SteamKit's SteamLanguage data.
Contains code generated from SteamKit's SteamLanguage data.

Jump to

Keyboard shortcuts

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