Skip to content

Commit a2348a0

Browse files
authored
Merge pull request UnownHash#216 from Mygod/better-showcase-entries
Record more complete information about contestEntry
2 parents 05601e4 + 1452c15 commit a2348a0

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

decoder/pokestop.go

+29-12
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,18 @@ func (stop *Pokestop) updatePokestopFromGetContestDataOutProto(contest *pogo.Con
616616

617617
func (stop *Pokestop) updatePokestopFromGetPokemonSizeContestEntryOutProto(contestData *pogo.GetPokemonSizeLeaderboardEntryOutProto) {
618618
type contestEntry struct {
619-
Rank int `json:"rank"`
620-
Score float64 `json:"score"`
621-
PokemonId int `json:"pokemon_id"`
622-
Form int `json:"form"`
623-
Costume int `json:"costume"`
624-
Gender int `json:"gender"`
619+
Rank int `json:"rank"`
620+
Score float64 `json:"score"`
621+
PokemonId int `json:"pokemon_id"`
622+
Form int `json:"form"`
623+
Costume int `json:"costume"`
624+
Gender int `json:"gender"`
625+
Shiny bool `json:"shiny"`
626+
TempEvolution int `json:"temp_evolution"`
627+
TempEvolutionFinishMs int64 `json:"temp_evolution_finish_ms"`
628+
Alignment int `json:"alignment"`
629+
Badge int `json:"badge"`
630+
LocationCard int `json:"location_card"`
625631
}
626632
type contestJson struct {
627633
TotalEntries int `json:"total_entries"`
@@ -638,12 +644,23 @@ func (stop *Pokestop) updatePokestopFromGetPokemonSizeContestEntryOutProto(conte
638644
break
639645
}
640646
j.ContestEntries = append(j.ContestEntries, contestEntry{
641-
Rank: int(rank),
642-
Score: entry.GetScore(),
643-
PokemonId: int(entry.GetPokedexId()),
644-
Form: int(entry.GetPokemonDisplay().Form),
645-
Costume: int(entry.GetPokemonDisplay().Costume),
646-
Gender: int(entry.GetPokemonDisplay().Gender),
647+
Rank: int(rank),
648+
Score: entry.GetScore(),
649+
PokemonId: int(entry.GetPokedexId()),
650+
Form: int(entry.GetPokemonDisplay().Form),
651+
Costume: int(entry.GetPokemonDisplay().Costume),
652+
Gender: int(entry.GetPokemonDisplay().Gender),
653+
Shiny: entry.GetPokemonDisplay().Shiny,
654+
TempEvolution: int(entry.GetPokemonDisplay().CurrentTempEvolution),
655+
TempEvolutionFinishMs: entry.GetPokemonDisplay().TemporaryEvolutionFinishMs,
656+
Alignment: int(entry.GetPokemonDisplay().Alignment),
657+
Badge: int(entry.GetPokemonDisplay().PokemonBadge),
658+
LocationCard: int(func() pogo.LocationCard {
659+
if entry.GetPokemonDisplay().LocationCard == nil {
660+
return 0
661+
}
662+
return entry.GetPokemonDisplay().LocationCard.LocationCard
663+
}()),
647664
})
648665

649666
}

0 commit comments

Comments
 (0)