From 1cc4a9d0af5323a074ccac3511cc3cc679779eb9 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 16 Dec 2022 14:17:00 +0000 Subject: [PATCH] CAPI killswitches: 'capi.auth' now preventing all CAPI actions. --- EDMarketConnector.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 470ead9c..c88fd162 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -912,6 +912,12 @@ class AppWindow(object): def login(self): """Initiate CAPI/Frontier login and set other necessary state.""" + should_return, new_data = killswitch.check_killswitch('capi.auth', {}) + if should_return: + logger.warning('capi.auth has been disabled via killswitch. Returning.') + self.status['text'] = 'CAPI auth disabled by killswitch' + return + if not self.status['text']: # LANG: Status - Attempting to get a Frontier Auth Access Token self.status['text'] = _('Logging in...') @@ -997,6 +1003,13 @@ class AppWindow(object): :param event: Tk generated event details. """ logger.trace_if('capi.worker', 'Begin') + should_return, new_data = killswitch.check_killswitch('capi.auth', {}) + if should_return: + logger.warning('capi.auth has been disabled via killswitch. Returning.') + self.status['text'] = 'CAPI auth disabled by killswitch' + hotkeymgr.play_bad() + return + auto_update = not event play_sound = (auto_update or int(event.type) == self.EVENT_VIRTUAL) and not config.get_int('hotkey_mute') @@ -1465,7 +1478,9 @@ class AppWindow(object): auto_update = True if auto_update: - self.w.after(int(SERVER_RETRY * 1000), self.capi_request_data) + should_return, new_data = killswitch.check_killswitch('capi.auth', {}) + if not should_return: + self.w.after(int(SERVER_RETRY * 1000), self.capi_request_data) if entry['event'] == 'ShutDown': # Enable WinSparkle automatic update checks