Categorygithub.com/paralin/go-underlords
modulepackage
0.0.0-20201128211604-316a96eaa590
Repository: https://github.com/paralin/go-underlords.git
Documentation: pkg.go.dev

# README

Dota Underlords

GoDoc Widget Go Report Card Widget

Introduction

go-underlords is a DOTA Auto Chess (Underlords) client plugin for go-steam.

Games implemented:

This project makes use of a dynamic API generator (apigen) designed to automatically interpret Valve's various naming conventions into a intermediate API scheme representation, which is then converted into Go code.

SOCache Mechanism

The caching mechanism makes it easy to watch for changes to common objects, like Lobby, LobbyInvite, Party, PartyInvite.

This mechanism is used everywhere, these objects are not exposed in their own events.

import (
	gcmm "github.com/paralin/go-underlords/protocol"
	"github.com/paralin/go-underlords/cso"
)

eventCh, eventCancel, err := dota.GetCache().SubscribeType(cso.Lobby)
if err != nil {
    return err
}

defer eventCancel()

lobbyEvent := <-eventCh
lobby := lobbyEvent.Object.(*gcmm.CSODACLobby)

Events for the object type are emitted on the eventCh. Be sure to call eventCancel once you are done with the channel to prevent resource leaks.

The cache object also adds interfaces to get and list the current objects in the cache.

Implementation Generation

The base API implementation is generated by the apigen code. Using heuristics, request IDs are matched to response IDs, and events and action-only requests are identified. Some manual tweaking is done in the overrides file.

Next, the API information is used to build a Go code-gen set of implementations around the MakeRequest request tracking mechanism.

This means that ALL of the Underlords API will be available in this codebase, although only some of it is documented.

go-steam Dependency

This library depends on go-steam. Currently we are using the FACEIT fork.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

New builds a new DAC handler.

# Constants

AppID is the ID for underlords.

# Variables

ErrNotReady is returned when the client is not ready.

# Structs

DAC handles the dota game handler.