Skip to content

Commit

Permalink
Fix raid mode proto timeout (#1379)
Browse files Browse the repository at this point in the history
* forts -> fort

* forts -> fort

* Drop isinstance checks

* Update external IP check to IPv4 only service
  • Loading branch information
JabLuszko authored Apr 4, 2024
1 parent a573c67 commit 33d64d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mapadroid/utils/walkerArgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def parse_args():
dest='autoconfig_no_auth')

# PTC Login tracking
parser.add_argument('-ips', '--ip_service', default='http://ifconfig.me',
parser.add_argument('-ips', '--ip_service', default='https://checkip.amazonaws.com',
help=('Host to use to request the external IPv4 address of the device. '
'MAD will search for the first IPv4 address via regex.'))
parser.add_argument('-elt', '--enable_login_tracking', action='store_true', default=False,
Expand Down
4 changes: 2 additions & 2 deletions mapadroid/worker/strategy/AbstractMitmBaseStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ def _gmo_cells_contain_multiple_of_key(gmo: pogoprotos.GetMapObjectsOutProto,
else:
keys.extend(keys_in_cell)
cells: RepeatedCompositeFieldContainer[pogoprotos.ClientMapCellProto] = gmo.map_cell
if not cells or not isinstance(cells, RepeatedCompositeFieldContainer):
if not cells:
return False
for cell in cells:
for key in keys:
value_of_key: Optional[Any] = getattr(cell, key, None)
if value_of_key and isinstance(value_of_key, list) and len(value_of_key) > 0:
if value_of_key and len(value_of_key) > 0:
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion mapadroid/worker/strategy/plain/WorkerInitStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InitTypes(Enum):


# Rural areas may not be populated with forts but wild or nearby mons...
KEY_TO_CHECK_FORTS: List[str] = ["forts", "wild_pokemon", "nearby_pokemon"]
KEY_TO_CHECK_FORTS: List[str] = ["fort", "wild_pokemon", "nearby_pokemon"]


class WorkerInitStrategy(AbstractWorkerMitmStrategy):
Expand Down
2 changes: 1 addition & 1 deletion mapadroid/worker/strategy/plain/WorkerRaidsMitmStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def _check_for_data_content(self, latest: Optional[LatestMitmDataEntry],
return ReceivedType.UNDEFINED, data_found
elif proto_to_wait_for == ProtoIdentifier.GMO:
gmo: pogoprotos.GetMapObjectsOutProto = ProtoHelper.parse(ProtoIdentifier.GMO, latest_proto_data)
if self._gmo_cells_contain_multiple_of_key(gmo, "forts"):
if self._gmo_cells_contain_multiple_of_key(gmo, "fort"):
data_found = latest_proto_data
type_of_data_found = ReceivedType.GMO
else:
Expand Down

0 comments on commit 33d64d3

Please sign in to comment.