From 0523dde14d1c0969bb92af8990da99dbc52db7ea Mon Sep 17 00:00:00 2001 From: James Berry Date: Tue, 4 Mar 2025 11:45:21 +0000 Subject: [PATCH 1/3] Add shiny_probability to quest reward structure --- decoder/pokestop.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/decoder/pokestop.go b/decoder/pokestop.go index b2394438..092b9b34 100644 --- a/decoder/pokestop.go +++ b/decoder/pokestop.go @@ -439,11 +439,13 @@ func (stop *Pokestop) updatePokestopFromQuestProto(questProto *pogo.FortSearchOu } else { infoData["pokemon_id"] = int(info.GetPokemonId()) } + infoData["shiny_probability"] = info.ShinyProbability if display := info.PokemonDisplay; display != nil { infoData["costume_id"] = int(display.Costume) infoData["form_id"] = int(display.Form) infoData["gender_id"] = int(display.Gender) infoData["shiny"] = display.Shiny + infoData["location_card"] = util.ExtractLocationCardFromDisplay(display) } else { From 6251fc236cfefcf769805956eaf8f37c9b9c981a Mon Sep 17 00:00:00 2001 From: James Berry Date: Tue, 4 Mar 2025 11:47:03 +0000 Subject: [PATCH 2/3] Remove extra whitespace --- decoder/pokestop.go | 1 - 1 file changed, 1 deletion(-) diff --git a/decoder/pokestop.go b/decoder/pokestop.go index 092b9b34..58e2df7b 100644 --- a/decoder/pokestop.go +++ b/decoder/pokestop.go @@ -445,7 +445,6 @@ func (stop *Pokestop) updatePokestopFromQuestProto(questProto *pogo.FortSearchOu infoData["form_id"] = int(display.Form) infoData["gender_id"] = int(display.Gender) infoData["shiny"] = display.Shiny - infoData["location_card"] = util.ExtractLocationCardFromDisplay(display) } else { From 8556383cbd7b9fd73f33280127521679fa768680 Mon Sep 17 00:00:00 2001 From: James Berry Date: Tue, 4 Mar 2025 12:01:52 +0000 Subject: [PATCH 3/3] Update interface{} to any in this file --- decoder/pokestop.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/decoder/pokestop.go b/decoder/pokestop.go index 58e2df7b..585b940b 100644 --- a/decoder/pokestop.go +++ b/decoder/pokestop.go @@ -254,12 +254,12 @@ func (stop *Pokestop) updatePokestopFromQuestProto(questProto *pogo.FortSearchOu questTarget := int64(questData.Goal.Target) questTemplate := strings.ToLower(questData.TemplateId) - conditions := []map[string]interface{}{} - rewards := []map[string]interface{}{} + conditions := []map[string]any{} + rewards := []map[string]any{} for _, conditionData := range questData.Goal.Condition { - condition := make(map[string]interface{}) - infoData := make(map[string]interface{}) + condition := make(map[string]any) + infoData := make(map[string]any) condition["type"] = int(conditionData.Type) switch conditionData.Type { case pogo.QuestConditionProto_WITH_BADGE_TYPE: @@ -411,8 +411,8 @@ func (stop *Pokestop) updatePokestopFromQuestProto(questProto *pogo.FortSearchOu } for _, rewardData := range questData.QuestRewards { - reward := make(map[string]interface{}) - infoData := make(map[string]interface{}) + reward := make(map[string]any) + infoData := make(map[string]any) reward["type"] = int(rewardData.Type) switch rewardData.Type { case pogo.QuestRewardProto_EXPERIENCE: @@ -679,7 +679,7 @@ func createPokestopWebhooks(oldStop *Pokestop, stop *Pokestop) { areas := MatchStatsGeofence(stop.Lat, stop.Lon) if stop.AlternativeQuestType.Valid && (oldStop == nil || stop.AlternativeQuestType != oldStop.AlternativeQuestType) { - questHook := map[string]interface{}{ + questHook := map[string]any{ "pokestop_id": stop.Id, "latitude": stop.Lat, "longitude": stop.Lon, @@ -705,7 +705,7 @@ func createPokestopWebhooks(oldStop *Pokestop, stop *Pokestop) { } if stop.QuestType.Valid && (oldStop == nil || stop.QuestType != oldStop.QuestType) { - questHook := map[string]interface{}{ + questHook := map[string]any{ "pokestop_id": stop.Id, "latitude": stop.Lat, "longitude": stop.Lon, @@ -730,7 +730,7 @@ func createPokestopWebhooks(oldStop *Pokestop, stop *Pokestop) { webhooksSender.AddMessage(webhooks.Quest, questHook, areas) } if (oldStop == nil && (stop.LureId != 0 || stop.PowerUpEndTimestamp.ValueOrZero() != 0)) || (oldStop != nil && ((stop.LureExpireTimestamp != oldStop.LureExpireTimestamp && stop.LureId != 0) || stop.PowerUpEndTimestamp != oldStop.PowerUpEndTimestamp)) { - pokestopHook := map[string]interface{}{ + pokestopHook := map[string]any{ "pokestop_id": stop.Id, "latitude": stop.Lat, "longitude": stop.Lon, @@ -756,7 +756,7 @@ func createPokestopWebhooks(oldStop *Pokestop, stop *Pokestop) { "showcase_pokemon_type_id": stop.ShowcasePokemonType, "showcase_ranking_standard": stop.ShowcaseRankingStandard, "showcase_expiry": stop.ShowcaseExpiry, - "showcase_rankings": func() interface{} { + "showcase_rankings": func() any { if !stop.ShowcaseRankings.Valid { return nil } else {