diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..fbafee3 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +hlna.py \ No newline at end of file diff --git a/.idea/hln-a.iml b/.idea/hln-a.iml new file mode 100644 index 0000000..ec63674 --- /dev/null +++ b/.idea/hln-a.iml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a971a2c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hlna.py b/hlna.py index e651c56..4f50fb4 100755 --- a/hlna.py +++ b/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):