mtga

package module
Version: v0.0.0-...-b7eb296 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 40 Imported by: 0

README

MTGA Output Log Parser

This is a tool for monitoring and parsing the MTGA output_log.txt file.

CircleCI GoDoc

Getting Started

Log Location
filepath.Join(os.Getenv("APPDATA"), "..", "LocalLow", "Wizards Of The Coast", "MTGA", "output_log.txt")
Log Example Files

Jul 25, Update v0.17: PDF | TXT

Example
package main

import (
    "flag"
    "fmt"
    "os"
    "path/filepath"
	
    "github.com/di-wu/mtga"
    "github.com/di-wu/mtga/thread/outgoing"
    "github.com/di-wu/mtga/thread/outgoing/log/client"
)

var filePath string

func main()  {
    flag.StringVar(&filePath, "file", filepath.Join(os.Getenv("APPDATA"), "..", "LocalLow", "Wizards Of The Coast", "MTGA", "output_log.txt"), "Location to the MTGAs log file.")
    flag.Parse()
	
    parser := mtga.Parser{}
    parser.OnAuthenticate(func(auth outgoing.Authenticate) {
        fmt.Println("Authenticated!")
    })
    parser.OnInventoryReport(func(report client.InventoryReport) {
        fmt.Printf("Gold: %d, Gems %d\n", report.Gold, report.Gems)
    })
 
    t, _ := mtga.NewTail(filePath)
 
    for l := range t.Logs() {
        parser.Parse(l)
    }
}

more...

Unimplemented Logs

There are probably still some logs that don't have a callback or are just not that relevant.

