data

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BannedChampion

type BannedChampion struct {
	PickTurn   int64 // The turn during which the champion was banned
	ChampionID int64 // The ID of the banned champion
	TeamID     int64 // The ID of the team that banned the champion
}

Banned champion information

type Champion

type Champion struct {
	Version   string         // Game version, e.g. "12.3.1"
	ID        string         // Champion ID, e.g. "Aatrox"
	Key       string         // Champion key, e.g. "266"
	Name      string         // Champion name, e.g. "Aatrox"
	Title     string         // Champion title, e.g. "the Darking Blade"
	Lore      string         // Full version of blurb
	Blurb     string         // Champion blurb, abridged
	Info      ChampionInfo   // Champion info, overview data on attack, defense, magic and difficulty
	Image     ChampionImage  // Info on champion image
	Skins     []ChampionSkin // Data about champion skins
	Tags      []string       // E.g. "Fighter", "Tank"
	AllyTips  []string       // Tips for helping this champion or having good synergy with them
	EnemyTips []string       // Tips for how to play against this champion
	Partype   string         // E.g. "Blood Well"
	Stats     ChampionStats
	Spells    []ChampionSpell
	Passive   struct {
		Name, Description string
		Image             ChampionImage
	}
	Recommended []interface{} // TODO check type
}

Champion data gotten from endpoints.GetChampionsAll and endpoints.GetChampionsSpecific.

GetChampionsSpecific will retrieve all data, whereas GetChampionsAll gets just some of the data.

https://developer.riotgames.com/docs/lol#data-dragon_champions explains how to enterpret their string templates

type ChampionImage

type ChampionImage struct {
	Full       string // E.g. "Aatrox.png"
	Sprite     string // E.g. "champion0.png"
	Group      string // E.g. "champion", "spell", "passive"
	X, Y, W, H int
}

Image of a champion, spell, etc

func (*ChampionImage) Get

func (i *ChampionImage) Get(version string) (string, *[]byte, error)

Downloads an image.

Leaving the version param empty (i.e. "") will get the latest.

Returns the URL, the file's bytes and an error.

type ChampionInfo

type ChampionInfo struct {
	Attack, Defense, Magic, Difficulty int
}

Some info on a champion.

type ChampionSkin

type ChampionSkin struct {
	ID      string
	Num     int
	Name    string
	Chromas bool
}

type ChampionSpell

type ChampionSpell struct {
	ID           string
	Name         string
	Description  string
	LevelTip     struct{ Label, Effect []string }
	ToolTip      string
	MaxRank      int
	Cooldown     []float32 // TODO: check if int or float
	CooldownBurn string
	Cost         []int // TODO: check if int or float
	CostBurn     string
	CostType     string // E.g. " {{ abilityresourcename }}"
	MaxAmmo      string
	Range        []int // ? could be a float?
	RangeBurn    string
	Image        ChampionImage
	Resource     string
	Vars         []interface{} // TODO: check type
	Effect       [][]float32
	EffectBurn   []string
	DataValues   map[interface{}]interface{} // TODO: check type
}

type ChampionStats

type ChampionStats struct {
	HP, HPPerLevel, HPRegen, HPRegenPerLevel                                                              float32
	MP, MPPerLevel, MPRegen, MPRegenPerLevel                                                              float32
	MoveSpeed                                                                                             float32
	AttackRange, Crit, CritPerLevel, AttackDamage, AttackDamagePerLevel, AttackSpeed, AttackSpeedPerLevel float32
	Armor, ArmorPerLevel, SpellBlock, SpellBlockPerLevel                                                  float32
}

type Champions

type Champions struct {
	Type    string
	Format  string
	Version string
	Data    map[string]Champion // All the champions. Maps their name (e.g. "Aatrox") to their (incomplete) champion data.
}

Data gotten from endpoints.GetChampionsAll and endpoints.GetChampionsSpecific.

type CurrentGameInfo

