Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions example_json/match_data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"data": {
"metadata": {
"dataVersion": "2",
"matchId": "NA1_4980010890",
"participants": [
"ViL-fqc_05wIgsqrNTZm4GTXv24-oNM0A4p41gcFdq9ltxyATnijVFkdBdE9EEQnErx4q81yTGZT1A",
Expand All @@ -14,7 +13,9 @@
"qVuw8MpQ1jk9pinzpAh6LIWowY4hjnbUkMJq8nJZ_PfdAtXoJoRt2bs0dT79H3xtsiJd1vGgXhpusg",
"5U0sb_NKk_baARqrpvFnYHSDA1D9qW8dk05Ptx6DA-TKzAlv0rbpGgeSyp9J-1ZrplJ_Vbo3N9WLoA",
"vEdac3yp21FNBsN29rG2dlg6Vjj45r2790gNutCMuJer6ET6204fKRNrQ_Qm6IFYjKVGQLdrkmCy5w"
]
],
"matchName": "Ixtali Iguanas vs. ChumpChangers",
"matchIdLCC": "12"
},
"info": {
"gameCreation": 1713749736915,
Expand All @@ -33,7 +34,7 @@
"name": "Ixtali Iguanas",
"side": "Blue",
"teamId": 100,
"gameOutcome": "Draw",
"gameResult": "Draw",
"score": 1,
"kills": 10,
"gold": 48637,
Expand Down Expand Up @@ -206,9 +207,6 @@
"name": "Lethal Tempo",
"id": 8008,
"image": "https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/Precision/PressTheAttack/PressTheAttack.png",
"shortDesc": "1.5s after damaging a champion gain a large amount of Attack Speed. Lethal Tempo allows you to temporarily exceed the attack speed limit.",
"longDesc": "1.5s after damaging a champion gain 40 - 110% Attack Speed (based on level) for 3s. Attacking a champion extends the effect to 6s.",
"key": "8008"
}
},
"secondary": {
Expand Down Expand Up @@ -236,22 +234,20 @@
"cs14": 108,
"csm": 8.5,
"effectiveHealAndShielding": 2533.677734375,
"firstBloodKill": false,
"goldEarned": 8063,
"goldSpent": 5825,
"goldPerMinute": 351.47007584514756,
"gpm": 351.47007584514756,
"kda": 20,
"killParticipation": 0.7692307692307693,
"neutralMinionsKilled": 0,
"soloKills": 1,
"teamDamagePercentage": 0.2646285560315761,
"totalDamageDealtToChampions": 14615,
"teamDmgPercentage": 0.2646285560315761,
"dmg": 14615,
"damagePerMinute": 637.0295947770143,
"totalDamageTaken": 4224,
"damageTakenOnTeamPercentage": 0.07712553674868768,
"damageTakenPercent": 0.07712553674868768,
"visionScore": 43,
"visionScorePerMinute": 1.9092156280807766,
"visionWardsBoughtInGame": 3,
"vspm": 1.9092156280807766,
"visionWardsBought": 3,
"wardsKilled": 4,
"wardsPlaced": 16
},
Expand Down Expand Up @@ -824,10 +820,6 @@
"kills": 0,
"image": "https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-match-history/global/default/baron-200.png"
},
"champion": {
"first": false,
"kills": 4
},
"dragon": {
"first": true,
"kills": 1,
Expand Down Expand Up @@ -912,20 +904,12 @@
"profile": {
"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A",
"name": "TopDiff",
"tag": "NA",
"level": 30,
"email": "topdiff@gmail.com",
"bio": "I'm a top laner who loves to play tanks and bruisers.",
"icon": 505,
"images": {
"icon": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/profileicon/505.png",
"banner": "https://ddragon.leagueoflegends.com/cdn/img/champion/splash/TahmKench_0.jpg"
}
"tag": "NA"
},
"runes": {
"primary": {
"name": "Precision",
"image": "perk-images/Styles/Precision/Precision.png",
"image": "https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/Precision/Precision.png",
"keystone": {
"name": "Lethal Tempo",
"id": 8008,
Expand Down
47 changes: 17 additions & 30 deletions example_json/player_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
"data": {
"_id": { "$oid": "66ef3ce4b35c8269fae088be" },
"profile": {
"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A",
"name": "TopDiff",
"tag": "NA",
"level": 30,
"email": "topdiff@gmail.com",
"bio": "I'm a top laner who loves to play tanks and bruisers.",
"icon": 505,
"canSub": true,
"email": "topdiff@gmail.com",
"images": {
"icon": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/profileicon/505.png",
"banner": "https://ddragon.leagueoflegends.com/cdn/img/champion/splash/TahmKench_0.jpg"
}
"icon": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/profileicon/505.png"
// "banner": "https://ddragon.leagueoflegends.com/cdn/img/champion/splash/TahmKench_0.jpg"
},
"level": 30,
"name": "TopDiff",
"primaryRole": "Top",
"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A",
"revision_date": 1729813892413,
"secondaryRole": "Jungle",
"tag": "NA"
},
"teams": [{ "1": "LCC_Champs" }, { "2": "LCC_Chumps" }],
"teams": [{ "1": {"name":"LCC_Champs", "role": "JUNGLE"} }, { "2": {"name":"LCC_Chumps", "role": "JUNGLE"} }],
"seasons":["2", "3"],
"matches": [
{
Expand Down Expand Up @@ -72,16 +75,11 @@
},
"deaths": 5,
"firstBloodKill": false,
"gameEndedInEarlySurrender": false,
"gameEndedInSurrender": false,
"mvp": false,
"goldEarned": 10347,
"goldSpent": 8250,
"individualPosition": "TOP",
"kills": 6,
"lane": "TOP",
"neutralMinionsKilled": 0,
"profileIcon": 1109,
"role": "SOLO",
"cs": 122,
"runes": {
"primary": {
"name": "Precision",
Expand Down Expand Up @@ -114,15 +112,13 @@
"image": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/spell/SummonerTeleport.png"
}
],
"teamEarlySurrendered": false,
"team": {
"name": "Ixtali Iguanas",
"image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/-1.png",
"id": 100,
"side": "Blue"
},
"teamPosition": "TOP",
"totalMinionsKilled": 124,
"vod": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"win": true,
"vs": {
Expand Down Expand Up @@ -178,16 +174,10 @@
},
"deaths": 5,
"firstBloodKill": false,
"gameEndedInEarlySurrender": false,
"gameEndedInSurrender": false,
"goldEarned": 10347,
"goldSpent": 8250,
"individualPosition": "TOP",
"kills": 6,
"lane": "TOP",
"neutralMinionsKilled": 0,
"profileIcon": 1109,
"role": "SOLO",
"cs": 0,
"runes": {
"primary": {
"name": "Precision",
Expand Down Expand Up @@ -220,21 +210,17 @@
"image": "SummonerTeleport.png"
}
},
"teamEarlySurrendered": false,
"team": {
"name": "Chump Changers",
"image": "https://cdn.communitydragon.org/latest/honor/emblem/generic",
"id": 200,
"side": "Red"
},
"teamPosition": "TOP",
"totalMinionsKilled": 124,
"win": false
}
}
],
"primaryRole": "Top",
"secondaryRole": "Jungle",
"championStats": {
"allTime": [
{
Expand Down Expand Up @@ -871,6 +857,7 @@
"kills": "45",
"deaths": "42",
"assists": "63",
"killParticipationTotal": "3.75",
"killParticipation": "0.75",
"kda": "2.45",
"goldEarned": "10347",
Expand Down
1 change: 1 addition & 0 deletions example_json/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"data": [{"role": "TOP", "build": [{"id": 1054, "name": "Doran"s Shield", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/1054.png"}, {"id": 6662, "name": "Iceborn Gauntlet", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/6662.png"}, {"id": 3158, "name": "Ionian Boots of Lucidity", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3158.png"}, {"id": 3110, "name": "Frozen Heart", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3110.png"}, {"id": 3211, "name": "Spectre"s Cowl", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3211.png"}, {"id": 3067, "name": "Kindlegem", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3067.png"}], "trinket": {"id": 3340, "name": "Stealth Ward", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3340.png"}, "champion": {"id": 75, "name": "Nasus", "level": 15, "experience": 14186, "image": {"square": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/champion/Nasus.png"}}, "assists": 2, "deaths": 5, "kills": 4, "kda": 1.2, "profile": {"puuid": "l5wI2JfWIgYucm9-vB7sMzcKWZGxhlnbMedOPGH4YozKJ8EMT3alTxM0cYTUWbY2YiDke2vd67JfqA", "name": "Unknown Summoner", "tag": "NA"}, "runes": {"primary": {"name": {"name": "Precision", "key": "7201_precision"}, "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/7201_precision.png", "keystone": {"id": 8021, "name": "fleetfootwork", "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/precision/fleetfootwork/fleetfootwork.png"}}, "secondary": {"name": {"name": "Resolve", "key": "7204_resolve"}, "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/7204_resolve.png"}}, "spells": [{"casts": 3, "id": 12, "name": "Teleport", "image": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/spell/SummonerTeleport.png"}, {"casts": 4, "id": 6, "name": "Ghost", "image": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/spell/SummonerHaste.png"}], "firstBlood": False, "cs": 171, "csm": 5.95, "cs14": 98, "dmg": 14506, "dpm": 504.56, "teamDmgPercent": 23.0, "goldEarned": 9620, "goldSpent": 8550, "gpm": 334.61, "killParticipation": 40.0, "effectiveHealAndShielding": 0, "totalDamageTaken": 34581, "damageTakenPercent": 36.0, "visionScore": 15, "vspm": 0.52, "visionWardsBought": 0, "wardsKilled": 1, "wardsPlaced": 8, "soloKills": 1}, {"role": "TOP", "build": [{"id": 1028, "name": "Ruby Crystal", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/1028.png"}, {"id": 6631, "name": "Stridebreaker", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/6631.png"}, {"id": 3006, "name": "Berserker"s Greaves", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3006.png"}, {"id": 3046, "name": "Phantom Dancer", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3046.png"}, {"id": 3066, "name": "Winged Moonplate", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3066.png"}, {"id": 1031, "name": "Chain Vest", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/1031.png"}], "trinket": {"id": 3340, "name": "Stealth Ward", "image": "http://ddragon.leagueoflegends.com/cdn/14.20.1/img/item/3340.png"}, "champion": {"id": 86, "name": "Garen", "level": 17, "experience": 16834, "image": {"square": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/champion/Garen.png"}}, "assists": 5, "deaths": 1, "kills": 4, "kda": 9, "profile": {"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A", "name": "Unknown Summoner", "tag": "NA"}, "runes": {"primary": {"name": {"name": "Precision", "key": "7201_precision"}, "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/7201_precision.png", "keystone": {"id": 8010, "name": "conqueror", "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/precision/conqueror/conqueror.png"}}, "secondary": {"name": {"name": "Resolve", "key": "7204_resolve"}, "image": "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/perk-images/styles/7204_resolve.png"}}, "spells": [{"casts": 3, "id": 4, "name": "Flash", "image": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/spell/SummonerFlash.png"}, {"casts": 6, "id": 14, "name": "Ignite", "image": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/spell/SummonerDot.png"}], "firstBlood": False, "cs": 232, "csm": 8.07, "cs14": 138, "dmg": 23946, "dpm": 832.9, "teamDmgPercent": 28.0, "goldEarned": 12525, "goldSpent": 9700, "gpm": 435.65, "killParticipation": 35.0, "effectiveHealAndShielding": 0, "totalDamageTaken": 24758, "damageTakenPercent": 26.0, "visionScore": 17, "vspm": 0.59, "visionWardsBought": 0, "wardsKilled": 2, "wardsPlaced": 9, "soloKills": 1}]}
113 changes: 113 additions & 0 deletions example_json/workflow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
a user registers generating their profile

"profile": {
"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A",
"name": "TopDiff",
"tag": "NA",
"level": 30,
"email": "topdiff@gmail.com",
"bio": "I'm a top laner who loves to play tanks and bruisers.",
"primaryRole": "Top",
"secondaryRole": "Jungle",
"images": {
"icon": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/profileicon/505.png",
"banner": "https://ddragon.leagueoflegends.com/cdn/img/champion/splash/TahmKench_0.jpg"
}
}


An Admin creates a list of team names
teams:[
{
id: 1,
name:teamA,
},
{
id: 2,
name:teamB,
},
{
id: 3,
name:teamC,
}
]

An Admin can also create a list of seasons

seasons:[
{id: 1,
"type": "Regular",
name: "LCC Season 1"},
{id: 1T,
"type": "Tie-breaker",
name: "LCC Season 1 Tiebreakers"},
{id: 1P,
"type": "Playoff"
name: "LCC Season 1 Playoffs"}
]

An Admin can add teams to a season (tracked on the team rosters)
{
id: 1,
name:teamA,
rosters:[
{
1: {

}
}
]
}

That player gets drafted to a team and the Admin assigns the registered player to their position and team for a particular season
Ex. TopDiff is the new toplaner for teamA for season.id 1

we need to add a roster for the teamA
{
id: 1,
name:teamA,
rosters:[
{
1: {
"TOP": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A"
}
} //puuid for TopDiff
]
}

we need to add a team to topdiff player obj

{
"profile": {
"puuid": "c2xoTJ33QjBVjNX4U2IzxcvMwd9keVQE0M0AcoJfh9l_82XMZSo07zyjg87RmWV-KjnlXqMzqcFm-A",
"name": "TopDiff",
"tag": "NA",
"level": 30,
"email": "topdiff@gmail.com",
"bio": "I'm a top laner who loves to play tanks and bruisers.",
"primaryRole": "Top",
"secondaryRole": "Jungle",
"images": {
"icon": "https://ddragon.leagueoflegends.com/cdn/14.20.1/img/profileicon/505.png",
"banner": "https://ddragon.leagueoflegends.com/cdn/img/champion/splash/TahmKench_0.jpg"
}
},
teams: [{1:"teamA"}]
}

THE HARD PART
The player plays champA in a match against teamB playing ChampB.
The Admin adds the match ID, the team names, and the season (or selects a match in a season)

Add the match data to the database containing all 10 players in the game
for each player in game, find their matchup and add their matchup to their player data (10 iteration)
TopDiff champA vs OtherGuy champB on TopDiffs player data
OtherGuy champB vs TopDiff champA on OtherGuys player data

Check if the player has stats on champA
if not, insert champion stats for champA
if so, retrieve TopDiffs championStats for ChampA and add the new match to them.
update TopDiffs aggregateStats with the new match

The Admin can upload a vod link with the match ID

Loading