Documentation
¶
Index ¶
- Constants
- func GetNextMatch(csgoConfig *utils.CSGOConfig, steamAPIKey string) string
- type CS
- func (c *CS) GetDemos()
- func (c *CS) GetRecentGames()
- func (c *CS) HandleClientWelcome(packet *gamecoordinator.GCPacket) error
- func (c *CS) HandleGCPacket(packet *gamecoordinator.GCPacket)
- func (c *CS) HandleGCReady(e *GCReadyEvent)
- func (c *CS) HandleMatchList(packet *gamecoordinator.GCPacket) error
- func (c *CS) RequestMatch(shareCode string)
- func (c *CS) SetPlaying(playing bool)
- func (c *CS) ShakeHands()
- func (c *CS) Write(messageType uint32, msg proto.Message)
- type GCReadyEvent
- type HandlerMap
- type MatchResponse
Constants ¶
const AppID = 730
AppID describes the csgo app / steam id.
Variables ¶
This section is empty.
Functions ¶
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.
Types ¶
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
RequestMatch requests the match information for a share code
func (*CS) SetPlaying ¶
SetPlaying sets the steam account to play csgo
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