Fixed command formatting having too many spaces.

This commit is contained in:
2026-05-03 01:12:35 +02:00
parent 36be931e9f
commit ca7283d57a

View File

@@ -139,14 +139,14 @@ def server_command_builder(
return "ERROR_NEWAIS" return "ERROR_NEWAIS"
command = [ command = [
SERVER_PATH, SERVER_PATH,
"-TS ", " -TS",
name, name,
"--port ", " --port ",
str(port), str(port),
"--statuspage ", " --statuspage ",
os.getcwd() + "/games/" + name + "/turnstats.html", os.getcwd() + "/games/" + name + "/turnstats.html",
"--era ", " --era ",
era, str(era),
] ]
if team_game: if team_game:
for team in teams: for team in teams:
@@ -158,10 +158,10 @@ def server_command_builder(
" --team " + str(team[0]) + " " + str(team[1]) + " " + str(team[2]) " --team " + str(team[0]) + " " + str(team[1]) + " " + str(team[2])
) )
if clustered_start: if clustered_start:
command.append(" --clustered ") command.append(" --clustered")
if not client_start: if not client_start:
command.append(" --noclientstart ") command.append(" --noclientstart")
if cataclysm > 0: if cataclysm > 0:
command.append(" --cataclysm " + str(cataclysm)) command.append(" --cataclysm " + str(cataclysm))
if conq_all: if conq_all:
@@ -169,7 +169,7 @@ def server_command_builder(
if not research_difficulty == 2: if not research_difficulty == 2:
command.append(" --research " + str(research_difficulty)) command.append(" --research " + str(research_difficulty))
if not random_start_research: if not random_start_research:
command.append(" --norandres ") command.append(" --norandres")
if not hof_size == 10: if not hof_size == 10:
command.append(" --hof_size " + str(hof_size)) command.append(" --hof_size " + str(hof_size))
if not global_slots == 5: if not global_slots == 5:
@@ -193,24 +193,24 @@ def server_command_builder(
if not start_prov == 1: if not start_prov == 1:
command.append(" --startprov " + str(start_prov)) command.append(" --startprov " + str(start_prov))
if renaming: if renaming:
command.append(" --renaming ") command.append(" --renaming")
if score_graphs: if score_graphs:
command.append(" --scoregraphs ") command.append(" --scoregraphs")
if no_nation_info: if no_nation_info:
command.append(" --nonationinfo ") command.append(" --nonationinfo")
if no_cheat_det: if no_cheat_det:
command.append(" --nocheatdet ") command.append(" --nocheatdet")
if no_artifact_rest: if no_artifact_rest:
command.append(" --noartrest ") command.append(" --noartrest")
if story_events == 1: if story_events == 1:
command.append(" --storyevents ") command.append(" --storyevents")
elif story_events == 2: elif story_events == 2:
command.append(" --allstoryevents ") command.append(" --allstoryevents")
command.append(" --newailvl " + str(new_ai_lvl)) command.append(" --newailvl " + str(new_ai_lvl))
if no_new_ai: if no_new_ai:
command.append(" --nonewai ") command.append(" --nonewai")
if conq_all: if conq_all:
command.append(" --conqall ") command.append(" --conqall")
command.append( command.append(
" --thrones " + str(thrones[0]) + " " + str(thrones[1]) + " " + str(thrones[2]) " --thrones " + str(thrones[0]) + " " + str(thrones[1]) + " " + str(thrones[2])
) )
@@ -218,10 +218,10 @@ def server_command_builder(
if not cataclysm == 0: if not cataclysm == 0:
command.append(" --cataclysm " + str(cataclysm)) command.append(" --cataclysm " + str(cataclysm))
if vwrap: if vwrap:
command.append(" --vwrap ") command.append(" --vwrap")
if not hwrap: if not hwrap:
command.append(" --nohwrap ") command.append(" --nohwrap")
return command return "".join(command)
def is_port_in_use(port: int) -> bool: def is_port_in_use(port: int) -> bool: