gsbot

package
v0.0.0-...-9823823 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

The GsBot package 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. Should a module have a `HandlePacket` method, you must register it with the steam.Client with `RegisterPacketHandler`. Any module with a `HandleEvent` method must be integrated into your event loop and should be called for each event you receive.

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
}

This 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 NewAuth

func NewAuth(bot *GsBot, details *steam.LogOnDetails, sentryPath string) *Auth

func (*Auth) HandleEvent

func (a *Auth) HandleEvent(event interface{})

func (*Auth) LogOn

func (a *Auth) LogOn()

This is called automatically after every ConnectedEvent, but must be called once again manually with an authcode if Steam requires it when logging on for the first time.

type Debug

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

This module logs incoming packets and events to a directory.

func NewDebug

func NewDebug(bot *GsBot, base string) (*Debug, error)

func (*Debug) HandleEvent

func (d *Debug) HandleEvent(event interface{})

func (*Debug) HandlePacket

func (d *Debug) HandlePacket(packet *protocol.Packet)

type GsBot

type GsBot struct {
	Client *steam.Client
	Log    *log.Logger
}

Base structure holding common data among GsBot modules.

func Default

func Default() *GsBot

Creates a new GsBot with a new steam.Client where logs are written to stdout.

type ServerList

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

This module saves the server list from ClientCMListEvent and uses it when you call `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{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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