Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ModMaphackIdentifier is the identifier we use to look for installs of maphack. ModMaphackIdentifier = "BH.dll" // ModHDIdentifier is the identifier we use to look for installs of hd mod. ModHDIdentifier = "D2HD.dll" )
View Source
const ( // GatewaySlashdiablo is the gateway option used if the user wants to connect to Slashdiablo. GatewaySlashdiablo = "Slashdiablo" // GatewayBattleNet is the gateway option used if the user wants to connect to the original Battle.net. GatewayBattleNet = "Battle.net" // SlashDiabloIP is the default IP for Slashdiablo. SlashDiabloIP = "play.slashdiablo.net" // BattleNetIP is the default Battle.net IP. BattleNetIP = "uswest.battle.net" )
Variables ¶
View Source
var ( // ErrCRCFileNotFound is used when the file to be hashed didn't exist. ErrCRCFileNotFound = errors.New("file not found") )
Functions ¶
This section is empty.
Types ¶
type Manifest ¶
type Manifest struct {
Files []PatchFile `json:"files"`
}
Manifest represents the current patch.
type PatchFile ¶
type PatchFile struct { Name string `json:"name"` CRC string `json:"crc"` LastModified time.Time `json:"last_modified"` ContentLength int64 `json:"content_length"` }
PatchFile represents a file that should be patched.
type PatchState ¶
PatchState represents the state given on every patch cycle.
type Service ¶
type Service interface { // Exec is responsible for executing the Diablo II game. Exec() error // ValidateGameVersions will make sure the game is up to date with expected patch. ValidateGameVersions() (bool, error) // Patch will patch Diablo II to the correct version. Patch(done chan bool) (<-chan float32, <-chan PatchState) // ApplyDEP will apply Windows specific fix for DEP. ApplyDEP(path string) error // SetGateway is responsible for setting Battle.net gateway. SetGateway(gateway string) error }
Service is responsible for all things related to the Slashdiablo ladder.
func NewService ¶
func NewService( slashdiabloClient slashdiablo.Client, configuration config.Service, logger log.Logger, ) Service
NewService returns a service with all the dependencies.
type WriteCounter ¶
type WriteCounter struct { Total float32 Written float32 // contains filtered or unexported fields }
WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.
Click to show internal directories.
Click to hide internal directories.