parser.OnUnknownLog(func(message string) {
    log.Println(message)
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Incoming

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

Incoming is a structure that holds the parser's incoming callbacks.

func (*Incoming) OnAIPractice

func (incoming *Incoming) OnAIPractice(callback func(success bool))

OnAIPractice attaches the given callback, which will be called on getting the ai practice success status.

func (*Incoming) OnClaimPrize

func (incoming *Incoming) OnClaimPrize(callback func(claim event.ClaimPrize))

OnClaimPrize attaches the given callback, which will be called on claiming the prize of an event.

func (*Incoming) OnConnectionDetails

func (incoming *Incoming) OnConnectionDetails(callback func(details front_door.ConnectionDetails))

OnConnectionDetails attaches the given callback, which will be called on receiving connection details.

func (*Incoming) OnCrackBooster

func (incoming *Incoming) OnCrackBooster(callback func(booster inventory.CrackedBooster))

OnCrackBooster attaches the given callback, which will be called on getting the cracked booster.

func (*Incoming) OnCreateDeck

func (incoming *Incoming) OnCreateDeck(callback func(deck deck.Deck))

OnCreateDeck attaches the given callback, which will be called on creating a deck.

func (*Incoming) OnDeckSubmit

func (incoming *Incoming) OnDeckSubmit(callback func(submit event.DeckSubmit))

OnDeckSubmit attaches the given callback, which will be called on submitting a deck.

func (*Incoming) OnDraft

func (incoming *Incoming) OnDraft(callback func(draft event.Draft))

OnDraft attaches the given callback, which will be called on drafting.

func (*Incoming) OnDraftStatus

func (incoming *Incoming) OnDraftStatus(callback func(status draft.Status))

OnDraftStatus attaches the given callback, which will be called on getting the draft status.

func (*Incoming) OnDrop

func (incoming *Incoming) OnDrop(callback func(drop event.Course))

OnDrop attaches the given callback, which will be called on dropping an event.

func (*Incoming) OnGetActiveEvents

func (incoming *Incoming) OnGetActiveEvents(callback func(events []event.ActiveEvent))

OnGetActiveEvents attaches the given callback, which will be called on getting all the active events.

func (*Incoming) OnGetAllProducts

func (incoming *Incoming) OnGetAllProducts(callback func(products []mercantile.Product))

OnGetAllProducts attaches the given callback, which will be called on getting all the products.

func (*Incoming) OnGetAllTracks

func (incoming *Incoming) OnGetAllTracks(callback func(tracks []progression.Track))

OnGetAllTracks attaches the given callback, which will be called on getting all the tracks.

func (*Incoming) OnGetCatalogStatus

func (incoming *Incoming) OnGetCatalogStatus(callback func(status inventory.CatalogStatus))

OnGetCatalogStatus attaches the given callback, which will be called on getting the catalog status.

func (*Incoming) OnGetCombinedRankInfo

func (incoming *Incoming) OnGetCombinedRankInfo(callback func(info event.CombinedRankInfo))

OnGetCombinedRankInfo attaches the given callback, which will be called on getting the combined rank info.

func (*Incoming) OnGetDeckLists

func (incoming *Incoming) OnGetDeckLists(callback func(decks []deck.Deck))

OnGetDeckLists attaches the given callback, which will be called on getting the deck lists.

func (*Incoming) OnGetEventAndSeasonPayouts

func (incoming *Incoming) OnGetEventAndSeasonPayouts(callback func(payout event.Payout))

OnGetEventAndSeasonPayouts attaches the given callback, which will be called on getting the event and season payouts.

func (*Incoming) OnGetFormats

func (incoming *Incoming) OnGetFormats(callback func(formats []inventory.Format))

OnGetFormats attaches the given callback, which will be called on getting the formats.

func (*Incoming) OnGetMotD

func (incoming *Incoming) OnGetMotD(callback func(d mot_d.MotD))

OnGetMotD attaches the given callback, which will be called on getting the mot d.

func (*Incoming) OnGetPlayerArtSkins

func (incoming *Incoming) OnGetPlayerArtSkins(callback func(skins inventory.PlayerArtSkins))

OnGetPlayerArtSkins attaches the given callback, which will be called on getting the card skins of the player.

func (*Incoming) OnGetPlayerCards

func (incoming *Incoming) OnGetPlayerCards(callback func(cards inventory.PlayerCards))

OnGetPlayerCards attaches the given callback, which will be called on getting the cards of the player.

func (*Incoming) OnGetPlayerCourse

func (incoming *Incoming) OnGetPlayerCourse(callback func(course event.Course))

OnGetPlayerCourse attaches the given callback, which will be called on getting the course of the player.

func (*Incoming) OnGetPlayerCourses

func (incoming *Incoming) OnGetPlayerCourses(callback func(courses []event.Course))

OnGetPlayerCourses attaches the given callback, which will be called on getting the courses of the player.

func (*Incoming) OnGetPlayerInventory

func (incoming *Incoming) OnGetPlayerInventory(callback func(inventory inventory.PlayerInventory))

OnGetPlayerInventory attaches the given callback, which will be called on getting the inventory of the player.

func (*Incoming) OnGetPlayerProgress

func (incoming *Incoming) OnGetPlayerProgress(callback func(progress progression.PlayerProgress))

OnGetPlayerProgress attaches the given callback, which will be called on getting the progress of the player.

func (*Incoming) OnGetPlayerQuests

func (incoming *Incoming) OnGetPlayerQuests(callback func(quests []quest.PlayerQuest))

OnGetPlayerQuests attaches the given callback, which will be called on getting the quests of the player.

func (*Incoming) OnGetPlayerSequenceData

func (incoming *Incoming) OnGetPlayerSequenceData(callback func(data inventory.SequenceData))

OnGetPlayerSequenceData attaches the given callback, which will be called on getting the sequence data of the player.

func (*Incoming) OnGetPreconDecks

func (incoming *Incoming) OnGetPreconDecks(callback func(decks []deck.PreconDeck))

OnGetPreconDecks attaches the given callback, which will be called on getting the precon deck lists.

func (*Incoming) OnGetProductCatalog

func (incoming *Incoming) OnGetProductCatalog(callback func(catalog inventory.ProductCatalog))

OnGetProductCatalog attaches the given callback, which will be called on getting the product catalog.

func (*Incoming) OnGetRewardSchedule

func (incoming *Incoming) OnGetRewardSchedule(callback func(schedule inventory.RewardSchedule))

OnGetRewardSchedule attaches the given callback, which will be called on getting the reward schedule.

func (*Incoming) OnGetSeasonAndRankDetail

func (incoming *Incoming) OnGetSeasonAndRankDetail(callback func(detail event.SeasonRankAndDetail))

OnGetSeasonAndRankDetail attaches the given callback, which will be called on getting the season and rank details.

func (*Incoming) OnGetStoreStatus

func (incoming *Incoming) OnGetStoreStatus(callback func(status mercantile.StoreStatus))

OnGetStoreStatus attaches the given callback, which will be called on getting the store status.

func (*Incoming) OnGetTrackDetail

func (incoming *Incoming) OnGetTrackDetail(callback func(detail quest.TrackDetail))

OnGetTrackDetail attaches the given callback, which will be called on getting the track details.

func (*Incoming) OnJoin

func (incoming *Incoming) OnJoin(callback func(course event.Course))

OnJoin attaches the given callback, which will be called on joining.

func (*Incoming) OnJoinEventQueueStatus

func (incoming *Incoming) OnJoinEventQueueStatus(callback func(status bool))

OnJoinEventQueueStatus attaches the given callback, which will be called on getting the join event queue status.

func (*Incoming) OnJoinQueue

func (incoming *Incoming) OnJoinQueue(callback func(success bool))

OnJoinQueue attaches the given callback, which will be called on getting the join queue success status.

func (*Incoming) OnLeaveQueue

func (incoming *Incoming) OnLeaveQueue(callback func(leave event.LeaveQueue))

OnLeaveQueue attaches the given callback, which will be called on leaving the queue.

func (*Incoming) OnLogInfo

func (incoming *Incoming) OnLogInfo(callback func(info []byte))

OnLogInfo attaches the given callback, which will be called on an incoming info log.

func (*Incoming) OnMakePick

func (incoming *Incoming) OnMakePick(callback func(draft draft.Status))

OnMakePick attaches the given callback, which will be called on picking a card in draft.

func (*Incoming) OnPayEntry

func (incoming *Incoming) OnPayEntry(callback func(entry event.PayEntry))

OnPayEntry attaches the given callback, which will be called on after paying the entry.

func (*Incoming) OnRedeemWildCardBulk

func (incoming *Incoming) OnRedeemWildCardBulk(callback func(redeem inventory.WildCardBulk))

OnRedeemWildCardBulk attaches the given callback, which will be called on redeeming wildcards.

func (*Incoming) OnUpdateBasicLandSet

func (incoming *Incoming) OnUpdateBasicLandSet(callback func(update inventory.BasicLandSet))

OnUpdateBasicLandSet attaches the given callback, which will be called on updating the basic land set.

func (*Incoming) OnUpdateDeck

func (incoming *Incoming) OnUpdateDeck(callback func(deck deck.Deck))

OnUpdateDeck attaches the given callback, which will be called on updating a deck.

type MatchTo

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

MatchTo is a structure that holds the parser's match to callbacks.

func (*MatchTo) OnAuthenticateResponse

func (to *MatchTo) OnAuthenticateResponse(callback func(response match_to.AuthenticateResponse))

OnAuthenticateResponse attaches the given callback, which will be called on an authentication response.

func (*MatchTo) OnGreActionsAvailableRequest

func (to *MatchTo) OnGreActionsAvailableRequest(callback func(prompt match_to.Prompt, req match_to.ActionsAvailableReq))

OnGreActionsAvailableRequest attaches the given callback, which will be called on requesting available actions.

func (*MatchTo) OnGreConnectResponse

func (to *MatchTo) OnGreConnectResponse(callback func(resp match_to.ConnectResp))

OnGreConnectResponse attaches the given callback, which will be called on a connection response.

func (*MatchTo) OnGreDeclareAttackersRequest

func (to *MatchTo) OnGreDeclareAttackersRequest(callback func(prompt match_to.Prompt, req match_to.DeclareAttackersReq))

OnGreDeclareAttackersRequest attaches the given callback, which will be called on requesting an attackers declaration.

func (*MatchTo) OnGreDieRollResultsResponse

func (to *MatchTo) OnGreDieRollResultsResponse(callback func(resp match_to.DieRollResultsResp))

OnGreDieRollResultsResponse attaches the given callback, which will be called on a die roll results response.

func (*MatchTo) OnGreGameStateMessage

func (to *MatchTo) OnGreGameStateMessage(callback func(msg match_to.GameStateMessage))

OnGreGameStateMessage attaches the given callback, which will be called on a game state message.

func (*MatchTo) OnGreGetSettingsResponse

func (to *MatchTo) OnGreGetSettingsResponse(callback func(resp match_to.Settings))

OnGreGetSettingsResponse attaches the given callback, which will be called on getting the setting.

func (*MatchTo) OnGreIntermissionRequest

func (to *MatchTo) OnGreIntermissionRequest(callback func(req match_to.IntermissionReq))

OnGreIntermissionRequest attaches the given callback, which will be called on requesting an intermission.

func (*MatchTo) OnGreMulliganRequest

func (to *MatchTo) OnGreMulliganRequest(callback func(prompt, nonDecision match_to.Prompt, req match_to.MulliganReq))

OnGreMulliganRequest attaches the given callback, which will be called on requesting a mulligan.

func (*MatchTo) OnGrePromptRequest

func (to *MatchTo) OnGrePromptRequest(callback func(req match_to.Prompt))

OnGrePromptRequest attaches the given callback, which will be called on requesting a prompt.

func (*MatchTo) OnGreQueuedGameStateMessage

func (to *MatchTo) OnGreQueuedGameStateMessage(callback func(msg match_to.GameStateMessage))

OnGreQueuedGameStateMessage attaches the given callback, which will be called on a queued game state message.

func (*MatchTo) OnGreSelectTargetsRequest

func (to *MatchTo) OnGreSelectTargetsRequest(callback func(prompt, nonDecision match_to.Prompt, targets match_to.Select, allowCancel string, allowUndo bool))

OnGreSelectTargetsRequest attaches the given callback, which will be called on requesting a target selection.

func (*MatchTo) OnGreSetSettingsResponse

func (to *MatchTo) OnGreSetSettingsResponse(callback func(resp match_to.Settings))

OnGreSetSettingsResponse attaches the given callback, which will be called on setting the setting.

func (*MatchTo) OnGreSubmitAttackersResponse

func (to *MatchTo) OnGreSubmitAttackersResponse(callback func(prompt, nonDecision match_to.Prompt, submit match_to.Submit))

OnGreSubmitAttackersResponse attaches the given callback, which will be called on submitting an attackers response.

func (*MatchTo) OnGreSubmitTargetsResponse

func (to *MatchTo) OnGreSubmitTargetsResponse(callback func(submit match_to.Submit))

OnGreSubmitTargetsResponse attaches the given callback, which will be called on submitting a targets response.

func (*MatchTo) OnGreTimerStateMessage

func (to *MatchTo) OnGreTimerStateMessage(callback func(msg match_to.TimerStateMessage))

OnGreTimerStateMessage attaches the given callback, which will be called on a timer state message.

func (*MatchTo) OnGreToClientEvent

func (to *MatchTo) OnGreToClientEvent(callback func(gre match_to.GreToClientEvent))

OnGreToClientEvent attaches the given callback, which will be called on every gre to client event.

func (*MatchTo) OnGreUIMessage

func (to *MatchTo) OnGreUIMessage(callback func(msg match_to.UiMessage))

OnGreUIMessage attaches the given callback, which will be called on a UI message.

func (*MatchTo) OnMatchGameRoomStateChangedEvent

func (to *MatchTo) OnMatchGameRoomStateChangedEvent(callback func(change match_to.RoomStateChange))

OnMatchGameRoomStateChangedEvent attaches the given callback, which will be called on a match game room state change.

type MinusOne

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

MinusOne is a structure that holds the parser's minus one callbacks.

func (*MinusOne) OnEventMatchCreated

func (one *MinusOne) OnEventMatchCreated(callback func(match minus_one.MatchCreated))

OnEventMatchCreated attaches the given callback, which will be called on creating an event match.

func (*MinusOne) OnInventoryUpdated

func (one *MinusOne) OnInventoryUpdated(callback func(update minus_one.InventoryUpdate))

OnInventoryUpdated attaches the given callback, which will be called on updating the inventory.

func (*MinusOne) OnRankUpdated

func (one *MinusOne) OnRankUpdated(callback func(update minus_one.RankUpdate))

OnRankUpdated attaches the given callback, which will be called on updating the rank.

func (*MinusOne) OnTrackProgressUpdated

func (one *MinusOne) OnTrackProgressUpdated(callback func(update []minus_one.TrackProgress))

OnTrackProgressUpdated attaches the given callback, which will be called on updating the track progress.

type Outgoing

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

Outgoing is a structure that holds the parser's outgoing callbacks.

func (*Outgoing) OnAIPractice

func (outgoing *Outgoing) OnAIPractice(callback func(practice event.AIPractice))

OnAIPractice attaches the given callback, which will be called on practicing with the AI.

func (*Outgoing) OnAuthenticate

func (outgoing *Outgoing) OnAuthenticate(callback func(auth outgoing.Authenticate))

OnAuthenticate attaches the given callback, which will be called on authenticating.

func (*Outgoing) OnBootSequenceReport

func (outgoing *Outgoing) OnBootSequenceReport(callback func(report client.BootSequenceReport))

OnBootSequenceReport attaches the given callback, which will be called on the report of the boot sequence.

func (*Outgoing) OnClaimPrize

func (outgoing *Outgoing) OnClaimPrize(callback func(event event.Event))

OnClaimPrize attaches the given callback, which will be called on claiming the prize of an event.

func (*Outgoing) OnConnected

func (outgoing *Outgoing) OnConnected(callback func(conn client.Connected))

OnConnected attaches the given callback, which will be called on connecting.

func (*Outgoing) OnCrackBooster

func (outgoing *Outgoing) OnCrackBooster(callback func(crack inventory.CrackBooster))

OnCrackBooster attaches the given callback, which will be called on the request of retrieving a cracked booster.

func (*Outgoing) OnCreateDeck

func (outgoing *Outgoing) OnCreateDeck(callback func(deck deck.Deck))

OnCreateDeck attaches the given callback, which will be called on creating a deck.

func (*Outgoing) OnDeckSubmit

func (outgoing *Outgoing) OnDeckSubmit(callback func(deck event.DeckSubmit))

OnDeckSubmit attaches the given callback, which will be called on submitting a deck.

func (*Outgoing) OnDeckUpdated

func (outgoing *Outgoing) OnDeckUpdated(callback func(update client.DeckUpdated))

OnDeckUpdated attaches the given callback, which will be called on updating a deck.

func (*Outgoing) OnDeleteDeck

func (outgoing *Outgoing) OnDeleteDeck(callback func(deck deck.DeleteDeck))

OnDeleteDeck attaches the given callback, which will be called on deleting a deck.

func (*Outgoing) OnDraft

func (outgoing *Outgoing) OnDraft(callback func(event event.Event))

OnDraft attaches the given callback, which will be called on drafting.

func (*Outgoing) OnDraftStatus

func (outgoing *Outgoing) OnDraftStatus(callback func(status draft.Status))

OnDraftStatus attaches the given callback, which will be called on getting the draft status.

func (*Outgoing) OnDrop

func (outgoing *Outgoing) OnDrop(callback func(event event.Event))

OnDrop attaches the given callback, which will be called on dropping an event.

func (*Outgoing) OnEmotesUsedReport

func (outgoing *Outgoing) OnEmotesUsedReport(callback func(report duel_scene.EmotesUsedReport))

OnEmotesUsedReport attaches the given callback, which will be called on the report of a tally of emotes used by a player during a match.

func (*Outgoing) OnEndOfMatchReport

func (outgoing *Outgoing) OnEndOfMatchReport(callback func(report duel_scene.EndOfMatchReport))

OnEndOfMatchReport attaches the given callback, which will be called on the report of an end of a match.

func (*Outgoing) OnGameStart

func (outgoing *Outgoing) OnGameStart(callback func(start duel_scene.GameStart))

OnGameStart attaches the given callback, which will be called on starting the game within a match.

func (*Outgoing) OnGameStop

func (outgoing *Outgoing) OnGameStop(callback func(stop duel_scene.GameStop))

OnGameStop attaches the given callback, which will be called on ending the game within a match.

func (*Outgoing) OnGetPlayerCourse

func (outgoing *Outgoing) OnGetPlayerCourse(callback func(event event.Event))

OnGetPlayerCourse attaches the given callback, which will be called on the request of retrieving the player (v2) courses.

func (*Outgoing) OnGetProductCatalog

func (outgoing *Outgoing) OnGetProductCatalog(callback func(catalog inventory.ProductCatalog))

OnGetProductCatalog attaches the given callback, which will be called on the request of retrieving the product catalog.

func (*Outgoing) OnGetTrackDetail

func (outgoing *Outgoing) OnGetTrackDetail(callback func(detail quest.TrackDetail))

OnGetTrackDetail attaches the given callback, which will be called on the request of retrieving the track details.

func (*Outgoing) OnHomeEventNavigation

func (outgoing *Outgoing) OnHomeEventNavigation(callback func(nav client.EventNavigation))

OnHomeEventNavigation attaches the given callback, which will be called when the user navigated to an event page from the home page.

func (*Outgoing) OnInventoryReport

func (outgoing *Outgoing) OnInventoryReport(callback func(report client.InventoryReport))

OnInventoryReport attaches the given callback, which will be called on the report of the summary of the inventory.

func (*Outgoing) OnJoin

func (outgoing *Outgoing) OnJoin(callback func(event event.Event))

OnJoin attaches the given callback, which will be called on joining an event.

func (*Outgoing) OnJoinQueue

func (outgoing *Outgoing) OnJoinQueue(callback func(queue event.JoinQueue))

OnJoinQueue attaches the given callback, which will be called on joining an event queue.

func (*Outgoing) OnLogError

func (outgoing *Outgoing) OnLogError(callback func(err log.Err))

OnLogError attaches the given callback, which will be called on an outgoing error log.

func (*Outgoing) OnLogInfo

func (outgoing *Outgoing) OnLogInfo(callback func(info log.Info))

OnLogInfo attaches the given callback, which will be called on an outgoing info log.

func (*Outgoing) OnMakePick

func (outgoing *Outgoing) OnMakePick(callback func(pick draft.Pick))

OnMakePick attaches the given callback, which will be called on picking a card in draft.

func (*Outgoing) OnPayEntry

func (outgoing *Outgoing) OnPayEntry(callback func(entry event.PayEntry))

OnPayEntry attaches the given callback, which will be called on paying the entry.

func (*Outgoing) OnPerformanceReport

func (outgoing *Outgoing) OnPerformanceReport(callback func(report client.PerformanceReport))

OnPerformanceReport attaches the given callback, which will be called on the report of the session performance analysis.

func (*Outgoing) OnPregameSequenceReport

func (outgoing *Outgoing) OnPregameSequenceReport(callback func(report client.PregameSequenceReport))

OnPregameSequenceReport attaches the given callback, which will be called on te report of the duration of the matchmaking processes including granular durations of notable events within. Durations are in seconds.

func (*Outgoing) OnProgressionRewardWebViewed

func (outgoing *Outgoing) OnProgressionRewardWebViewed(callback func(view client.RewardWeb))

OnProgressionRewardWebViewed attaches the given callback, which will be called on viewing the reward web progression.

func (*Outgoing) OnProgressionTrackViewed

func (outgoing *Outgoing) OnProgressionTrackViewed(callback func(view client.ProgressionView))

OnProgressionTrackViewed attaches the given callback, which will be called on viewing the track progression.

func (*Outgoing) OnPurchaseFunnel

func (outgoing *Outgoing) OnPurchaseFunnel(callback func(funnel client.PurchaseFunnel))

OnPurchaseFunnel attaches the given callback, which will be called on updating available store SKUs.

func (*Outgoing) OnPurchaseProduct

func (outgoing *Outgoing) OnPurchaseProduct(callback func(purchase mercantile.PurchaseProduct))

OnPurchaseProduct attaches the given callback, which will be called on purchasing a product.

func (*Outgoing) OnRedeemWildCardBulk

func (outgoing *Outgoing) OnRedeemWildCardBulk(callback func(redeem inventory.WildCardBulk))

OnRedeemWildCardBulk attaches the given callback, which will be called on redeeming wildcards.

func (*Outgoing) OnSceneChange

func (outgoing *Outgoing) OnSceneChange(callback func(change client.SceneChange))

OnSceneChange attaches the given callback, which will be called on changing scenes.

func (*Outgoing) OnSetAvatarSelection

func (outgoing *Outgoing) OnSetAvatarSelection(callback func(selection client.AvatarSelection))

OnSetAvatarSelection attaches the given callback, which will be called on selecting an avatar.

func (*Outgoing) OnSetPetSelection

func (outgoing *Outgoing) OnSetPetSelection(callback func(selection inventory.PetSelection))

OnSetPetSelection attaches the given callback, which will be called on selecting a pet.

func (*Outgoing) OnSystemMessageView

func (outgoing *Outgoing) OnSystemMessageView(callback func(view client.SystemMessageView))

OnSystemMessageView attaches the given callback, which will be called on system messages.

func (*Outgoing) OnUpdateDeck

func (outgoing *Outgoing) OnUpdateDeck(callback func(deck deck.Deck))

OnUpdateDeck attaches the given callback, which will be called on updating a deck.

func (*Outgoing) OnUserDeviceSpecs

func (outgoing *Outgoing) OnUserDeviceSpecs(callback func(specs client.UserDeviceSpecs))

OnUserDeviceSpecs attaches the given callback, which will be called on the report of the user device specs.

type Parser

type Parser struct {
	Single

	Outgoing
	Incoming
	Unhandled
	MinusOne
	ToMatch
	MatchTo
	// contains filtered or unexported fields
}

Parser is a structure that holds all the parser's callbacks.

func (*Parser) OnConnectResponse

func (parser *Parser) OnConnectResponse(callback func(resp connect_resp.Response))

OnConnectResponse attaches the given callback, which will be called on getting the connection response.

func (*Parser) OnSingleLineTreadLog

func (parser *Parser) OnSingleLineTreadLog(callback func(log string))

OnSingleLineTreadLog attaches the given callback, which will be called on single line thread log.

func (*Parser) OnTreadLog

func (parser *Parser) OnTreadLog(callback func(log thread.Log))

OnTreadLog attaches the given callback, which will be called on every thread log.

func (*Parser) OnUnknownLog

func (parser *Parser) OnUnknownLog(callback func(message string))

OnUnknownLog attaches the given callback, which will be called on unparsed logs.

func (*Parser) OnZoneChange

func (parser *Parser) OnZoneChange(callback func(change ZoneChange))

OnZoneChange attaches the given callback, which will be called on changing zones.

func (*Parser) Parse

func (parser *Parser) Parse(l RawLog)

Parse parses a raw log (returned by the tails logs channel). It calls the callback that matches that parsed log.

type RawLog

type RawLog []string

RawLog represents a sequence of lines from the file that can be parsed as one log.

type Single

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

Single is a structure that holds the parser's single line callbacks.

func (*Single) OnCardNotExist

func (single *Single) OnCardNotExist(callback func(card single.NotExist))

OnCardNotExist attaches the given callback, which will be called on a not existing card.

func (*Single) OnNullEntity

func (single *Single) OnNullEntity(callback func(null single.NullEntity))

OnNullEntity attaches the given callback, which will be called on a null entity.

func (*Single) OnSkinsSeen

func (single *Single) OnSkinsSeen(callback func(skins single.Skins))

OnSkinsSeen attaches the given callback, which will be called on seeing skins.

func (*Single) OnStateChange

func (single *Single) OnStateChange(callback func(from, to string))

OnStateChange attaches the given callback, which will be called on a the state change.

type Tail

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

Tail can monitor data streams and open files, displaying new information as it is written. For example, it's a useful way to monitor the newest events in a system log in real time.

func NewTail

func NewTail(filePath string) (*Tail, error)

NewTail creates a new tail that monitors the file located at the given file path.

func (*Tail) Close

func (t *Tail) Close()

Close stops the monitoring.

func (*Tail) Err

func (t *Tail) Err() error

Err returns a channel of errors read from the monitored file.

func (*Tail) Logs

func (t *Tail) Logs() chan RawLog

Logs returns a channel of logs read from the monitored file.

type ToMatch

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

ToMatch is a structure that holds the parser's to match callbacks.

func (*ToMatch) OnToMatchThreadLog

func (to *ToMatch) OnToMatchThreadLog(callback func(method thread.LogMethod, payload string))

OnToMatchThreadLog attaches the given callback, which will be called on a match to thread log.

type Unhandled

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

Unhandled is a structure that holds the parser's unhandled callbacks.

func (*Unhandled) OnDieRollResults

func (unhandled *Unhandled) OnDieRollResults(callback func(results unhandled.DieRollResults))

OnDieRollResults attaches the given callback, which will be called on getting the die roll results.

func (*Unhandled) OnSubmitAttackersResponse

func (unhandled *Unhandled) OnSubmitAttackersResponse(callback func(prompt, nonDecision match_to.Prompt, submit match_to.Submit))

OnSubmitAttackersResponse attaches the given callback, which will be called on submitting an attackers response.

func (*Unhandled) OnSubmitTargetsResponse

func (unhandled *Unhandled) OnSubmitTargetsResponse(callback func(resp match_to.Submit))

OnSubmitTargetsResponse attaches the given callback, which will be called on submitting an targets response.

type ZoneChange

type ZoneChange struct {
	Type       ZoneChangeType
	Target     string
	InstanceID int
	GrpID      int
	Instigator int
	Source     string
}

ZoneChange occurs on the changing of zones of a certain target by a certain source.

Two types:

[Type] for ["[Target]" InstanceID:[ID], GrpID:[ID]] ("[Target]") had Instigator [ID] ("[Source]")
[Type] for [ID] ("[NULL]") had Instigator [ID] ("[Source]")

type ZoneChangeType

type ZoneChangeType string

ZoneChangeType is the cause type of the zone change.

const (
	// Countered indicates that the zone change is caused by a counter event.
	Countered ZoneChangeType = "Countered"
	// Damage indicated that the zone change is caused by a damage event.
	Damage ZoneChangeType = "Damage"
	// Destroy indicated that the zone change is caused by a destroy event.
	Destroy ZoneChangeType = "Destroy"
	// Exile indicated that the zone change is caused by a exile event.
	Exile ZoneChangeType = "Exile"
	// ZeroToughness indicated that the zone change is caused by a zero toughness event.
	ZeroToughness ZoneChangeType = "ZeroToughness"
)

Jump to

Keyboard shortcuts

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