From f1aed75337a39eedaa4f3188ba8d80076baf99f7 Mon Sep 17 00:00:00 2001 From: JabLuszko Date: Fri, 5 Apr 2024 05:48:15 +0200 Subject: [PATCH 1/2] Update QuestStrategy.py --- mapadroid/worker/strategy/quest/QuestStrategy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mapadroid/worker/strategy/quest/QuestStrategy.py b/mapadroid/worker/strategy/quest/QuestStrategy.py index d24cec253..e12273010 100644 --- a/mapadroid/worker/strategy/quest/QuestStrategy.py +++ b/mapadroid/worker/strategy/quest/QuestStrategy.py @@ -578,11 +578,11 @@ async def _ensure_stop_present(self, timestamp: float) -> PositionStopType: async def _current_position_has_spinnable_stop(self, timestamp: float) -> PositionStopType: type_received, data_received, time_received = await self._wait_for_data_after_moving(timestamp, ProtoIdentifier.GMO, 35) - if (type_received != ReceivedType.GMO or data_received is None - or not isinstance(data_received, pogoprotos.GetMapObjectsOutProto)): + if type_received != ReceivedType.GMO or data_received is None: await self._spinnable_data_failure() return PositionStopType.GMO_NOT_AVAILABLE - latest_proto: pogoprotos.GetMapObjectsOutProto = data_received + + latest_proto: pogoprotos.GetMapObjectsOutProto = ProtoHelper.parse(ProtoIdentifier.GMO, data_received) if not latest_proto.map_cell: logger.warning("Can't spin stop - no map info in GMO!") From d3def82ade7962b1af9a7c5e2d65ad6a167744dc Mon Sep 17 00:00:00 2001 From: JabLuszko Date: Fri, 5 Apr 2024 05:56:25 +0200 Subject: [PATCH 2/2] Update DbPogoProtoSubmitRaw.py --- mapadroid/db/DbPogoProtoSubmitRaw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapadroid/db/DbPogoProtoSubmitRaw.py b/mapadroid/db/DbPogoProtoSubmitRaw.py index 7b9661177..fb0f64ae5 100644 --- a/mapadroid/db/DbPogoProtoSubmitRaw.py +++ b/mapadroid/db/DbPogoProtoSubmitRaw.py @@ -714,7 +714,7 @@ async def quest(self, session: AsyncSession, quest_proto: pogoprotos.FortSearchO condition: RepeatedCompositeFieldContainer[pogoprotos.QuestConditionProto] = goal.condition # TODO: Json dumping protos... - json_condition: str = json.dumps(condition) + json_condition: str = ProtoHelper.to_json(condition) task = await quest_gen.questtask(int(quest_type), json_condition, int(target), quest_template, quest_title_resource_id) quest: Optional[TrsQuest] = await TrsQuestHelper.get(session, fort_id, quest_layer)