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
- func ValidAvatar(avatar []byte) bool
- type ClientMsg
- func (c *ClientMsg) GetMsgType() steamlang.EMsg
- func (c *ClientMsg) GetSessionId() int32
- func (c *ClientMsg) GetSourceJobId() JobId
- func (c *ClientMsg) GetSteamId() steamid.SteamId
- func (c *ClientMsg) GetTargetJobId() JobId
- func (c *ClientMsg) IsProto() bool
- func (c *ClientMsg) Serialize(w io.Writer) error
- func (c *ClientMsg) SetSessionId(session int32)
- func (c *ClientMsg) SetSourceJobId(job JobId)
- func (c *ClientMsg) SetSteamId(s steamid.SteamId)
- func (c *ClientMsg) SetTargetJobId(job JobId)
- type ClientMsgProtobuf
- func (c *ClientMsgProtobuf) GetMsgType() steamlang.EMsg
- func (c *ClientMsgProtobuf) GetRealm() uint32
- func (c *ClientMsgProtobuf) GetSessionId() int32
- func (c *ClientMsgProtobuf) GetSourceJobId() JobId
- func (c *ClientMsgProtobuf) GetSteamId() steamid.SteamId
- func (c *ClientMsgProtobuf) GetTargetJobId() JobId
- func (c *ClientMsgProtobuf) GetTargetJobName() string
- func (c *ClientMsgProtobuf) IsProto() bool
- func (c *ClientMsgProtobuf) Serialize(w io.Writer) error
- func (c *ClientMsgProtobuf) SetRealm(realm uint32)
- func (c *ClientMsgProtobuf) SetSessionId(session int32)
- func (c *ClientMsgProtobuf) SetSourceJobId(job JobId)
- func (c *ClientMsgProtobuf) SetSteamId(s steamid.SteamId)
- func (c *ClientMsgProtobuf) SetTargetJobId(job JobId)
- func (c *ClientMsgProtobuf) SetTargetJobName(name string)
- type Deserializer
- type IClientMsg
- type IMsg
- type JobId
- type MessageBody
- type Msg
- type Packet
- type Serializable
- type Serializer
Constants ¶
const DefaultAvatar = "fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb"
const EClientPersonaStateFlag_DefaultInfoRequest = steamlang.EClientPersonaStateFlag_PlayerName | steamlang.EClientPersonaStateFlag_Presence | steamlang.EClientPersonaStateFlag_SourceID | steamlang.EClientPersonaStateFlag_GameExtraInfo
the default details to request in most situations
Variables ¶
This section is empty.
Functions ¶
func ValidAvatar ¶
Types ¶
type ClientMsg ¶
type ClientMsg struct { Header *steamlang.ExtendedClientMsgHdr Body MessageBody Payload []byte }
Represents a struct backed client message.
func NewClientMsg ¶
func NewClientMsg(body MessageBody, payload []byte) *ClientMsg
func (*ClientMsg) GetMsgType ¶
func (*ClientMsg) GetSessionId ¶
func (*ClientMsg) GetSourceJobId ¶
func (*ClientMsg) GetSteamId ¶
func (*ClientMsg) GetTargetJobId ¶
func (*ClientMsg) SetSessionId ¶
func (*ClientMsg) SetSourceJobId ¶
func (*ClientMsg) SetSteamId ¶
func (*ClientMsg) SetTargetJobId ¶
type ClientMsgProtobuf ¶
type ClientMsgProtobuf struct { Header *steamlang.MsgHdrProtoBuf Body proto.Message }
Represents a protobuf backed client message with session data.
func NewClientMsgProtobuf ¶
func NewClientMsgProtobuf(eMsg steamlang.EMsg, body proto.Message) *ClientMsgProtobuf
func (*ClientMsgProtobuf) GetMsgType ¶
func (c *ClientMsgProtobuf) GetMsgType() steamlang.EMsg
func (*ClientMsgProtobuf) GetRealm ¶
func (c *ClientMsgProtobuf) GetRealm() uint32
func (*ClientMsgProtobuf) GetSessionId ¶
func (c *ClientMsgProtobuf) GetSessionId() int32
func (*ClientMsgProtobuf) GetSourceJobId ¶
func (c *ClientMsgProtobuf) GetSourceJobId() JobId
func (*ClientMsgProtobuf) GetSteamId ¶
func (c *ClientMsgProtobuf) GetSteamId() steamid.SteamId
func (*ClientMsgProtobuf) GetTargetJobId ¶
func (c *ClientMsgProtobuf) GetTargetJobId() JobId
func (*ClientMsgProtobuf) GetTargetJobName ¶
func (c *ClientMsgProtobuf) GetTargetJobName() string
func (*ClientMsgProtobuf) IsProto ¶
func (c *ClientMsgProtobuf) IsProto() bool
func (*ClientMsgProtobuf) SetRealm ¶
func (c *ClientMsgProtobuf) SetRealm(realm uint32)
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.SteamId)
func (*ClientMsgProtobuf) SetTargetJobId ¶
func (c *ClientMsgProtobuf) SetTargetJobId(job JobId)
func (*ClientMsgProtobuf) SetTargetJobName ¶
func (c *ClientMsgProtobuf) SetTargetJobName(name string)
type Deserializer ¶
type IClientMsg ¶
type IClientMsg interface { IMsg GetSessionId() int32 SetSessionId(int32) GetSteamId() steamid.SteamId SetSteamId(steamid.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() steamlang.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 MessageBody ¶
type MessageBody interface { Serializable GetEMsg() steamlang.EMsg }
type Msg ¶
type Msg struct { Header *steamlang.MsgHdr Body MessageBody Payload []byte }
func NewMsg ¶
func NewMsg(body MessageBody, payload []byte) *Msg
func (*Msg) GetMsgType ¶
func (*Msg) GetSourceJobId ¶
func (*Msg) GetTargetJobId ¶
func (*Msg) SetSourceJobId ¶
func (*Msg) SetTargetJobId ¶
type Packet ¶
type Packet struct { EMsg steamlang.EMsg IsProto bool TargetJobId JobId SourceJobId JobId Data []byte }
Represents an incoming, partially unread message.
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
type Serializable ¶
type Serializable interface { Serializer Deserializer }
type Serializer ¶
Directories ¶
Path | Synopsis |
---|---|
Contains code generated from SteamKit's SteamLanguage data.
|
Contains code generated from SteamKit's SteamLanguage data. |