From 85191508d3221d0938418517dfe8bd57d6c213dd Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Thu, 12 Jan 2017 00:18:15 +0000 Subject: [PATCH] Specific error for API data doesn't match Journal --- EDMarketConnector.py | 2 +- L10n/en.template | 3 +++ README.md | 12 ++++++++++++ companion.py | 6 ++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 06ed685a..552a5e5b 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -397,7 +397,7 @@ class AppWindow: elif not data.get('ship') or not data['ship'].get('modules') or not data['ship'].get('name','').strip(): self.status['text'] = _("What are you flying?!") # Shouldn't happen elif monitor.cmdr and data['commander']['name'] != monitor.cmdr: - raise companion.CredentialsError() # Companion API credentials don't match Journal + raise companion.CmdrError() # Companion API return doesn't match Journal elif (auto_update and not data['commander'].get('docked')) or (monitor.system and data['lastSystem']['name'] != monitor.system) or (monitor.shipid and data['ship']['id'] != monitor.shipid) or (monitor.shiptype and data['ship']['name'].lower() != monitor.shiptype): raise companion.ServerLagging() diff --git a/L10n/en.template b/L10n/en.template index f9a83c42..b6f505f4 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -157,6 +157,9 @@ /* [companion.py] */ "Error: Verification failed" = "Error: Verification failed"; +/* Raised when the user has multiple accounts and the username/password setting is not for the account they're currently playing OR the user has reset their Cmdr and the Companion API server is still returning data for the old Cmdr. [companion.py] */ +"Error: Wrong Cmdr" = "Error: Wrong Cmdr"; + /* Item in the File menu on Windows. [EDMarketConnector.py] */ "Exit" = "Exit"; diff --git a/README.md b/README.md index 9b77fbb7..48766df8 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,18 @@ This problem is tracked as [Issue #92](https://github.com/Marginal/EDMarketConne ### Doesn't auto-update or track Systems visited This app uses Elite: Dangerous' “journal” files to track the systems and stations that you visit. If you're running this app on a different machine from the Elite: Dangerous game, or if you find that this app isn't automatically tracking the systems that you visit and/or isn't automatically “updating” on docking (if you have that option selected), then adjust the “E:D journal file location” setting on the Configuration tab to point to the game's journal files. +### Error: Wrong Cmdr +The Frontier server that supplies data to this app is supplying data for a different Cmdr than the one that you're currently playing. Either: + +1. You have multiple accounts and the username/password setting is not for the account that you're currently playing; or +2. You have reset your Cmdr but Frontier's server is still supplying data for the old Cmdr. + +If 1 check your username/password settings. + +If 2 this problem may or may not resolve itself in time. + +This problem is tracked as [Issue #165](https://github.com/Marginal/EDMarketConnector/issues/165). + ### Error: Can't connect to EDDN EDMC needs to talk to eddn-gateway.elite-markets.net on port 8080. If you consistently receive this error check that your router or VPN configuration allows port 8080 / tcp outbound. diff --git a/companion.py b/companion.py index a4eb35aa..fc6813ec 100644 --- a/companion.py +++ b/companion.py @@ -153,6 +153,12 @@ class CredentialsError(Exception): def __str__(self): return unicode(self).encode('utf-8') +class CmdrError(Exception): + def __unicode__(self): + return _('Error: Wrong Cmdr') # Raised when the user has multiple accounts and the username/password setting is not for the account they're currently playing OR the user has reset their Cmdr and the Companion API server is still returning data for the old Cmdr + def __str__(self): + return unicode(self).encode('utf-8') + class VerificationRequired(Exception): def __unicode__(self): return _('Error: Verification failed')