diff --git a/src/pathfinder/__init__.py b/src/pathfinder/__init__.py index b7184be..2c2ac82 100644 --- a/src/pathfinder/__init__.py +++ b/src/pathfinder/__init__.py @@ -2,5 +2,5 @@ __organization__ = "FarshieldTech" __appname__ = "Pathfinder" -__version__ = "0.1.0" +__version__ = "0.1.1" __author__ = "Valtyr Farshield" diff --git a/src/pathfinder/app.py b/src/pathfinder/app.py index 7b2917e..4bf3721 100644 --- a/src/pathfinder/app.py +++ b/src/pathfinder/app.py @@ -528,6 +528,8 @@ def thread_done(self, connections): if connections > 0: self._trip_message("Retrieved {} connections!".format(connections), MainWindow.MSG_OK) + elif connections == 0: + self._trip_message("No wormhole connections exist!", MainWindow.MSG_ERROR) else: self._trip_message("Error. Check url/user/pass.", MainWindow.MSG_ERROR) diff --git a/src/pathfinder/model/tripwire.py b/src/pathfinder/model/tripwire.py index 260a88a..f96fe99 100644 --- a/src/pathfinder/model/tripwire.py +++ b/src/pathfinder/model/tripwire.py @@ -12,6 +12,7 @@ class Tripwire: """ Tripwire handler """ + USER_AGENT = "Pathfinder v0.1.1" def __init__(self, eve_db, username, password, url): self.eve_db = eve_db @@ -30,12 +31,16 @@ def login(self): "username": self.username, "password": self.password } + headers = { + "Referer": login_url, + "User-Agent": Tripwire.USER_AGENT, + } try: result = session_requests.post( login_url, data=payload, - headers=dict(referer=login_url) + headers=headers ) except requests.exceptions.RequestException: logging.warning("Unable to connect to Tripwire") @@ -51,13 +56,19 @@ def get_chain(self): if self.session_requests: refresh_url = urlparse.urljoin(self.url, "refresh.php") payload = { - "mode": "init" + "mode": "init", + "systemID": "30000142" + } + headers = { + "Referer": refresh_url, + "User-Agent": Tripwire.USER_AGENT, } try: result = self.session_requests.get( refresh_url, - params=payload + params=payload, + headers=headers ) except requests.exceptions.RequestException as e: logging.error(e, exc_info=True) @@ -69,10 +80,14 @@ def get_chain(self): return response def augment_map(self, solar_map): - connections = 0 + connections = -1 # not logged in, yet chain = self.get_chain() if chain: + # we get some sort of response so at least we're logged in + connections = 0 + + # let's see how many wormhole signatures exist (if any...) for sig in chain["chain"]["map"]: if sig["type"] != "GATE": connections += 1