mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-22 07:35:37 -07:00
- Added better fallback to default port range when a custom range fails
- Updated config to be clearer
This commit is contained in:
@@ -146,6 +146,15 @@ def get_random_port(game_ports):
|
||||
available_ports.append(int(item))
|
||||
|
||||
port = get_port_from_list(available_ports)
|
||||
if port == 0:
|
||||
logging.info("Unable to find port. Expanding search to the default ports. (49152-65535)")
|
||||
checked_ports = []
|
||||
while len(set(checked_ports)) < (65535-49152)+1:
|
||||
port = random.randint(49152, 65535)
|
||||
if not is_port_in_use(port):
|
||||
break
|
||||
else:
|
||||
checked_ports.append(port)
|
||||
|
||||
return port
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
# Ports used for game hosting. Values can be specific ports, port ranges or both. Default is: "49152-65535"
|
||||
# Examples of valid values: "40000-41000,49152-65535"
|
||||
# If ports within the range(s) are already in use, the WebHost will fallback to the default "49152-65535" range.
|
||||
#GAME_PORTS: "49152-65535"
|
||||
|
||||
# Place where uploads go.
|
||||
|
||||
Reference in New Issue
Block a user