1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 00:07:14 +03:00

protocol: Don't use win32-specific edmc://auth if --force-localserver-for-auth

Tested with a build/install and run with:

	"c:\Program Files (x86)\EDMarketConnector\EDMarketConnector.exe" --force-localserver-for-auth --trace

2021-01-22 12:57:11.020 - TRACE - protocol.ProtocolHandler.__init__:222: Web ser
ver listening on http://localhost:53657/auth
This commit is contained in:
Athanasius 2021-01-22 13:00:02 +00:00
parent 3b2b658881
commit e1757a3a99

View File

@ -7,7 +7,9 @@ import sys
from config import appname, config
from constants import protocolhandler_redirect
from EDMCLogging import get_main_logger
logger = get_main_logger()
if sys.platform == 'win32':
from ctypes import *
@ -74,7 +76,7 @@ if sys.platform == 'darwin' and getattr(sys, 'frozen', False):
protocolhandler.master.after(ProtocolHandler.POLL, protocolhandler.poll)
elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine:
elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine and not config.auth_force_localserver:
class WNDCLASS(Structure):
_fields_ = [('style', UINT),
@ -217,6 +219,7 @@ else: # Linux / Run from source
GenericProtocolHandler.__init__(self)
self.httpd = HTTPServer(('localhost', 0), HTTPRequestHandler)
self.redirect = 'http://localhost:%d/auth' % self.httpd.server_port
logger.trace(f'Web server listening on {self.redirect}')
self.thread = None
def start(self, master):