добавлена работа с потоками для каждого сервера, ожидается добавление работы с кластерами.
This commit is contained in:
parent
576f660a66
commit
c88d17a06f
10
dodo.py
10
dodo.py
@ -2,6 +2,7 @@
|
||||
import os
|
||||
import yaml
|
||||
import threading
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
home_dir = Path.home()
|
||||
@ -20,7 +21,7 @@ def yaml_edit():
|
||||
print("""Укажите требуется ли кластер?
|
||||
1. Да
|
||||
2. Нет""")
|
||||
count_cluster = input(":\n")
|
||||
count_cluster = input("")
|
||||
if count_cluster == "1":
|
||||
cluster_server = True
|
||||
else:
|
||||
@ -105,7 +106,6 @@ def yaml_create(cluster_server, map_server, name_server, port_server, query_port
|
||||
]
|
||||
with open(f"{home_dir}/.config/dodo/{map_server[-1]}.yaml", 'w') as yamlfile:
|
||||
data = yaml.dump(settings_dodo, yamlfile)
|
||||
print(data)
|
||||
print("Конфиг создан")
|
||||
|
||||
|
||||
@ -119,15 +119,15 @@ def install(map_server):
|
||||
print("-"*20)
|
||||
os.system(f"steamcmd +force_install_dir {dir_server + i} +login anonymous +app_update 376030 +quit")
|
||||
print("-"*20)
|
||||
print(i)
|
||||
print("Карта скачана " + i)
|
||||
print("-"*20)
|
||||
def start():
|
||||
def start(i):
|
||||
os.chdir(dir_server + i + "/" + "ShooterGame/Binaries/Linux/")
|
||||
os.system(f"./ShooterGameServer {i}?SessionName={name_server}?Port={port_server}?QueryPort={query_port}?MaxPlayers={max_players}?GameModIds={mods_id}?listen={listen_server}")
|
||||
print("-"*20)
|
||||
print("server " +i + " Запустился")
|
||||
print("-"*20)
|
||||
threads = threading.Thread(target=start, args=(map_server,))
|
||||
threads = threading.Thread(target=start, args=(i,))
|
||||
threads.start()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user