type CurrentGameInfo struct {
	GameID            int64                    // The ID of the game
	GameType          string                   // The game type
	GameStartTime     int64                    // The game start time represented in epoch milliseconds
	MapID             int64                    // The ID of the map
	GameLength        int64                    // The amount of time in seconds that has passed since the game started
	PlatformID        string                   // The ID of the platform on which the game is being played
	GameMode          string                   // The game mode
	BannedChampions   []BannedChampion         // Banned champion information
	GameQueueConfigID int64                    // The queue type (queue types are documented on the Game Constants page)
	Observers         Observer                 // The observer information
	Participants      []CurrentGameParticipant // The participant information
}

type CurrentGameParticipant

type CurrentGameParticipant struct {
	ChampionID               int64                     // The ID of the champion played by this participant
	Perks                    Perks                     // Perks/Runes Reforged Information
	ProfileIconID            int64                     // The ID of the profile icon used by this participant
	Bot                      bool                      // Flag indicating whether or not this participant is a bot
	TeamID                   int64                     // The team ID of this participant, indicating the participant's team
	SummonerName             string                    // The summoner name of this participant
	SummonerID               string                    // The encrypted summoner ID of this participant
	Spell1ID                 int64                     // The ID of the first summoner spell used by this participant
	Spell2ID                 int64                     // The ID of the second summoner spell used by this participant
	GameCustomizationObjects []GameCustomizationObject // List of Game Customizations
}

The participant information

type FeaturedGameInfo

type FeaturedGameInfo struct {
	GameMode          string                // The game mode (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO)
	GameLength        int64                 // The amount of time in seconds that has passed since the game started
	MapID             int64                 // The ID of the map
	GameType          string                // The game type (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME)
	BannedChampions   []BannedChampion      // Banned champion information
	GameID            int64                 // The ID of the game
	Observer          Observer              // The observer information
	GameQueueConfigID int64                 // The queue type
	GameStartTime     int64                 // The game start time represented in epoch milliseconds
	Participants      []FeaturedParticipant // The participant information
	PlatformID        string                // The ID of the platform on which the game is being played
}

Info on a given game listed by featured games

type FeaturedGames

type FeaturedGames struct {
	GameList              []FeaturedGameInfo // The list of featured games
	ClientRefreshInterval int64              // The suggested interval to wait before requesting FeaturedGames again
}

List of featured games gotten from the endpoint GetGamesFeatured

type FeaturedParticipant

type FeaturedParticipant struct {
	Bot           bool   // Flag indicating whether or not this participant is a bot
	Spell1ID      int64  // The ID of the first summoner spell used by this participant
	Spell2ID      int64  // The ID of the second summoner spell used by this participant
	ProfileIconID int64  // The ID of the profile icon used by this participant
	SummonerName  string // The summoner name of this participant
	ChampionID    int64  // The ID of the champion played by this participant
	TeamID        int64  // The ID of this participant, indicating the participant's team
}

The participant information of a featured game

type GameCustomizationObject

type GameCustomizationObject struct {
	Category string // Category identifier for the Game Customization
	Content  string // Game customization content
}

List of Game Customizations

type InfoDTO

type InfoDTO struct {
	GameCreation       int64            // Unix timestamp for when the game is created on the game server (i.e., the loading screen).
	GameDuration       int64            // Prior to patch 11.20, this field returns the game length in milliseconds calculated from gameEndTimestamp - gameStartTimestamp. Post patch 11.20, this field returns the max timePlayed of any participant in the game in seconds, which makes the behavior of this field consistent with that of match-v4. The best way to handling the change in this field is to treat the value as milliseconds if the gameEndTimestamp field isn't in the response and to treat the value as seconds if gameEndTimestamp is in the response.
	GameEndTimestamp   int64            // Unix timestamp for when match ends on the game server. This timestamp can occasionally be significantly longer than when the match "ends". The most reliable way of determining the timestamp for the end of the match would be to add the max time played of any participant to the gameStartTimestamp. This field was added to match-v5 in patch 11.20 on Oct 5th, 2021.
	GameID             int64            //
	GameMode           string           // Refer to the Game Constants documentation.
	GameName           string           //
	GameStartTimestamp int64            // Unix timestamp for when match starts on the game server.
	GameType           string           //
	GameVersion        string           // The first two parts can be used to determine the patch a game was played on.
	MapID              int              // Refer to the Game Constants documentation.
	Participants       []ParticipantDTO //
	PlatformID         string           // Platform where the match was played.
	QueueID            int              // Refer to the Game Constants documentation.
	Teams              []TeamDTO        //
	TournamentCode     string           // Tournament code used to generate the match. This field was added to match-v5 in patch 11.13 on June 23rd, 2021.
}

