pep8 изменение пути к файлам сервера.
This commit is contained in:
parent
9877a12122
commit
964c031dd0
18
hlna.py
18
hlna.py
@ -5,17 +5,16 @@ import threading
|
||||
from pathlib import Path
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
import yaml
|
||||
import click
|
||||
import colorama
|
||||
import click_completion
|
||||
|
||||
from rcon.source import Client
|
||||
|
||||
home_dir = Path.home()
|
||||
dir_server = f"{home_dir}/ARK_Servers/"
|
||||
dir_server = f"{home_dir}/ARK_Servers/Server"
|
||||
config_hlna = f"{home_dir}/.config/hlna/"
|
||||
|
||||
mods_id = ""
|
||||
listen_server = True
|
||||
|
||||
@ -229,6 +228,7 @@ def config(list_config=list_config):
|
||||
|
||||
yaml_create(cluster_server, map_s, list_config[-1], port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override)
|
||||
|
||||
|
||||
def yaml_create(cluster_server, map_s, name_server, port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override):
|
||||
settings_hlna = [
|
||||
{
|
||||
@ -370,14 +370,15 @@ def start(m, name_server=list_config):
|
||||
print("Запускаем все активные карты")
|
||||
|
||||
names_serverstart = choose_map(names_serverstart)
|
||||
server_dir = dir_server + "Server" + "/ShooterGame/Binaries/Linux/"
|
||||
print_line("Качаем сервер")
|
||||
server_dir = dir_server + "/ShooterGame/Binaries/Linux/"
|
||||
print_line("Валидация файлов сервера")
|
||||
x = os.system(f"steamcmd +force_install_dir {server_dir} +login anonymous +app_update 376030 +quit")
|
||||
os.chdir(server_dir)
|
||||
for i in names_serverstart:
|
||||
data = read_yaml(i)
|
||||
starting_map = dict_mapname[i]
|
||||
|
||||
def starting(i):
|
||||
os.chdir(server_dir)
|
||||
os.system(
|
||||
f"./ShooterGameServer {i}?SessionName={data['SessionName']}?Port={data['Port']}?QueryPort={data['QueryPort']}?RCONEnabled={data['RCONEnabled']}?RCONPort={data['RCONPort']}?ServerAdminPassword={data['ServerAdminPassword']}?multihome=127.0.0.1?MaxPlayers={data['MaxPlayers']}?GameModIds={data['ModsId']}?listen={data['Listen']} -clusterid={data['clusterid']} -ClusterDirOverride={data['clusterdir']}")
|
||||
|
||||
@ -437,6 +438,7 @@ def choose_map(arr):
|
||||
|
||||
return new_arr
|
||||
|
||||
|
||||
@hlna.command()
|
||||
@click.argument('c', nargs=1)
|
||||
@click.option('-m', required=True, help="Название карты для применения rcon команды")
|
||||
@ -461,8 +463,12 @@ def rcon(m,c):
|
||||
with Client('127.0.0.1', port, passwd=str(passwd)) as client:
|
||||
response = client.run(c)
|
||||
print(response)
|
||||
|
||||
|
||||
def zero(x=""):
|
||||
return ""
|
||||
|
||||
|
||||
if __name__ == 'hlna':
|
||||
input = zero
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user