Version: v1.1.0 Latest Latest

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 11 Imported by: 0




View Source
const AppID = 730

AppID describes the csgo app / steam id.


This section is empty.


func GetNextMatch added in v1.1.0

func GetNextMatch(csgoConfig *utils.CSGOConfig, steamAPIKey string) string

GetNextMatch returns the next match's share code. It uses the saved share codes as the current one.


type CS

type CS struct {
	// contains filtered or unexported fields

CS holds the steam client and whether the client is connected to the GameCoordinator

func NewCSGO

func NewCSGO(client *steam.Client) *CS

NewCSGO creates a CS client from a steam client and registers the packet handler

func (*CS) GetDemos

func (c *CS) GetDemos()

GetDemos gets the last match via the Steam Web API and tries to request information from the GC. It iterates through all csgo users and requests the latest share code via the API.

func (*CS) GetRecentGames

func (c *CS) GetRecentGames()

GetRecentGames requests the players match history.

func (*CS) HandleClientWelcome

func (c *CS) HandleClientWelcome(packet *gamecoordinator.GCPacket) error

HandleClientWelcome creates a ready event and tries sends a command to download recent games.

func (*CS) HandleGCPacket

func (c *CS) HandleGCPacket(packet *gamecoordinator.GCPacket)

HandleGCPacket takes incoming packets from the GC and coordinates them to the handler funcs.

func (*CS) HandleGCReady

func (c *CS) HandleGCReady(e *GCReadyEvent)

HandleGCReady starts a daemon and checks every hour for new demos.

func (*CS) HandleMatchList

func (c *CS) HandleMatchList(packet *gamecoordinator.GCPacket) error

HandleMatchList handles a gc message containing matches and tries to download those.

func (*CS) RequestMatch added in v1.1.0

func (c *CS) RequestMatch(shareCode string)

RequestMatch requests the match information for a share code

func (*CS) SetPlaying

func (c *CS) SetPlaying(playing bool)

SetPlaying sets the steam account to play csgo

func (*CS) ShakeHands

func (c *CS) ShakeHands()

ShakeHands sends a hello to the GC

func (*CS) Write

func (c *CS) Write(messageType uint32, msg proto.Message)

Write sends a message to the game coordinator.

type GCReadyEvent

type GCReadyEvent struct{}

GCReadyEvent is used to broadcast that the GC is ready

type HandlerMap

type HandlerMap map[uint32]func(packet *gamecoordinator.GCPacket) error

HandlerMap is the map of message types to handler functions

type MatchResponse

type MatchResponse struct {
	Result struct {
		Nextcode string `json:"nextcode"`
	} `json:"result"`

MatchResponse contains information about the latest match


Path Synopsis

Jump to

Keyboard shortcuts

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