type Item

type Item struct {
	Name string
	Rune struct {
		IsRune bool
		Tier   int
		Type   string
	}
	Gold struct {
		Base, Total, Sell int
		Purchasable       bool
	}
	Group            string
	Description      string
	Colloq           string
	PlainText        string
	Consumed         bool
	Stacks           int
	Depth            int
	ConsumeOnFull    bool
	From             []string // TODO: verify type
	Into             []string // TODO: verify type
	SpecialRecipe    int
	InStore          bool
	HideFromAll      bool
	RequiredChampion string
	RequiredAlly     string
	Stats            map[string]float64
	Tags             []string // TODO: verify type
	Maps             map[int]bool
	Image            ChampionImage
}

type Items

type Items struct {
	Type    string                                 // "items"
	Version string                                 // Game version
	Basic   Item                                   // Empty item template
	Data    map[int]Item                           // Actual items
	Groups  []struct{ ID, MaxGroupOwnable string } // Defines various item groups
	Tree    []struct {
		Header string
		Tags   []string
	}
}

func GetItemsParsed

func GetItemsParsed(version, localisation string) (*Items, error)

type MatchDTO

type MatchDTO struct {
	Metadata MetadataDTO // Match metadata.
	Info     InfoDTO     // Match info.
}

func GetMatchDTO

func GetMatchDTO(data []byte) *MatchDTO

func NewMatchDTO

func NewMatchDTO() *MatchDTO

type MetadataDTO

type MetadataDTO struct {
	DataVersion  string   // Match data version.
	MatchID      string   // Match ID.
	Participants []string // A list of participant PUUIDs
}

type ObjectiveDTO

type ObjectiveDTO struct {
	First bool
	Kills int
}

type Observer

type Observer struct {
	EncryptionKey string // Key used to decrypt the spectator grid game data for playback
}

The observer information

type ParticipantDTO

