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