name_server заменил на list_config
This commit is contained in:
18
hlna.py
18
hlna.py
@ -5,12 +5,12 @@ import threading
|
||||
from pathlib import Path
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
import yaml
|
||||
from rcon.source import Client
|
||||
import click
|
||||
import colorama
|
||||
import click_completion
|
||||
|
||||
from rcon.source import Client
|
||||
|
||||
home_dir = Path.home()
|
||||
dir_server = f"{home_dir}/ARK_Servers/"
|
||||
@ -138,7 +138,6 @@ def config(list_config=list_config):
|
||||
port_s.append(data['Port'])
|
||||
rcon_p.append(data['RCONPort'])
|
||||
query_p.append(data['QueryPort'])
|
||||
|
||||
|
||||
if amount_map == 1:
|
||||
map_s = "TheIsland"
|
||||
@ -168,7 +167,6 @@ def config(list_config=list_config):
|
||||
# Если вдруг каким-то боком проверка не отработает и не будет нужной цифры
|
||||
map_s = 'TheIsland'
|
||||
|
||||
|
||||
def ports(ports_arr):
|
||||
while True:
|
||||
port = check_int("")
|
||||
@ -186,12 +184,12 @@ def config(list_config=list_config):
|
||||
|
||||
if list_config:
|
||||
data = read_yaml(list_config[-1])
|
||||
name_server.append(input("Укажите название Сервера: \n"))
|
||||
if name_server[-1] == '':
|
||||
if map_s in name_server:
|
||||
name_server.pop(); name_server.append(map_s + str(name_server.count(map_s)))
|
||||
list_config.append(input("Укажите название Сервера: \n"))
|
||||
if list_config[-1] == '':
|
||||
if map_s in list_config:
|
||||
list_config.pop(); list_config.append(map_s + str(list_config.count(map_s)))
|
||||
else:
|
||||
name_server.pop(); name_server.append(map_s) # если enter, то ставим последним элементом карту
|
||||
list_config.pop(); list_config.append(map_s) # если enter, то ставим последним элементом карту
|
||||
|
||||
port_server = ports(port_s)
|
||||
query_port = ports(query_p)
|
||||
@ -239,7 +237,7 @@ def config(list_config=list_config):
|
||||
if max_players == 0:
|
||||
max_players = 70
|
||||
|
||||
yaml_create(cluster_server, map_s, name_server[-1], port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override)
|
||||
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):
|
||||
|
Reference in New Issue
Block a user