type ParticipantDTO struct {
	Assists                        int
	BaronKills                     int
	BountyLevel                    int
	ChampExperience                int
	ChampLevel                     int
	ChampionID                     int // Prior to patch 11.4, on Feb 18th, 2021, this field returned invalid championIds. We recommend determining the champion based on the championName field for matches played prior to patch 11.4.
	ChampionName                   string
	ChampionTransform              int // This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin)
	ConsumablesPurchased           int
	DamageDealtToBuildings         int
	DamageDealtToObjectives        int
	DamageDealtToTurrets           int
	DamageSelfMitigated            int
	Deaths                         int
	DetectorWardsPlaced            int
	DoubleKills                    int
	DragonKills                    int
	FirstBloodAssist               bool
	FirstBloodKill                 bool
	FirstTowerAssist               bool
	FirstTowerKill                 bool
	GameEndedInEarlySurrender      bool
	GameEndedInSurrender           bool
	GoldEarned                     int
	GoldSpent                      int
	IndividualPosition             string //Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field.
	InhibitorKills                 int
	InhibitorTakedowns             int
	InhibitorsLost                 int
	Item0                          int
	Item1                          int
	Item2                          int
	Item3                          int
	Item4                          int
	Item5                          int
	Item6                          int
	ItemsPurchased                 int
	KillingSprees                  int
	Kills                          int
	Lane                           string
	LargestCriticalStrike          int
	LargestKillingSpree            int
	LargestMultiKill               int
	LongestTimeSpentLiving         int
	MagicDamageDealt               int
	MagicDamageDealtToChampions    int
	MagicDamageTaken               int
	NeutralMinionsKilled           int
	NexusKills                     int
	NexusTakedowns                 int
	NexusLost                      int
	ObjectivesStolen               int
	ObjectivesStolenAssists        int
	ParticipantID                  int
	PentaKills                     int
	Perks                          PerksDTO
	PhysicalDamageDealt            int
	PhysicalDamageDealtToChampions int
	PhysicalDamageTaken            int
	ProfileIcon                    int
	PUUID                          string
	QuadraKills                    int
	RiotIDName                     string
	RiotIDTagline                  string
	Role                           string
	SightWardsBoughtInGame         int
	Spell1Casts                    int
	Spell2Casts                    int
	Spell3Casts                    int
	Spell4Casts                    int
	Summoner1Casts                 int
	Summoner1ID                    int
	Summoner2Casts                 int
	Summoner2ID                    int
	SummonerID                     string
	SummonerLevel                  int
	SummonerName                   string
	TeamEarlySurrendered           bool
	TeamID                         int
	TeamPosition                   string // Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field.
	TimeCCingOthers                int
	TimePlayed                     int
	TotalDamageDealt               int
	TotalDamageDealtToChampions    int
	TotalDamageShieldedOnTeammates int
	TotalDamageTaken               int
	TotalHeal                      int
	TotalHealsOnTeammates          int
	TotalMinionsKilled             int
	TotalTimeCCDealt               int
	TotalTimeSpentDead             int
	TotalUnitsHealed               int
	TripleKills                    int
	TrueDamageDealt                int
	TrueDamageDealtToChampions     int
	TrueDamageTaken                int
	TurretKills                    int
	TurretTakedowns                int
	TurretsLost                    int
	UnrealKills                    int
	VisionScore                    int
	VisionWardsBoughtInGame        int
	WardsKilled                    int
	WardsPlaced                    int
	Win                            bool
}

type Perks

type Perks struct {
	PerkIDs       []int64 // IDs of the perks/runes assigned
	PerkStyle     int64   // Primary runes path
	PerksSubStype int64   // Secondary runes path
}

Perks/Runes Reforged Information

type PerksDTO

type PerksDTO struct {
	StatPerks struct{ Defense, Flex, Offense int }
	Styles    struct {
		Description string
		Selections  []struct{ Perk, Var1, Var2, Var3 int }
		Style       int
	}
}

type Realm

type Realm struct {
	N              struct{ Item, Rune, Mastery, Summoner, Champion, ProfileIcon, Map, Language, Sticker string }
	V              string // ? game version?
	L              string // ? locale e.g. "en_GB" for euw
	CDN            string // DataDragon CDN location
	DD             string // ? DataDragon version?
	LG             string
	CSS            string
	ProfileIconMax int
	Store          interface{} // ? what is this?
}

type SummonerDTO

type SummonerDTO struct {
	AccountID     string // Encrypted account ID. Max length 56 characters.
	Name          string // Summoner name.
	ID            string // Encrypted summoner ID. Max length 63 characters.
	PUUID         string // Encrypted PUUID. Exact length of 78 characters.
	ProfileIconID int64  // ID of the summoner icon associated with the summoner.
	SummonerLevel int64  // Summoner level associated with the summoner.
	RevisionDate  int64  // Date summoner was last modified specified as epoch milliseconds. The following events will update this timestamp: summoner name change, summoner level change, or profile icon change.
}

Represents a summoner

type TeamDTO

type TeamDTO struct {
	Bans       []struct{ ChampionID, PickTurn int }
	Objectives struct{ Baron, Champion, Dragon, Inhibitor, RiftHrald, Tower ObjectiveDTO }
	TeamID     int
	Win        bool
}

Jump to

Keyboard shortcuts

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