mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-04-12 10:28:15 -07:00
Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
This commit is contained in:
@@ -41,13 +41,7 @@ app.config["SELFLAUNCH"] = True # application process is in charge of launching
|
||||
app.config["SELFLAUNCHCERT"] = None # can point to a SSL Certificate to encrypt Room websocket connections
|
||||
app.config["SELFLAUNCHKEY"] = None # can point to a SSL Certificate Key to encrypt Room websocket connections
|
||||
app.config["SELFGEN"] = True # application process is in charge of scheduling Generations.
|
||||
app.config["DEBUG"] = False
|
||||
app.config["PORT"] = 80
|
||||
app.config["GAME_PORTS"] = ["49152-65535", 0]
|
||||
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
||||
app.config['MAX_CONTENT_LENGTH'] = 64 * 1024 * 1024 # 64 megabyte limit
|
||||
# if you want to deploy, make sure you have a non-guessable secret key
|
||||
app.config["SECRET_KEY"] = bytes(socket.gethostname(), encoding="utf-8")
|
||||
# at what amount of worlds should scheduling be used, instead of rolling in the web-thread
|
||||
app.config["JOB_THRESHOLD"] = 1
|
||||
# after what time in seconds should generation be aborted, freeing the queue slot. Can be set to None to disable.
|
||||
|
||||
@@ -184,12 +184,12 @@ class WebHostContext(Context):
|
||||
return d
|
||||
|
||||
|
||||
def get_random_port(game_ports: list, host):
|
||||
def get_random_port(game_ports: list[str | int], host: str):
|
||||
available_ports = []
|
||||
ephemeral_allowed = False
|
||||
for item in game_ports:
|
||||
if type(item) is str and '-' in item:
|
||||
start, end = map(int, item.split('-'))
|
||||
if isinstance(item, str) and "-" in item:
|
||||
start, end = map(int, item.split("-"))
|
||||
available_ports.append(range(start, end+1))
|
||||
elif int(item) == 0:
|
||||
ephemeral_allowed = True
|
||||
|
||||
Reference in New Issue
Block a user