Documentation ¶
Overview ¶
Package gsbot contains some useful utilites for working with the steam package. It implements authentication with sentries, server lists and logging messages and events.
Every module is optional and requires an instance of the GsBot struct.
Each a module auto-registers as `steam.PacketHandler` with the `steam.Client` and `EventHandler` with GsBot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth module handles authentication.
It logs on automatically after a ConnectedEvent and saves the sentry data to a file which is also used for logon if available.
If you're logging on for the first time Steam may require an authcode. You can then connect again with the new logon details.
func (*Auth) HandleEvent ¶
func (a *Auth) HandleEvent(event interface{})
type Debug ¶
type Debug struct {
// contains filtered or unexported fields
}
Debug module logs incoming packets and events to a directory.
func (*Debug) HandleEvent ¶
func (d *Debug) HandleEvent(event interface{})
func (*Debug) HandlePacket ¶
type EventHandler ¶
type EventHandler interface {
HandleEvent(event interface{})
}
type GsBot ¶
type GsBot struct { Client *steam.Client Log *log.Logger // contains filtered or unexported fields }
GsBot is the base struct holding common data among GsBot modules.
func Default ¶
func Default() *GsBot
Default creates a new GsBot with a new steam.Client where logs are written to stdout.
func (*GsBot) HandleEvent ¶
func (bot *GsBot) HandleEvent(event interface{})
func (*GsBot) RegisterEventHandler ¶
func (bot *GsBot) RegisterEventHandler(handler EventHandler)
type ServerList ¶
type ServerList struct {
// contains filtered or unexported fields
}
ServerList module saves the server list from ClientCMListEvent and uses it when you call `client.Connect`.
func NewServerList ¶
func NewServerList(bot *GsBot, listPath string) *ServerList
func (*ServerList) Connect ¶
func (s *ServerList) Connect() (bool, error)
func (*ServerList) ConnectBind ¶
func (s *ServerList) ConnectBind(laddr *net.TCPAddr) (bool, error)
func (*ServerList) HandleEvent ¶
func (s *ServerList) HandleEvent(event interface{})