diff --git a/EDMC.py b/EDMC.py index 159ff879..6a4cb39d 100755 --- a/EDMC.py +++ b/EDMC.py @@ -232,6 +232,9 @@ try: except companion.ServerError as e: sys.stderr.write('Server is down\n') sys.exit(EXIT_SERVER) +except companion.SKUError as e: + sys.stderr.write('Server SKU problem\n') + sys.exit(EXIT_SERVER) except companion.CredentialsError as e: sys.stderr.write('Invalid Credentials\n') sys.exit(EXIT_CREDENTIALS) diff --git a/L10n/cs.strings b/L10n/cs.strings index 6756b39b..57c10404 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Chyba: Server Frontieru laguje"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Chyba: Server Frontieru SKU problém"; + /* [companion.py] */ "Error: Invalid Credentials" = "Chyba: Chybné přihlašovací údaje"; diff --git a/L10n/de.strings b/L10n/de.strings index 81ac75f1..d76c985d 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Fehler: Frontier-Server ist überlastet"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Fehler: Frontier-Server SKU Problem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Fehler: Ungültige Anmeldedaten"; diff --git a/L10n/en.template b/L10n/en.template index f9d1c552..9fef51c7 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Error: Frontier server is lagging"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Error: Invalid Credentials"; diff --git a/L10n/es.strings b/L10n/es.strings index a0caf9c7..bcc9a076 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Error: El servidor de Frontier está retrasado"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Error: Problema de SKU en el servidor de Frontier"; + /* [companion.py] */ "Error: Invalid Credentials" = "Error: Credenciales Inválidas"; diff --git a/L10n/fi.strings b/L10n/fi.strings index 4ca56f49..cf8d8ed2 100644 --- a/L10n/fi.strings +++ b/L10n/fi.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Virhe: Frontierin palvelin vastaa vanhoilla tiedoilla"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Virhe: Frontier -palvelimen SKU-ongelma"; + /* [companion.py] */ "Error: Invalid Credentials" = "Virhe: kirjautuminen ei kelpaa"; diff --git a/L10n/fr.strings b/L10n/fr.strings index 57e1f9f8..f15db41e 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Erreur : Le serveur Frontier ne répond pas"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Erreur : Le serveur Frontier a un problème de SKU"; + /* [companion.py] */ "Error: Invalid Credentials" = "Erreur : Identifiants invalides"; diff --git a/L10n/it.strings b/L10n/it.strings index 158a8354..5d7fca46 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Errore: il server Frontier sta laggando"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Errore: il server Frontier ha un problema SKU"; + /* [companion.py] */ "Error: Invalid Credentials" = "Errore: Credenziali non valide"; diff --git a/L10n/ja.strings b/L10n/ja.strings index c56e2db6..507012d8 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "エラー: Frontier社のサーバが混雑しています"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "エラー: Frontier社のサーバで非ゲーム所有者と判断されました"; + /* [companion.py] */ "Error: Invalid Credentials" = "エラー: 認証情報に誤りがあります"; diff --git a/L10n/lv.strings b/L10n/lv.strings index 6fe16bb3..3d6f47ae 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Kļūda: Frontier serveris aizkavējas"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Kļūda: Nederīga lietotāja informācija"; diff --git a/L10n/nl.strings b/L10n/nl.strings index 3f1fe544..0d17c7b0 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Fout: Frontier server is vertraagd"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Fout: Frontier server SKU probleem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Fout: Ongeldige inlog gegevens"; diff --git a/L10n/pl.strings b/L10n/pl.strings index 13b5066f..8e394efd 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Błąd: Serwer Frontiera laguje"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Błąd w odpowiedzi serwera autoryzacyjnego."; + /* [companion.py] */ "Error: Invalid Credentials" = "Błąd: Dane uwierzytelniające niepoprawne"; diff --git a/L10n/ru.strings b/L10n/ru.strings index fe6e441a..a59305e3 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Ошибка: Сервер Фронтир лаг'ает"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Ошибка: неверное имя пользователя или пароль"; diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index 5f820b97..a024c9da 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Greška: Frontier server je usporen"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Greška: SKU problem na Frontier Serveru."; + /* [companion.py] */ "Error: Invalid Credentials" = "Greška: Pogrešni kredencijali"; diff --git a/L10n/uk.strings b/L10n/uk.strings index 0eed0dec..a4d2784c 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -166,6 +166,9 @@ /* Raised when Companion API server is returning old data, e.g. when the servers are too busy. [EDMarketConnector.py] */ "Error: Frontier server is lagging" = "Помилка: З`єднання з сервером гри з затримками!"; +/* Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU'. [companion.py] */ +"Error: Frontier server SKU problem" = "Error: Frontier server SKU problem"; + /* [companion.py] */ "Error: Invalid Credentials" = "Помилка: Невірні облікові дані!"; diff --git a/companion.py b/companion.py index f9098ade..075bed7c 100644 --- a/companion.py +++ b/companion.py @@ -114,6 +114,12 @@ class ServerLagging(Exception): def __str__(self): return unicode(self).encode('utf-8') +class SKUError(Exception): + def __unicode__(self): + return _('Error: Frontier server SKU problem') # Raised when the Companion API server thinks that the user has not purchased E:D. i.e. doesn't have the correct 'SKU' + def __str__(self): + return unicode(self).encode('utf-8') + class CredentialsError(Exception): def __unicode__(self): return _('Error: Invalid Credentials') @@ -193,7 +199,10 @@ class Session: raise ServerError() elif r.url == self.server + URL_LOGIN: # would have redirected away if success self.dump(r) - raise CredentialsError() + if 'purchase' in r.text.lower(): + raise SKUError() + else: + raise CredentialsError() elif r.url == self.server + URL_CONFIRM: # redirected to verification page self.state = Session.STATE_AUTH raise VerificationRequired()