clientapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Makes calls to the LoL in-game client to get data.

Index

Constants

View Source
const (
	EndpointActivePlayer          = "/liveclientdata/activeplayer"
	EndpointActivePlayerAbilities = "/liveclientdata/activeplayerabilities"
	EndpointActivePlayerName      = "/liveclientdata/activeplayername"
	EndpointActivePlayerRunes     = "/liveclientdata/activeplayerrunes"
	EndpointAllGameData           = "/liveclientdata/allgamedata"
	EndpointEventData             = "/liveclientdata/eventdata"
	EndpointGameStats             = "/liveclientdata/gamestats"
	EndpointPlayerItems           = "/liveclientdata/playeritems"
	EndpointPlayerList            = "/liveclientdata/playerlist"
	EndpointPlayerMainRunes       = "/liveclientdata/playermainrunes"
	EndpointPlayerScores          = "/liveclientdata/playerscores"
	EndpointPlayerSummonerSpells  = "/liveclientdata/playersummonerspells"
)
View Source
const Root = "https://127.0.0.1:2999"

Variables

This section is empty.

Functions

func Get

func Get(endpoint string) (*http.Response, error)

func GetActivePlayerName

func GetActivePlayerName() (*string, error)

func GetEndPoints

func GetEndPoints() ([]string, error)

func GetPEM

func GetPEM() (*x509.CertPool, error)

func GetPlayerItems

func GetPlayerItems(playerName string) (*[]Item, error)

func GetPlayerList

func GetPlayerList() (*[]Player, error)

func GetPlayerSummonerSpells

func GetPlayerSummonerSpells(playerName string) (*struct{ SummonerSpellOne, SummonerSpellTwo DataEntry }, error)

func GetRead

func GetRead(endpoint string) ([]byte, error)

Types

type Abilities

type Abilities struct{ Passive, Q, W, E, R Ability }

func GetActivePlayerAbilities

func GetActivePlayerAbilities() (*Abilities, error)

type Ability

type Ability struct {
	DataEntry
	AbilityLevel int
}

type ActivePlayer

type ActivePlayer struct {
	Abilities          Abilities
	ChampionStats      map[string]interface{} // floats or strings
	CurrentGold        float64
	FullRunes          Runes
	Level              int
	SummonerName       string
	TeamRelativeColors bool
}

func GetActivePlayer

func GetActivePlayer() (*ActivePlayer, error)

type AllGameData

type AllGameData struct {
	ActivePlayer ActivePlayer
	AllPlayers   []Player
	Events       Events
	GameData     GameStats
}

func GetAllGameData

func GetAllGameData() (*AllGameData, error)

type DataEntry

type DataEntry struct {
	ID                                          interface{} // string or int
	DisplayName, RawDescription, RawDisplayName string
}

type Event

type Event struct {
	EventID   int
	EventName string
	EventTime float64
}

type Events

type Events struct {
	Events []Event
}

func GetEventData

func GetEventData() (*Events, error)

type GameStats

type GameStats struct {
	GameMode, MapName, MapTerrain string
	GameTime                      float64
	MapNumber                     int
}

func GetGameStats

func GetGameStats() (*GameStats, error)

type Item

type Item struct {
	CanUse, Consumable                          bool
	Count, ItemID, Price, Slot                  int
	DisplayName, RawDescription, RawDisplayName string
}

type Player

type Player struct {
	ChampionName    string
	IsBot           bool
	IsDead          bool
	Items           []Item
	Level           int
	Position        string
	RawChampionName string
	RespawnTimer    float32
	Runes           Runes
	Scores          Scores
	SkinID          int
	SummonerName    string
	SummonerSpells  struct{ SummonerSpellOne, SummonerSpellTwo DataEntry }
	Team            string
}

type Runes

type Runes struct {
	GeneralRunes, StatRunes                      []DataEntry
	Keystone, PrimaryRuneTree, SecondaryRuneTree DataEntry
}

func GetActivePlayerRunes

func GetActivePlayerRunes() (*Runes, error)

func GetPlayerMainRunes

func GetPlayerMainRunes(playerName string) (*Runes, error)

type Scores

type Scores struct {
	Assists, CreepScore, Deaths, Kills int
	WardScore                          float64
}

func GetPlayerScores

func GetPlayerScores(playerName string) (*Scores, error)

Jump to

Keyboard shortcuts

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