From 8589fb09644461a2118174c6643ae18e69003966 Mon Sep 17 00:00:00 2001 From: sitisll Date: Mon, 27 Feb 2023 19:02:15 +0300 Subject: [PATCH] =?UTF-8?q?name=5Fserver=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BD=D0=B0=20list=5Fconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.name | 1 + .idea/hln-a.iml | 7 +++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/vcs.xml | 6 ++++++ hlna.py | 18 ++++++++---------- 6 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/hln-a.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml 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):