Merged ai_slots and closed_slots into one.
This commit is contained in:
@@ -54,10 +54,9 @@ def server_command_builder(
|
||||
name: str,
|
||||
port: int,
|
||||
era: int, # 1 EA, 2 MA, 3 LA
|
||||
closed_slots: list[int] = [], # list of nations that will be closed
|
||||
ai_slots: list[
|
||||
tuple[int, int]
|
||||
] = [], # list of nations that will be ai tuple format: NationID, AI Level (1-6)
|
||||
] = [], # list of nations that will be ai tuple format: NationID, AI Level (1-6), 0 being closed
|
||||
client_start: bool = True,
|
||||
teams: list[tuple[int, int, int]] = [],
|
||||
clustered_start: bool = False,
|
||||
@@ -105,8 +104,8 @@ def server_command_builder(
|
||||
if not (len(ai_indexes) == len(set(ai_indexes))):
|
||||
return "ERROR_AIS"
|
||||
|
||||
if bool(set(closed_slots) & set(ai_indexes)):
|
||||
return "ERROR_CLOSED_AIS"
|
||||
# if bool(set(closed_slots) & set(ai_indexes)):
|
||||
# return "ERROR_CLOSED_AIS"
|
||||
|
||||
if required_apoints == 0:
|
||||
required_apoints = thrones[0] + (2 * thrones[1]) + (3 * thrones[2]) - 1
|
||||
@@ -150,7 +149,7 @@ def server_command_builder(
|
||||
]
|
||||
if team_game:
|
||||
for team in teams:
|
||||
# TODO Can team have more than one disciple and pretender?
|
||||
# TODO: Can team have more than one disciple and pretender?
|
||||
if team[0] not in available_nations[str(era)]:
|
||||
return "ERROR_INVALID_NATION"
|
||||
|
||||
@@ -229,6 +228,8 @@ def server_command_builder(
|
||||
if ai[0] in added_ais:
|
||||
return "ERROR_DUPLICATE_AI"
|
||||
match ai[1]:
|
||||
case 0:
|
||||
command.append(" --closed " + str(ai[0]))
|
||||
case 1:
|
||||
command.append(" --easyai " + str(ai[0]))
|
||||
case 2:
|
||||
|
||||
Reference in New Issue
Block a user